zeed 0.9.14 → 0.9.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-RFXMRHAW.js → chunk-ILTCEHLM.js} +1 -1
- package/dist/{chunk-RFXMRHAW.js.map → chunk-ILTCEHLM.js.map} +1 -1
- package/dist/index.all.d.ts +1 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.ts +2 -2
- package/dist/index.browser.js +1 -1
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +2 -2
- package/dist/index.node.js +1 -1
- package/dist/{uuid-3d22b8c3.d.ts → uuid-9445a6c1.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -10,4 +10,4 @@ ${i.stack}`:`${i.name||"Error"}: ${i.message}`;try{return o?JSON.stringify(i,nul
|
|
|
10
10
|
`;for(;s=n.exec(u);){let a=s[2]??s[3]??"";a=a.replaceAll('""','"'),i.push(a),s[4]===`
|
|
11
11
|
`&&(o.push(i),i=[])}return o}r(Mn,"csvParse");function ha(e,t={}){let n=Mn(e,t),o=n[0];return n.slice(1).map(i=>Object.fromEntries(i.map((s,u)=>[o[u],s])))}r(ha,"csvParseToObjects");var Rn=D("zeed:dispose","error");async function Sn(e){typeof e=="function"?await O(e()):S(e)?await e:typeof e.dispose=="function"?await O(e.dispose()):S(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await O(e.cleanup()):S(e.cleanup)&&await e.cleanup}r(Sn,"callDisposer");function Fe(e){let{name:t}=typeof e=="string"?{name:e}:e??{},n=[],o=r(async u=>{u!=null&&n.includes(u)&&(Ae(n,a=>a!==u),await Sn(u))},"untrack"),i=r(async()=>{for(t&&Rn.debug(`dispose ${t}: ${n.length} entries`);n.length>0;)await o(n[0])},"dispose"),s=r(u=>{if(u!=null)return n.unshift(u),()=>o(u)},"track");return Object.assign(i,{track:s,add:s,untrack:o,dispose:i,exec:i,getSize(){return n.length},isDisposed(){return n.length<=0}})}r(Fe,"useDispose");var va=Fe;function Aa(e={}){let{mode:t="fifo"}=e,n=[],o=r(async(s=!1)=>{for(;n.length>0;){let u=n[0];if(Ae(n,a=>a!==u),typeof u=="function"){let a=u();if(S(a)){if(s)throw new Error(`Expected sync only function, but found async: ${u}`);await a}}else if(S(u)){if(s)throw new Error(`Expected sync only function, but found async: ${u}`);await u}else throw new Error(`Unhandled disposable: ${u}`)}},"exec");return Object.assign(o,{add:r(s=>{t==="lifo"?n.unshift(s):n.push(s)},"add"),exec:o,getSize(){return n.length}})}r(Aa,"useDefer");function Pa(e,t=0){let n=setTimeout(e,t);return()=>{n&&(clearTimeout(n),n=void 0)}}r(Pa,"useTimeout");function Da(e,t){let n=setInterval(e,t);return()=>{n&&(clearInterval(n),n=void 0)}}r(Da,"useInterval");function Ua(e,t,n,...o){return e==null?()=>{}:(e.on?e.on(t,n,...o):e.addEventListener&&e.addEventListener(t,n,...o),()=>{e.off?e.off(t,n,...o):e.removeEventListener&&e.removeEventListener(t,n,...o)})}r(Ua,"useEventListener");function Sa(){let e=!0;return(t,n)=>{let o=!1;if(e){e=!1;try{t(),o=!0}finally{e=!0}}else n!==void 0&&n();return o}}r(Sa,"useMutex");function Ca(){let e=!0;return async(t,n)=>{let o=!1;if(e){e=!1;try{let i=t();S(i)&&await i,o=!0}finally{e=!0}}else if(n!==void 0){let i=n();S(i)&&await i}return o}}r(Ca,"useAsyncMutex");var Z=D("zeed:emitter","error"),M=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this.dispose=Fe();this.call=new Proxy({},{get:(t,n)=>async(...o)=>await this.emit(n,...o)})}async emit(t,...n){let o=!1;try{let i=this.subscribers[t]||[];if(this.subscribersOnAny.forEach(s=>s(t,...n)),i.length>0){let s=i.map(u=>{try{return O(u(...n))}catch(a){Z.warn("emit warning:",a)}return null}).filter(u=>u!=null);o=!0,await Promise.all(s)}}catch(i){Z.error("emit exception",i)}return o}onAny(t){this.subscribersOnAny.push(t)}on(t,n){let o=this.subscribers[t]||[];return o.push(n),this.subscribers[t]=o,()=>{this.off(t,n)}}onCall(t){for(let[n,o]of Object.entries(t))this.on(n,o)}once(t,n){let o=r(async(...i)=>(this.off(t,o),await O(n(...i))),"onceListener");return this.on(t,o),()=>{this.off(t,n)}}off(t,n){return this.subscribers[t]=(this.subscribers[t]||[]).filter(o=>n&&o!==n),this}removeAllListeners(){return this.subscribers={},this}};r(M,"Emitter");function ja(){let e=Q().emitter;return e||(e=new M,Q().emitter=e),e}r(ja,"getGlobalEmitter");var Ha=new M;function za(e,t){let n=Math.round(E()*100),o=[],i,s=r((a,l)=>{let c={key:a,obj:l};o.push(c),i&&i()},"incoming");return t?e.on?e.on(t,a=>{s(t,a)}):e.addEventListener?e.addEventListener(t,a=>{s(t,a)}):Z.error(n,"Cannot listen to key"):e.onAny?e.onAny((a,l)=>{s(a,l)}):Z.error(n,"cannot listen to all for",e),r((a,l=!0)=>new Promise((c,f)=>{a||(a=t,a||o.length&&(a=o[0].key)),i=r(()=>{for(;o.length>0;){let d=o.shift();if(d.key===a)i=void 0,c(d.obj);else{if(l){Z.warn(n,`Unhandled event ${a} with value: ${d.obj}`);continue}f(new Error(`Expected ${a}, but found ${d.key} with value=${d.obj}`)),Z.error(n,`Unhandled event ${a} with value: ${d.obj}`)}break}},"lazyResolve"),i()}),"on")}r(za,"lazyListener");var Dt=r(()=>Date.now(),"getTimestamp");function Va(e){return e>999?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(2)}ms`}r(Va,"formatMilliseconds");function qa(...e){for(let t of e){if(t instanceof Date)return t;if(typeof t=="string"){let n=null;if(t.includes(":"))try{n=new Date(t)}catch{}if(!(n instanceof Date)){let o=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);o&&(n=new Date(+o[1],+o[2]-1,+o[3],12,0))}if(n instanceof Date)return n}}}r(qa,"parseDate");var{encode:Ut,decode:Cn}=z(62),{encode:Et,decode:Fn}=z(32),de=16;function Ie(){return J(de)}r(Ie,"uuidBytes");function kn(e=Ie()){return Ut(e,22)}r(kn,"uuidB62");function In(e){return Ut(e,22)}r(In,"uuidEncodeB62");function On(e){return Cn(e,de)}r(On,"uuidDecodeB62");function $n(e=Ie()){return Et(e,26)}r($n,"uuidB32");function _n(e){return Et(e,26)}r(_n,"uuidEncodeB32");function Bn(e){return Fn(e,de)}r(Bn,"uuidDecodeB32");var jn="10000000-1000-4000-8000-100000000000",Hn=typeof crypto<"u"&&crypto.randomUUID!=null?crypto.randomUUID.bind(crypto):()=>jn.replace(/[018]/g,e=>(e^J(1)[0]&15>>e/4).toString(16));function zn(e){let t=We(e);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16)}`}r(zn,"uuidEncodeV4");function Nn(e){return Ze(e.replaceAll("-",""))}r(Nn,"uuidDecodeV4");var Mt=16e11;function Gn(e){let t=new Uint8Array([0,0,0,0,0,0]),n=t.length-1;for(let o=0;o<t.length;o++){let i=e&255;t[n-o]=i,e=(e-i)/256}return t}r(Gn,"longToByteArray");function Rt(){let e=Dt()-Mt;return new Uint8Array([...Gn(e),...J(10)])}r(Rt,"suidBytes");function Xa(){return qn(Rt())}r(Xa,"suid");function eu(e){return Vn(Ct(e))}r(eu,"suidDate");function Vn(e){return new Date(Mt+e.slice(0,6).reduce((t,n)=>t*256+n,0))}r(Vn,"suidBytesDate");var tu=r(()=>new Uint32Array(J(4))[0],"uuid32bit"),Oe={base62:{uuid:kn,uuidDecode:On,uuidEncode:In},base32:{uuid:$n,uuidDecode:Bn,uuidEncode:_n},uuidv4:{uuid:Hn,uuidDecode:Nn,uuidEncode:zn}},pe="base62",St=!1;function nu(e,t=!1){pe=e,St=t}r(nu,"setUuidDefaultEncoding");function N(){return Oe[pe].uuid(St?Rt():Ie())}r(N,"uuid");function Ct(e){return Oe[pe].uuidDecode(e)}r(Ct,"uuidDecode");function qn(e){return Oe[pe].uuidEncode(e)}r(qn,"uuidEncode");function ru(e){try{return Ct(e).length===de}catch{}return!1}r(ru,"uuidIsValid");var ke={};function F(e="id"){return ke[e]==null&&(ke[e]=0),`${e}-${ke[e]++}`}r(F,"uname");var Jn=0;function ou(){return`id-${Jn++}`}r(ou,"qid");var ge=class extends M{constructor(){super(...arguments);this.id=N()}close(){this.dispose()}};r(ge,"Channel");var te=class extends ge{constructor(){super(...arguments);this.isConnected=!0}postMessage(n){this.other?.emit("message",{data:n,origin:"local",lastEventId:N()})}};r(te,"LocalChannel");function cu(){let e=new te,t=new te;return e.other=t,t.other=e,[e,t]}r(cu,"createLocalChannelPair");var $e=class{async encode(t){return t}async decode(t){return t}};r($e,"NoopEncoder");var G=class{async encode(t){return xe(t)}async decode(t){return be(t)}};r(G,"JsonEncoder");var _e=class{constructor(t){this.key=t}async encode(t){let n=xe(t);return await tt(n,this.key)}async decode(t){let n=await nt(t,this.key);return be(n)}};r(_e,"CryptoEncoder");var Ft=r((e,t,n={})=>new Proxy(n,{get:(o,i)=>i in o?o[i]:(...s)=>e(i,s,t)}),"createPromiseProxy");function wu(e={}){let{name:t=F("hub"),encoder:n=new G,retryAfter:o=1e3,ignoreUnhandled:i=!0,logLevel:s=!1}=e,u=D(t,s),a={},l,c=[],f,d={},h=r(()=>{clearTimeout(f)},"dispose"),y=r(async()=>{if(clearTimeout(f),l){if(l.isConnected)for(;c.length;){let b=c[0];try{l.postMessage(await n.encode(b)),c.shift()}catch(x){u.warn("postMessage",x);break}}c.length>0&&o>0&&(f=setTimeout(y,o))}},"postNext"),p=r(async b=>{u("enqueue postMessage",b),c.push(b),await y()},"postMessage"),g=r(async b=>{l=b,l.on("connect",y),l.on("message",async x=>{u("onmessage",typeof x);let{name:m,args:A,id:T,result:w,error:U}=await n.decode(x.data);if(m){u(`name ${m} id ${T}`);try{if(a[m]==null)throw new Error(`handler for ${m} was not found`);let v=a[m](...A);S(v)&&(v=await v),u(`result ${v}`),T&&await p({id:T,result:v})}catch(v){let I=v instanceof Error?v:new Error(Pe(v));u.warn("execution error",I.name),await p({id:T,error:{message:I.message,stack:I.stack,name:I.name}})}}else if(T)if(u(`response for id=${T}: result=${w}, error=${U}`),d[T]==null)w===void 0?u(`skip response for ${T}`):u.warn(`no response hook for ${T}`);else{let[v,I]=d[T];if(v&&I)if(delete d[T],U){let ne=new Error(U.message);ne.stack=U.stack,ne.name=U.name,u.warn("reject",ne.name),I(ne)}else u("resolve",w),v(w)}else i||u.warn("Unhandled message",x)}),await y()},"connect"),L=r(async(b,x,m={})=>{let{timeout:A=5e3}=m,T=N();return await p({name:b,args:x,id:T}),gt(new Promise((w,U)=>d[T]=[w,U]),A)},"fetchMessage");return e.channel&&g(e.channel),{dispose:h,connect:g,listen(b){Object.assign(a,b)},send(){return Ft(L,{},{options(b){return Ft(L,{...b})}})}}}r(wu,"useMessageHub");var me=class extends M{constructor(n){super();this.publish=this.emit.bind(this);this.subscribe=this.on.bind(this);let{name:o,encoder:i=new G,channel:s,debug:u=!1}=n;this.channel=s,this.encoder=i,this.debug=u,this.name=o??this.channel.id??F("pubsub"),this.log=D(`${this.shortId}`),this.debug&&(this.channel.on("connect",()=>{this.log("channel connected")}),this.channel.on("disconnect",()=>{this.log("channel disconnected")})),this.channel.on("message",async({data:a})=>{let l=await this.encoder.decode(a);if(this.debug?this.log(`channel message, event=${l?.event}, info=`,l):this.log(`channel message, event=${l?.event}`),l){let{event:c,args:f}=l;await this.emitSuper(c,...f)}})}get shortId(){return this.name.substr(0,6)}async emitSuper(n,...o){return await super.emit(n,...o)}async emit(n,...o){try{if(this.debug?this.log(`emit(${String(n)})`,n):this.log(`emit(${String(n)})`,o.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let i=await this.encoder.encode({event:n,args:o});return this.channel.postMessage(i),!0}catch(i){this.log.warn(`emit(${String(n)})`,i)}return!1}};r(me,"PubSub");function Eu(e){return new me(e)}r(Eu,"usePubSub");var Wn=1;var kt=r(e=>e,"defaultSerialize"),Zn=kt;function Su(e,t){let{post:n,on:o,eventNames:i=[],serialize:s=kt,deserialize:u=Zn}=t,a=new Map;return o(async l=>{let c=u(l),[f,d,h,y]=c;if(f===1||f===2){let p,g;if(y!=null)try{let L=e[y];p=await L(...d)}catch(L){g=String(L)}else g="Method implementation missing";f===1&&h&&n(s(g?[4,g,h]:[3,p,h]))}else if(h){let p=a.get(h);p!=null&&(f===4?p.reject(d):p.resolve(d)),a.delete(h)}}),new Proxy({},{get(l,c){let f=r((...h)=>{n(s([2,h,null,c]))},"sendEvent");if(t.onlyEvents||i.includes(c))return f.asEvent=f,f;let d=r((...h)=>new Promise((y,p)=>{let g=Wn++;a.set(g,{resolve:y,reject:p}),n(s([1,h,g,c]))}),"sendCall");return d.asEvent=f,d}})}r(Su,"useRPC");var B=class extends M{constructor(n={}){super();this._isCancelled=!1;this._resetWhenFinished=!0;this._children=[];this._totalUnits=n.totalUnits??0,this._completedUnits=n.completeUnits??0,this._resetWhenFinished=n.resetWhenFinished??!0,this.name=n.name??F("progress"),this.dispose.add(async()=>{for(let o of this._children)await o.dispose();await this.emit("progressDispose",this)})}update(){this.emit("progressChanged",this),this._isCancelled&&this._resetWhenFinished&&this.getTotalUnits()<=this.getCompletedUnits()&&this.reset()}reset(){if(this._isCancelled){this._isCancelled=!1;for(let n of this._children)n.reset();this.update()}}async cancel(){if(!this._isCancelled){this._isCancelled=!0,await this.emit("progressCancelled",this);for(let n of this._children)await n.cancel();this.update()}}addChild(n){n.on("progressDispose",()=>this.removeChild(n)),n.on("progressChanged",()=>this.update()),this._children.includes(n)||this._children.push(n),this.update()}createChildProgress(n){let o=new B(n);return this.addChild(o),o}removeChild(n){rt(this._children,n),this.update()}getTotalUnits(){if(this.isIndeterminate())return 0;let n=this._totalUnits;for(let o of this._children)n+=o.getTotalUnits();return n}getCompletedUnits(){if(this.isIndeterminate())return 0;let n=this._completedUnits;for(let o of this._children)n+=o.getCompletedUnits();return n}isIndeterminate(){return this._totalUnits<=0&&this._children.length<=0}isCancelled(){return this._isCancelled}isFinished(){return this.dispose.isDisposed()||!this.isIndeterminate()&&this.getTotalUnits()<=this.getCompletedUnits()}getFraction(){if(this.isIndeterminate())return 0;let n=this.getCompletedUnits()/this.getTotalUnits();return isNaN(n)&&(n=0),Math.min(1,Math.max(0,n))}getChildrenCount(){return this._children.length}setTotalUnits(n,o){this._totalUnits=n,o!=null&&(this._completedUnits=o),this.update()}incTotalUnits(n=1){this._totalUnits+=n,this.update()}setCompletetedUnits(n){this._completedUnits=n,this.update()}setCompleted(){this._completedUnits=this._totalUnits,this.update()}incCompletedUnits(n=1){this._completedUnits+=n,this.update()}toString(n=0){let o=`${" ".repeat(n)}${this.name}: ${this._completedUnits} of ${this._totalUnits} units, ${Math.floor(this.getFraction()*100)} %, cancel=${this._isCancelled}
|
|
12
12
|
`;for(let i of this._children)o+=i.toString(n+1);return n===0?o.trim():o}};r(B,"Progress");var Kn=(o=>(o[o.waiting=0]="waiting",o[o.running=1]="running",o[o.finished=2]="finished",o))(Kn||{}),Yn=(o=>(o[o.replace=0]="replace",o[o.memoize=1]="memoize",o[o.error=2]="error",o))(Yn||{});function Ku(e={}){let{maxParallel:t=3,name:n=F("pool")}=e,o=new M,i=new B({name:n});i.on("progressCancelled",L);let s=0,u=0,a=0,l=0,c={};async function f(){if(s>0){let[x,m]=ft();return o.once("didFinish",m),x}}r(f,"waitFinishAll");async function d(){for(let x of Object.keys(c))c[x].state===2&&(await c[x].progress.dispose(),delete c[x])}r(d,"cleanupFinished");function h(){o.emit("didFinish"),s=0,u=0,d(),i.reset()}r(h,"didFinish");function y(){let x=0,m=0;for(let{max:A,resolved:T,state:w}of Object.values(c))x+=A,m+=w===2?A:Math.min(A,T);o.emit("didUpdate",s,u,x,m)}r(y,"didUpdate");function p(){if(y(),s>0&&s===u&&h(),a>=t)return;let x=Object.values(c).filter(m=>m.state===0);if(x.length>0){let m;for(let A of x)A.group!=null&&Object.values(c).some(T=>T.state===1&&T.id!==A.id&&T.group===A.group)||(m==null||A.priority<m.priority)&&(m=A);if(m!=null){let A=m.id,T=m.done;m.state=1,++a,o.emit("didStart",A);let w=r(U=>{m&&(m.result=U,m.state=2,m.resolved=m.max),--a,++u,p()},"taskFinished");m.task(m).then(U=>{T(U),o.emit("didResolve",A,U),w(U)}).catch(U=>{T(),o.emit("didReject",A,U),w()})}}}r(p,"performNext");function g(x){let m=c[x];m&&m.state===0&&(c[x].state=2,++u,o.emit("didCancel",x),c[x].progress.dispose(),y())}r(g,"cancel");function L(){Object.keys(c).forEach(g)}r(L,"cancelAll");function b(x,m={}){let A,T=new Promise(v=>A=v),w=m.id??N();if(c[w]!=null){let v=m.idConflictResolution??1;if(v===0)g(w);else if(v===1){let I=c[w];return{id:w,promise:(async()=>{if(I.state===2)return c[w].result})(),dispose:()=>g(w),cancel:()=>g(w)}}else throw new Error(`Pool task with id=${w} already exists!`)}let U=new B({name:w,totalUnits:m.max??1,completeUnits:m.resolved??0});return i.addChild(U),c[w]={id:w,task:x,priority:++l,group:m.group,state:0,max:m.max??1,resolved:m.resolved??0,done:A,payload:m.payload,progress:U,setMax(v){U.setTotalUnits(v),c[w].max=v,y()},setResolved(v){U.setCompletetedUnits(v),c[w].resolved=v,y()},incResolved(v=1){U.incCompletedUnits(v),c[w].resolved+=v,y()}},++s,p(),{id:w,promise:T,dispose:()=>g(w),cancel:()=>g(w)}}return r(b,"enqueue"),{events:o,cancel:g,cancelAll:L,progress:i,enqueue:b,dispose:L,waitFinishAll:f}}r(Ku,"usePool");var Be=class extends M{constructor(n={}){super();this.queue=[];this.waitToFinish=[];this.countMax=0;this.countResolved=0;this.paused=!1;let{name:o=F("queue"),logLevel:i}=n;this.name=o,this.log=D(`zeed:queue:${o}`,i??1/0)}async performNext(){if(this.log("performNext, queue.length =",this.queue.length),this.currentTask!=null){this.log("performNext => skip while another task is running");return}if(this.paused){this.log("performNext => skip while is paused");return}for(;this.currentTask==null&&!this.paused;){let n=this.queue.shift();if(this.log(`performNext => ${n?.name}`),n==null)break;this.countResolved===0&&this.emit("didStart",this.countMax);let{name:o,task:i,resolve:s}=n;this.currentTask=i();let u;try{this.log.info(`start task ${o}`),u=await this.currentTask,this.log(`finished task ${o} with result =`,u)}catch(a){this.log.warn("Error performing task",a)}s(u),this.currentTask=void 0,this.countResolved+=1,this.emit("didUpdate",this.countMax,this.countResolved)}for(this.queue.length===0&&(this.emit("didFinish"),this.countMax=0,this.countResolved=0);this.waitToFinish.length>0;)this.waitToFinish.shift()()}async enqueue(n,o={}){let{immediate:i=!1,name:s=F(this.name)}=o;return i?(this.log.info(`immediate execution ${s}`),await n()):(this.log(`enqueue ${s}`),new Promise(u=>{this.queue.push({name:s,task:n,resolve:u}),this.countMax+=1,this.emit("didUpdate",this.countMax,this.countResolved),this.performNext()}))}async enqueueReentrant(n,o={}){return this.enqueue(n,{immediate:this.currentTask!=null,name:o.name})}async cancelAll(n=!0){this.log("cancelAll"),this.emit("didCancel");let o=this.queue.map(i=>i.resolve);this.queue=[],o.forEach(i=>i(void 0)),await this.wait()}async pause(){this.log("pause"),this.paused=!0,await this.wait()}resume(){this.log("resume"),this.paused=!1,this.performNext()}async wait(){if(this.log("wait"),!(this.currentTask==null&&(this.queue.length===0||this.paused)))return new Promise(n=>{this.waitToFinish.push(n)})}get isPaused(){return this.paused}get hasTasks(){return this.queue.length!==0}};r(Be,"SerialQueue");var K=!1,k=K?D("zeed:throttle","error"):()=>{};function ac(e,t={}){let{delay:n=100,trailing:o=!0,leading:i=!0}=t,s=0,u=0,a=0,l,c=Date.now();function f(){return s?(clearTimeout(s),s=void 0,!0):!1}r(f,"clearExistingTimeout");function d(...h){let y=Date.now(),p=y-u;function g(){let b=Date.now();return`total ${(b-c).toFixed(1)}ms - elapsed ${(b-u).toFixed(1)}ms - visited ${a}x`}r(g,"debugElapsed");let L=r(()=>{a=0,u=Date.now(),e.apply(this,h)},"exec");if(l=L,p>n||!s){K&&k("elapsed",g()),i&&(p>n?(K&&k("\u{1F680} leading",g()),L()):++a);let b=p>n?n:n-p;k(`\u23F1 start timeout with ${b.toFixed(1)}ms`,g()),f(),u=y,s=setTimeout(()=>{K&&k("\u23F1 reached timeout",g()),s=0,o&&(!i||a>0)&&(K&&k("\u{1F680} trailing",g()),l?.())},b)}else++a,K&&k("visited",g())}return r(d,"wrapper"),d.cancel=f,d.stop=()=>{f()&&l&&l()},d.immediate=r(async function(...y){f(),u=Date.now(),e.apply(this,y)},"immediate"),d.dispose=()=>d.stop(),d}r(ac,"throttle");function uc(e,t={}){let{delay:n=100}=t,o=0,i=!1,s;function u(){o&&(k("clear"),clearTimeout(o),o=0)}r(u,"clearExistingTimeout");async function a(){try{if(u(),s!=null){k("exec");let f=[...s];s=void 0,i=!0,await O(e(...f)),i=!1,k("exec done"),s!=null&&(u(),k("exec trigger next"),o=setTimeout(a,n))}}catch{}}r(a,"exec");function l(...f){s=[...f],u(),k("trigger"),i===!1&&(o=setTimeout(a,n))}r(l,"wrapper");async function c(...f){u(),s=[...f],await a()}return r(c,"immediate"),l.cancel=u,l.dispose=u,l.immediate=c,l}r(uc,"debounce");function fc(e=globalThis?.location?.hostname??""){return["::ffff:127.0.0.1","localhost","127.0.0.1","","::1","::"].includes(e)||e.startsWith("192.168.")||e.startsWith("10.0.")||e.endsWith(".local")}r(fc,"isLocalHost");function mc(e){let{level:t=void 0,filter:n=void 0,messages:o=[]}=e,i=q(n),s=re(t);return u=>{s(u.level)&&i(u.name)&&o.push(u)}}r(mc,"LoggerMemoryHandler");var Y=D("zeed:network","error"),je={cache:"no-cache",redirect:"follow",headers:{}};function Qn(e){let t=/:\/\/([^@]*)@/gi.exec(e);if(t&&t[1]){let[n,o]=t[1].split(":",2);return{url:e.replace(`${t[1]}@`,""),username:n,password:o}}}r(Qn,"parseBasicAuth");async function It(e,t={},n=fetch){try{_(t)&&(t=fe({},...W(t)));let o=Qn(String(e));o&&(e=o.url,t=fe({},t,Xn(o.username,o.password))),t.headers!=null&&!(t.headers instanceof Headers)&&(t.headers=new Headers(t.headers));let i=await n(String(e),t);if(i.status<400)return i;try{Y.warn(`Fetch of ${String(e)} returned status=${i.status}. Options:`,t),Y.warn(`Response: ${await i.text()}`)}catch(s){Y.error("Exception:",s)}}catch(o){Y.error("fetchBasic",o)}}r(It,"fetchBasic");async function wc(e,t={},n=fetch){try{let o=await It(e,[{method:"GET",headers:{Accept:"application/json"}},t],n);if(o)return await o.json()}catch(o){Y.error("fetchJSON error:",o)}}r(wc,"fetchJson");async function Lc(e,t={},n=fetch){try{let o=await It(e,[je,{method:"GET"},t],n);if(o)return await o.text()}catch(o){Y.error("fetchHTML error:",o)}}r(Lc,"fetchText");function vc(e,t="POST"){return{method:t,...je,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:At(e)}}r(vc,"fetchOptionsFormURLEncoded");function Ac(e,t="POST"){return{method:t,...je,headers:{"Content-Type":"application/json; charset=utf-8"},body:C(e)}}r(Ac,"fetchOptionsJson");function Xn(e,t){return{headers:{Authorization:`Basic ${Ke(`${e}:${t}`)}`}}}r(Xn,"fetchOptionsBasicAuth");function Ot(){if(typeof window<"u")return window}r(Ot,"getWindow");function er(){if(typeof navigator<"u")return navigator}r(er,"getNavigator");function Uc(){return Ot()??typeof WorkerGlobalScope<"u"?self:typeof global<"u"?global:Function("return this;")()}r(Uc,"getGlobal");var j=er(),V=Ot();function tr(e={ios:!1,macos:!1,windows:!1,beaker:!1,electron:!1,wkwebview:!1,pwa:!1,pwaInstalled:!1,browser:!1,node:!1,worker:!1,test:!1,jest:!1,macosNative:!1,iosNative:!1,appleNative:!1,touch:!1}){return e.ios=j?.platform?.match(/(iPhone|iPod|iPad)/i)!=null,e.macos=!!j?.platform?.startsWith("Mac"),e.windows=!!j?.platform?.startsWith("Win"),e.beaker=V?.beaker!=null,e.electron=(j?.userAgent?.toLowerCase()?.indexOf(" electron/")||-1)>-1&&!e.beaker,e.wkwebview=V?.webkit?.messageHandlers!=null,e.pwa=j?.serviceWorker!=null,e.pwaInstalled=j?.standalone||V?.matchMedia?.("(display-mode: standalone)")?.matches,e.node=typeof process<"u"&&process?.release?.name==="node",e.browser=!e.electron&&!e.wkwebview&&!e.node,e.worker=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,e.jest=typeof jest<"u"||typeof vitest<"u",e.test=e.jest,e.macosNative=e.wkwebview&&e.macos,e.iosNative=e.wkwebview&&e.ios,e.appleNative=e.wkwebview,e.touch=V&&"ontouchstart"in V||(j?.maxTouchPoints||0)>1||j?.msPointerEnabled&&V?.MSGesture||V?.DocumentTouch&&document instanceof DocumentTouch,e}r(tr,"detect");var nr=r(()=>typeof window<"u"&&globalThis===window,"isBrowser"),Ec=tr();function Mc(e){nr()?window.addEventListener("beforeunload",e):typeof process<"u"&&process.on("exit",()=>e)}r(Mc,"useExitHandler");var He=class{constructor(t={}){this.store={}}setItem(t,n){this.store[t]=Se(n)}getItem(t){return Se(this.store[t])}removeItem(t){delete this.store[t]}clear(){this.store={}}allKeys(){return Object.keys(this.store)}};r(He,"MemStorage");var Ic=r(()=>{},"noop");export{r as a,Q as b,Bt as c,q as d,ye as e,re as f,oe as g,X as h,ze as i,Ne as j,zt as k,D as l,Lr as m,C as n,vr as o,Gt as p,Vt as q,qe as r,Je as s,R as t,Er as u,We as v,Ze as w,Ke as x,Mr as y,qt as z,Rr as A,Ye as B,xe as C,be as D,Qe as E,J as F,et as G,Te as H,Xe as I,Jt as J,kr as K,Ir as L,tt as M,nt as N,Wt as O,E as P,_r as Q,Br as R,jr as S,Hr as T,Zt as U,zr as V,Nr as W,Gr as X,Vr as Y,Kt as Z,Wr as _,Le as $,Zr as aa,ve as ba,Yt as ca,Qt as da,W as ea,Xt as fa,eo as ga,rt as ha,to as ia,Ae as ja,no as ka,ro as la,en as ma,oo as na,tn as oa,ot as pa,io as qa,so as ra,ao as sa,uo as ta,co as ua,lo as va,fo as wa,po as xa,go as ya,z as za,bo as Aa,To as Ba,wo as Ca,Lo as Da,vo as Ea,Ao as Fa,Po as Ga,Do as Ha,Uo as Ia,Ro as Ja,sn as Ka,So as La,Co as Ma,Oo as Na,$o as Oa,_o as Pa,an as Qa,un as Ra,cn as Sa,Pe as Ta,Bo as Ua,jo as Va,Ho as Wa,zo as Xa,ln as Ya,No as Za,Go as _a,Ue as $a,Ee as ab,st as bb,fn as cb,Jo as db,at as eb,ut as fb,Wo as gb,Zo as hb,ce as ib,Ko as jb,De as kb,dn as lb,pn as mb,Me as nb,ct as ob,Yo as pb,Qo as qb,ue as rb,Xo as sb,ei as tb,ti as ub,ft as vb,ii as wb,si as xb,dt as yb,ai as zb,pt as Ab,ui as Bb,gt as Cb,ci as Db,S as Eb,O as Fb,P as Gb,gi as Hb,mi as Ib,yi as Jb,hi as Kb,gn as Lb,Ti as Mb,wi as Nb,Li as Ob,$ as Pb,Re as Qb,_ as Rb,le as Sb,Pi as Tb,Di as Ub,mt as Vb,Ui as Wb,Ei as Xb,yt as Yb,Mi as Zb,Ri as _b,Si as $b,Ci as ac,Fi as bc,mn as cc,yn as dc,fe as ec,ht as fc,Bi as gc,zi as hc,Ni as ic,Gi as jc,Vi as kc,Zi as lc,Ki as mc,Yi as nc,es as oc,Tt as pc,ee as qc,wt as rc,is as sc,ss as tc,as as uc,us as vc,cs as wc,ls as xc,fs as yc,ds as zc,Lt as Ac,vt as Bc,ys as Cc,wn as Dc,Ts as Ec,As as Fc,vn as Gc,At as Hc,Ps as Ic,Ms as Jc,Rs as Kc,Ss as Lc,Cs as Mc,Fs as Nc,Se as Oc,ks as Pc,Is as Qc,Os as Rc,$s as Sc,Un as Tc,Hs as Uc,Ce as Vc,ya as Wc,Mn as Xc,ha as Yc,Fe as Zc,va as _c,Aa as $c,Pa as ad,Da as bd,Ua as cd,Sa as dd,Ca as ed,M as fd,ja as gd,Ha as hd,za as id,Dt as jd,Va as kd,qa as ld,Ie as md,kn as nd,In as od,On as pd,$n as qd,_n as rd,Bn as sd,Hn as td,zn as ud,Nn as vd,Rt as wd,Xa as xd,eu as yd,Vn as zd,tu as Ad,nu as Bd,N as Cd,Ct as Dd,qn as Ed,ru as Fd,F as Gd,ou as Hd,ge as Id,te as Jd,cu as Kd,$e as Ld,G as Md,_e as Nd,Ft as Od,wu as Pd,me as Qd,Eu as Rd,Su as Sd,B as Td,Kn as Ud,Yn as Vd,Ku as Wd,Be as Xd,ac as Yd,uc as Zd,fc as _d,mc as $d,Qn as ae,It as be,wc as ce,Lc as de,vc as ee,Ac as fe,Xn as ge,Ot as he,er as ie,Uc as je,tr as ke,nr as le,Ec as me,Mc as ne,He as oe,Ic as pe};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-ILTCEHLM.js.map
|