PageSourceSearch

https://www.uni-one.ai/_next/static/chunks/1265-70f00f70b974c52a.js

js uni-one.ai collected 2026-10-05 13:10:17 UTC 8,570 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1265],{6750:(t,i,l)=>{l.d(i,{q:()=>s});var e=l(23324);function s(){let[t,i]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{i(!0)},[]),t}},10179:(t,i,l)=>{l.d(i,{H:()=>e});let e={PENDING:"PENDING",GENERATING:"GENERATING",COMPLETED:"COMPLETED",FAILED:"FAILED",FAILED_REFUNDED:"FAILED_REFUNDED"}},52414:(t,i,l)=>{l.d(i,{dG:()=>s});var e=l(44322);let s={getImageList:async t=>{let i=new URLSearchParams({page:t.page.toString(),pageSize:t.pageSize.toString()});return void 0!==t.workspaceId&&i.set("workspaceId",t.workspaceId||""),t.search&&i.set("search",t.search),void 0!==t.isLiked&&i.set("isLiked","true"),t.status&&i.set("status",t.status),t.sort&&i.set("sort",t.sort),t.imageTaskType&&i.set("imageTaskType",t.imageTaskType),e.HD.get("images?".concat(i.toString())).json()},getImageStatus:async t=>e.HD.post("images/status",{json:{imageIds:t}}).json(),deleteImage:async t=>e.HD.delete("images/".concat(t)).json(),batchDeleteImages:async t=>e.HD.post("workspaces/images/batch",{json:{operation:"delete",imageIds:t}}).json(),batchMoveImages:async(t,i)=>e.HD.post("workspaces/images/batch",{json:{operation:"move",imageIds:t,workspaceId:i}}).json(),postProcessImage:async t=>e.HD.post("images/post-process",{json:t}).json(),createImageShareLink:async t=>e.HD.post("images/share",{json:{imageId:t}}).json(),recordImageInteraction:async(t,i)=>e.HD.post("images/interaction",{json:{imageId:t,action:i}}).json()}},68964:(t,i,l)=>{l.d(i,{n:()=>e});let e=[l(10179).H.GENERATING]},78739:(t,i,l)=>{l.d(i,{gQ:()=>o}),l(72464);var e=l(23324);let s=(0,e.createContext)(void 0),o=()=>(0,e.useContext)(s)},89768:(t,i,l)=>{l.d(i,{O:()=>u});var e=l(92554);let s={log:function(){for(var t=arguments.length,i=Array(t),l=0;l<t;l++)i[l]=arguments[l]},error:function(){for(var t=arguments.length,i=Array(t),l=0;l<t;l++)i[l]=arguments[l]}};class o{addTasks(t){if(0===t.length)return;let i=!1;t.forEach(t=>{this.ids.has(t)||(this.ids.add(t),i=!0)}),i&&(s.log("[PollingManager] Adding tasks:",t),s.log("[PollingManager] Total tasks:",this.ids.size),s.log("[PollingManager] All tasks:",Array.from(this.ids)),!this.isPolling&&this.ids.size>0&&this.start())}removeTasks(t){0!==t.length&&(s.log("[PollingManager] Removing tasks:",t),s.log("[PollingManager] Before removal:",Array.from(this.ids)),t.forEach(t=>{this.ids.has(t)?(this.ids.delete(t),s.log("[PollingManager] Removed task: ".concat(t))):s.log("[PollingManager] Task not found: ".concat(t))}),s.log("[PollingManager] Remaining tasks:",this.ids.size),s.log("[PollingManager] After removal:",Array.from(this.ids)),0===this.ids.size&&(s.log("[PollingManager] All tasks completed, stopping"),this.stop()))}setTasks(t){let i=new Set(this.ids),l=new Set(t);s.log("[PollingManager] Smart update task list"),s.log("[PollingManager] Current tasks:",Array.from(i)),s.log("[PollingManager] New tasks:",Array.from(l)),i.forEach(t=>{l.has(t)||(this.ids.delete(t),s.log("[PollingManager] Removing task: ".concat(t)))});let e=t.filter(t=>!i.has(t));e.length>0&&(s.log("[PollingManager] Adding new tasks:",e),this.addTasks(e)),0===this.ids.size&&this.isPolling&&(s.log("[PollingManager] All tasks completed, stopping"),this.stop()),s.log("[PollingManager] Updated task list:",Array.from(this.ids))}updateTasks(t){s.log("[PollingManager] Updating task list, new tasks:",t),this.ids.clear(),t.length>0?this.addTasks(t):(s.log("[PollingManager] No tasks to poll, stopping"),this.stop())}getActiveTasks(){return Array.from(this.ids)}start(){if(this.isPolling)return void s.log("[PollingManager] Already polling, skipping start");this.isPolling=!0,this.startTime=Date.now(),this.retryCount=0,s.log("[PollingManager] Starting polling, task count:",this.ids.size),s.log("[PollingManager] Task list:",Array.from(this.ids)),this.poll()}stop(){s.log("[PollingManager] Stopping polling"),this.isPolling=!1,this.pollingTimeout&&(clearTimeout(this.pollingTimeout),this.pollingTimeout=null,s.log("[PollingManager] Cleared polling timeout"))}async poll(){if(this.startTime&&Date.now()-this.startTime>this.MAX_POLLING_DURATION){console.warn("[PollingManager] Max polling duration (5 minutes) reached, stopping"),this.stop();return}if(!this.isPolling||0===this.ids.size||this.isCancelled){s.log("[PollingManager] Polling conditions not met, stopping",{isPolling:this.isPolling,taskCount:this.ids.size,isCancelled:this.isCancelled}),this.stop();return}try{let t=Array.from(this.ids);if(s.log("[PollingManager] Executing poll, task IDs:",t),s.log("[PollingManager] Before poll task count:",this.ids.size),this.inFlightRequest=this.onUpdate(t),await this.inFlightRequest,this.isCancelled)return void s.log("[PollingManager] Polling cancelled, ignoring results");if(this.retryCount=0,s.log("[PollingManager] After poll task count:",this.ids.size),s.log("[PollingManager] After poll task list:",Array.from(this.ids)),0===this.ids.size){s.log("[PollingManager] All tasks completed after poll, stopping"),this.stop();return}if(!this.isPolling)return void s.log("[PollingManager] Polling stopped, not scheduling next poll");this.scheduleNextPoll()}catch(t){if(this.isCancelled)return void s.log("[PollingManager] Polling cancelled, ignoring error");s.error("[PollingManager] Polling failed:",t),this.retryCount++,this.options.onError(t),this.retryCount<this.options.maxRetries&&this.ids.size>0?(s.log("[PollingManager] Retry ".concat(this.retryCount,"/").concat(this.options.maxRetries)),this.scheduleNextPoll()):(this.retryCount>=this.options.maxRetries?s.error("[PollingManager] Max retries reached, stopping"):s.log("[PollingManager] No tasks to retry, stopping"),this.stop())}finally{this.inFlightRequest=null}}scheduleNextPoll(){this.pollingTimeout&&(clearTimeout(this.pollingTimeout),this.pollingTimeout=null),this.isPolling&&this.ids.size>0?(s.log("[PollingManager] Next poll in ".concat(this.options.interval,"ms")),this.pollingTimeout=setTimeout(()=>this.poll(),this.options.interval)):s.log("[PollingManager] Polling conditions not met, not scheduling next poll",{isPolling:this.isPolling,taskCount:this.ids.size})}cleanup(){s.log("[PollingManager] Cleaning up"),this.isCancelled=!0,this.stop(),this.ids.clear()}pollNow(){this.ids.size>0?(s.log("[PollingManager] Polling immediately"),this.poll()):s.log("[PollingManager] No tasks, skipping immediate poll")}getStatus(){return{isPolling:this.isPolling,taskCount:this.ids.size,tasks:Array.from(this.ids),retryCount:this.retryCount}}constructor(t,i={}){this.pollingTimeout=null,this.isPolling=!1,this.ids=new Set,this.retryCount=0,this.inFlightRequest=null,this.isCancelled=!1,this.MAX_POLLING_DURATION=3e5,this.startTime=null,this.onUpdate=t,this.options={interval:i.interval||5e3,maxRetries:i.maxRetries||3,onError:i.onError||(t=>s.error("Polling error:",t))}}}var a=l(52414),n=l(68964),r=l(39652),g=l(10179),h=l(84926);let d=new Set,c=[g.H.FAILED,g.H.FAILED_REFUNDED],p=async t=>{if(0!==t.length)try{let i=await a.dG.getImageStatus(t);if(i.code!==r.BL.Success)throw Error(i.message||"Polling status failed");let l=i.data;d.forEach(t=>{try{t(l)}catch(t){console.error("[GlobalImagePolling] Callback error:",t)}}),l.filter(t=>c.includes(t.status)).length>0&&h.oR.error("Generation failed. Credits have been refunded.");let e=l.filter(t=>!n.n.includes(t.status)).map(t=>
1t.id);e.length>0&&u.getState().removeTasks(e)}catch(t){throw console.error("[GlobalImagePolling] Polling update failed:",t),t}},u=(0,e.v)((t,i)=>({pollingManager:null,initialize:l=>{let{pollingManager:e}=i();return d.add(l),e||(t({pollingManager:new o(p,{interval:4e3,maxRetries:3,onError:t=>{console.error("[GlobalImagePolling] Error:",t)}})}),console.log("[GlobalImagePolling] PollingManager initialized")),()=>{d.delete(l)}},addTasks:t=>{let{pollingManager:l}=i();if(!l)return void console.warn("[GlobalImagePolling] PollingManager not initialized, call initialize() first");t.length>0&&(console.log("[GlobalImagePolling] Adding tasks:",t),l.addTasks(t))},removeTasks:t=>{let{pollingManager:l}=i();l&&t.length>0&&(console.log("[GlobalImagePolling] Removing tasks:",t),l.removeTasks(t))},setTasks:t=>{let{pollingManager:l}=i();if(!l)return void console.warn("[GlobalImagePolling] PollingManager not initialized, call initialize() first");console.log("[GlobalImagePolling] Setting tasks:",t),l.setTasks(t)},cleanup:()=>{let{pollingManager:l}=i();l&&(console.log("[GlobalImagePolling] Cleaning up PollingManager"),l.cleanup(),d.clear(),t({pollingManager:null}))},getStatus:()=>{let{pollingManager:t}=i();return t?t.getStatus():{isPolling:!1,taskCount:0,tasks:[],retryCount:0}}}))}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.