1"use strict";(self.webpackChunkvue_storefront=self.webpackChunkvue_storefront||[]).push([[1958],{18037:function(_,p,h){h.d(p,{b:function(){return m}});var m=(s=>(s[s.CRITICAL=0]="CRITICAL",s[s.IMPORTANT=1]="IMPORTANT",s[s.NORMAL=2]="NORMAL",s[s.LAZY=3]="LAZY",s))(m||{})},88195:function(_,p,h){h.d(p,{a:function(){return I},P:function(){return b}});var m=h(18037),s=h(3996),g=h(95283);const $=()=>{if(!g.S$&&typeof performance<"u")return performance.now();try{return Object(function(){var e=new Error("Cannot find module 'perf_hooks'");throw e.code="MODULE_NOT_FOUND",e}()).now()}catch{return Date.now()}};class y{constructor(){this.queue=[],this.isProcessing=!1,this._instanceId=Math.random().toString(36).slice(2,6),this._totalScheduled=0,this._totalResolved=0,this._totalRejected=0}async schedule(e){return this._totalScheduled++,e.priority===m.b.CRITICAL?((0,s.cY)("scheduler",`[${this._instanceId}] CRITICAL \u2192 immediate: ${e.id} (total scheduled: ${this._totalScheduled})`),e.execute()):(e.abortController=new AbortController,new Promise((t,i)=>{const a={task:e,wrappedTask:{...e},resolve:t,reject:i,scheduledAt:$()};e.abortController.signal.addEventListener("abort",()=>{const r=this.queue.indexOf(a),n=($()-a.scheduledAt).toFixed(1);(0,s.cY)("scheduler",`[${this._instanceId}:abort] ${e.id}, inQueue=${r!==-1}, waited=${n}ms`),r!==-1&&this.queue.splice(r,1),this._totalRejected++,i(new Error("Task was aborted"))}),this.queue.push(a),this.queue.sort((r,n)=>r.task.priority-n.task.priority),(0,s.cY)("scheduler",`[${this._instanceId}:schedule] ${e.id} (p=${e.priority}), queue=[${this.queue.map(r=>r.task.id).join(", ")}], processing=${this.isProcessing}, stats=${this._totalScheduled}s/${this._totalResolved}ok/${this._totalRejected}err`),this.isProcessing||this.processQueue()}))}async processQueue(){this.isProcessing=!0;const e=Math.random().toString(36).slice(2,6);(0,s.cY)("scheduler",`[${this._instanceId}:process:${e}] START, queue=[${this.queue.map(t=>t.task.id).join(", ")}]`);try{for(;this.queue.length;){const t=this.queue[0],i=this.queue.map(n=>n.task.id);await this.yieldToMain();const a=this.queue.map(n=>n.task.id);if(JSON.stringify(i)!==JSON.stringify(a)&&(0,s.cY)("scheduler",`[${this._instanceId}:process:${e}] QUEUE SHIFTED during yield! before=[${i.join(",")}] after=[${a.join(",")}], entry=${t.task.id} still queue[0]=${this.queue[0]?.task.id===t.task.id}`),!this.queue.includes(t)){(0,s.cY)("scheduler",`[${this._instanceId}:process:${e}] entry ${t.task.id} removed during yield (aborted?), skipping`);continue}t.startedAt=$();const r=(t.startedAt-t.scheduledAt).toFixed(1);try{(0,s.cY)("scheduler",`[${this._instanceId}:process:${e}] EXEC ${t.task.id}, waitedInQueue=${r}ms, remaining=${this.queue.length}`);const n=await t.task.execute(),d=($()-t.startedAt).toFixed(1),u=this.queue.indexOf(t);u!==-1?this.queue.splice(u,1):(0,s.cY)("scheduler",`[${this._instanceId}:process:${e}] WARNING: ${t.task.id} not in queue after exec (aborted during exec?)`),this._totalResolved++,t.resolve(n),(0,s.cY)("scheduler",`[${this._instanceId}:process:${e}] RESOLVED ${t.task.id} in ${d}ms, remaining=${this.queue.length}, stats=${this._totalResolved}ok/${this._totalRejected}err`)}catch(n){const d=t.startedAt?($()-t.startedAt).toFixed(1):"?",u=this.queue.indexOf(t);u!==-1&&this.queue.splice(u,1),this._totalRejected++,t.reject(n),(0,s.cY)("scheduler",`[${this._instanceId}:process:${e}] REJECTED ${t.task.id} in ${d}ms, error="${n?.message||n}", remaining=${this.queue.length}, stats=${this._totalResolved}ok/${this._totalRejected}err`)}}}catch(t){(0,s.cY)("scheduler",`[${this._instanceId}:process:${e}] FATAL processQueue crash! queue=[${this.queue.map(a=>a.task.id).join(",")}], error="${t?.message||t}"`);const i=[...this.queue];this.queue=[],i.forEach(a=>{this._totalRejected++,a.reject(t)})}finally{this.isProcessing=!1,(0,s.cY)("scheduler",`[${this._instanceId}:process:${e}] END, stats=${this._totalScheduled}scheduled/${this._totalResolved}ok/${this._totalRejected}err, queueLeftover=${this.queue.length}`)}}async yieldToMain(){return"scheduler"in window&&typeof window.scheduler?.yield=="function"?window.scheduler.yield():new Promise(e=>setTimeout(e,0))}abort(e){const t=this.queue.find(i=>i.task.id===e);t?.task.abortController?((0,s.cY)("scheduler",`[${this._instanceId}:abort] ${e}`),t.task.abortController.abort()):(0,s.cY)("scheduler",`[${this._instanceId}:abort] ${e} NOT FOUND in queue of ${this.queue.length}`)}clear(){const e=this.queue.map(t=>t.task.id);(0,s.cY)("scheduler",`[${this._instanceId}:clear] clearing ${e.length} tasks: [${e.join(", ")}], stats before: ${this._totalScheduled}s/${this._totalResolved}ok/${this._totalRejected}err`),this.queue.forEach(t=>{t.task.abortController&&t.task.abortController.abort()}),this.queue=[]}getStuckTasks(e=1e4){const t=$();return this.queue.filter(i=>t-i.scheduledAt>e).map(i=>({id:i.task.id,waitMs:Math.round(t-i.scheduledAt),started:!!i.startedAt}))}getStats(){return{instanceId:this._instanceId,queueLength:this.queue.length,isProcessing:this.isProcessing,scheduled:this._totalScheduled,resolved:this._totalResolved,rejected:this._totalRejected,pending:this._totalScheduled-this._totalResolved-this._totalRejected,queueIds:this.queue.map(e=>e.task.id)}}}var k=h(85471);const c=()=>
1{if(!g.S$&&typeof performance<"u")return performance.now();try{return Object(function(){var e=new Error("Cannot find module 'perf_hooks'");throw e.code="MODULE_NOT_FOUND",e}()).now()}catch{return Date.now()}};var b=(l=>(l.LOADING="loading",l.SUCCESS="success",l.ERROR="error",l))(b||{});class I{constructor(){this._instanceId=Math.random().toString(36).slice(2,6),this._loadTimings=new Map,this.scheduler=new y;const e=k.Ay.observable({states:new Map});this.blockStates=e.states,(0,s.cY)("blocks",`[LoadManager:${this._instanceId}] created`)}async loadBlock(e){const t=c();this._loadTimings.set(e.id,{start:t}),(0,s.cY)("blocks",`[LoadManager:${this._instanceId}] loadBlock START: ${e.id} (p=${e.priority})`);try{await this.scheduler.schedule({id:e.id,priority:e.priority,execute:async()=>{(0,s.cY)("blocks",`[LoadManager:${this._instanceId}] execute START: ${e.id} (+${(c()-t).toFixed(0)}ms since loadBlock)`);let a=this.blockStates.get(e.id);a||(a=k.Ay.observable({status:"loading",ready:!1,component:null,data:null,error:null,isEmpty:!1}),this.blockStates.set(e.id,a),(0,s.cY)("blocks",`[LoadManager:${this._instanceId}] created state for: ${e.id}`));const r=this._loadTimings.get(e.id);try{const[n,d]=await Promise.all([e.loadData().then(o=>(r.dataEnd=c(),(0,s.cY)("blocks",`[LoadManager:${this._instanceId}] data OK: ${e.id} in ${(r.dataEnd-t).toFixed(0)}ms`),o)).catch(o=>{throw r.dataEnd=c(),(0,s.cY)("blocks",`[LoadManager:${this._instanceId}] data FAILED: ${e.id} in ${(r.dataEnd-t).toFixed(0)}ms \u2014 ${o?.message||o}`),a.error=o,o}),e.loadComponent().then(o=>(r.componentEnd=c(),(0,s.cY)("blocks",`[LoadManager:${this._instanceId}] component OK: ${e.id} in ${(r.componentEnd-t).toFixed(0)}ms, type=${typeof o}, name=${o?.name||"?"}`),o)).catch(o=>{throw r.componentEnd=c(),(0,s.cY)("blocks",`[LoadManager:${this._instanceId}] component FAILED: ${e.id} in ${(r.componentEnd-t).toFixed(0)}ms \u2014 ${o?.message||o}`),a.error=o,o})]);r.end=c();const u=(r.end-t).toFixed(0);(0,s.cY)("blocks",`[LoadManager:${this._instanceId}] execute SUCCESS: ${e.id} in ${u}ms`,{hasData:!!n,dataType:Array.isArray(n)?`array[${n.length}]`:typeof n,hasComponent:!!d,componentName:d?.name||"?"});const f=a.status;return Object.assign(a,{component:d,data:n,isEmpty:Array.isArray(n)?n.length===0:!n,status:"success",ready:!0}),(0,s.cY)("blocks",`[LoadManager:${this._instanceId}] STATE ${e.id}: ${f} \u2192 success, ready=true`),{data:n,component:d}}catch(n){r.end=c();const d=(r.end-t).toFixed(0);(0,s.cY)("blocks",`[LoadManager:${this._instanceId}] execute FAILED: ${e.id} in ${d}ms`,n?.message||n);const u=a.status;throw Object.assign(a,{status:"error",error:n}),(0,s.cY)("blocks",`[LoadManager:${this._instanceId}] STATE ${e.id}: ${u} \u2192 error`),n}}});const i=(c()-t).toFixed(0);return(0,s.cY)("blocks",`[LoadManager:${this._instanceId}] loadBlock DONE: ${e.id} in ${i}ms`),this.blockStates.get(e.id)}catch(i){const a=(c()-t).toFixed(0);throw(0,s.cY)("blocks",`[LoadManager:${this._instanceId}] loadBlock ERROR: ${e.id} in ${a}ms`,i?.message||i),i}}getBlockState(e){return this.blockStates.get(e)}abortBlock(e){this.scheduler.abort(`${e}-data`),this.scheduler.abort(`${e}-component`),this.blockStates.delete(e)}clear(){const e=Array.from(this.blockStates.keys()),t=e.map(i=>{const a=this.blockStates.get(i);return`${i}:${a?.status||"?"}`});(0,s.cY)("blocks",`[LoadManager:${this._instanceId}:clear] resetting ${e.length} blocks: [${t.join(", ")}]`),this.scheduler.clear(),e.forEach(i=>{const a=k.Ay.observable({status:"loading",ready:!1,component:null,data:null,error:null,isEmpty:!1});this.blockStates.set(i,a)}),this._loadTimings.clear(),(0,s.cY)("blocks",`[LoadManager:${this._instanceId}:clear] done`)}getDiagnostics(){const e={};this.blockStates.forEach((a,r)=>{e[r]={status:a.status,ready:a.ready,hasData:!!a.data,hasComponent:!!a.component,isEmpty:a.isEmpty,hasError:!!a.error,errorMsg:a.error?.message||null}});const t=this.scheduler.getStats(),i=this.scheduler.getStuckTasks(1e4);return{managerId:this._instanceId,blockCount:this.blockStates.size,blocks:e,scheduler:t,stuckTasks:i,timings:Object.fromEntries(this._loadTimings)}}}}}]);
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.