"use strict";exports.id=876,exports.ids=[876],exports.modules={61967:(e,t,s)=>{t.ImportPagesController=void 0;var r=s(86950),o=s(1923);t.ImportPagesController=class{async execute(e){const{response:t,isAborted:s,input:a}=e;if(s())return t.aborted();if(a.processing){const t=new r.ImportPagesProcessPagesChecker;return await t.execute(e)}return(new o.ImportPagesProcessZipFile).execute(e)}}},86950:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PROCESS_PAGES_WAIT_TIME=t.ImportPagesProcessPagesChecker=void 0;var r=s(29729),o=s(96466);const a=t.PROCESS_PAGES_WAIT_TIME=5;t.ImportPagesProcessPagesChecker=class{async execute(e){const{response:t,context:s,store:i}=e,{items:n}=await s.tasks.listTasks({where:{parentId:i.getTask().id,definitionId:r.PageImportTask.Process,taskStatus_in:[o.TaskDataStatus.RUNNING,o.TaskDataStatus.PENDING]},limit:1});return n.length>0?t.continue({...e.input},{seconds:a}):t.done()}}},1923:(e,t,s)=>{var r=s(92120).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ImportPagesProcessZipFile=void 0;var o=s(29729),a=s(29921),i=r(s(51889));t.ImportPagesProcessZipFile=class{async execute(e){const{response:t,input:s,trigger:r,store:n}=e,{zipFileUrl:c}=s;if(!c)return t.error({message:'Missing "zipFileUrl" in the input.'});const p=await(0,a.extractAndUploadZipFileContents)(c);if(0===p.length)return t.error({message:"No pages found in the provided zip file."});const u=(0,i.default)(p,5);for(const e of u)await r({definition:o.PageImportTask.Process,input:{category:s.category,meta:s.meta,identity:s.identity,items:e,done:[],failed:[],pageIdList:[]}});return await n.updateOutput({total:p.length},{save:!1}),t.continue({...s,processing:!0},{seconds:10})}}}};
//# sourceMappingURL=ImportPagesController.b2520bf9.chunk.js.map