@illuma-ai/code-sandbox 1.4.0 → 1.5.0

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/index.cjs CHANGED
@@ -1,9 +1,5 @@
1
- "use strict";var sT=Object.create;var zv=Object.defineProperty;var rT=Object.getOwnPropertyDescriptor;var iT=Object.getOwnPropertyNames;var aT=Object.getPrototypeOf,oT=Object.prototype.hasOwnProperty;var lT=(a,i,l,u)=>{if(i&&typeof i=="object"||typeof i=="function")for(let h of iT(i))!oT.call(a,h)&&h!==l&&zv(a,h,{get:()=>i[h],enumerable:!(u=rT(i,h))||u.enumerable});return a};var cT=(a,i,l)=>(l=a!=null?sT(aT(a)):{},lT(i||!a||!a.__esModule?zv(l,"default",{value:a,enumerable:!0}):l,a));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react/jsx-runtime"),q=require("react");function oi(){return oi=Object.assign?Object.assign.bind():function(a){for(var i=1;i<arguments.length;i++){var l=arguments[i];for(var u in l)({}).hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},oi.apply(null,arguments)}var Vo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ra(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var qv,Gv={exports:{}};/*!
2
- Copyright (c) 2018 Jed Watson.
3
- Licensed under the MIT License (MIT), see
4
- http://jedwatson.github.io/classnames
5
- */var ju,Kv,Yv,uT=(qv||(qv=1,ju=Gv,(function(){var a={}.hasOwnProperty;function i(){for(var h="",m=0;m<arguments.length;m++){var f=arguments[m];f&&(h=u(h,l(f)))}return h}function l(h){if(typeof h=="string"||typeof h=="number")return h;if(typeof h!="object")return"";if(Array.isArray(h))return i.apply(null,h);if(h.toString!==Object.prototype.toString&&!h.toString.toString().includes("[native code]"))return h.toString();var m="";for(var f in h)a.call(h,f)&&h[f]&&(m=u(m,f));return m}function u(h,m){return m?h?h+" "+m:h+m:h}ju.exports?(i.default=i,ju.exports=i):window.classNames=i})()),Gv.exports),md=Ra(uT),Zv,Xv,dT=(Yv||(Yv=1,Kv=function a(i,l){if(i===l)return!0;if(i&&l&&typeof i=="object"&&typeof l=="object"){if(i.constructor!==l.constructor)return!1;var u,h,m;if(Array.isArray(i)){if((u=i.length)!=l.length)return!1;for(h=u;h--!==0;)if(!a(i[h],l[h]))return!1;return!0}if(i instanceof Map&&l instanceof Map){if(i.size!==l.size)return!1;for(h of i.entries())if(!l.has(h[0]))return!1;for(h of i.entries())if(!a(h[1],l.get(h[0])))return!1;return!0}if(i instanceof Set&&l instanceof Set){if(i.size!==l.size)return!1;for(h of i.entries())if(!l.has(h[0]))return!1;return!0}if(ArrayBuffer.isView(i)&&ArrayBuffer.isView(l)){if((u=i.length)!=l.length)return!1;for(h=u;h--!==0;)if(i[h]!==l[h])return!1;return!0}if(i.constructor===RegExp)return i.source===l.source&&i.flags===l.flags;if(i.valueOf!==Object.prototype.valueOf)return i.valueOf()===l.valueOf();if(i.toString!==Object.prototype.toString)return i.toString()===l.toString();if((u=(m=Object.keys(i)).length)!==Object.keys(l).length)return!1;for(h=u;h--!==0;)if(!Object.prototype.hasOwnProperty.call(l,m[h]))return!1;for(h=u;h--!==0;){var f=m[h];if(!a(i[f],l[f]))return!1}return!0}return i!=i&&l!=l}),Kv),hT=Ra(dT),Jv,Qv,In=Ra((function(){if(Xv)return Zv;Xv=1;var a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,h=parseInt,m=Object.prototype.toString;function f(b){var v=typeof b;return!!b&&(v=="object"||v=="function")}function _(b){if(typeof b=="number")return b;if((function(E){return typeof E=="symbol"||(function(A){return!!A&&typeof A=="object"})(E)&&m.call(E)=="[object Symbol]"})(b))return NaN;if(f(b)){var v=typeof b.valueOf=="function"?b.valueOf():b;b=f(v)?v+"":v}if(typeof b!="string")return b===0?b:+b;b=b.replace(a,"");var w=l.test(b);return w||u.test(b)?h(b.slice(2),w?2:8):i.test(b)?NaN:+b}return Zv=function(b,v,w){return w===void 0&&(w=v,v=void 0),w!==void 0&&(w=(w=_(w))==w?w:0),v!==void 0&&(v=(v=_(v))==v?v:0),(function(E,A,R){return E==E&&(R!==void 0&&(E=E<=R?E:R),A!==void 0&&(E=E>=A?E:A)),E})(_(b),v,w)}})()),pT=Ra((function(){if(Qv)return Jv;Qv=1;var a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,h=parseInt,m=typeof Vo=="object"&&Vo&&Vo.Object===Object&&Vo,f=typeof self=="object"&&self&&self.Object===Object&&self,_=m||f||Function("return this")(),b=Object.prototype.toString,v=Math.max,w=Math.min,E=function(){return _.Date.now()};function A(P){var j=typeof P;return!!P&&(j=="object"||j=="function")}function R(P){if(typeof P=="number")return P;if((function(B){return typeof B=="symbol"||(function(Y){return!!Y&&typeof Y=="object"})(B)&&b.call(B)=="[object Symbol]"})(P))return NaN;if(A(P)){var j=typeof P.valueOf=="function"?P.valueOf():P;P=A(j)?j+"":j}if(typeof P!="string")return P===0?P:+P;P=P.replace(a,"");var M=l.test(P);return M||u.test(P)?h(P.slice(2),M?2:8):i.test(P)?NaN:+P}return Jv=function(P,j,M){var B,Y,H,Z,re,ge,se=0,ae=!1,xe=!1,oe=!0;if(typeof P!="function")throw new TypeError("Expected a function");function Fe(Ae){var We=B,Re=Y;return B=Y=void 0,se=Ae,Z=P.apply(Re,We)}function ie(Ae){var We=Ae-ge;return ge===void 0||We>=j||We<0||xe&&Ae-se>=H}function Ee(){var Ae=E();if(ie(Ae))return Be(Ae);re=setTimeout(Ee,(function(We){var Re=j-(We-ge);return xe?w(Re,H-(We-se)):Re})(Ae))}function Be(Ae){return re=void 0,oe&&B?Fe(Ae):(B=Y=void 0,Z)}function ke(){var Ae=E(),We=ie(Ae);if(B=arguments,Y=this,ge=Ae,We){if(re===void 0)return(function(Re){return se=Re,re=setTimeout(Ee,j),ae?Fe(Re):Z})(ge);if(xe)return re=setTimeout(Ee,j),Fe(ge)}return re===void 0&&(re=setTimeout(Ee,j)),Z}return j=R(j)||0,A(M)&&(ae=!!M.leading,H=(xe="maxWait"in M)?v(R(M.maxWait)||0,j):H,oe="trailing"in M?!!M.trailing:oe),ke.cancel=function(){re!==void 0&&clearTimeout(re),se=0,B=ge=Y=re=void 0},ke.flush=function(){return re===void 0?Z:Be(E())},ke}})()),e2={width:void 0,height:void 0};function fT(a){const{ref:i,box:l="content-box"}=a,[{width:u,height:h},m]=q.useState(e2),f=(function(){const v=q.useRef(!1);return q.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]),q.useCallback(()=>v.current,[])})(),_=q.useRef(oi({},e2)),b=q.useRef(void 0);return b.current=a.onResize,q.useEffect(()=>{if(!i.current||typeof window>"u"||!("ResizeObserver"in window))return;const v=new ResizeObserver(([w])=>{const E=l==="border-box"?"borderBoxSize":l==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",A=t2(w,E,"inlineSize"),R=t2(w,E,"blockSize");if(_.current.width!==A||_.current.height!==R){const P={width:A,height:R};_.current.width=A,_.current.height=R,b.current?b.current(P):f()&&m(P)}});return v.observe(i.current,{box:l}),()=>{v.disconnect()}},[l,i,f]),{width:u,height:h}}function t2(a,i,l){return a[i]?Array.isArray(a[i])?a[i][0][l]:a[i][l]:i==="contentBoxSize"?a.contentRect[l==="inlineSize"?"width":"height"]:void 0}var mT="allotment-module_splitView__L-yRc",gT="allotment-module_sashContainer__fzwJF",yT="allotment-module_splitViewContainer__rQnVa",X0="allotment-module_splitViewView__MGZ6O",_T="allotment-module_vertical__WSwwa",bT="allotment-module_horizontal__7doS8",vT="allotment-module_separatorBorder__x-rDS";let ma,J0=!1,Q0=!1;typeof navigator=="object"&&(ma=navigator.userAgent,Q0=ma.indexOf("Macintosh")>=0,J0=(ma.indexOf("Macintosh")>=0||ma.indexOf("iPad")>=0||ma.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0);const ew=J0,wT=Q0,n2=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?q.useLayoutEffect:q.useEffect;class ST{constructor(){this._size=void 0}getSize(){return this._size}setSize(i){this._size=i}}function Ho(a,i){const l=a.length,u=l-i.length;return u>=0&&a.slice(u,l)===i}var s2,r2={exports:{}},xT=(s2||(s2=1,(function(a){var i=Object.prototype.hasOwnProperty,l="~";function u(){}function h(b,v,w){this.fn=b,this.context=v,this.once=w||!1}function m(b,v,w,E,A){if(typeof w!="function")throw new TypeError("The listener must be a function");var R=new h(w,E||b,A),P=l?l+v:v;return b._events[P]?b._events[P].fn?b._events[P]=[b._events[P],R]:b._events[P].push(R):(b._events[P]=R,b._eventsCount++),b}function f(b,v){--b._eventsCount===0?b._events=new u:delete b._events[v]}function _(){this._events=new u,this._eventsCount=0}Object.create&&(u.prototype=Object.create(null),new u().__proto__||(l=!1)),_.prototype.eventNames=function(){var b,v,w=[];if(this._eventsCount===0)return w;for(v in b=this._events)i.call(b,v)&&w.push(l?v.slice(1):v);return Object.getOwnPropertySymbols?w.concat(Object.getOwnPropertySymbols(b)):w},_.prototype.listeners=function(b){var v=l?l+b:b,w=this._events[v];if(!w)return[];if(w.fn)return[w.fn];for(var E=0,A=w.length,R=new Array(A);E<A;E++)R[E]=w[E].fn;return R},_.prototype.listenerCount=function(b){var v=l?l+b:b,w=this._events[v];return w?w.fn?1:w.length:0},_.prototype.emit=function(b,v,w,E,A,R){var P=l?l+b:b;if(!this._events[P])return!1;var j,M,B=this._events[P],Y=arguments.length;if(B.fn){switch(B.once&&this.removeListener(b,B.fn,void 0,!0),Y){case 1:return B.fn.call(B.context),!0;case 2:return B.fn.call(B.context,v),!0;case 3:return B.fn.call(B.context,v,w),!0;case 4:return B.fn.call(B.context,v,w,E),!0;case 5:return B.fn.call(B.context,v,w,E,A),!0;case 6:return B.fn.call(B.context,v,w,E,A,R),!0}for(M=1,j=new Array(Y-1);M<Y;M++)j[M-1]=arguments[M];B.fn.apply(B.context,j)}else{var H,Z=B.length;for(M=0;M<Z;M++)switch(B[M].once&&this.removeListener(b,B[M].fn,void 0,!0),Y){case 1:B[M].fn.call(B[M].context);break;case 2:B[M].fn.call(B[M].context,v);break;case 3:B[M].fn.call(B[M].context,v,w);break;case 4:B[M].fn.call(B[M].context,v,w,E);break;default:if(!j)for(H=1,j=new Array(Y-1);H<Y;H++)j[H-1]=arguments[H];B[M].fn.apply(B[M].context,j)}}return!0},_.prototype.on=function(b,v,w){return m(this,b,v,w,!1)},_.prototype.once=function(b,v,w){return m(this,b,v,w,!0)},_.prototype.removeListener=function(b,v,w,E){var A=l?l+b:b;if(!this._events[A])return this;if(!v)return f(this,A),this;var R=this._events[A];if(R.fn)R.fn!==v||E&&!R.once||w&&R.context!==w||f(this,A);else{for(var P=0,j=[],M=R.length;P<M;P++)(R[P].fn!==v||E&&!R[P].once||w&&R[P].context!==w)&&j.push(R[P]);j.length?this._events[A]=j.length===1?j[0]:j:f(this,A)}return this},_.prototype.removeAllListeners=function(b){var v;return b?(v=l?l+b:b,this._events[v]&&f(this,v)):(this._events=new u,this._eventsCount=0),this},_.prototype.off=_.prototype.removeListener,_.prototype.addListener=_.prototype.on,_.prefixed=l,_.EventEmitter=_,a.exports=_})(r2)),r2.exports),Vd=Ra(xT);function i2(a,i){const l=a.indexOf(i);l>-1&&(a.splice(l,1),a.unshift(i))}function Vu(a,i){const l=a.indexOf(i);l>-1&&(a.splice(l,1),a.push(i))}function gn(a,i,l=1){const u=Math.max(0,Math.ceil((i-a)/l)),h=new Array(u);let m=-1;for(;++m<u;)h[m]=a+m*l;return h}var ET="sash-module_sash__K-9lB",kT="sash-module_disabled__Hm-wx",CT="sash-module_mac__Jf6OJ",a2="sash-module_vertical__pB-rs",AT="sash-module_minimum__-UKxp",TT="sash-module_maximum__TCWxD",o2="sash-module_horizontal__kFbiw",Hu="sash-module_hover__80W6I",Wu="sash-module_active__bJspD";let _n=(function(a){return a.Vertical="VERTICAL",a.Horizontal="HORIZONTAL",a})({}),en=(function(a){return a.Disabled="DISABLED",a.Minimum="MINIMUM",a.Maximum="MAXIMUM",a.Enabled="ENABLED",a})({}),tw=ew?20:8;const nw=new Vd;class l2 extends Vd{get state(){return this._state}set state(i){this._state!==i&&(this.el.classList.toggle(kT,i===en.Disabled),this.el.classList.toggle("sash-disabled",i===en.Disabled),this.el.classList.toggle(AT,i===en.Minimum),this.el.classList.toggle("sash-minimum",i===en.Minimum),this.el.classList.toggle(TT,i===en.Maximum),this.el.classList.toggle("sash-maximum",i===en.Maximum),this._state=i,this.emit("enablementChange",i))}constructor(i,l,u){var h;super(),this.el=void 0,this.layoutProvider=void 0,this.orientation=void 0,this.size=void 0,this.hoverDelay=300,this.hoverDelayer=pT(m=>m.classList.add("sash-hover",Hu),this.hoverDelay),this._state=en.Enabled,this.onPointerStart=m=>{const f=m.pageX,_=m.pageY,b={startX:f,currentX:f,startY:_,currentY:_};this.el.classList.add("sash-active",Wu),this.emit("start",b),this.el.setPointerCapture(m.pointerId);const v=E=>{E.preventDefault();const A={startX:f,currentX:E.pageX,startY:_,currentY:E.pageY};this.emit("change",A)},w=E=>{E.preventDefault(),this.el.classList.remove("sash-active",Wu),this.hoverDelayer.cancel(),this.emit("end"),this.el.releasePointerCapture(E.pointerId),window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",w)};window.addEventListener("pointermove",v),window.addEventListener("pointerup",w)},this.onPointerDoublePress=()=>{this.emit("reset")},this.onMouseEnter=()=>{this.el.classList.contains(Wu)?(this.hoverDelayer.cancel(),this.el.classList.add("sash-hover",Hu)):this.hoverDelayer(this.el)},this.onMouseLeave=()=>{this.hoverDelayer.cancel(),this.el.classList.remove("sash-hover",Hu)},this.el=document.createElement("div"),this.el.classList.add("sash",ET),this.el.dataset.testid="sash",i.append(this.el),wT&&this.el.classList.add("sash-mac",CT),this.el.addEventListener("pointerdown",this.onPointerStart),this.el.addEventListener("dblclick",this.onPointerDoublePress),this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("mouseleave",this.onMouseLeave),typeof u.size=="number"?(this.size=u.size,u.orientation===_n.Vertical?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=tw,nw.on("onDidChangeGlobalSize",m=>{this.size=m,this.layout()})),this.layoutProvider=l,this.orientation=(h=u.orientation)!=null?h:_n.Vertical,this.orientation===_n.Horizontal?(this.el.classList.add("sash-horizontal",o2),this.el.classList.remove("sash-vertical",a2)):(this.el.classList.remove("sash-horizontal",o2),this.el.classList.add("sash-vertical",a2)),this.layout()}layout(){if(this.orientation===_n.Vertical){const i=this.layoutProvider;this.el.style.left=i.getVerticalSashLeft(this)-this.size/2+"px",i.getVerticalSashTop&&(this.el.style.top=i.getVerticalSashTop(this)+"px"),i.getVerticalSashHeight&&(this.el.style.height=i.getVerticalSashHeight(this)+"px")}else{const i=this.layoutProvider;this.el.style.top=i.getHorizontalSashTop(this)-this.size/2+"px",i.getHorizontalSashLeft&&(this.el.style.left=i.getHorizontalSashLeft(this)+"px"),i.getHorizontalSashWidth&&(this.el.style.width=i.getHorizontalSashWidth(this)+"px")}}dispose(){this.el.removeEventListener("pointerdown",this.onPointerStart),this.el.removeEventListener("dblclick",this.onPointerDoublePress),this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("mouseleave",()=>this.onMouseLeave),this.el.remove()}}let ll;var zu;(zu=ll||(ll={})).Distribute={type:"distribute"},zu.Split=function(a){return{type:"split",index:a}},zu.Invisible=function(a){return{type:"invisible",cachedVisibleSize:a}};let yn=(function(a){return a.Normal="NORMAL",a.Low="LOW",a.High="HIGH",a})({});class sw{constructor(i,l,u){this.container=void 0,this.view=void 0,this._size=void 0,this._cachedVisibleSize=void 0,this.container=i,this.view=l,this.container.classList.add("split-view-view",X0),this.container.dataset.testid="split-view-view",typeof u=="number"?(this._size=u,this._cachedVisibleSize=void 0,i.classList.add("split-view-view-visible")):(this._size=0,this._cachedVisibleSize=u.cachedVisibleSize)}set size(i){this._size=i}get size(){return this._size}get priority(){return this.view.priority}get snap(){return!!this.view.snap}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return this._cachedVisibleSize===void 0}setVisible(i,l){i!==this.visible&&(i?(this.size=In(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof l=="number"?l:this.size,this.size=0),this.container.classList.toggle("split-view-view-visible",i),this.view.setVisible&&this.view.setVisible(i))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}set enabled(i){this.container.style.pointerEvents=i?"":"none"}layout(i){this.layoutContainer(i),this.view.layout(this.size,i)}}class IT extends sw{layoutContainer(i){this.container.style.left=`${i}px`,this.container.style.width=`${this.size}px`}}class RT extends sw{layoutContainer(i){this.container.style.top=`${i}px`,this.container.style.height=`${this.size}px`}}class PT extends Vd{get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(i){this._startSnappingEnabled!==i&&(this._startSnappingEnabled=i,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(i){this._endSnappingEnabled!==i&&(this._endSnappingEnabled=i,this.updateSashEnablement())}constructor(i,l={},u,h,m){var f,_;if(super(),this.onDidChange=void 0,this.onDidDragStart=void 0,this.onDidDragEnd=void 0,this.orientation=void 0,this.sashContainer=void 0,this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.sashDragState=void 0,this.proportionalLayout=void 0,this.getSashOrthogonalSize=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onSashEnd=b=>{this.emit("sashchange",b),this.saveProportions();for(const v of this.viewItems)v.enabled=!0},this.orientation=(f=l.orientation)!=null?f:_n.Vertical,this.proportionalLayout=(_=l.proportionalLayout)!=null?_:!0,this.getSashOrthogonalSize=l.getSashOrthogonalSize,u&&(this.onDidChange=u),h&&(this.onDidDragStart=h),m&&(this.onDidDragEnd=m),this.sashContainer=document.createElement("div"),this.sashContainer.classList.add("sash-container",gT),i.prepend(this.sashContainer),l.descriptor){this.size=l.descriptor.size;for(const[b,v]of l.descriptor.views.entries()){const w=v.size,E=v.container,A=v.view;this.addView(E,A,w,b,!0)}this.contentSize=this.viewItems.reduce((b,v)=>b+v.size,0),this.saveProportions()}}addView(i,l,u,h=this.viewItems.length,m){let f;f=typeof u=="number"?u:u.type==="split"?this.getViewSize(u.index)/2:u.type==="invisible"?{cachedVisibleSize:u.cachedVisibleSize}:l.minimumSize;const _=this.orientation===_n.Vertical?new RT(i,l,f):new IT(i,l,f);if(this.viewItems.splice(h,0,_),this.viewItems.length>1){const b=this.orientation===_n.Vertical?new l2(this.sashContainer,{getHorizontalSashTop:E=>this.getSashPosition(E),getHorizontalSashWidth:this.getSashOrthogonalSize},{orientation:_n.Horizontal}):new l2(this.sashContainer,{getVerticalSashLeft:E=>this.getSashPosition(E),getVerticalSashHeight:this.getSashOrthogonalSize},{orientation:_n.Vertical}),v=this.orientation===_n.Vertical?E=>({sash:b,start:E.startY,current:E.currentY}):E=>({sash:b,start:E.startX,current:E.currentX});b.on("start",E=>{var A;this.emit("sashDragStart"),this.onSashStart(v(E));const R=this.viewItems.map(P=>P.size);(A=this.onDidDragStart)==null||A.call(this,R)}),b.on("change",E=>this.onSashChange(v(E))),b.on("end",()=>{var E;this.emit("sashDragEnd"),this.onSashEnd(this.sashItems.findIndex(R=>R.sash===b));const A=this.viewItems.map(R=>R.size);(E=this.onDidDragEnd)==null||E.call(this,A)}),b.on("reset",()=>{const E=this.sashItems.findIndex(M=>M.sash===b),A=gn(E,-1,-1),R=gn(E+1,this.viewItems.length),P=this.findFirstSnapIndex(A),j=this.findFirstSnapIndex(R);(typeof P!="number"||this.viewItems[P].visible)&&(typeof j!="number"||this.viewItems[j].visible)&&this.emit("sashreset",E)});const w={sash:b};this.sashItems.splice(h-1,0,w)}m||this.relayout(),m||typeof u=="number"||u.type!=="distribute"||this.distributeViewSizes()}removeView(i,l){if(i<0||i>=this.viewItems.length)throw new Error("Index out of bounds");const u=this.viewItems.splice(i,1)[0].view;if(this.viewItems.length>=1){const h=Math.max(i-1,0);this.sashItems.splice(h,1)[0].sash.dispose()}return this.relayout(),l&&l.type==="distribute"&&this.distributeViewSizes(),u}moveView(i,l,u){const h=this.getViewCachedVisibleSize(l),m=h===void 0?this.getViewSize(l):ll.Invisible(h),f=this.removeView(l);this.addView(i,f,m,u)}getViewCachedVisibleSize(i){if(i<0||i>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[i].cachedVisibleSize}layout(i=this.size){const l=Math.max(this.size,this.contentSize);if(this.size=i,this.proportions)for(let u=0;u<this.viewItems.length;u++){const h=this.viewItems[u];h.size=In(Math.round(this.proportions[u]*i),h.minimumSize,h.maximumSize)}else{const u=gn(0,this.viewItems.length),h=u.filter(f=>this.viewItems[f].priority===yn.Low),m=u.filter(f=>this.viewItems[f].priority===yn.High);this.resize(this.viewItems.length-1,i-l,void 0,h,m)}this.distributeEmptySpace(),this.layoutViews()}resizeView(i,l){if(i<0||i>=this.viewItems.length)return;const u=gn(0,this.viewItems.length).filter(_=>_!==i),h=[...u.filter(_=>this.viewItems[_].priority===yn.Low),i],m=u.filter(_=>this.viewItems[_].priority===yn.High),f=this.viewItems[i];l=Math.round(l),l=In(l,f.minimumSize,Math.min(f.maximumSize,this.size)),f.size=l,this.relayout(h,m)}resizeViews(i){for(let l=0;l<i.length;l++){const u=this.viewItems[l];let h=i[l];h=Math.round(h),h=In(h,u.minimumSize,Math.min(u.maximumSize,this.size)),u.size=h}this.contentSize=this.viewItems.reduce((l,u)=>l+u.size,0),this.saveProportions(),this.layout(this.size)}getViewSize(i){return i<0||i>=this.viewItems.length?-1:this.viewItems[i].size}isViewVisible(i){if(i<0||i>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[i].visible}setViewVisible(i,l){if(i<0||i>=this.viewItems.length)throw new Error("Index out of bounds");this.viewItems[i].setVisible(l),this.distributeEmptySpace(i),this.layoutViews(),this.saveProportions()}distributeViewSizes(){const i=[];let l=0;for(const _ of this.viewItems)_.maximumSize-_.minimumSize>0&&(i.push(_),l+=_.size);const u=Math.floor(l/i.length);for(const _ of i)_.size=In(u,_.minimumSize,_.maximumSize);const h=gn(0,this.viewItems.length),m=h.filter(_=>this.viewItems[_].priority===yn.Low),f=h.filter(_=>this.viewItems[_].priority===yn.High);this.relayout(m,f)}dispose(){this.sashItems.forEach(i=>i.sash.dispose()),this.sashItems=[],this.sashContainer.remove()}relayout(i,l){const u=this.viewItems.reduce((h,m)=>h+m.size,0);this.resize(this.viewItems.length-1,this.size-u,void 0,i,l),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}onSashStart({sash:i,start:l}){const u=this.sashItems.findIndex(h=>h.sash===i);(h=>{const m=this.viewItems.map(Y=>Y.size);let f,_,b=Number.NEGATIVE_INFINITY,v=Number.POSITIVE_INFINITY;const w=gn(u,-1,-1),E=gn(u+1,this.viewItems.length),A=w.reduce((Y,H)=>Y+(this.viewItems[H].minimumSize-m[H]),0),R=w.reduce((Y,H)=>Y+(this.viewItems[H].viewMaximumSize-m[H]),0),P=E.length===0?Number.POSITIVE_INFINITY:E.reduce((Y,H)=>Y+(m[H]-this.viewItems[H].minimumSize),0),j=E.length===0?Number.NEGATIVE_INFINITY:E.reduce((Y,H)=>Y+(m[H]-this.viewItems[H].viewMaximumSize),0);b=Math.max(A,j),v=Math.min(P,R);const M=this.findFirstSnapIndex(w),B=this.findFirstSnapIndex(E);if(typeof M=="number"){const Y=this.viewItems[M],H=Math.floor(Y.viewMinimumSize/2);f={index:M,limitDelta:Y.visible?b-H:b+H,size:Y.size}}if(typeof B=="number"){const Y=this.viewItems[B],H=Math.floor(Y.viewMinimumSize/2);_={index:B,limitDelta:Y.visible?v+H:v-H,size:Y.size}}this.sashDragState={start:h,current:h,index:u,sizes:m,minDelta:b,maxDelta:v,snapBefore:f,snapAfter:_}})(l)}onSashChange({current:i}){const{index:l,start:u,sizes:h,minDelta:m,maxDelta:f,snapBefore:_,snapAfter:b}=this.sashDragState;this.sashDragState.current=i;const v=i-u;this.resize(l,v,h,void 0,void 0,m,f,_,b),this.distributeEmptySpace(),this.layoutViews()}getSashPosition(i){let l=0;for(let u=0;u<this.sashItems.length;u++)if(l+=this.viewItems[u].size,this.sashItems[u].sash===i)return l;return 0}resize(i,l,u=this.viewItems.map(w=>w.size),h,m,f=Number.NEGATIVE_INFINITY,_=Number.POSITIVE_INFINITY,b,v){if(i<0||i>=this.viewItems.length)return 0;const w=gn(i,-1,-1),E=gn(i+1,this.viewItems.length);if(m)for(const se of m)i2(w,se),i2(E,se);if(h)for(const se of h)Vu(w,se),Vu(E,se);const A=w.map(se=>this.viewItems[se]),R=w.map(se=>u[se]),P=E.map(se=>this.viewItems[se]),j=E.map(se=>u[se]),M=w.reduce((se,ae)=>se+(this.viewItems[ae].minimumSize-u[ae]),0),B=w.reduce((se,ae)=>se+(this.viewItems[ae].maximumSize-u[ae]),0),Y=E.length===0?Number.POSITIVE_INFINITY:E.reduce((se,ae)=>se+(u[ae]-this.viewItems[ae].minimumSize),0),H=E.length===0?Number.NEGATIVE_INFINITY:E.reduce((se,ae)=>se+(u[ae]-this.viewItems[ae].maximumSize),0),Z=Math.max(M,H,f),re=Math.min(Y,B,_);let ge=!1;if(b){const se=this.viewItems[b.index],ae=l>=b.limitDelta;ge=ae!==se.visible,se.setVisible(ae,b.size)}if(!ge&&v){const se=this.viewItems[v.index],ae=l<v.limitDelta;ge=ae!==se.visible,se.setVisible(ae,v.size)}if(ge)return this.resize(i,l,u,h,m,f,_);for(let se=0,ae=l=In(l,Z,re);se<A.length;se++){const xe=A[se],oe=In(R[se]+ae,xe.minimumSize,xe.maximumSize);ae-=oe-R[se],xe.size=oe}for(let se=0,ae=l;se<P.length;se++){const xe=P[se],oe=In(j[se]-ae,xe.minimumSize,xe.maximumSize);ae+=oe-j[se],xe.size=oe}return l}distributeEmptySpace(i){const l=this.viewItems.reduce((v,w)=>v+w.size,0);let u=this.size-l;const h=gn(0,this.viewItems.length),m=[],f=h.filter(v=>this.viewItems[v].priority===yn.Low),_=h.filter(v=>this.viewItems[v].priority===yn.Normal),b=h.filter(v=>this.viewItems[v].priority===yn.High);m.push(...b,..._,...f),typeof i=="number"&&Vu(m,i);for(let v=0;u!==0&&v<m.length;v++){const w=this.viewItems[m[v]],E=In(w.size+u,w.minimumSize,w.maximumSize);u-=E-w.size,w.size=E}}layoutViews(){var i;this.contentSize=this.viewItems.reduce((u,h)=>u+h.size,0);let l=0;for(const u of this.viewItems)u.layout(l),l+=u.size;(i=this.onDidChange)!=null&&i.call(this,this.viewItems.map(u=>u.size)),this.sashItems.forEach(u=>u.sash.layout()),this.updateSashEnablement()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(i=>i.size/this.contentSize))}updateSashEnablement(){let i=!1;const l=this.viewItems.map(b=>i=b.size-b.minimumSize>0||i);i=!1;const u=this.viewItems.map(b=>i=b.maximumSize-b.size>0||i),h=[...this.viewItems].reverse();i=!1;const m=h.map(b=>i=b.size-b.minimumSize>0||i).reverse();i=!1;const f=h.map(b=>i=b.maximumSize-b.size>0||i).reverse();let _=0;for(let b=0;b<this.sashItems.length;b++){const{sash:v}=this.sashItems[b];_+=this.viewItems[b].size;const w=!(l[b]&&f[b+1]),E=!(u[b]&&m[b+1]);if(w&&E){const A=gn(b,-1,-1),R=gn(b+1,this.viewItems.length),P=this.findFirstSnapIndex(A),j=this.findFirstSnapIndex(R),M=typeof P=="number"&&!this.viewItems[P].visible,B=typeof j=="number"&&!this.viewItems[j].visible;M&&m[b]&&(_>0||this.startSnappingEnabled)?v.state=en.Minimum:B&&l[b]&&(_<this.contentSize||this.endSnappingEnabled)?v.state=en.Maximum:v.state=en.Disabled}else v.state=w&&!E?en.Minimum:!w&&E?en.Maximum:en.Enabled}}findFirstSnapIndex(i){for(const l of i){const u=this.viewItems[l];if(u.visible&&u.snap)return l}for(const l of i){const u=this.viewItems[l];if(u.visible&&u.maximumSize-u.minimumSize>0)return;if(!u.visible&&u.snap)return l}}}class Zr{constructor(i){this.size=void 0,this.size=i}getPreferredSize(){return this.size}}class c2{constructor(i,l){this.proportion=void 0,this.layoutService=void 0,this.proportion=i,this.layoutService=l}getPreferredSize(){return this.proportion*this.layoutService.getSize()}}class Wo{getPreferredSize(){}}class u2{get preferredSize(){return this.layoutStrategy.getPreferredSize()}set preferredSize(i){if(typeof i=="number")this.layoutStrategy=new Zr(i);else if(typeof i=="string"){const l=i.trim();if(Ho(l,"%")){const u=Number(l.slice(0,-1))/100;this.layoutStrategy=new c2(u,this.layoutService)}else if(Ho(l,"px")){const u=Number(l.slice(0,-2))/100;this.layoutStrategy=new Zr(u)}else if(typeof Number.parseFloat(l)=="number"){const u=Number.parseFloat(l);this.layoutStrategy=new Zr(u)}else this.layoutStrategy=new Wo}else this.layoutStrategy=new Wo}constructor(i,l){var u;if(this.minimumSize=0,this.maximumSize=Number.POSITIVE_INFINITY,this.element=void 0,this.priority=void 0,this.snap=void 0,this.layoutService=void 0,this.layoutStrategy=void 0,this.layoutService=i,this.element=l.element,this.minimumSize=typeof l.minimumSize=="number"?l.minimumSize:30,this.maximumSize=typeof l.maximumSize=="number"?l.maximumSize:Number.POSITIVE_INFINITY,typeof l.preferredSize=="number")this.layoutStrategy=new Zr(l.preferredSize);else if(typeof l.preferredSize=="string"){const h=l.preferredSize.trim();if(Ho(h,"%")){const m=Number(h.slice(0,-1))/100;this.layoutStrategy=new c2(m,this.layoutService)}else if(Ho(h,"px")){const m=Number(h.slice(0,-2));this.layoutStrategy=new Zr(m)}else if(typeof Number.parseFloat(h)=="number"){const m=Number.parseFloat(h);this.layoutStrategy=new Zr(m)}else this.layoutStrategy=new Wo}else this.layoutStrategy=new Wo;this.priority=(u=l.priority)!=null?u:yn.Normal,this.snap=typeof l.snap=="boolean"&&l.snap}layout(i){}}function d2(a){return a.minSize!==void 0||a.maxSize!==void 0||a.preferredSize!==void 0||a.priority!==void 0||a.visible!==void 0}const Hd=q.forwardRef(({className:a,children:i},l)=>q.createElement("div",{ref:l,className:md("split-view-view",X0,a)},i));Hd.displayName="Allotment.Pane";const rw=q.forwardRef(({children:a,className:i,id:l,maxSize:u=1/0,minSize:h=30,proportionalLayout:m=!0,separator:f=!0,sizes:_,defaultSizes:b=_,snap:v=!1,vertical:w=!1,onChange:E,onReset:A,onVisibleChange:R,onDragStart:P,onDragEnd:j},M)=>{const B=q.useRef(null),Y=q.useRef([]),H=q.useRef(new Map),Z=q.useRef(null),re=q.useRef(new Map),ge=q.useRef(new ST),se=q.useRef([]),[ae,xe]=q.useState(!1);process.env.NODE_ENV!=="production"&&_&&console.warn("Prop sizes is deprecated. Please use defaultSizes instead.");const oe=q.useMemo(()=>q.Children.toArray(a).filter(q.isValidElement),[a]),Fe=q.useCallback(ie=>{var Ee,Be;const ke=(Ee=se.current)==null?void 0:Ee[ie];return typeof(ke==null?void 0:ke.preferredSize)=="number"&&((Be=Z.current)!=null&&Be.resizeView(ie,Math.round(ke.preferredSize)),!0)},[]);return q.useImperativeHandle(M,()=>({reset:()=>{if(A)A();else{var ie;(ie=Z.current)==null||ie.distributeViewSizes();for(let Ee=0;Ee<se.current.length;Ee++)Fe(Ee)}},resize:ie=>{var Ee;(Ee=Z.current)==null||Ee.resizeViews(ie)}})),n2(()=>{let ie=!0;b&&re.current.size!==b.length&&(ie=!1,console.warn(`Expected ${b.length} children based on defaultSizes but found ${re.current.size}`)),ie&&b&&(Y.current=oe.map(ke=>ke.key));const Ee=oi({orientation:w?_n.Vertical:_n.Horizontal,proportionalLayout:m},ie&&b&&{descriptor:{size:b.reduce((ke,Ae)=>ke+Ae,0),views:b.map((ke,Ae)=>{var We,Re,Je,vt;const ee=H.current.get(Y.current[Ae]),pe=new u2(ge.current,oi({element:document.createElement("div"),minimumSize:(We=ee==null?void 0:ee.minSize)!=null?We:h,maximumSize:(Re=ee==null?void 0:ee.maxSize)!=null?Re:u,priority:(Je=ee==null?void 0:ee.priority)!=null?Je:yn.Normal},(ee==null?void 0:ee.preferredSize)&&{preferredSize:ee==null?void 0:ee.preferredSize},{snap:(vt=ee==null?void 0:ee.snap)!=null?vt:v}));return se.current.push(pe),{container:[...re.current.values()][Ae],size:ke,view:pe}})}});Z.current=new PT(B.current,Ee,E,P,j),Z.current.on("sashDragStart",()=>{var ke;(ke=B.current)==null||ke.classList.add("split-view-sash-dragging")}),Z.current.on("sashDragEnd",()=>{var ke;(ke=B.current)==null||ke.classList.remove("split-view-sash-dragging")}),Z.current.on("sashchange",ke=>{if(R&&Z.current){const Ae=oe.map(We=>We.key);for(let We=0;We<Ae.length;We++){const Re=H.current.get(Ae[We]);(Re==null?void 0:Re.visible)!==void 0&&Re.visible!==Z.current.isViewVisible(We)&&R(We,Z.current.isViewVisible(We))}}}),Z.current.on("sashreset",ke=>{if(A)A();else{var Ae;if(Fe(ke)||Fe(ke+1))return;(Ae=Z.current)==null||Ae.distributeViewSizes()}});const Be=Z.current;return()=>{Be.dispose()}},[]),n2(()=>{if(ae){const De=oe.map(fe=>fe.key),be=[...Y.current],Qe=De.filter(fe=>!Y.current.includes(fe)),it=De.filter(fe=>Y.current.includes(fe)),Pe=Y.current.map(fe=>!De.includes(fe));for(let fe=Pe.length-1;fe>=0;fe--){var ie;Pe[fe]&&((ie=Z.current)!=null&&ie.removeView(fe),be.splice(fe,1),se.current.splice(fe,1))}for(const fe of Qe){var Ee,Be,ke,Ae,We;const Ce=H.current.get(fe),je=new u2(ge.current,oi({element:document.createElement("div"),minimumSize:(Ee=Ce==null?void 0:Ce.minSize)!=null?Ee:h,maximumSize:(Be=Ce==null?void 0:Ce.maxSize)!=null?Be:u,priority:(ke=Ce==null?void 0:Ce.priority)!=null?ke:yn.Normal},(Ce==null?void 0:Ce.preferredSize)&&{preferredSize:Ce==null?void 0:Ce.preferredSize},{snap:(Ae=Ce==null?void 0:Ce.snap)!=null?Ae:v}));(We=Z.current)!=null&&We.addView(re.current.get(fe),je,ll.Distribute,De.findIndex(_e=>_e===fe)),be.splice(De.findIndex(_e=>_e===fe),0,fe),se.current.splice(De.findIndex(_e=>_e===fe),0,je)}for(;!hT(De,be);)for(const[fe,Ce]of De.entries()){const je=be.findIndex(_e=>_e===Ce);if(je!==fe){var Re;(Re=Z.current)==null||Re.moveView(re.current.get(Ce),je,fe);const _e=be[je];be.splice(je,1),be.splice(fe,0,_e);break}}for(const fe of Qe){var Je;const Ce=De.findIndex(_e=>_e===fe),je=se.current[Ce].preferredSize;je!==void 0&&((Je=Z.current)==null||Je.resizeView(Ce,je))}for(const fe of[...Qe,...it]){var vt,ee;const Ce=H.current.get(fe),je=De.findIndex(_e=>_e===fe);Ce&&d2(Ce)&&Ce.visible!==void 0&&((vt=Z.current)==null?void 0:vt.isViewVisible(je))!==Ce.visible&&((ee=Z.current)==null||ee.setViewVisible(je,Ce.visible))}for(const fe of it){const Ce=H.current.get(fe),je=De.findIndex(_e=>_e===fe);if(Ce&&d2(Ce)){var pe;Ce.preferredSize!==void 0&&se.current[je].preferredSize!==Ce.preferredSize&&(se.current[je].preferredSize=Ce.preferredSize);let _e=!1;Ce.minSize!==void 0&&se.current[je].minimumSize!==Ce.minSize&&(se.current[je].minimumSize=Ce.minSize,_e=!0),Ce.maxSize!==void 0&&se.current[je].maximumSize!==Ce.maxSize&&(se.current[je].maximumSize=Ce.maxSize,_e=!0),_e&&((pe=Z.current)==null||pe.layout())}}(Qe.length>0||Pe.length>0)&&(Y.current=De)}},[oe,ae,u,h,v]),q.useEffect(()=>{Z.current&&(Z.current.onDidChange=E)},[E]),q.useEffect(()=>{Z.current&&(Z.current.onDidDragStart=P)},[P]),q.useEffect(()=>{Z.current&&(Z.current.onDidDragEnd=j)},[j]),fT({ref:B,onResize:({width:ie,height:Ee})=>{var Be;ie&&Ee&&((Be=Z.current)!=null&&Be.layout(w?Ee:ie),ge.current.setSize(w?Ee:ie),xe(!0))}}),q.useEffect(()=>{ew&&DT(20)},[]),q.createElement("div",{ref:B,className:md("split-view",w?"split-view-vertical":"split-view-horizontal",{"split-view-separator-border":f},mT,w?_T:bT,{[vT]:f},i),id:l},q.createElement("div",{className:md("split-view-container",yT)},q.Children.toArray(a).map(ie=>{if(!q.isValidElement(ie))return null;const Ee=ie.key;return ie.type.displayName==="Allotment.Pane"?(H.current.set(Ee,ie.props),q.cloneElement(ie,{key:Ee,ref:Be=>{const ke=ie.ref;ke&&(ke.current=Be),Be?re.current.set(Ee,Be):re.current.delete(Ee)}})):q.createElement(Hd,{key:Ee,ref:Be=>{Be?re.current.set(Ee,Be):re.current.delete(Ee)}},ie)})))});function DT(a){const i=In(a,4,20),l=In(a,1,8);document.documentElement.style.setProperty("--sash-size",i+"px"),document.documentElement.style.setProperty("--sash-hover-size",l+"px"),(function(u){tw=u,nw.emit("onDidChangeGlobalSize",u)})(i)}rw.displayName="Allotment";var qu=Object.assign(rw,{Pane:Hd});const iw=q.createContext({});function OT(a){const i=q.useRef(null);return i.current===null&&(i.current=a()),i.current}const NT=typeof window<"u",BT=NT?q.useLayoutEffect:q.useEffect,Wd=q.createContext(null);function zd(a,i){a.indexOf(i)===-1&&a.push(i)}function cl(a,i){const l=a.indexOf(i);l>-1&&a.splice(l,1)}const Yn=(a,i,l)=>l>i?i:l<a?a:l;function gd(a,i){return i?`${a}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${i}`:a}let di=()=>{},cs=()=>{};var Z0;typeof process<"u"&&((Z0=process.env)==null?void 0:Z0.NODE_ENV)!=="production"&&(di=(a,i,l)=>{!a&&typeof console<"u"&&console.warn(gd(i,l))},cs=(a,i,l)=>{if(!a)throw new Error(gd(i,l))});const us={},aw=a=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(a);function ow(a){return typeof a=="object"&&a!==null}const lw=a=>/^0[^.\s]+$/u.test(a);function cw(a){let i;return()=>(i===void 0&&(i=a()),i)}const vn=a=>a,LT=(a,i)=>l=>i(a(l)),Pa=(...a)=>a.reduce(LT),Ca=(a,i,l)=>{const u=i-a;return u===0?1:(l-a)/u};class qd{constructor(){this.subscriptions=[]}add(i){return zd(this.subscriptions,i),()=>cl(this.subscriptions,i)}notify(i,l,u){const h=this.subscriptions.length;if(h)if(h===1)this.subscriptions[0](i,l,u);else for(let m=0;m<h;m++){const f=this.subscriptions[m];f&&f(i,l,u)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Wt=a=>a*1e3,bn=a=>a/1e3;function uw(a,i){return i?a*(1e3/i):0}const h2=new Set;function Gd(a,i,l){a||h2.has(i)||(console.warn(gd(i,l)),h2.add(i))}const dw=(a,i,l)=>(((1-3*l+3*i)*a+(3*l-6*i))*a+3*i)*a,MT=1e-7,FT=12;function $T(a,i,l,u,h){let m,f,_=0;do f=i+(l-i)/2,m=dw(f,u,h)-a,m>0?l=f:i=f;while(Math.abs(m)>MT&&++_<FT);return f}function Da(a,i,l,u){if(a===i&&l===u)return vn;const h=m=>$T(m,0,1,a,l);return m=>m===0||m===1?m:dw(h(m),i,u)}const hw=a=>i=>i<=.5?a(2*i)/2:(2-a(2*(1-i)))/2,pw=a=>i=>1-a(1-i),fw=Da(.33,1.53,.69,.99),Kd=pw(fw),mw=hw(Kd),gw=a=>(a*=2)<1?.5*Kd(a):.5*(2-Math.pow(2,-10*(a-1))),Yd=a=>1-Math.sin(Math.acos(a)),yw=pw(Yd),_w=hw(Yd),UT=Da(.42,0,1,1),jT=Da(0,0,.58,1),bw=Da(.42,0,.58,1),VT=a=>Array.isArray(a)&&typeof a[0]!="number",vw=a=>Array.isArray(a)&&typeof a[0]=="number",p2={linear:vn,easeIn:UT,easeInOut:bw,easeOut:jT,circIn:Yd,circInOut:_w,circOut:yw,backIn:Kd,backInOut:mw,backOut:fw,anticipate:gw},HT=a=>typeof a=="string",f2=a=>{if(vw(a)){cs(a.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[i,l,u,h]=a;return Da(i,l,u,h)}else if(HT(a))return cs(p2[a]!==void 0,`Invalid easing type '${a}'`,"invalid-easing-type"),p2[a];return a},zo=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function WT(a,i){let l=new Set,u=new Set,h=!1,m=!1;const f=new WeakSet;let _={delta:0,timestamp:0,isProcessing:!1};function b(w){f.has(w)&&(v.schedule(w),a()),w(_)}const v={schedule:(w,E=!1,A=!1)=>{const P=A&&h?l:u;return E&&f.add(w),P.has(w)||P.add(w),w},cancel:w=>{u.delete(w),f.delete(w)},process:w=>{if(_=w,h){m=!0;return}h=!0,[l,u]=[u,l],l.forEach(b),l.clear(),h=!1,m&&(m=!1,v.process(w))}};return v}const zT=40;function ww(a,i){let l=!1,u=!0;const h={delta:0,timestamp:0,isProcessing:!1},m=()=>l=!0,f=zo.reduce((H,Z)=>(H[Z]=WT(m),H),{}),{setup:_,read:b,resolveKeyframes:v,preUpdate:w,update:E,preRender:A,render:R,postRender:P}=f,j=()=>{const H=us.useManualTiming?h.timestamp:performance.now();l=!1,us.useManualTiming||(h.delta=u?1e3/60:Math.max(Math.min(H-h.timestamp,zT),1)),h.timestamp=H,h.isProcessing=!0,_.process(h),b.process(h),v.process(h),w.process(h),E.process(h),A.process(h),R.process(h),P.process(h),h.isProcessing=!1,l&&i&&(u=!1,a(j))},M=()=>{l=!0,u=!0,h.isProcessing||a(j)};return{schedule:zo.reduce((H,Z)=>{const re=f[Z];return H[Z]=(ge,se=!1,ae=!1)=>(l||M(),re.schedule(ge,se,ae)),H},{}),cancel:H=>{for(let Z=0;Z<zo.length;Z++)f[zo[Z]].cancel(H)},state:h,steps:f}}const{schedule:qe,cancel:Ps,state:Ct,steps:Gu}=ww(typeof requestAnimationFrame<"u"?requestAnimationFrame:vn,!0);let el;function qT(){el=void 0}const Mt={now:()=>(el===void 0&&Mt.set(Ct.isProcessing||us.useManualTiming?Ct.timestamp:performance.now()),el),set:a=>{el=a,queueMicrotask(qT)}},Sw=a=>i=>typeof i=="string"&&i.startsWith(a),xw=Sw("--"),GT=Sw("var(--"),Zd=a=>GT(a)?KT.test(a.split("/*")[0].trim()):!1,KT=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function m2(a){return typeof a!="string"?!1:a.split("/*")[0].includes("var(--")}const hi={test:a=>typeof a=="number",parse:parseFloat,transform:a=>a},Aa={...hi,transform:a=>Yn(0,1,a)},qo={...hi,default:1},xa=a=>Math.round(a*1e5)/1e5,Xd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function YT(a){return a==null}const ZT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Jd=(a,i)=>l=>!!(typeof l=="string"&&ZT.test(l)&&l.startsWith(a)||i&&!YT(l)&&Object.prototype.hasOwnProperty.call(l,i)),Ew=(a,i,l)=>u=>{if(typeof u!="string")return u;const[h,m,f,_]=u.match(Xd);return{[a]:parseFloat(h),[i]:parseFloat(m),[l]:parseFloat(f),alpha:_!==void 0?parseFloat(_):1}},XT=a=>Yn(0,255,a),Ku={...hi,transform:a=>Math.round(XT(a))},cr={test:Jd("rgb","red"),parse:Ew("red","green","blue"),transform:({red:a,green:i,blue:l,alpha:u=1})=>"rgba("+Ku.transform(a)+", "+Ku.transform(i)+", "+Ku.transform(l)+", "+xa(Aa.transform(u))+")"};function JT(a){let i="",l="",u="",h="";return a.length>5?(i=a.substring(1,3),l=a.substring(3,5),u=a.substring(5,7),h=a.substring(7,9)):(i=a.substring(1,2),l=a.substring(2,3),u=a.substring(3,4),h=a.substring(4,5),i+=i,l+=l,u+=u,h+=h),{red:parseInt(i,16),green:parseInt(l,16),blue:parseInt(u,16),alpha:h?parseInt(h,16)/255:1}}const yd={test:Jd("#"),parse:JT,transform:cr.transform},Oa=a=>({test:i=>typeof i=="string"&&i.endsWith(a)&&i.split(" ").length===1,parse:parseFloat,transform:i=>`${i}${a}`}),Ts=Oa("deg"),Kn=Oa("%"),de=Oa("px"),QT=Oa("vh"),eI=Oa("vw"),g2={...Kn,parse:a=>Kn.parse(a)/100,transform:a=>Kn.transform(a*100)},ei={test:Jd("hsl","hue"),parse:Ew("hue","saturation","lightness"),transform:({hue:a,saturation:i,lightness:l,alpha:u=1})=>"hsla("+Math.round(a)+", "+Kn.transform(xa(i))+", "+Kn.transform(xa(l))+", "+xa(Aa.transform(u))+")"},ft={test:a=>cr.test(a)||yd.test(a)||ei.test(a),parse:a=>cr.test(a)?cr.parse(a):ei.test(a)?ei.parse(a):yd.parse(a),transform:a=>typeof a=="string"?a:a.hasOwnProperty("red")?cr.transform(a):ei.transform(a),getAnimatableNone:a=>{const i=ft.parse(a);return i.alpha=0,ft.transform(i)}},tI=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function nI(a){var i,l;return isNaN(a)&&typeof a=="string"&&(((i=a.match(Xd))==null?void 0:i.length)||0)+(((l=a.match(tI))==null?void 0:l.length)||0)>0}const kw="number",Cw="color",sI="var",rI="var(",y2="${}",iI=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ci(a){const i=a.toString(),l=[],u={color:[],number:[],var:[]},h=[];let m=0;const _=i.replace(iI,b=>(ft.test(b)?(u.color.push(m),h.push(Cw),l.push(ft.parse(b))):b.startsWith(rI)?(u.var.push(m),h.push(sI),l.push(b)):(u.number.push(m),h.push(kw),l.push(parseFloat(b))),++m,y2)).split(y2);return{values:l,split:_,indexes:u,types:h}}function aI(a){return ci(a).values}function Aw({split:a,types:i}){const l=a.length;return u=>{let h="";for(let m=0;m<l;m++)if(h+=a[m],u[m]!==void 0){const f=i[m];f===kw?h+=xa(u[m]):f===Cw?h+=ft.transform(u[m]):h+=u[m]}return h}}function oI(a){return Aw(ci(a))}const lI=a=>typeof a=="number"?0:ft.test(a)?ft.getAnimatableNone(a):a,cI=(a,i)=>typeof a=="number"?i!=null&&i.trim().endsWith("/")?a:0:lI(a);function uI(a){const i=ci(a);return Aw(i)(i.values.map((u,h)=>cI(u,i.split[h])))}const Rn={test:nI,parse:aI,createTransformer:oI,getAnimatableNone:uI};function Yu(a,i,l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?a+(i-a)*6*l:l<1/2?i:l<2/3?a+(i-a)*(2/3-l)*6:a}function dI({hue:a,saturation:i,lightness:l,alpha:u}){a/=360,i/=100,l/=100;let h=0,m=0,f=0;if(!i)h=m=f=l;else{const _=l<.5?l*(1+i):l+i-l*i,b=2*l-_;h=Yu(b,_,a+1/3),m=Yu(b,_,a),f=Yu(b,_,a-1/3)}return{red:Math.round(h*255),green:Math.round(m*255),blue:Math.round(f*255),alpha:u}}function ul(a,i){return l=>l>0?i:a}const rt=(a,i,l)=>a+(i-a)*l,Zu=(a,i,l)=>{const u=a*a,h=l*(i*i-u)+u;return h<0?0:Math.sqrt(h)},hI=[yd,cr,ei],pI=a=>hI.find(i=>i.test(a));function _2(a){const i=pI(a);if(di(!!i,`'${a}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!i)return!1;let l=i.parse(a);return i===ei&&(l=dI(l)),l}const b2=(a,i)=>{const l=_2(a),u=_2(i);if(!l||!u)return ul(a,i);const h={...l};return m=>(h.red=Zu(l.red,u.red,m),h.green=Zu(l.green,u.green,m),h.blue=Zu(l.blue,u.blue,m),h.alpha=rt(l.alpha,u.alpha,m),cr.transform(h))},_d=new Set(["none","hidden"]);function fI(a,i){return _d.has(a)?l=>l<=0?a:i:l=>l>=1?i:a}function mI(a,i){return l=>rt(a,i,l)}function Qd(a){return typeof a=="number"?mI:typeof a=="string"?Zd(a)?ul:ft.test(a)?b2:_I:Array.isArray(a)?Tw:typeof a=="object"?ft.test(a)?b2:gI:ul}function Tw(a,i){const l=[...a],u=l.length,h=a.map((m,f)=>Qd(m)(m,i[f]));return m=>{for(let f=0;f<u;f++)l[f]=h[f](m);return l}}function gI(a,i){const l={...a,...i},u={};for(const h in l)a[h]!==void 0&&i[h]!==void 0&&(u[h]=Qd(a[h])(a[h],i[h]));return h=>{for(const m in u)l[m]=u[m](h);return l}}function yI(a,i){const l=[],u={color:0,var:0,number:0};for(let h=0;h<i.values.length;h++){const m=i.types[h],f=a.indexes[m][u[m]],_=a.values[f]??0;l[h]=_,u[m]++}return l}const _I=(a,i)=>{const l=Rn.createTransformer(i),u=ci(a),h=ci(i);return u.indexes.var.length===h.indexes.var.length&&u.indexes.color.length===h.indexes.color.length&&u.indexes.number.length>=h.indexes.number.length?_d.has(a)&&!h.values.length||_d.has(i)&&!u.values.length?fI(a,i):Pa(Tw(yI(u,h),h.values),l):(di(!0,`Complex values '${a}' and '${i}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),ul(a,i))};function Iw(a,i,l){return typeof a=="number"&&typeof i=="number"&&typeof l=="number"?rt(a,i,l):Qd(a)(a,i)}const bI=a=>{const i=({timestamp:l})=>a(l);return{start:(l=!0)=>qe.update(i,l),stop:()=>Ps(i),now:()=>Ct.isProcessing?Ct.timestamp:Mt.now()}},Rw=(a,i,l=10)=>{let u="";const h=Math.max(Math.round(i/l),2);for(let m=0;m<h;m++)u+=Math.round(a(m/(h-1))*1e4)/1e4+", ";return`linear(${u.substring(0,u.length-2)})`},dl=2e4;function eh(a){let i=0;const l=50;let u=a.next(i);for(;!u.done&&i<dl;)i+=l,u=a.next(i);return i>=dl?1/0:i}function vI(a,i=100,l){const u=l({...a,keyframes:[0,i]}),h=Math.min(eh(u),dl);return{type:"keyframes",ease:m=>u.next(h*m).value/i,duration:bn(h)}}const st={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function bd(a,i){return a*Math.sqrt(1-i*i)}const wI=12;function SI(a,i,l){let u=l;for(let h=1;h<wI;h++)u=u-a(u)/i(u);return u}const Xu=.001;function xI({duration:a=st.duration,bounce:i=st.bounce,velocity:l=st.velocity,mass:u=st.mass}){let h,m;di(a<=Wt(st.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let f=1-i;f=Yn(st.minDamping,st.maxDamping,f),a=Yn(st.minDuration,st.maxDuration,bn(a)),f<1?(h=v=>{const w=v*f,E=w*a,A=w-l,R=bd(v,f),P=Math.exp(-E);return Xu-A/R*P},m=v=>{const E=v*f*a,A=E*l+l,R=Math.pow(f,2)*Math.pow(v,2)*a,P=Math.exp(-E),j=bd(Math.pow(v,2),f);return(-h(v)+Xu>0?-1:1)*((A-R)*P)/j}):(h=v=>{const w=Math.exp(-v*a),E=(v-l)*a+1;return-Xu+w*E},m=v=>{const w=Math.exp(-v*a),E=(l-v)*(a*a);return w*E});const _=5/a,b=SI(h,m,_);if(a=Wt(a),isNaN(b))return{stiffness:st.stiffness,damping:st.damping,duration:a};{const v=Math.pow(b,2)*u;return{stiffness:v,damping:f*2*Math.sqrt(u*v),duration:a}}}const EI=["duration","bounce"],kI=["stiffness","damping","mass"];function v2(a,i){return i.some(l=>a[l]!==void 0)}function CI(a){let i={velocity:st.velocity,stiffness:st.stiffness,damping:st.damping,mass:st.mass,isResolvedFromDuration:!1,...a};if(!v2(a,kI)&&v2(a,EI))if(i.velocity=0,a.visualDuration){const l=a.visualDuration,u=2*Math.PI/(l*1.2),h=u*u,m=2*Yn(.05,1,1-(a.bounce||0))*Math.sqrt(h);i={...i,mass:st.mass,stiffness:h,damping:m}}else{const l=xI({...a,velocity:0});i={...i,...l,mass:st.mass},i.isResolvedFromDuration=!0}return i}function hl(a=st.visualDuration,i=st.bounce){const l=typeof a!="object"?{visualDuration:a,keyframes:[0,1],bounce:i}:a;let{restSpeed:u,restDelta:h}=l;const m=l.keyframes[0],f=l.keyframes[l.keyframes.length-1],_={done:!1,value:m},{stiffness:b,damping:v,mass:w,duration:E,velocity:A,isResolvedFromDuration:R}=CI({...l,velocity:-bn(l.velocity||0)}),P=A||0,j=v/(2*Math.sqrt(b*w)),M=f-m,B=bn(Math.sqrt(b/w)),Y=Math.abs(M)<5;u||(u=Y?st.restSpeed.granular:st.restSpeed.default),h||(h=Y?st.restDelta.granular:st.restDelta.default);let H,Z,re,ge,se,ae;if(j<1)re=bd(B,j),ge=(P+j*B*M)/re,H=oe=>{const Fe=Math.exp(-j*B*oe);return f-Fe*(ge*Math.sin(re*oe)+M*Math.cos(re*oe))},se=j*B*ge+M*re,ae=j*B*M-ge*re,Z=oe=>Math.exp(-j*B*oe)*(se*Math.sin(re*oe)+ae*Math.cos(re*oe));else if(j===1){H=Fe=>f-Math.exp(-B*Fe)*(M+(P+B*M)*Fe);const oe=P+B*M;Z=Fe=>Math.exp(-B*Fe)*(B*oe*Fe-P)}else{const oe=B*Math.sqrt(j*j-1);H=Be=>{const ke=Math.exp(-j*B*Be),Ae=Math.min(oe*Be,300);return f-ke*((P+j*B*M)*Math.sinh(Ae)+oe*M*Math.cosh(Ae))/oe};const Fe=(P+j*B*M)/oe,ie=j*B*Fe-M*oe,Ee=j*B*M-Fe*oe;Z=Be=>{const ke=Math.exp(-j*B*Be),Ae=Math.min(oe*Be,300);return ke*(ie*Math.sinh(Ae)+Ee*Math.cosh(Ae))}}const xe={calculatedDuration:R&&E||null,velocity:oe=>Wt(Z(oe)),next:oe=>{if(!R&&j<1){const ie=Math.exp(-j*B*oe),Ee=Math.sin(re*oe),Be=Math.cos(re*oe),ke=f-ie*(ge*Ee+M*Be),Ae=Wt(ie*(se*Ee+ae*Be));return _.done=Math.abs(Ae)<=u&&Math.abs(f-ke)<=h,_.value=_.done?f:ke,_}const Fe=H(oe);if(R)_.done=oe>=E;else{const ie=Wt(Z(oe));_.done=Math.abs(ie)<=u&&Math.abs(f-Fe)<=h}return _.value=_.done?f:Fe,_},toString:()=>{const oe=Math.min(eh(xe),dl),Fe=Rw(ie=>xe.next(oe*ie).value,oe,30);return oe+"ms "+Fe},toTransition:()=>{}};return xe}hl.applyToOptions=a=>{const i=vI(a,100,hl);return a.ease=i.ease,a.duration=Wt(i.duration),a.type="keyframes",a};const AI=5;function Pw(a,i,l){const u=Math.max(i-AI,0);return uw(l-a(u),i-u)}function vd({keyframes:a,velocity:i=0,power:l=.8,timeConstant:u=325,bounceDamping:h=10,bounceStiffness:m=500,modifyTarget:f,min:_,max:b,restDelta:v=.5,restSpeed:w}){const E=a[0],A={done:!1,value:E},R=ae=>_!==void 0&&ae<_||b!==void 0&&ae>b,P=ae=>_===void 0?b:b===void 0||Math.abs(_-ae)<Math.abs(b-ae)?_:b;let j=l*i;const M=E+j,B=f===void 0?M:f(M);B!==M&&(j=B-E);const Y=ae=>-j*Math.exp(-ae/u),H=ae=>B+Y(ae),Z=ae=>{const xe=Y(ae),oe=H(ae);A.done=Math.abs(xe)<=v,A.value=A.done?B:oe};let re,ge;const se=ae=>{R(A.value)&&(re=ae,ge=hl({keyframes:[A.value,P(A.value)],velocity:Pw(H,ae,A.value),damping:h,stiffness:m,restDelta:v,restSpeed:w}))};return se(0),{calculatedDuration:null,next:ae=>{let xe=!1;return!ge&&re===void 0&&(xe=!0,Z(ae),se(ae)),re!==void 0&&ae>=re?ge.next(ae-re):(!xe&&Z(ae),A)}}}function TI(a,i,l){const u=[],h=l||us.mix||Iw,m=a.length-1;for(let f=0;f<m;f++){let _=h(a[f],a[f+1]);if(i){const b=Array.isArray(i)?i[f]||vn:i;_=Pa(b,_)}u.push(_)}return u}function II(a,i,{clamp:l=!0,ease:u,mixer:h}={}){const m=a.length;if(cs(m===i.length,"Both input and output ranges must be the same length","range-length"),m===1)return()=>i[0];if(m===2&&i[0]===i[1])return()=>i[1];const f=a[0]===a[1];a[0]>a[m-1]&&(a=[...a].reverse(),i=[...i].reverse());const _=TI(i,u,h),b=_.length,v=w=>{if(f&&w<a[0])return i[0];let E=0;if(b>1)for(;E<a.length-2&&!(w<a[E+1]);E++);const A=Ca(a[E],a[E+1],w);return _[E](A)};return l?w=>v(Yn(a[0],a[m-1],w)):v}function RI(a,i){const l=a[a.length-1];for(let u=1;u<=i;u++){const h=Ca(0,i,u);a.push(rt(l,1,h))}}function PI(a){const i=[0];return RI(i,a.length-1),i}function DI(a,i){return a.map(l=>l*i)}function OI(a,i){return a.map(()=>i||bw).splice(0,a.length-1)}function ti({duration:a=300,keyframes:i,times:l,ease:u="easeInOut"}){const h=VT(u)?u.map(f2):f2(u),m={done:!1,value:i[0]},f=DI(l&&l.length===i.length?l:PI(i),a),_=II(f,i,{ease:Array.isArray(h)?h:OI(i,h)});return{calculatedDuration:a,next:b=>(m.value=_(b),m.done=b>=a,m)}}const NI=a=>a!==null;function th(a,{repeat:i,repeatType:l="loop"},u,h=1){const m=a.filter(NI),_=h<0||i&&l!=="loop"&&i%2===1?0:m.length-1;return!_||u===void 0?m[_]:u}const BI={decay:vd,inertia:vd,tween:ti,keyframes:ti,spring:hl};function Dw(a){typeof a.type=="string"&&(a.type=BI[a.type])}class nh{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(i=>{this.resolve=i})}notifyFinished(){this.resolve()}then(i,l){return this.finished.then(i,l)}}const LI=a=>a/100;class sh extends nh{constructor(i){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var u,h;const{motionValue:l}=this.options;l&&l.updatedAt!==Mt.now()&&this.tick(Mt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(h=(u=this.options).onStop)==null||h.call(u))},this.options=i,this.initAnimation(),this.play(),i.autoplay===!1&&this.pause()}initAnimation(){const{options:i}=this;Dw(i);const{type:l=ti,repeat:u=0,repeatDelay:h=0,repeatType:m,velocity:f=0}=i;let{keyframes:_}=i;const b=l||ti;process.env.NODE_ENV!=="production"&&b!==ti&&cs(_.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${_}`,"spring-two-frames"),b!==ti&&typeof _[0]!="number"&&(this.mixKeyframes=Pa(LI,Iw(_[0],_[1])),_=[0,100]);const v=b({...i,keyframes:_});m==="mirror"&&(this.mirroredGenerator=b({...i,keyframes:[..._].reverse(),velocity:-f})),v.calculatedDuration===null&&(v.calculatedDuration=eh(v));const{calculatedDuration:w}=v;this.calculatedDuration=w,this.resolvedDuration=w+h,this.totalDuration=this.resolvedDuration*(u+1)-h,this.generator=v}updateTime(i){const l=Math.round(i-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=l}tick(i,l=!1){const{generator:u,totalDuration:h,mixKeyframes:m,mirroredGenerator:f,resolvedDuration:_,calculatedDuration:b}=this;if(this.startTime===null)return u.next(0);const{delay:v=0,keyframes:w,repeat:E,repeatType:A,repeatDelay:R,type:P,onUpdate:j,finalKeyframe:M}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,i):this.speed<0&&(this.startTime=Math.min(i-h/this.speed,this.startTime)),l?this.currentTime=i:this.updateTime(i);const B=this.currentTime-v*(this.playbackSpeed>=0?1:-1),Y=this.playbackSpeed>=0?B<0:B>h;this.currentTime=Math.max(B,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=h);let H=this.currentTime,Z=u;if(E){const ae=Math.min(this.currentTime,h)/_;let xe=Math.floor(ae),oe=ae%1;!oe&&ae>=1&&(oe=1),oe===1&&xe--,xe=Math.min(xe,E+1),!!(xe%2)&&(A==="reverse"?(oe=1-oe,R&&(oe-=R/_)):A==="mirror"&&(Z=f)),H=Yn(0,1,oe)*_}const re=Y?{done:!1,value:w[0]}:Z.next(H);m&&!Y&&(re.value=m(re.value));let{done:ge}=re;!Y&&b!==null&&(ge=this.playbackSpeed>=0?this.currentTime>=h:this.currentTime<=0);const se=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&ge);return se&&P!==vd&&(re.value=th(w,this.options,M,this.speed)),j&&j(re.value),se&&this.finish(),re}then(i,l){return this.finished.then(i,l)}get duration(){return bn(this.calculatedDuration)}get iterationDuration(){const{delay:i=0}=this.options||{};return this.duration+bn(i)}get time(){return bn(this.currentTime)}set time(i){i=Wt(i),this.currentTime=i,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=i:this.driver&&(this.startTime=this.driver.now()-i/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=i,this.tick(i))}getGeneratorVelocity(){const i=this.currentTime;if(i<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(i);const l=this.generator.next(i).value;return Pw(u=>this.generator.next(u).value,i,l)}get speed(){return this.playbackSpeed}set speed(i){const l=this.playbackSpeed!==i;l&&this.driver&&this.updateTime(Mt.now()),this.playbackSpeed=i,l&&this.driver&&(this.time=bn(this.currentTime))}play(){var h,m;if(this.isStopped)return;const{driver:i=bI,startTime:l}=this.options;this.driver||(this.driver=i(f=>this.tick(f))),(m=(h=this.options).onPlay)==null||m.call(h);const u=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=u):this.holdTime!==null?this.startTime=u-this.holdTime:this.startTime||(this.startTime=l??u),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Mt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var i,l;this.notifyFinished(),this.teardown(),this.state="finished",(l=(i=this.options).onComplete)==null||l.call(i)}cancel(){var i,l;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(l=(i=this.options).onCancel)==null||l.call(i)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(i){return this.startTime=0,this.tick(i,!0)}attachTimeline(i){var l;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(l=this.driver)==null||l.stop(),i.observe(this)}}function MI(a){for(let i=1;i<a.length;i++)a[i]??(a[i]=a[i-1])}const ur=a=>a*180/Math.PI,wd=a=>{const i=ur(Math.atan2(a[1],a[0]));return Sd(i)},FI={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:a=>(Math.abs(a[0])+Math.abs(a[3]))/2,rotate:wd,rotateZ:wd,skewX:a=>ur(Math.atan(a[1])),skewY:a=>ur(Math.atan(a[2])),skew:a=>(Math.abs(a[1])+Math.abs(a[2]))/2},Sd=a=>(a=a%360,a<0&&(a+=360),a),w2=wd,S2=a=>Math.sqrt(a[0]*a[0]+a[1]*a[1]),x2=a=>Math.sqrt(a[4]*a[4]+a[5]*a[5]),$I={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:S2,scaleY:x2,scale:a=>(S2(a)+x2(a))/2,rotateX:a=>Sd(ur(Math.atan2(a[6],a[5]))),rotateY:a=>Sd(ur(Math.atan2(-a[2],a[0]))),rotateZ:w2,rotate:w2,skewX:a=>ur(Math.atan(a[4])),skewY:a=>ur(Math.atan(a[1])),skew:a=>(Math.abs(a[1])+Math.abs(a[4]))/2};function xd(a){return a.includes("scale")?1:0}function Ed(a,i){if(!a||a==="none")return xd(i);const l=a.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let u,h;if(l)u=$I,h=l;else{const _=a.match(/^matrix\(([-\d.e\s,]+)\)$/u);u=FI,h=_}if(!h)return xd(i);const m=u[i],f=h[1].split(",").map(jI);return typeof m=="function"?m(f):f[m]}const UI=(a,i)=>{const{transform:l="none"}=getComputedStyle(a);return Ed(l,i)};function jI(a){return parseFloat(a.trim())}const pi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],fi=new Set(pi),E2=a=>a===hi||a===de,VI=new Set(["x","y","z"]),HI=pi.filter(a=>!VI.has(a));function WI(a){const i=[];return HI.forEach(l=>{const u=a.getValue(l);u!==void 0&&(i.push([l,u.get()]),u.set(l.startsWith("scale")?1:0))}),i}const Rs={width:({x:a},{paddingLeft:i="0",paddingRight:l="0"})=>a.max-a.min-parseFloat(i)-parseFloat(l),height:({y:a},{paddingTop:i="0",paddingBottom:l="0"})=>a.max-a.min-parseFloat(i)-parseFloat(l),top:(a,{top:i})=>parseFloat(i),left:(a,{left:i})=>parseFloat(i),bottom:({y:a},{top:i})=>parseFloat(i)+(a.max-a.min),right:({x:a},{left:i})=>parseFloat(i)+(a.max-a.min),x:(a,{transform:i})=>Ed(i,"x"),y:(a,{transform:i})=>Ed(i,"y")};Rs.translateX=Rs.x;Rs.translateY=Rs.y;const dr=new Set;let kd=!1,Cd=!1,Ad=!1;function Ow(){if(Cd){const a=Array.from(dr).filter(u=>u.needsMeasurement),i=new Set(a.map(u=>u.element)),l=new Map;i.forEach(u=>{const h=WI(u);h.length&&(l.set(u,h),u.render())}),a.forEach(u=>u.measureInitialState()),i.forEach(u=>{u.render();const h=l.get(u);h&&h.forEach(([m,f])=>{var _;(_=u.getValue(m))==null||_.set(f)})}),a.forEach(u=>u.measureEndState()),a.forEach(u=>{u.suspendedScrollY!==void 0&&window.scrollTo(0,u.suspendedScrollY)})}Cd=!1,kd=!1,dr.forEach(a=>a.complete(Ad)),dr.clear()}function Nw(){dr.forEach(a=>{a.readKeyframes(),a.needsMeasurement&&(Cd=!0)})}function zI(){Ad=!0,Nw(),Ow(),Ad=!1}class rh{constructor(i,l,u,h,m,f=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...i],this.onComplete=l,this.name=u,this.motionValue=h,this.element=m,this.isAsync=f}scheduleResolve(){this.state="scheduled",this.isAsync?(dr.add(this),kd||(kd=!0,qe.read(Nw),qe.resolveKeyframes(Ow))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:i,name:l,element:u,motionValue:h}=this;if(i[0]===null){const m=h==null?void 0:h.get(),f=i[i.length-1];if(m!==void 0)i[0]=m;else if(u&&l){const _=u.readValue(l,f);_!=null&&(i[0]=_)}i[0]===void 0&&(i[0]=f),h&&m===void 0&&h.set(i[0])}MI(i)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(i=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,i),dr.delete(this)}cancel(){this.state==="scheduled"&&(dr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qI=a=>a.startsWith("--");function Bw(a,i,l){qI(i)?a.style.setProperty(i,l):a.style[i]=l}const GI={};function Lw(a,i){const l=cw(a);return()=>GI[i]??l()}const KI=Lw(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Mw=Lw(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Sa=([a,i,l,u])=>`cubic-bezier(${a}, ${i}, ${l}, ${u})`,k2={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Sa([0,.65,.55,1]),circOut:Sa([.55,0,1,.45]),backIn:Sa([.31,.01,.66,-.59]),backOut:Sa([.33,1.53,.69,.99])};function Fw(a,i){if(a)return typeof a=="function"?Mw()?Rw(a,i):"ease-out":vw(a)?Sa(a):Array.isArray(a)?a.map(l=>Fw(l,i)||k2.easeOut):k2[a]}function YI(a,i,l,{delay:u=0,duration:h=300,repeat:m=0,repeatType:f="loop",ease:_="easeOut",times:b}={},v=void 0){const w={[i]:l};b&&(w.offset=b);const E=Fw(_,h);Array.isArray(E)&&(w.easing=E);const A={delay:u,duration:h,easing:Array.isArray(E)?"linear":E,fill:"both",iterations:m+1,direction:f==="reverse"?"alternate":"normal"};return v&&(A.pseudoElement=v),a.animate(w,A)}function $w(a){return typeof a=="function"&&"applyToOptions"in a}function ZI({type:a,...i}){return $w(a)&&Mw()?a.applyToOptions(i):(i.duration??(i.duration=300),i.ease??(i.ease="easeOut"),i)}class Uw extends nh{constructor(i){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!i)return;const{element:l,name:u,keyframes:h,pseudoElement:m,allowFlatten:f=!1,finalKeyframe:_,onComplete:b}=i;this.isPseudoElement=!!m,this.allowFlatten=f,this.options=i,cs(typeof i.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const v=ZI(i);this.animation=YI(l,u,h,v,m),v.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!m){const w=th(h,this.options,_,this.speed);this.updateMotionValue&&this.updateMotionValue(w),Bw(l,u,w),this.animation.cancel()}b==null||b(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var i,l;(l=(i=this.animation).finish)==null||l.call(i)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:i}=this;i==="idle"||i==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var l,u,h;const i=(l=this.options)==null?void 0:l.element;!this.isPseudoElement&&(i!=null&&i.isConnected)&&((h=(u=this.animation).commitStyles)==null||h.call(u))}get duration(){var l,u;const i=((u=(l=this.animation.effect)==null?void 0:l.getComputedTiming)==null?void 0:u.call(l).duration)||0;return bn(Number(i))}get iterationDuration(){const{delay:i=0}=this.options||{};return this.duration+bn(i)}get time(){return bn(Number(this.animation.currentTime)||0)}set time(i){const l=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Wt(i),l&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(i){i<0&&(this.finishedTime=null),this.animation.playbackRate=i}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(i){this.manualStartTime=this.animation.startTime=i}attachTimeline({timeline:i,rangeStart:l,rangeEnd:u,observe:h}){var m;return this.allowFlatten&&((m=this.animation.effect)==null||m.updateTiming({easing:"linear"})),this.animation.onfinish=null,i&&KI()?(this.animation.timeline=i,l&&(this.animation.rangeStart=l),u&&(this.animation.rangeEnd=u),vn):h(this)}}const jw={anticipate:gw,backInOut:mw,circInOut:_w};function XI(a){return a in jw}function JI(a){typeof a.ease=="string"&&XI(a.ease)&&(a.ease=jw[a.ease])}const Ju=10;class QI extends Uw{constructor(i){JI(i),Dw(i),super(i),i.startTime!==void 0&&i.autoplay!==!1&&(this.startTime=i.startTime),this.options=i}updateMotionValue(i){const{motionValue:l,onUpdate:u,onComplete:h,element:m,...f}=this.options;if(!l)return;if(i!==void 0){l.set(i);return}const _=new sh({...f,autoplay:!1}),b=Math.max(Ju,Mt.now()-this.startTime),v=Yn(0,Ju,b-Ju),w=_.sample(b).value,{name:E}=this.options;m&&E&&Bw(m,E,w),l.setWithVelocity(_.sample(Math.max(0,b-v)).value,w,v),_.stop()}}const C2=(a,i)=>i==="zIndex"?!1:!!(typeof a=="number"||Array.isArray(a)||typeof a=="string"&&(Rn.test(a)||a==="0")&&!a.startsWith("url("));function eR(a){const i=a[0];if(a.length===1)return!0;for(let l=0;l<a.length;l++)if(a[l]!==i)return!0}function tR(a,i,l,u){const h=a[0];if(h===null)return!1;if(i==="display"||i==="visibility")return!0;const m=a[a.length-1],f=C2(h,i),_=C2(m,i);return di(f===_,`You are trying to animate ${i} from "${h}" to "${m}". "${f?m:h}" is not an animatable value.`,"value-not-animatable"),!f||!_?!1:eR(a)||(l==="spring"||$w(l))&&u}function Td(a){a.duration=0,a.type="keyframes"}const nR=new Set(["opacity","clipPath","filter","transform"]),sR=cw(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function rR(a){var w;const{motionValue:i,name:l,repeatDelay:u,repeatType:h,damping:m,type:f}=a;if(!(((w=i==null?void 0:i.owner)==null?void 0:w.current)instanceof HTMLElement))return!1;const{onUpdate:b,transformTemplate:v}=i.owner.getProps();return sR()&&l&&nR.has(l)&&(l!=="transform"||!v)&&!b&&!u&&h!=="mirror"&&m!==0&&f!=="inertia"}const iR=40;class aR extends nh{constructor({autoplay:i=!0,delay:l=0,type:u="keyframes",repeat:h=0,repeatDelay:m=0,repeatType:f="loop",keyframes:_,name:b,motionValue:v,element:w,...E}){var P;super(),this.stop=()=>{var j,M;this._animation&&(this._animation.stop(),(j=this.stopTimeline)==null||j.call(this)),(M=this.keyframeResolver)==null||M.cancel()},this.createdAt=Mt.now();const A={autoplay:i,delay:l,type:u,repeat:h,repeatDelay:m,repeatType:f,name:b,motionValue:v,element:w,...E},R=(w==null?void 0:w.KeyframeResolver)||rh;this.keyframeResolver=new R(_,(j,M,B)=>this.onKeyframesResolved(j,M,A,!B),b,v,w),(P=this.keyframeResolver)==null||P.scheduleResolve()}onKeyframesResolved(i,l,u,h){var M,B;this.keyframeResolver=void 0;const{name:m,type:f,velocity:_,delay:b,isHandoff:v,onUpdate:w}=u;this.resolvedAt=Mt.now(),tR(i,m,f,_)||((us.instantAnimations||!b)&&(w==null||w(th(i,u,l))),i[0]=i[i.length-1],Td(u),u.repeat=0);const A={startTime:h?this.resolvedAt?this.resolvedAt-this.createdAt>iR?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:l,...u,keyframes:i},R=!v&&rR(A),P=(B=(M=A.motionValue)==null?void 0:M.owner)==null?void 0:B.current,j=R?new QI({...A,element:P}):new sh(A);j.finished.then(()=>{this.notifyFinished()}).catch(vn),this.pendingTimeline&&(this.stopTimeline=j.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=j}get finished(){return this._animation?this.animation.finished:this._finished}then(i,l){return this.finished.finally(i).then(()=>{})}get animation(){var i;return this._animation||((i=this.keyframeResolver)==null||i.resume(),zI()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(i){this.animation.time=i}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(i){this.animation.speed=i}get startTime(){return this.animation.startTime}attachTimeline(i){return this._animation?this.stopTimeline=this.animation.attachTimeline(i):this.pendingTimeline=i,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var i;this._animation&&this.animation.cancel(),(i=this.keyframeResolver)==null||i.cancel()}}function Vw(a,i,l,u=0,h=1){const m=Array.from(a).sort((v,w)=>v.sortNodePosition(w)).indexOf(i),f=a.size,_=(f-1)*u;return typeof l=="function"?l(m,f):h===1?m*u:_-m*u}const oR=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function lR(a){const i=oR.exec(a);if(!i)return[,];const[,l,u,h]=i;return[`--${l??u}`,h]}const cR=4;function Hw(a,i,l=1){cs(l<=cR,`Max CSS variable fallback depth detected in property "${a}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[u,h]=lR(a);if(!u)return;const m=window.getComputedStyle(i).getPropertyValue(u);if(m){const f=m.trim();return aw(f)?parseFloat(f):f}return Zd(h)?Hw(h,i,l+1):h}const uR={type:"spring",stiffness:500,damping:25,restSpeed:10},dR=a=>({type:"spring",stiffness:550,damping:a===0?2*Math.sqrt(550):30,restSpeed:10}),hR={type:"keyframes",duration:.8},pR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},fR=(a,{keyframes:i})=>i.length>2?hR:fi.has(a)?a.startsWith("scale")?dR(i[1]):uR:pR,mR=a=>a!==null;function gR(a,{repeat:i,repeatType:l="loop"},u){const h=a.filter(mR),m=i&&l!=="loop"&&i%2===1?0:h.length-1;return h[m]}function Ww(a,i){if(a!=null&&a.inherit&&i){const{inherit:l,...u}=a;return{...i,...u}}return a}function ih(a,i){const l=(a==null?void 0:a[i])??(a==null?void 0:a.default)??a;return l!==a?Ww(l,a):l}function yR({when:a,delay:i,delayChildren:l,staggerChildren:u,staggerDirection:h,repeat:m,repeatType:f,repeatDelay:_,from:b,elapsed:v,...w}){return!!Object.keys(w).length}const ah=(a,i,l,u={},h,m)=>f=>{const _=ih(u,a)||{},b=_.delay||u.delay||0;let{elapsed:v=0}=u;v=v-Wt(b);const w={keyframes:Array.isArray(l)?l:[null,l],ease:"easeOut",velocity:i.getVelocity(),..._,delay:-v,onUpdate:A=>{i.set(A),_.onUpdate&&_.onUpdate(A)},onComplete:()=>{f(),_.onComplete&&_.onComplete()},name:a,motionValue:i,element:m?void 0:h};yR(_)||Object.assign(w,fR(a,w)),w.duration&&(w.duration=Wt(w.duration)),w.repeatDelay&&(w.repeatDelay=Wt(w.repeatDelay)),w.from!==void 0&&(w.keyframes[0]=w.from);let E=!1;if((w.type===!1||w.duration===0&&!w.repeatDelay)&&(Td(w),w.delay===0&&(E=!0)),(us.instantAnimations||us.skipAnimations||h!=null&&h.shouldSkipAnimations)&&(E=!0,Td(w),w.delay=0),w.allowFlatten=!_.type&&!_.ease,E&&!m&&i.get()!==void 0){const A=gR(w.keyframes,_);if(A!==void 0){qe.update(()=>{w.onUpdate(A),w.onComplete()});return}}return _.isSync?new sh(w):new aR(w)};function A2(a){const i=[{},{}];return a==null||a.values.forEach((l,u)=>{i[0][u]=l.get(),i[1][u]=l.getVelocity()}),i}function oh(a,i,l,u){if(typeof i=="function"){const[h,m]=A2(u);i=i(l!==void 0?l:a.custom,h,m)}if(typeof i=="string"&&(i=a.variants&&a.variants[i]),typeof i=="function"){const[h,m]=A2(u);i=i(l!==void 0?l:a.custom,h,m)}return i}function li(a,i,l){const u=a.getProps();return oh(u,i,l!==void 0?l:u.custom,a)}const zw=new Set(["width","height","top","left","right","bottom",...pi]),T2=30,_R=a=>!isNaN(parseFloat(a));class bR{constructor(i,l={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=u=>{var m;const h=Mt.now();if(this.updatedAt!==h&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(u),this.current!==this.prev&&((m=this.events.change)==null||m.notify(this.current),this.dependents))for(const f of this.dependents)f.dirty()},this.hasAnimated=!1,this.setCurrent(i),this.owner=l.owner}setCurrent(i){this.current=i,this.updatedAt=Mt.now(),this.canTrackVelocity===null&&i!==void 0&&(this.canTrackVelocity=_R(this.current))}setPrevFrameValue(i=this.current){this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt}onChange(i){return process.env.NODE_ENV!=="production"&&Gd(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",i)}on(i,l){this.events[i]||(this.events[i]=new qd);const u=this.events[i].add(l);return i==="change"?()=>{u(),qe.read(()=>{this.events.change.getSize()||this.stop()})}:u}clearListeners(){for(const i in this.events)this.events[i].clear()}attach(i,l){this.passiveEffect=i,this.stopPassiveEffect=l}set(i){this.passiveEffect?this.passiveEffect(i,this.updateAndNotify):this.updateAndNotify(i)}setWithVelocity(i,l,u){this.set(l),this.prev=void 0,this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt-u}jump(i,l=!0){this.updateAndNotify(i),this.prev=i,this.prevUpdatedAt=this.prevFrameValue=void 0,l&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var i;(i=this.events.change)==null||i.notify(this.current)}addDependent(i){this.dependents||(this.dependents=new Set),this.dependents.add(i)}removeDependent(i){this.dependents&&this.dependents.delete(i)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const i=Mt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||i-this.updatedAt>T2)return 0;const l=Math.min(this.updatedAt-this.prevUpdatedAt,T2);return uw(parseFloat(this.current)-parseFloat(this.prevFrameValue),l)}start(i){return this.stop(),new Promise(l=>{this.hasAnimated=!0,this.animation=i(l),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var i,l;(i=this.dependents)==null||i.clear(),(l=this.events.destroy)==null||l.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ui(a,i){return new bR(a,i)}const Id=a=>Array.isArray(a);function vR(a,i,l){a.hasValue(i)?a.getValue(i).set(l):a.addValue(i,ui(l))}function wR(a){return Id(a)?a[a.length-1]||0:a}function SR(a,i){const l=li(a,i);let{transitionEnd:u={},transition:h={},...m}=l||{};m={...m,...u};for(const f in m){const _=wR(m[f]);vR(a,f,_)}}const Pt=a=>!!(a&&a.getVelocity);function xR(a){return!!(Pt(a)&&a.add)}function Rd(a,i){const l=a.getValue("willChange");if(xR(l))return l.add(i);if(!l&&us.WillChange){const u=new us.WillChange("auto");a.addValue("willChange",u),u.add(i)}}function lh(a){return a.replace(/([A-Z])/g,i=>`-${i.toLowerCase()}`)}const ER="framerAppearId",qw="data-"+lh(ER);function Gw(a){return a.props[qw]}function kR({protectedKeys:a,needsAnimating:i},l){const u=a.hasOwnProperty(l)&&i[l]!==!0;return i[l]=!1,u}function Kw(a,i,{delay:l=0,transitionOverride:u,type:h}={}){let{transition:m,transitionEnd:f,..._}=i;const b=a.getDefaultTransition();m=m?Ww(m,b):b;const v=m==null?void 0:m.reduceMotion;u&&(m=u);const w=[],E=h&&a.animationState&&a.animationState.getState()[h];for(const A in _){const R=a.getValue(A,a.latestValues[A]??null),P=_[A];if(P===void 0||E&&kR(E,A))continue;const j={delay:l,...ih(m||{},A)},M=R.get();if(M!==void 0&&!R.isAnimating&&!Array.isArray(P)&&P===M&&!j.velocity)continue;let B=!1;if(window.MotionHandoffAnimation){const Z=Gw(a);if(Z){const re=window.MotionHandoffAnimation(Z,A,qe);re!==null&&(j.startTime=re,B=!0)}}Rd(a,A);const Y=v??a.shouldReduceMotion;R.start(ah(A,R,P,Y&&zw.has(A)?{type:!1}:j,a,B));const H=R.animation;H&&w.push(H)}if(f){const A=()=>qe.update(()=>{f&&SR(a,f)});w.length?Promise.all(w).then(A):A()}return w}function Pd(a,i,l={}){var b;const u=li(a,i,l.type==="exit"?(b=a.presenceContext)==null?void 0:b.custom:void 0);let{transition:h=a.getDefaultTransition()||{}}=u||{};l.transitionOverride&&(h=l.transitionOverride);const m=u?()=>Promise.all(Kw(a,u,l)):()=>Promise.resolve(),f=a.variantChildren&&a.variantChildren.size?(v=0)=>{const{delayChildren:w=0,staggerChildren:E,staggerDirection:A}=h;return CR(a,i,v,w,E,A,l)}:()=>Promise.resolve(),{when:_}=h;if(_){const[v,w]=_==="beforeChildren"?[m,f]:[f,m];return v().then(()=>w())}else return Promise.all([m(),f(l.delay)])}function CR(a,i,l=0,u=0,h=0,m=1,f){const _=[];for(const b of a.variantChildren)b.notify("AnimationStart",i),_.push(Pd(b,i,{...f,delay:l+(typeof u=="function"?0:u)+Vw(a.variantChildren,b,u,h,m)}).then(()=>b.notify("AnimationComplete",i)));return Promise.all(_)}function AR(a,i,l={}){a.notify("AnimationStart",i);let u;if(Array.isArray(i)){const h=i.map(m=>Pd(a,m,l));u=Promise.all(h)}else if(typeof i=="string")u=Pd(a,i,l);else{const h=typeof i=="function"?li(a,i,l.custom):i;u=Promise.all(Kw(a,h,l))}return u.then(()=>{a.notify("AnimationComplete",i)})}const TR={test:a=>a==="auto",parse:a=>a},Yw=a=>i=>i.test(a),Zw=[hi,de,Kn,Ts,eI,QT,TR],I2=a=>Zw.find(Yw(a));function IR(a){return typeof a=="number"?a===0:a!==null?a==="none"||a==="0"||lw(a):!0}const RR=new Set(["brightness","contrast","saturate","opacity"]);function PR(a){const[i,l]=a.slice(0,-1).split("(");if(i==="drop-shadow")return a;const[u]=l.match(Xd)||[];if(!u)return a;const h=l.replace(u,"");let m=RR.has(i)?1:0;return u!==l&&(m*=100),i+"("+m+h+")"}const DR=/\b([a-z-]*)\(.*?\)/gu,Dd={...Rn,getAnimatableNone:a=>{const i=a.match(DR);return i?i.map(PR).join(" "):a}},Od={...Rn,getAnimatableNone:a=>{const i=Rn.parse(a);return Rn.createTransformer(a)(i.map(u=>typeof u=="number"?0:typeof u=="object"?{...u,alpha:1}:u))}},R2={...hi,transform:Math.round},OR={rotate:Ts,rotateX:Ts,rotateY:Ts,rotateZ:Ts,scale:qo,scaleX:qo,scaleY:qo,scaleZ:qo,skew:Ts,skewX:Ts,skewY:Ts,distance:de,translateX:de,translateY:de,translateZ:de,x:de,y:de,z:de,perspective:de,transformPerspective:de,opacity:Aa,originX:g2,originY:g2,originZ:de},ch={borderWidth:de,borderTopWidth:de,borderRightWidth:de,borderBottomWidth:de,borderLeftWidth:de,borderRadius:de,borderTopLeftRadius:de,borderTopRightRadius:de,borderBottomRightRadius:de,borderBottomLeftRadius:de,width:de,maxWidth:de,height:de,maxHeight:de,top:de,right:de,bottom:de,left:de,inset:de,insetBlock:de,insetBlockStart:de,insetBlockEnd:de,insetInline:de,insetInlineStart:de,insetInlineEnd:de,padding:de,paddingTop:de,paddingRight:de,paddingBottom:de,paddingLeft:de,paddingBlock:de,paddingBlockStart:de,paddingBlockEnd:de,paddingInline:de,paddingInlineStart:de,paddingInlineEnd:de,margin:de,marginTop:de,marginRight:de,marginBottom:de,marginLeft:de,marginBlock:de,marginBlockStart:de,marginBlockEnd:de,marginInline:de,marginInlineStart:de,marginInlineEnd:de,fontSize:de,backgroundPositionX:de,backgroundPositionY:de,...OR,zIndex:R2,fillOpacity:Aa,strokeOpacity:Aa,numOctaves:R2},NR={...ch,color:ft,backgroundColor:ft,outlineColor:ft,fill:ft,stroke:ft,borderColor:ft,borderTopColor:ft,borderRightColor:ft,borderBottomColor:ft,borderLeftColor:ft,filter:Dd,WebkitFilter:Dd,mask:Od,WebkitMask:Od},Xw=a=>NR[a],BR=new Set([Dd,Od]);function Jw(a,i){let l=Xw(a);return BR.has(l)||(l=Rn),l.getAnimatableNone?l.getAnimatableNone(i):void 0}const LR=new Set(["auto","none","0"]);function MR(a,i,l){let u=0,h;for(;u<a.length&&!h;){const m=a[u];typeof m=="string"&&!LR.has(m)&&ci(m).values.length&&(h=a[u]),u++}if(h&&l)for(const m of i)a[m]=Jw(l,h)}class FR extends rh{constructor(i,l,u,h,m){super(i,l,u,h,m,!0)}readKeyframes(){const{unresolvedKeyframes:i,element:l,name:u}=this;if(!l||!l.current)return;super.readKeyframes();for(let w=0;w<i.length;w++){let E=i[w];if(typeof E=="string"&&(E=E.trim(),Zd(E))){const A=Hw(E,l.current);A!==void 0&&(i[w]=A),w===i.length-1&&(this.finalKeyframe=E)}}if(this.resolveNoneKeyframes(),!zw.has(u)||i.length!==2)return;const[h,m]=i,f=I2(h),_=I2(m),b=m2(h),v=m2(m);if(b!==v&&Rs[u]){this.needsMeasurement=!0;return}if(f!==_)if(E2(f)&&E2(_))for(let w=0;w<i.length;w++){const E=i[w];typeof E=="string"&&(i[w]=parseFloat(E))}else Rs[u]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:i,name:l}=this,u=[];for(let h=0;h<i.length;h++)(i[h]===null||IR(i[h]))&&u.push(h);u.length&&MR(i,u,l)}measureInitialState(){const{element:i,unresolvedKeyframes:l,name:u}=this;if(!i||!i.current)return;u==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Rs[u](i.measureViewportBox(),window.getComputedStyle(i.current)),l[0]=this.measuredOrigin;const h=l[l.length-1];h!==void 0&&i.getValue(u,h).jump(h,!1)}measureEndState(){var _;const{element:i,name:l,unresolvedKeyframes:u}=this;if(!i||!i.current)return;const h=i.getValue(l);h&&h.jump(this.measuredOrigin,!1);const m=u.length-1,f=u[m];u[m]=Rs[l](i.measureViewportBox(),window.getComputedStyle(i.current)),f!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=f),(_=this.removedTransforms)!=null&&_.length&&this.removedTransforms.forEach(([b,v])=>{i.getValue(b).set(v)}),this.resolveNoneKeyframes()}}const $R=new Set(["opacity","clipPath","filter","transform"]);function Qw(a,i,l){if(a==null)return[];if(a instanceof EventTarget)return[a];if(typeof a=="string"){let u=document;const h=(l==null?void 0:l[a])??u.querySelectorAll(a);return h?Array.from(h):[]}return Array.from(a).filter(u=>u!=null)}const eS=(a,i)=>i&&typeof a=="number"?i.transform(a):a;function UR(a){return ow(a)&&"offsetHeight"in a}const{schedule:uh}=ww(queueMicrotask,!1),Tn={x:!1,y:!1};function tS(){return Tn.x||Tn.y}function jR(a){return a==="x"||a==="y"?Tn[a]?null:(Tn[a]=!0,()=>{Tn[a]=!1}):Tn.x||Tn.y?null:(Tn.x=Tn.y=!0,()=>{Tn.x=Tn.y=!1})}function nS(a,i){const l=Qw(a),u=new AbortController,h={passive:!0,...i,signal:u.signal};return[l,h,()=>u.abort()]}function VR(a){return!(a.pointerType==="touch"||tS())}function HR(a,i,l={}){const[u,h,m]=nS(a,l);return u.forEach(f=>{let _=!1,b=!1,v;const w=()=>{f.removeEventListener("pointerleave",P)},E=M=>{v&&(v(M),v=void 0),w()},A=M=>{_=!1,window.removeEventListener("pointerup",A),window.removeEventListener("pointercancel",A),b&&(b=!1,E(M))},R=()=>{_=!0,window.addEventListener("pointerup",A,h),window.addEventListener("pointercancel",A,h)},P=M=>{if(M.pointerType!=="touch"){if(_){b=!0;return}E(M)}},j=M=>{if(!VR(M))return;b=!1;const B=i(f,M);typeof B=="function"&&(v=B,f.addEventListener("pointerleave",P,h))};f.addEventListener("pointerenter",j,h),f.addEventListener("pointerdown",R,h)}),m}const sS=(a,i)=>i?a===i?!0:sS(a,i.parentElement):!1,dh=a=>a.pointerType==="mouse"?typeof a.button!="number"||a.button<=0:a.isPrimary!==!1,WR=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function zR(a){return WR.has(a.tagName)||a.isContentEditable===!0}const qR=new Set(["INPUT","SELECT","TEXTAREA"]);function GR(a){return qR.has(a.tagName)||a.isContentEditable===!0}const tl=new WeakSet;function P2(a){return i=>{i.key==="Enter"&&a(i)}}function Qu(a,i){a.dispatchEvent(new PointerEvent("pointer"+i,{isPrimary:!0,bubbles:!0}))}const KR=(a,i)=>{const l=a.currentTarget;if(!l)return;const u=P2(()=>{if(tl.has(l))return;Qu(l,"down");const h=P2(()=>{Qu(l,"up")}),m=()=>Qu(l,"cancel");l.addEventListener("keyup",h,i),l.addEventListener("blur",m,i)});l.addEventListener("keydown",u,i),l.addEventListener("blur",()=>l.removeEventListener("keydown",u),i)};function D2(a){return dh(a)&&!tS()}const O2=new WeakSet;function YR(a,i,l={}){const[u,h,m]=nS(a,l),f=_=>{const b=_.currentTarget;if(!D2(_)||O2.has(_))return;tl.add(b),l.stopPropagation&&O2.add(_);const v=i(b,_),w=(R,P)=>{window.removeEventListener("pointerup",E),window.removeEventListener("pointercancel",A),tl.has(b)&&tl.delete(b),D2(R)&&typeof v=="function"&&v(R,{success:P})},E=R=>{w(R,b===window||b===document||l.useGlobalTarget||sS(b,R.target))},A=R=>{w(R,!1)};window.addEventListener("pointerup",E,h),window.addEventListener("pointercancel",A,h)};return u.forEach(_=>{(l.useGlobalTarget?window:_).addEventListener("pointerdown",f,h),UR(_)&&(_.addEventListener("focus",v=>KR(v,h)),!zR(_)&&!_.hasAttribute("tabindex")&&(_.tabIndex=0))}),m}function hh(a){return ow(a)&&"ownerSVGElement"in a}const nl=new WeakMap;let Is;const rS=(a,i,l)=>(u,h)=>h&&h[0]?h[0][a+"Size"]:hh(u)&&"getBBox"in u?u.getBBox()[i]:u[l],ZR=rS("inline","width","offsetWidth"),XR=rS("block","height","offsetHeight");function JR({target:a,borderBoxSize:i}){var l;(l=nl.get(a))==null||l.forEach(u=>{u(a,{get width(){return ZR(a,i)},get height(){return XR(a,i)}})})}function QR(a){a.forEach(JR)}function eP(){typeof ResizeObserver>"u"||(Is=new ResizeObserver(QR))}function tP(a,i){Is||eP();const l=Qw(a);return l.forEach(u=>{let h=nl.get(u);h||(h=new Set,nl.set(u,h)),h.add(i),Is==null||Is.observe(u)}),()=>{l.forEach(u=>{const h=nl.get(u);h==null||h.delete(i),h!=null&&h.size||Is==null||Is.unobserve(u)})}}const sl=new Set;let ni;function nP(){ni=()=>{const a={get width(){return window.innerWidth},get height(){return window.innerHeight}};sl.forEach(i=>i(a))},window.addEventListener("resize",ni)}function sP(a){return sl.add(a),ni||nP(),()=>{sl.delete(a),!sl.size&&typeof ni=="function"&&(window.removeEventListener("resize",ni),ni=void 0)}}function N2(a,i){return typeof a=="function"?sP(a):tP(a,i)}function rP(a){return hh(a)&&a.tagName==="svg"}const iP=[...Zw,ft,Rn],aP=a=>iP.find(Yw(a)),B2=()=>({translate:0,scale:1,origin:0,originPoint:0}),si=()=>({x:B2(),y:B2()}),L2=()=>({min:0,max:0}),bt=()=>({x:L2(),y:L2()}),oP=new WeakMap;function _l(a){return a!==null&&typeof a=="object"&&typeof a.start=="function"}function Ta(a){return typeof a=="string"||Array.isArray(a)}const ph=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],fh=["initial",...ph];function bl(a){return _l(a.animate)||fh.some(i=>Ta(a[i]))}function iS(a){return!!(bl(a)||a.variants)}function lP(a,i,l){for(const u in i){const h=i[u],m=l[u];if(Pt(h))a.addValue(u,h);else if(Pt(m))a.addValue(u,ui(h,{owner:a}));else if(m!==h)if(a.hasValue(u)){const f=a.getValue(u);f.liveStyle===!0?f.jump(h):f.hasAnimated||f.set(h)}else{const f=a.getStaticValue(u);a.addValue(u,ui(f!==void 0?f:h,{owner:a}))}}for(const u in l)i[u]===void 0&&a.removeValue(u);return i}const Nd={current:null},aS={current:!1},cP=typeof window<"u";function uP(){if(aS.current=!0,!!cP)if(window.matchMedia){const a=window.matchMedia("(prefers-reduced-motion)"),i=()=>Nd.current=a.matches;a.addEventListener("change",i),i()}else Nd.current=!1}const M2=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let pl={};function oS(a){pl=a}function dP(){return pl}class hP{scrapeMotionValuesFromProps(i,l,u){return{}}constructor({parent:i,props:l,presenceContext:u,reducedMotionConfig:h,skipAnimations:m,blockInitialAnimation:f,visualState:_},b={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=rh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const R=Mt.now();this.renderScheduledAt<R&&(this.renderScheduledAt=R,qe.render(this.render,!1,!0))};const{latestValues:v,renderState:w}=_;this.latestValues=v,this.baseTarget={...v},this.initialValues=l.initial?{...v}:{},this.renderState=w,this.parent=i,this.props=l,this.presenceContext=u,this.depth=i?i.depth+1:0,this.reducedMotionConfig=h,this.skipAnimationsConfig=m,this.options=b,this.blockInitialAnimation=!!f,this.isControllingVariants=bl(l),this.isVariantNode=iS(l),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(i&&i.current);const{willChange:E,...A}=this.scrapeMotionValuesFromProps(l,{},this);for(const R in A){const P=A[R];v[R]!==void 0&&Pt(P)&&P.set(v[R])}}mount(i){var l,u;if(this.hasBeenMounted)for(const h in this.initialValues)(l=this.values.get(h))==null||l.jump(this.initialValues[h]),this.latestValues[h]=this.initialValues[h];this.current=i,oP.set(i,this),this.projection&&!this.projection.instance&&this.projection.mount(i),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((h,m)=>this.bindToMotionValue(m,h)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(aS.current||uP(),this.shouldReduceMotion=Nd.current),process.env.NODE_ENV!=="production"&&Gd(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(u=this.parent)==null||u.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var i;this.projection&&this.projection.unmount(),Ps(this.notifyUpdate),Ps(this.render),this.valueSubscriptions.forEach(l=>l()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(i=this.parent)==null||i.removeChild(this);for(const l in this.events)this.events[l].clear();for(const l in this.features){const u=this.features[l];u&&(u.unmount(),u.isMounted=!1)}this.current=null}addChild(i){this.children.add(i),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(i)}removeChild(i){this.children.delete(i),this.enteringChildren&&this.enteringChildren.delete(i)}bindToMotionValue(i,l){if(this.valueSubscriptions.has(i)&&this.valueSubscriptions.get(i)(),l.accelerate&&$R.has(i)&&this.current instanceof HTMLElement){const{factory:f,keyframes:_,times:b,ease:v,duration:w}=l.accelerate,E=new Uw({element:this.current,name:i,keyframes:_,times:b,ease:v,duration:Wt(w)}),A=f(E);this.valueSubscriptions.set(i,()=>{A(),E.cancel()});return}const u=fi.has(i);u&&this.onBindTransform&&this.onBindTransform();const h=l.on("change",f=>{this.latestValues[i]=f,this.props.onUpdate&&qe.preRender(this.notifyUpdate),u&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let m;typeof window<"u"&&window.MotionCheckAppearSync&&(m=window.MotionCheckAppearSync(this,i,l)),this.valueSubscriptions.set(i,()=>{h(),m&&m(),l.owner&&l.stop()})}sortNodePosition(i){return!this.current||!this.sortInstanceNodePosition||this.type!==i.type?0:this.sortInstanceNodePosition(this.current,i.current)}updateFeatures(){let i="animation";for(i in pl){const l=pl[i];if(!l)continue;const{isEnabled:u,Feature:h}=l;if(!this.features[i]&&h&&u(this.props)&&(this.features[i]=new h(this)),this.features[i]){const m=this.features[i];m.isMounted?m.update():(m.mount(),m.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):bt()}getStaticValue(i){return this.latestValues[i]}setStaticValue(i,l){this.latestValues[i]=l}update(i,l){(i.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=i,this.prevPresenceContext=this.presenceContext,this.presenceContext=l;for(let u=0;u<M2.length;u++){const h=M2[u];this.propEventSubscriptions[h]&&(this.propEventSubscriptions[h](),delete this.propEventSubscriptions[h]);const m="on"+h,f=i[m];f&&(this.propEventSubscriptions[h]=this.on(h,f))}this.prevMotionValues=lP(this,this.scrapeMotionValuesFromProps(i,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(i){return this.props.variants?this.props.variants[i]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(i){const l=this.getClosestVariantNode();if(l)return l.variantChildren&&l.variantChildren.add(i),()=>l.variantChildren.delete(i)}addValue(i,l){const u=this.values.get(i);l!==u&&(u&&this.removeValue(i),this.bindToMotionValue(i,l),this.values.set(i,l),this.latestValues[i]=l.get())}removeValue(i){this.values.delete(i);const l=this.valueSubscriptions.get(i);l&&(l(),this.valueSubscriptions.delete(i)),delete this.latestValues[i],this.removeValueFromRenderState(i,this.renderState)}hasValue(i){return this.values.has(i)}getValue(i,l){if(this.props.values&&this.props.values[i])return this.props.values[i];let u=this.values.get(i);return u===void 0&&l!==void 0&&(u=ui(l===null?void 0:l,{owner:this}),this.addValue(i,u)),u}readValue(i,l){let u=this.latestValues[i]!==void 0||!this.current?this.latestValues[i]:this.getBaseTargetFromProps(this.props,i)??this.readValueFromInstance(this.current,i,this.options);return u!=null&&(typeof u=="string"&&(aw(u)||lw(u))?u=parseFloat(u):!aP(u)&&Rn.test(l)&&(u=Jw(i,l)),this.setBaseTarget(i,Pt(u)?u.get():u)),Pt(u)?u.get():u}setBaseTarget(i,l){this.baseTarget[i]=l}getBaseTarget(i){var m;const{initial:l}=this.props;let u;if(typeof l=="string"||typeof l=="object"){const f=oh(this.props,l,(m=this.presenceContext)==null?void 0:m.custom);f&&(u=f[i])}if(l&&u!==void 0)return u;const h=this.getBaseTargetFromProps(this.props,i);return h!==void 0&&!Pt(h)?h:this.initialValues[i]!==void 0&&u===void 0?void 0:this.baseTarget[i]}on(i,l){return this.events[i]||(this.events[i]=new qd),this.events[i].add(l)}notify(i,...l){this.events[i]&&this.events[i].notify(...l)}scheduleRenderMicrotask(){uh.render(this.render)}}class lS extends hP{constructor(){super(...arguments),this.KeyframeResolver=FR}sortInstanceNodePosition(i,l){return i.compareDocumentPosition(l)&2?1:-1}getBaseTargetFromProps(i,l){const u=i.style;return u?u[l]:void 0}removeValueFromRenderState(i,{vars:l,style:u}){delete l[i],delete u[i]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:i}=this.props;Pt(i)&&(this.childSubscription=i.on("change",l=>{this.current&&(this.current.textContent=`${l}`)}))}}class Ds{constructor(i){this.isMounted=!1,this.node=i}update(){}}function cS({top:a,left:i,right:l,bottom:u}){return{x:{min:i,max:l},y:{min:a,max:u}}}function pP({x:a,y:i}){return{top:i.min,right:a.max,bottom:i.max,left:a.min}}function fP(a,i){if(!i)return a;const l=i({x:a.left,y:a.top}),u=i({x:a.right,y:a.bottom});return{top:l.y,left:l.x,bottom:u.y,right:u.x}}function ed(a){return a===void 0||a===1}function Bd({scale:a,scaleX:i,scaleY:l}){return!ed(a)||!ed(i)||!ed(l)}function lr(a){return Bd(a)||uS(a)||a.z||a.rotate||a.rotateX||a.rotateY||a.skewX||a.skewY}function uS(a){return F2(a.x)||F2(a.y)}function F2(a){return a&&a!=="0%"}function fl(a,i,l){const u=a-l,h=i*u;return l+h}function $2(a,i,l,u,h){return h!==void 0&&(a=fl(a,h,u)),fl(a,l,u)+i}function Ld(a,i=0,l=1,u,h){a.min=$2(a.min,i,l,u,h),a.max=$2(a.max,i,l,u,h)}function dS(a,{x:i,y:l}){Ld(a.x,i.translate,i.scale,i.originPoint),Ld(a.y,l.translate,l.scale,l.originPoint)}const U2=.999999999999,j2=1.0000000000001;function mP(a,i,l,u=!1){var _;const h=l.length;if(!h)return;i.x=i.y=1;let m,f;for(let b=0;b<h;b++){m=l[b],f=m.projectionDelta;const{visualElement:v}=m.options;v&&v.props.style&&v.props.style.display==="contents"||(u&&m.options.layoutScroll&&m.scroll&&m!==m.root&&ii(a,{x:-m.scroll.offset.x,y:-m.scroll.offset.y}),f&&(i.x*=f.x.scale,i.y*=f.y.scale,dS(a,f)),u&&lr(m.latestValues)&&ii(a,m.latestValues,(_=m.layout)==null?void 0:_.layoutBox))}i.x<j2&&i.x>U2&&(i.x=1),i.y<j2&&i.y>U2&&(i.y=1)}function ri(a,i){a.min=a.min+i,a.max=a.max+i}function V2(a,i,l,u,h=.5){const m=rt(a.min,a.max,h);Ld(a,i,l,m,u)}function H2(a,i){return typeof a=="string"?parseFloat(a)/100*(i.max-i.min):a}function ii(a,i,l){const u=l??a;V2(a.x,H2(i.x,u.x),i.scaleX,i.scale,i.originX),V2(a.y,H2(i.y,u.y),i.scaleY,i.scale,i.originY)}function hS(a,i){return cS(fP(a.getBoundingClientRect(),i))}function gP(a,i,l){const u=hS(a,l),{scroll:h}=i;return h&&(ri(u.x,h.offset.x),ri(u.y,h.offset.y)),u}const yP={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_P=pi.length;function bP(a,i,l){let u="",h=!0;for(let m=0;m<_P;m++){const f=pi[m],_=a[f];if(_===void 0)continue;let b=!0;if(typeof _=="number")b=_===(f.startsWith("scale")?1:0);else{const v=parseFloat(_);b=f.startsWith("scale")?v===1:v===0}if(!b||l){const v=eS(_,ch[f]);if(!b){h=!1;const w=yP[f]||f;u+=`${w}(${v}) `}l&&(i[f]=v)}}return u=u.trim(),l?u=l(i,h?"":u):h&&(u="none"),u}function mh(a,i,l){const{style:u,vars:h,transformOrigin:m}=a;let f=!1,_=!1;for(const b in i){const v=i[b];if(fi.has(b)){f=!0;continue}else if(xw(b)){h[b]=v;continue}else{const w=eS(v,ch[b]);b.startsWith("origin")?(_=!0,m[b]=w):u[b]=w}}if(i.transform||(f||l?u.transform=bP(i,a.transform,l):u.transform&&(u.transform="none")),_){const{originX:b="50%",originY:v="50%",originZ:w=0}=m;u.transformOrigin=`${b} ${v} ${w}`}}function pS(a,{style:i,vars:l},u,h){const m=a.style;let f;for(f in i)m[f]=i[f];h==null||h.applyProjectionStyles(m,u);for(f in l)m.setProperty(f,l[f])}function W2(a,i){return i.max===i.min?0:a/(i.max-i.min)*100}const ga={correct:(a,i)=>{if(!i.target)return a;if(typeof a=="string")if(de.test(a))a=parseFloat(a);else return a;const l=W2(a,i.target.x),u=W2(a,i.target.y);return`${l}% ${u}%`}},vP={correct:(a,{treeScale:i,projectionDelta:l})=>{const u=a,h=Rn.parse(a);if(h.length>5)return u;const m=Rn.createTransformer(a),f=typeof h[0]!="number"?1:0,_=l.x.scale*i.x,b=l.y.scale*i.y;h[0+f]/=_,h[1+f]/=b;const v=rt(_,b,.5);return typeof h[2+f]=="number"&&(h[2+f]/=v),typeof h[3+f]=="number"&&(h[3+f]/=v),m(h)}},Md={borderRadius:{...ga,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ga,borderTopRightRadius:ga,borderBottomLeftRadius:ga,borderBottomRightRadius:ga,boxShadow:vP};function fS(a,{layout:i,layoutId:l}){return fi.has(a)||a.startsWith("origin")||(i||l!==void 0)&&(!!Md[a]||a==="opacity")}function gh(a,i,l){var f;const u=a.style,h=i==null?void 0:i.style,m={};if(!u)return m;for(const _ in u)(Pt(u[_])||h&&Pt(h[_])||fS(_,a)||((f=l==null?void 0:l.getValue(_))==null?void 0:f.liveStyle)!==void 0)&&(m[_]=u[_]);return m}function wP(a){return window.getComputedStyle(a)}class SP extends lS{constructor(){super(...arguments),this.type="html",this.renderInstance=pS}readValueFromInstance(i,l){var u;if(fi.has(l))return(u=this.projection)!=null&&u.isProjecting?xd(l):UI(i,l);{const h=wP(i),m=(xw(l)?h.getPropertyValue(l):h[l])||0;return typeof m=="string"?m.trim():m}}measureInstanceViewportBox(i,{transformPagePoint:l}){return hS(i,l)}build(i,l,u){mh(i,l,u.transformTemplate)}scrapeMotionValuesFromProps(i,l,u){return gh(i,l,u)}}const xP={offset:"stroke-dashoffset",array:"stroke-dasharray"},EP={offset:"strokeDashoffset",array:"strokeDasharray"};function kP(a,i,l=1,u=0,h=!0){a.pathLength=1;const m=h?xP:EP;a[m.offset]=`${-u}`,a[m.array]=`${i} ${l}`}const CP=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function mS(a,{attrX:i,attrY:l,attrScale:u,pathLength:h,pathSpacing:m=1,pathOffset:f=0,..._},b,v,w){if(mh(a,_,v),b){a.style.viewBox&&(a.attrs.viewBox=a.style.viewBox);return}a.attrs=a.style,a.style={};const{attrs:E,style:A}=a;E.transform&&(A.transform=E.transform,delete E.transform),(A.transform||E.transformOrigin)&&(A.transformOrigin=E.transformOrigin??"50% 50%",delete E.transformOrigin),A.transform&&(A.transformBox=(w==null?void 0:w.transformBox)??"fill-box",delete E.transformBox);for(const R of CP)E[R]!==void 0&&(A[R]=E[R],delete E[R]);i!==void 0&&(E.x=i),l!==void 0&&(E.y=l),u!==void 0&&(E.scale=u),h!==void 0&&kP(E,h,m,f,!1)}const gS=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),yS=a=>typeof a=="string"&&a.toLowerCase()==="svg";function AP(a,i,l,u){pS(a,i,void 0,u);for(const h in i.attrs)a.setAttribute(gS.has(h)?h:lh(h),i.attrs[h])}function _S(a,i,l){const u=gh(a,i,l);for(const h in a)if(Pt(a[h])||Pt(i[h])){const m=pi.indexOf(h)!==-1?"attr"+h.charAt(0).toUpperCase()+h.substring(1):h;u[m]=a[h]}return u}class TP extends lS{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=bt}getBaseTargetFromProps(i,l){return i[l]}readValueFromInstance(i,l){if(fi.has(l)){const u=Xw(l);return u&&u.default||0}return l=gS.has(l)?l:lh(l),i.getAttribute(l)}scrapeMotionValuesFromProps(i,l,u){return _S(i,l,u)}build(i,l,u){mS(i,l,this.isSVGTag,u.transformTemplate,u.style)}renderInstance(i,l,u,h){AP(i,l,u,h)}mount(i){this.isSVGTag=yS(i.tagName),super.mount(i)}}const IP=fh.length;function bS(a){if(!a)return;if(!a.isControllingVariants){const l=a.parent?bS(a.parent)||{}:{};return a.props.initial!==void 0&&(l.initial=a.props.initial),l}const i={};for(let l=0;l<IP;l++){const u=fh[l],h=a.props[u];(Ta(h)||h===!1)&&(i[u]=h)}return i}function vS(a,i){if(!Array.isArray(i))return!1;const l=i.length;if(l!==a.length)return!1;for(let u=0;u<l;u++)if(i[u]!==a[u])return!1;return!0}const RP=[...ph].reverse(),PP=ph.length;function DP(a){return i=>Promise.all(i.map(({animation:l,options:u})=>AR(a,l,u)))}function OP(a){let i=DP(a),l=z2(),u=!0,h=!1;const m=v=>(w,E)=>{var R;const A=li(a,E,v==="exit"?(R=a.presenceContext)==null?void 0:R.custom:void 0);if(A){const{transition:P,transitionEnd:j,...M}=A;w={...w,...M,...j}}return w};function f(v){i=v(a)}function _(v){const{props:w}=a,E=bS(a.parent)||{},A=[],R=new Set;let P={},j=1/0;for(let B=0;B<PP;B++){const Y=RP[B],H=l[Y],Z=w[Y]!==void 0?w[Y]:E[Y],re=Ta(Z),ge=Y===v?H.isActive:null;ge===!1&&(j=B);let se=Z===E[Y]&&Z!==w[Y]&&re;if(se&&(u||h)&&a.manuallyAnimateOnMount&&(se=!1),H.protectedKeys={...P},!H.isActive&&ge===null||!Z&&!H.prevProp||_l(Z)||typeof Z=="boolean")continue;if(Y==="exit"&&H.isActive&&ge!==!0){H.prevResolvedValues&&(P={...P,...H.prevResolvedValues});continue}const ae=NP(H.prevProp,Z);let xe=ae||Y===v&&H.isActive&&!se&&re||B>j&&re,oe=!1;const Fe=Array.isArray(Z)?Z:[Z];let ie=Fe.reduce(m(Y),{});ge===!1&&(ie={});const{prevResolvedValues:Ee={}}=H,Be={...Ee,...ie},ke=Re=>{xe=!0,R.has(Re)&&(oe=!0,R.delete(Re)),H.needsAnimating[Re]=!0;const Je=a.getValue(Re);Je&&(Je.liveStyle=!1)};for(const Re in Be){const Je=ie[Re],vt=Ee[Re];if(P.hasOwnProperty(Re))continue;let ee=!1;Id(Je)&&Id(vt)?ee=!vS(Je,vt):ee=Je!==vt,ee?Je!=null?ke(Re):R.add(Re):Je!==void 0&&R.has(Re)?ke(Re):H.protectedKeys[Re]=!0}H.prevProp=Z,H.prevResolvedValues=ie,H.isActive&&(P={...P,...ie}),(u||h)&&a.blockInitialAnimation&&(xe=!1);const Ae=se&&ae;xe&&(!Ae||oe)&&A.push(...Fe.map(Re=>{const Je={type:Y};if(typeof Re=="string"&&(u||h)&&!Ae&&a.manuallyAnimateOnMount&&a.parent){const{parent:vt}=a,ee=li(vt,Re);if(vt.enteringChildren&&ee){const{delayChildren:pe}=ee.transition||{};Je.delay=Vw(vt.enteringChildren,a,pe)}}return{animation:Re,options:Je}}))}if(R.size){const B={};if(typeof w.initial!="boolean"){const Y=li(a,Array.isArray(w.initial)?w.initial[0]:w.initial);Y&&Y.transition&&(B.transition=Y.transition)}R.forEach(Y=>{const H=a.getBaseTarget(Y),Z=a.getValue(Y);Z&&(Z.liveStyle=!0),B[Y]=H??null}),A.push({animation:B})}let M=!!A.length;return u&&(w.initial===!1||w.initial===w.animate)&&!a.manuallyAnimateOnMount&&(M=!1),u=!1,h=!1,M?i(A):Promise.resolve()}function b(v,w){var A;if(l[v].isActive===w)return Promise.resolve();(A=a.variantChildren)==null||A.forEach(R=>{var P;return(P=R.animationState)==null?void 0:P.setActive(v,w)}),l[v].isActive=w;const E=_(v);for(const R in l)l[R].protectedKeys={};return E}return{animateChanges:_,setActive:b,setAnimateFunction:f,getState:()=>l,reset:()=>{l=z2(),h=!0}}}function NP(a,i){return typeof i=="string"?i!==a:Array.isArray(i)?!vS(i,a):!1}function sr(a=!1){return{isActive:a,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function z2(){return{animate:sr(!0),whileInView:sr(),whileHover:sr(),whileTap:sr(),whileDrag:sr(),whileFocus:sr(),exit:sr()}}function q2(a,i){a.min=i.min,a.max=i.max}function kn(a,i){q2(a.x,i.x),q2(a.y,i.y)}function G2(a,i){a.translate=i.translate,a.scale=i.scale,a.originPoint=i.originPoint,a.origin=i.origin}const wS=1e-4,BP=1-wS,LP=1+wS,SS=.01,MP=0-SS,FP=0+SS;function Ft(a){return a.max-a.min}function $P(a,i,l){return Math.abs(a-i)<=l}function K2(a,i,l,u=.5){a.origin=u,a.originPoint=rt(i.min,i.max,a.origin),a.scale=Ft(l)/Ft(i),a.translate=rt(l.min,l.max,a.origin)-a.originPoint,(a.scale>=BP&&a.scale<=LP||isNaN(a.scale))&&(a.scale=1),(a.translate>=MP&&a.translate<=FP||isNaN(a.translate))&&(a.translate=0)}function Ea(a,i,l,u){K2(a.x,i.x,l.x,u?u.originX:void 0),K2(a.y,i.y,l.y,u?u.originY:void 0)}function Y2(a,i,l){a.min=l.min+i.min,a.max=a.min+Ft(i)}function UP(a,i,l){Y2(a.x,i.x,l.x),Y2(a.y,i.y,l.y)}function Z2(a,i,l){a.min=i.min-l.min,a.max=a.min+Ft(i)}function ml(a,i,l){Z2(a.x,i.x,l.x),Z2(a.y,i.y,l.y)}function X2(a,i,l,u,h){return a-=i,a=fl(a,1/l,u),h!==void 0&&(a=fl(a,1/h,u)),a}function jP(a,i=0,l=1,u=.5,h,m=a,f=a){if(Kn.test(i)&&(i=parseFloat(i),i=rt(f.min,f.max,i/100)-f.min),typeof i!="number")return;let _=rt(m.min,m.max,u);a===m&&(_-=i),a.min=X2(a.min,i,l,_,h),a.max=X2(a.max,i,l,_,h)}function J2(a,i,[l,u,h],m,f){jP(a,i[l],i[u],i[h],i.scale,m,f)}const VP=["x","scaleX","originX"],HP=["y","scaleY","originY"];function Q2(a,i,l,u){J2(a.x,i,VP,l?l.x:void 0,u?u.x:void 0),J2(a.y,i,HP,l?l.y:void 0,u?u.y:void 0)}function e0(a){return a.translate===0&&a.scale===1}function xS(a){return e0(a.x)&&e0(a.y)}function t0(a,i){return a.min===i.min&&a.max===i.max}function WP(a,i){return t0(a.x,i.x)&&t0(a.y,i.y)}function n0(a,i){return Math.round(a.min)===Math.round(i.min)&&Math.round(a.max)===Math.round(i.max)}function ES(a,i){return n0(a.x,i.x)&&n0(a.y,i.y)}function s0(a){return Ft(a.x)/Ft(a.y)}function r0(a,i){return a.translate===i.translate&&a.scale===i.scale&&a.originPoint===i.originPoint}function Gn(a){return[a("x"),a("y")]}function zP(a,i,l){let u="";const h=a.x.translate/i.x,m=a.y.translate/i.y,f=(l==null?void 0:l.z)||0;if((h||m||f)&&(u=`translate3d(${h}px, ${m}px, ${f}px) `),(i.x!==1||i.y!==1)&&(u+=`scale(${1/i.x}, ${1/i.y}) `),l){const{transformPerspective:v,rotate:w,rotateX:E,rotateY:A,skewX:R,skewY:P}=l;v&&(u=`perspective(${v}px) ${u}`),w&&(u+=`rotate(${w}deg) `),E&&(u+=`rotateX(${E}deg) `),A&&(u+=`rotateY(${A}deg) `),R&&(u+=`skewX(${R}deg) `),P&&(u+=`skewY(${P}deg) `)}const _=a.x.scale*i.x,b=a.y.scale*i.y;return(_!==1||b!==1)&&(u+=`scale(${_}, ${b})`),u||"none"}const kS=["TopLeft","TopRight","BottomLeft","BottomRight"],qP=kS.length,i0=a=>typeof a=="string"?parseFloat(a):a,a0=a=>typeof a=="number"||de.test(a);function GP(a,i,l,u,h,m){h?(a.opacity=rt(0,l.opacity??1,KP(u)),a.opacityExit=rt(i.opacity??1,0,YP(u))):m&&(a.opacity=rt(i.opacity??1,l.opacity??1,u));for(let f=0;f<qP;f++){const _=`border${kS[f]}Radius`;let b=o0(i,_),v=o0(l,_);if(b===void 0&&v===void 0)continue;b||(b=0),v||(v=0),b===0||v===0||a0(b)===a0(v)?(a[_]=Math.max(rt(i0(b),i0(v),u),0),(Kn.test(v)||Kn.test(b))&&(a[_]+="%")):a[_]=v}(i.rotate||l.rotate)&&(a.rotate=rt(i.rotate||0,l.rotate||0,u))}function o0(a,i){return a[i]!==void 0?a[i]:a.borderRadius}const KP=CS(0,.5,yw),YP=CS(.5,.95,vn);function CS(a,i,l){return u=>u<a?0:u>i?1:l(Ca(a,i,u))}function ZP(a,i,l){const u=Pt(a)?a:ui(a);return u.start(ah("",u,i,l)),u.animation}function Ia(a,i,l,u={passive:!0}){return a.addEventListener(i,l,u),()=>a.removeEventListener(i,l)}const XP=(a,i)=>a.depth-i.depth;class JP{constructor(){this.children=[],this.isDirty=!1}add(i){zd(this.children,i),this.isDirty=!0}remove(i){cl(this.children,i),this.isDirty=!0}forEach(i){this.isDirty&&this.children.sort(XP),this.isDirty=!1,this.children.forEach(i)}}function QP(a,i){const l=Mt.now(),u=({timestamp:h})=>{const m=h-l;m>=i&&(Ps(u),a(m-i))};return qe.setup(u,!0),()=>Ps(u)}function rl(a){return Pt(a)?a.get():a}class eD{constructor(){this.members=[]}add(i){zd(this.members,i);for(let l=this.members.length-1;l>=0;l--){const u=this.members[l];if(u===i||u===this.lead||u===this.prevLead)continue;const h=u.instance;(!h||h.isConnected===!1)&&!u.snapshot&&(cl(this.members,u),u.unmount())}i.scheduleRender()}remove(i){if(cl(this.members,i),i===this.prevLead&&(this.prevLead=void 0),i===this.lead){const l=this.members[this.members.length-1];l&&this.promote(l)}}relegate(i){var l;for(let u=this.members.indexOf(i)-1;u>=0;u--){const h=this.members[u];if(h.isPresent!==!1&&((l=h.instance)==null?void 0:l.isConnected)!==!1)return this.promote(h),!0}return!1}promote(i,l){var h;const u=this.lead;if(i!==u&&(this.prevLead=u,this.lead=i,i.show(),u)){u.updateSnapshot(),i.scheduleRender();const{layoutDependency:m}=u.options,{layoutDependency:f}=i.options;(m===void 0||m!==f)&&(i.resumeFrom=u,l&&(u.preserveOpacity=!0),u.snapshot&&(i.snapshot=u.snapshot,i.snapshot.latestValues=u.animationValues||u.latestValues),(h=i.root)!=null&&h.isUpdating&&(i.isLayoutDirty=!0)),i.options.crossfade===!1&&u.hide()}}exitAnimationComplete(){this.members.forEach(i=>{var l,u,h,m,f;(u=(l=i.options).onExitComplete)==null||u.call(l),(f=(h=i.resumingFrom)==null?void 0:(m=h.options).onExitComplete)==null||f.call(m)})}scheduleRender(){this.members.forEach(i=>i.instance&&i.scheduleRender(!1))}removeLeadSnapshot(){var i;(i=this.lead)!=null&&i.snapshot&&(this.lead.snapshot=void 0)}}const il={hasAnimatedSinceResize:!0,hasEverUpdated:!1},td=["","X","Y","Z"],tD=1e3;let nD=0;function nd(a,i,l,u){const{latestValues:h}=i;h[a]&&(l[a]=h[a],i.setStaticValue(a,0),u&&(u[a]=0))}function AS(a){if(a.hasCheckedOptimisedAppear=!0,a.root===a)return;const{visualElement:i}=a.options;if(!i)return;const l=Gw(i);if(window.MotionHasOptimisedAnimation(l,"transform")){const{layout:h,layoutId:m}=a.options;window.MotionCancelOptimisedAnimation(l,"transform",qe,!(h||m))}const{parent:u}=a;u&&!u.hasCheckedOptimisedAppear&&AS(u)}function TS({attachResizeListener:a,defaultParent:i,measureScroll:l,checkIsScrollRoot:u,resetTransform:h}){return class{constructor(f={},_=i==null?void 0:i()){this.id=nD++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(iD),this.nodes.forEach(cD),this.nodes.forEach(uD),this.nodes.forEach(aD)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,this.root=_?_.root||_:this,this.path=_?[..._.path,_]:[],this.parent=_,this.depth=_?_.depth+1:0;for(let b=0;b<this.path.length;b++)this.path[b].shouldResetTransform=!0;this.root===this&&(this.nodes=new JP)}addEventListener(f,_){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new qd),this.eventHandlers.get(f).add(_)}notifyListeners(f,..._){const b=this.eventHandlers.get(f);b&&b.notify(..._)}hasListeners(f){return this.eventHandlers.has(f)}mount(f){if(this.instance)return;this.isSVG=hh(f)&&!rP(f),this.instance=f;const{layoutId:_,layout:b,visualElement:v}=this.options;if(v&&!v.current&&v.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(b||_)&&(this.isLayoutDirty=!0),a){let w,E=0;const A=()=>this.root.updateBlockedByResize=!1;qe.read(()=>{E=window.innerWidth}),a(f,()=>{const R=window.innerWidth;R!==E&&(E=R,this.root.updateBlockedByResize=!0,w&&w(),w=QP(A,250),il.hasAnimatedSinceResize&&(il.hasAnimatedSinceResize=!1,this.nodes.forEach(u0)))})}_&&this.root.registerSharedNode(_,this),this.options.animate!==!1&&v&&(_||b)&&this.addEventListener("didUpdate",({delta:w,hasLayoutChanged:E,hasRelativeLayoutChanged:A,layout:R})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const P=this.options.transition||v.getDefaultTransition()||mD,{onLayoutAnimationStart:j,onLayoutAnimationComplete:M}=v.getProps(),B=!this.targetLayout||!ES(this.targetLayout,R),Y=!E&&A;if(this.options.layoutRoot||this.resumeFrom||Y||E&&(B||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const H={...ih(P,"layout"),onPlay:j,onComplete:M};(v.shouldReduceMotion||this.options.layoutRoot)&&(H.delay=0,H.type=!1),this.startAnimation(H),this.setAnimationOrigin(w,Y)}else E||u0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=R})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ps(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(dD),this.animationId++)}getTransformTemplate(){const{visualElement:f}=this.options;return f&&f.getProps().transformTemplate}willUpdate(f=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&AS(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let w=0;w<this.path.length;w++){const E=this.path[w];E.shouldResetTransform=!0,(typeof E.latestValues.x=="string"||typeof E.latestValues.y=="string")&&(E.isLayoutDirty=!0),E.updateScroll("snapshot"),E.options.layoutRoot&&E.willUpdate(!1)}const{layoutId:_,layout:b}=this.options;if(_===void 0&&!b)return;const v=this.getTransformTemplate();this.prevTransformTemplateValue=v?v(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(l0);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(c0);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(lD),this.nodes.forEach(sD),this.nodes.forEach(rD)):this.nodes.forEach(c0),this.clearAllSnapshots();const _=Mt.now();Ct.delta=Yn(0,1e3/60,_-Ct.timestamp),Ct.timestamp=_,Ct.isProcessing=!0,Gu.update.process(Ct),Gu.preRender.process(Ct),Gu.render.process(Ct),Ct.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,uh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(oD),this.sharedNodes.forEach(hD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,qe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){qe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ft(this.snapshot.measuredBox.x)&&!Ft(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let b=0;b<this.path.length;b++)this.path[b].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=bt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:_}=this.options;_&&_.notify("LayoutMeasure",this.layout.layoutBox,f?f.layoutBox:void 0)}updateScroll(f="measure"){let _=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(_=!1),_&&this.instance){const b=u(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:b,offset:l(this.instance),wasRoot:this.scroll?this.scroll.isRoot:b}}}resetTransform(){if(!h)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,_=this.projectionDelta&&!xS(this.projectionDelta),b=this.getTransformTemplate(),v=b?b(this.latestValues,""):void 0,w=v!==this.prevTransformTemplateValue;f&&this.instance&&(_||lr(this.latestValues)||w)&&(h(this.instance,v),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const _=this.measurePageBox();let b=this.removeElementScroll(_);return f&&(b=this.removeTransform(b)),gD(b),{animationId:this.root.animationId,measuredBox:_,layoutBox:b,latestValues:{},source:this.id}}measurePageBox(){var v;const{visualElement:f}=this.options;if(!f)return bt();const _=f.measureViewportBox();if(!(((v=this.scroll)==null?void 0:v.wasRoot)||this.path.some(yD))){const{scroll:w}=this.root;w&&(ri(_.x,w.offset.x),ri(_.y,w.offset.y))}return _}removeElementScroll(f){var b;const _=bt();if(kn(_,f),(b=this.scroll)!=null&&b.wasRoot)return _;for(let v=0;v<this.path.length;v++){const w=this.path[v],{scroll:E,options:A}=w;w!==this.root&&E&&A.layoutScroll&&(E.wasRoot&&kn(_,f),ri(_.x,E.offset.x),ri(_.y,E.offset.y))}return _}applyTransform(f,_=!1){var v,w;const b=bt();kn(b,f);for(let E=0;E<this.path.length;E++){const A=this.path[E];!_&&A.options.layoutScroll&&A.scroll&&A!==A.root&&ii(b,{x:-A.scroll.offset.x,y:-A.scroll.offset.y}),lr(A.latestValues)&&ii(b,A.latestValues,(v=A.layout)==null?void 0:v.layoutBox)}return lr(this.latestValues)&&ii(b,this.latestValues,(w=this.layout)==null?void 0:w.layoutBox),b}removeTransform(f){var b;const _=bt();kn(_,f);for(let v=0;v<this.path.length;v++){const w=this.path[v];if(!lr(w.latestValues))continue;let E;w.instance&&(Bd(w.latestValues)&&w.updateSnapshot(),E=bt(),kn(E,w.measurePageBox())),Q2(_,w.latestValues,(b=w.snapshot)==null?void 0:b.layoutBox,E)}return lr(this.latestValues)&&Q2(_,this.latestValues),_}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ct.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!1){var R;const _=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=_.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=_.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=_.isSharedProjectionDirty);const b=!!this.resumingFrom||this!==_;if(!(f||b&&this.isSharedProjectionDirty||this.isProjectionDirty||(R=this.parent)!=null&&R.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:w,layoutId:E}=this.options;if(!this.layout||!(w||E))return;this.resolvedRelativeTargetAt=Ct.timestamp;const A=this.getClosestProjectingParent();A&&this.linkedParentVersion!==A.layoutVersion&&!A.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(A&&A.layout?this.createRelativeTarget(A,this.layout.layoutBox,A.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=bt(),this.targetWithTransforms=bt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),UP(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):kn(this.target,this.layout.layoutBox),dS(this.target,this.targetDelta)):kn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,A&&!!A.resumingFrom==!!this.resumingFrom&&!A.options.layoutScroll&&A.target&&this.animationProgress!==1?this.createRelativeTarget(A,this.target,A.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Bd(this.parent.latestValues)||uS(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(f,_,b){this.relativeParent=f,this.linkedParentVersion=f.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=bt(),this.relativeTargetOrigin=bt(),ml(this.relativeTargetOrigin,_,b),kn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var P;const f=this.getLead(),_=!!this.resumingFrom||this!==f;let b=!0;if((this.isProjectionDirty||(P=this.parent)!=null&&P.isProjectionDirty)&&(b=!1),_&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(b=!1),this.resolvedRelativeTargetAt===Ct.timestamp&&(b=!1),b)return;const{layout:v,layoutId:w}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(v||w))return;kn(this.layoutCorrected,this.layout.layoutBox);const E=this.treeScale.x,A=this.treeScale.y;mP(this.layoutCorrected,this.treeScale,this.path,_),f.layout&&!f.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(f.target=f.layout.layoutBox,f.targetWithTransforms=bt());const{target:R}=f;if(!R){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(G2(this.prevProjectionDelta.x,this.projectionDelta.x),G2(this.prevProjectionDelta.y,this.projectionDelta.y)),Ea(this.projectionDelta,this.layoutCorrected,R,this.latestValues),(this.treeScale.x!==E||this.treeScale.y!==A||!r0(this.projectionDelta.x,this.prevProjectionDelta.x)||!r0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",R))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){var _;if((_=this.options.visualElement)==null||_.scheduleRender(),f){const b=this.getStack();b&&b.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=si(),this.projectionDelta=si(),this.projectionDeltaWithTransform=si()}setAnimationOrigin(f,_=!1){const b=this.snapshot,v=b?b.latestValues:{},w={...this.latestValues},E=si();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!_;const A=bt(),R=b?b.source:void 0,P=this.layout?this.layout.source:void 0,j=R!==P,M=this.getStack(),B=!M||M.members.length<=1,Y=!!(j&&!B&&this.options.crossfade===!0&&!this.path.some(fD));this.animationProgress=0;let H;this.mixTargetDelta=Z=>{const re=Z/1e3;d0(E.x,f.x,re),d0(E.y,f.y,re),this.setTargetDelta(E),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ml(A,this.layout.layoutBox,this.relativeParent.layout.layoutBox),pD(this.relativeTarget,this.relativeTargetOrigin,A,re),H&&WP(this.relativeTarget,H)&&(this.isProjectionDirty=!1),H||(H=bt()),kn(H,this.relativeTarget)),j&&(this.animationValues=w,GP(w,v,this.latestValues,re,Y,B)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=re},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(f){var _,b,v;this.notifyListeners("animationStart"),(_=this.currentAnimation)==null||_.stop(),(v=(b=this.resumingFrom)==null?void 0:b.currentAnimation)==null||v.stop(),this.pendingAnimation&&(Ps(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=qe.update(()=>{il.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ui(0)),this.motionValue.jump(0,!1),this.currentAnimation=ZP(this.motionValue,[0,1e3],{...f,velocity:0,isSync:!0,onUpdate:w=>{this.mixTargetDelta(w),f.onUpdate&&f.onUpdate(w)},onStop:()=>{},onComplete:()=>{f.onComplete&&f.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(tD),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:_,target:b,layout:v,latestValues:w}=f;if(!(!_||!b||!v)){if(this!==f&&this.layout&&v&&IS(this.options.animationType,this.layout.layoutBox,v.layoutBox)){b=this.target||bt();const E=Ft(this.layout.layoutBox.x);b.x.min=f.target.x.min,b.x.max=b.x.min+E;const A=Ft(this.layout.layoutBox.y);b.y.min=f.target.y.min,b.y.max=b.y.min+A}kn(_,b),ii(_,w),Ea(this.projectionDeltaWithTransform,this.layoutCorrected,_,w)}}registerSharedNode(f,_){this.sharedNodes.has(f)||this.sharedNodes.set(f,new eD),this.sharedNodes.get(f).add(_);const v=_.options.initialPromotionConfig;_.promote({transition:v?v.transition:void 0,preserveFollowOpacity:v&&v.shouldPreserveFollowOpacity?v.shouldPreserveFollowOpacity(_):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){var _;const{layoutId:f}=this.options;return f?((_=this.getStack())==null?void 0:_.lead)||this:this}getPrevLead(){var _;const{layoutId:f}=this.options;return f?(_=this.getStack())==null?void 0:_.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:_,preserveFollowOpacity:b}={}){const v=this.getStack();v&&v.promote(this,b),f&&(this.projectionDelta=void 0,this.needsReset=!0),_&&this.setOptions({transition:_})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let _=!1;const{latestValues:b}=f;if((b.z||b.rotate||b.rotateX||b.rotateY||b.rotateZ||b.skewX||b.skewY)&&(_=!0),!_)return;const v={};b.z&&nd("z",f,v,this.animationValues);for(let w=0;w<td.length;w++)nd(`rotate${td[w]}`,f,v,this.animationValues),nd(`skew${td[w]}`,f,v,this.animationValues);f.render();for(const w in v)f.setStaticValue(w,v[w]),this.animationValues&&(this.animationValues[w]=v[w]);f.scheduleRender()}applyProjectionStyles(f,_){if(!this.instance||this.isSVG)return;if(!this.isVisible){f.visibility="hidden";return}const b=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,f.visibility="",f.opacity="",f.pointerEvents=rl(_==null?void 0:_.pointerEvents)||"",f.transform=b?b(this.latestValues,""):"none";return}const v=this.getLead();if(!this.projectionDelta||!this.layout||!v.target){this.options.layoutId&&(f.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,f.pointerEvents=rl(_==null?void 0:_.pointerEvents)||""),this.hasProjected&&!lr(this.latestValues)&&(f.transform=b?b({},""):"none",this.hasProjected=!1);return}f.visibility="";const w=v.animationValues||v.latestValues;this.applyTransformsToTarget();let E=zP(this.projectionDeltaWithTransform,this.treeScale,w);b&&(E=b(w,E)),f.transform=E;const{x:A,y:R}=this.projectionDelta;f.transformOrigin=`${A.origin*100}% ${R.origin*100}% 0`,v.animationValues?f.opacity=v===this?w.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:w.opacityExit:f.opacity=v===this?w.opacity!==void 0?w.opacity:"":w.opacityExit!==void 0?w.opacityExit:0;for(const P in Md){if(w[P]===void 0)continue;const{correct:j,applyTo:M,isCSSVariable:B}=Md[P],Y=E==="none"?w[P]:j(w[P],v);if(M){const H=M.length;for(let Z=0;Z<H;Z++)f[M[Z]]=Y}else B?this.options.visualElement.renderState.vars[P]=Y:f[P]=Y}this.options.layoutId&&(f.pointerEvents=v===this?rl(_==null?void 0:_.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>{var _;return(_=f.currentAnimation)==null?void 0:_.stop()}),this.root.nodes.forEach(l0),this.root.sharedNodes.clear()}}}function sD(a){a.updateLayout()}function rD(a){var l;const i=((l=a.resumeFrom)==null?void 0:l.snapshot)||a.snapshot;if(a.isLead()&&a.layout&&i&&a.hasListeners("didUpdate")){const{layoutBox:u,measuredBox:h}=a.layout,{animationType:m}=a.options,f=i.source!==a.layout.source;m==="size"?Gn(E=>{const A=f?i.measuredBox[E]:i.layoutBox[E],R=Ft(A);A.min=u[E].min,A.max=A.min+R}):IS(m,i.layoutBox,u)&&Gn(E=>{const A=f?i.measuredBox[E]:i.layoutBox[E],R=Ft(u[E]);A.max=A.min+R,a.relativeTarget&&!a.currentAnimation&&(a.isProjectionDirty=!0,a.relativeTarget[E].max=a.relativeTarget[E].min+R)});const _=si();Ea(_,u,i.layoutBox);const b=si();f?Ea(b,a.applyTransform(h,!0),i.measuredBox):Ea(b,u,i.layoutBox);const v=!xS(_);let w=!1;if(!a.resumeFrom){const E=a.getClosestProjectingParent();if(E&&!E.resumeFrom){const{snapshot:A,layout:R}=E;if(A&&R){const P=bt();ml(P,i.layoutBox,A.layoutBox);const j=bt();ml(j,u,R.layoutBox),ES(P,j)||(w=!0),E.options.layoutRoot&&(a.relativeTarget=j,a.relativeTargetOrigin=P,a.relativeParent=E)}}}a.notifyListeners("didUpdate",{layout:u,snapshot:i,delta:b,layoutDelta:_,hasLayoutChanged:v,hasRelativeLayoutChanged:w})}else if(a.isLead()){const{onExitComplete:u}=a.options;u&&u()}a.options.transition=void 0}function iD(a){a.parent&&(a.isProjecting()||(a.isProjectionDirty=a.parent.isProjectionDirty),a.isSharedProjectionDirty||(a.isSharedProjectionDirty=!!(a.isProjectionDirty||a.parent.isProjectionDirty||a.parent.isSharedProjectionDirty)),a.isTransformDirty||(a.isTransformDirty=a.parent.isTransformDirty))}function aD(a){a.isProjectionDirty=a.isSharedProjectionDirty=a.isTransformDirty=!1}function oD(a){a.clearSnapshot()}function l0(a){a.clearMeasurements()}function c0(a){a.isLayoutDirty=!1}function lD(a){const{visualElement:i}=a.options;i&&i.getProps().onBeforeLayoutMeasure&&i.notify("BeforeLayoutMeasure"),a.resetTransform()}function u0(a){a.finishAnimation(),a.targetDelta=a.relativeTarget=a.target=void 0,a.isProjectionDirty=!0}function cD(a){a.resolveTargetDelta()}function uD(a){a.calcProjection()}function dD(a){a.resetSkewAndRotation()}function hD(a){a.removeLeadSnapshot()}function d0(a,i,l){a.translate=rt(i.translate,0,l),a.scale=rt(i.scale,1,l),a.origin=i.origin,a.originPoint=i.originPoint}function h0(a,i,l,u){a.min=rt(i.min,l.min,u),a.max=rt(i.max,l.max,u)}function pD(a,i,l,u){h0(a.x,i.x,l.x,u),h0(a.y,i.y,l.y,u)}function fD(a){return a.animationValues&&a.animationValues.opacityExit!==void 0}const mD={duration:.45,ease:[.4,0,.1,1]},p0=a=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(a),f0=p0("applewebkit/")&&!p0("chrome/")?Math.round:vn;function m0(a){a.min=f0(a.min),a.max=f0(a.max)}function gD(a){m0(a.x),m0(a.y)}function IS(a,i,l){return a==="position"||a==="preserve-aspect"&&!$P(s0(i),s0(l),.2)}function yD(a){var i;return a!==a.root&&((i=a.scroll)==null?void 0:i.wasRoot)}const _D=TS({attachResizeListener:(a,i)=>Ia(a,"resize",i),measureScroll:()=>{var a,i;return{x:document.documentElement.scrollLeft||((a=document.body)==null?void 0:a.scrollLeft)||0,y:document.documentElement.scrollTop||((i=document.body)==null?void 0:i.scrollTop)||0}},checkIsScrollRoot:()=>!0}),sd={current:void 0},RS=TS({measureScroll:a=>({x:a.scrollLeft,y:a.scrollTop}),defaultParent:()=>{if(!sd.current){const a=new _D({});a.mount(window),a.setOptions({layoutScroll:!0}),sd.current=a}return sd.current},resetTransform:(a,i)=>{a.style.transform=i!==void 0?i:"none"},checkIsScrollRoot:a=>window.getComputedStyle(a).position==="fixed"}),PS=q.createContext({transformPagePoint:a=>a,isStatic:!1,reducedMotion:"never"});function bD(a=!0){const i=q.useContext(Wd);if(i===null)return[!0,null];const{isPresent:l,onExitComplete:u,register:h}=i,m=q.useId();q.useEffect(()=>{if(a)return h(m)},[a]);const f=q.useCallback(()=>a&&u&&u(m),[m,u,a]);return!l&&u?[!1,f]:[!0]}const DS=q.createContext({strict:!1}),g0={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let y0=!1;function vD(){if(y0)return;const a={};for(const i in g0)a[i]={isEnabled:l=>g0[i].some(u=>!!l[u])};oS(a),y0=!0}function OS(){return vD(),dP()}function wD(a){const i=OS();for(const l in a)i[l]={...i[l],...a[l]};oS(i)}const SD=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function gl(a){return a.startsWith("while")||a.startsWith("drag")&&a!=="draggable"||a.startsWith("layout")||a.startsWith("onTap")||a.startsWith("onPan")||a.startsWith("onLayout")||SD.has(a)}let NS=a=>!gl(a);function xD(a){typeof a=="function"&&(NS=i=>i.startsWith("on")?!gl(i):a(i))}try{xD(require("@emotion/is-prop-valid").default)}catch{}function ED(a,i,l){const u={};for(const h in a)h==="values"&&typeof a.values=="object"||(NS(h)||l===!0&&gl(h)||!i&&!gl(h)||a.draggable&&h.startsWith("onDrag"))&&(u[h]=a[h]);return u}const vl=q.createContext({});function kD(a,i){if(bl(a)){const{initial:l,animate:u}=a;return{initial:l===!1||Ta(l)?l:void 0,animate:Ta(u)?u:void 0}}return a.inherit!==!1?i:{}}function CD(a){const{initial:i,animate:l}=kD(a,q.useContext(vl));return q.useMemo(()=>({initial:i,animate:l}),[_0(i),_0(l)])}function _0(a){return Array.isArray(a)?a.join(" "):a}const yh=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function BS(a,i,l){for(const u in i)!Pt(i[u])&&!fS(u,l)&&(a[u]=i[u])}function AD({transformTemplate:a},i){return q.useMemo(()=>{const l=yh();return mh(l,i,a),Object.assign({},l.vars,l.style)},[i])}function TD(a,i){const l=a.style||{},u={};return BS(u,l,a),Object.assign(u,AD(a,i)),u}function ID(a,i){const l={},u=TD(a,i);return a.drag&&a.dragListener!==!1&&(l.draggable=!1,u.userSelect=u.WebkitUserSelect=u.WebkitTouchCallout="none",u.touchAction=a.drag===!0?"none":`pan-${a.drag==="x"?"y":"x"}`),a.tabIndex===void 0&&(a.onTap||a.onTapStart||a.whileTap)&&(l.tabIndex=0),l.style=u,l}const LS=()=>({...yh(),attrs:{}});function RD(a,i,l,u){const h=q.useMemo(()=>{const m=LS();return mS(m,i,yS(u),a.transformTemplate,a.style),{...m.attrs,style:{...m.style}}},[i]);if(a.style){const m={};BS(m,a.style,a),h.style={...m,...h.style}}return h}const PD=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function _h(a){return typeof a!="string"||a.includes("-")?!1:!!(PD.indexOf(a)>-1||/[A-Z]/u.test(a))}function DD(a,i,l,{latestValues:u},h,m=!1,f){const b=(f??_h(a)?RD:ID)(i,u,h,a),v=ED(i,typeof a=="string",m),w=a!==q.Fragment?{...v,...b,ref:l}:{},{children:E}=i,A=q.useMemo(()=>Pt(E)?E.get():E,[E]);return q.createElement(a,{...w,children:A})}function OD({scrapeMotionValuesFromProps:a,createRenderState:i},l,u,h){return{latestValues:ND(l,u,h,a),renderState:i()}}function ND(a,i,l,u){const h={},m=u(a,{});for(const A in m)h[A]=rl(m[A]);let{initial:f,animate:_}=a;const b=bl(a),v=iS(a);i&&v&&!b&&a.inherit!==!1&&(f===void 0&&(f=i.initial),_===void 0&&(_=i.animate));let w=l?l.initial===!1:!1;w=w||f===!1;const E=w?_:f;if(E&&typeof E!="boolean"&&!_l(E)){const A=Array.isArray(E)?E:[E];for(let R=0;R<A.length;R++){const P=oh(a,A[R]);if(P){const{transitionEnd:j,transition:M,...B}=P;for(const Y in B){let H=B[Y];if(Array.isArray(H)){const Z=w?H.length-1:0;H=H[Z]}H!==null&&(h[Y]=H)}for(const Y in j)h[Y]=j[Y]}}}return h}const MS=a=>(i,l)=>{const u=q.useContext(vl),h=q.useContext(Wd),m=()=>OD(a,i,u,h);return l?m():OT(m)},BD=MS({scrapeMotionValuesFromProps:gh,createRenderState:yh}),LD=MS({scrapeMotionValuesFromProps:_S,createRenderState:LS}),MD=Symbol.for("motionComponentSymbol");function FD(a,i,l){const u=q.useRef(l);q.useInsertionEffect(()=>{u.current=l});const h=q.useRef(null);return q.useCallback(m=>{var _;m&&((_=a.onMount)==null||_.call(a,m));const f=u.current;if(typeof f=="function")if(m){const b=f(m);typeof b=="function"&&(h.current=b)}else h.current?(h.current(),h.current=null):f(m);else f&&(f.current=m);i&&(m?i.mount(m):i.unmount())},[i])}const FS=q.createContext({});function Qr(a){return a&&typeof a=="object"&&Object.prototype.hasOwnProperty.call(a,"current")}function $D(a,i,l,u,h,m){var H,Z;const{visualElement:f}=q.useContext(vl),_=q.useContext(DS),b=q.useContext(Wd),v=q.useContext(PS),w=v.reducedMotion,E=v.skipAnimations,A=q.useRef(null),R=q.useRef(!1);u=u||_.renderer,!A.current&&u&&(A.current=u(a,{visualState:i,parent:f,props:l,presenceContext:b,blockInitialAnimation:b?b.initial===!1:!1,reducedMotionConfig:w,skipAnimations:E,isSVG:m}),R.current&&A.current&&(A.current.manuallyAnimateOnMount=!0));const P=A.current,j=q.useContext(FS);P&&!P.projection&&h&&(P.type==="html"||P.type==="svg")&&UD(A.current,l,h,j);const M=q.useRef(!1);q.useInsertionEffect(()=>{P&&M.current&&P.update(l,b)});const B=l[qw],Y=q.useRef(!!B&&typeof window<"u"&&!((H=window.MotionHandoffIsComplete)!=null&&H.call(window,B))&&((Z=window.MotionHasOptimisedAnimation)==null?void 0:Z.call(window,B)));return BT(()=>{R.current=!0,P&&(M.current=!0,window.MotionIsMounted=!0,P.updateFeatures(),P.scheduleRenderMicrotask(),Y.current&&P.animationState&&P.animationState.animateChanges())}),q.useEffect(()=>{P&&(!Y.current&&P.animationState&&P.animationState.animateChanges(),Y.current&&(queueMicrotask(()=>{var re;(re=window.MotionHandoffMarkAsComplete)==null||re.call(window,B)}),Y.current=!1),P.enteringChildren=void 0)}),P}function UD(a,i,l,u){const{layoutId:h,layout:m,drag:f,dragConstraints:_,layoutScroll:b,layoutRoot:v,layoutCrossfade:w}=i;a.projection=new l(a.latestValues,i["data-framer-portal-id"]?void 0:$S(a.parent)),a.projection.setOptions({layoutId:h,layout:m,alwaysMeasureLayout:!!f||_&&Qr(_),visualElement:a,animationType:typeof m=="string"?m:"both",initialPromotionConfig:u,crossfade:w,layoutScroll:b,layoutRoot:v})}function $S(a){if(a)return a.options.allowProjection!==!1?a.projection:$S(a.parent)}function rd(a,{forwardMotionProps:i=!1,type:l}={},u,h){u&&wD(u);const m=l?l==="svg":_h(a),f=m?LD:BD;function _(v,w){let E;const A={...q.useContext(PS),...v,layoutId:jD(v)},{isStatic:R}=A,P=CD(v),j=f(v,R);if(!R&&typeof window<"u"){VD(A,u);const M=HD(A);E=M.MeasureLayout,P.visualElement=$D(a,j,A,h,M.ProjectionNode,m)}return O.jsxs(vl.Provider,{value:P,children:[E&&P.visualElement?O.jsx(E,{visualElement:P.visualElement,...A}):null,DD(a,v,FD(j,P.visualElement,w),j,R,i,m)]})}_.displayName=`motion.${typeof a=="string"?a:`create(${a.displayName??a.name??""})`}`;const b=q.forwardRef(_);return b[MD]=a,b}function jD({layoutId:a}){const i=q.useContext(iw).id;return i&&a!==void 0?i+"-"+a:a}function VD(a,i){const l=q.useContext(DS).strict;if(process.env.NODE_ENV!=="production"&&i&&l){const u="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";a.ignoreStrict?di(!1,u,"lazy-strict-mode"):cs(!1,u,"lazy-strict-mode")}}function HD(a){const i=OS(),{drag:l,layout:u}=i;if(!l&&!u)return{};const h={...l,...u};return{MeasureLayout:l!=null&&l.isEnabled(a)||u!=null&&u.isEnabled(a)?h.MeasureLayout:void 0,ProjectionNode:h.ProjectionNode}}function WD(a,i){if(typeof Proxy>"u")return rd;const l=new Map,u=(m,f)=>rd(m,f,a,i),h=(m,f)=>(process.env.NODE_ENV!=="production"&&Gd(!1,"motion() is deprecated. Use motion.create() instead."),u(m,f));return new Proxy(h,{get:(m,f)=>f==="create"?u:(l.has(f)||l.set(f,rd(f,void 0,a,i)),l.get(f))})}const zD=(a,i)=>i.isSVG??_h(a)?new TP(i):new SP(i,{allowProjection:a!==q.Fragment});class qD extends Ds{constructor(i){super(i),i.animationState||(i.animationState=OP(i))}updateAnimationControlsSubscription(){const{animate:i}=this.node.getProps();_l(i)&&(this.unmountControls=i.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:i}=this.node.getProps(),{animate:l}=this.node.prevProps||{};i!==l&&this.updateAnimationControlsSubscription()}unmount(){var i;this.node.animationState.reset(),(i=this.unmountControls)==null||i.call(this)}}let GD=0;class KD extends Ds{constructor(){super(...arguments),this.id=GD++}update(){if(!this.node.presenceContext)return;const{isPresent:i,onExitComplete:l}=this.node.presenceContext,{isPresent:u}=this.node.prevPresenceContext||{};if(!this.node.animationState||i===u)return;const h=this.node.animationState.setActive("exit",!i);l&&!i&&h.then(()=>{l(this.id)})}mount(){const{register:i,onExitComplete:l}=this.node.presenceContext||{};l&&l(this.id),i&&(this.unmount=i(this.id))}unmount(){}}const YD={animation:{Feature:qD},exit:{Feature:KD}};function Na(a){return{point:{x:a.pageX,y:a.pageY}}}const ZD=a=>i=>dh(i)&&a(i,Na(i));function ka(a,i,l,u){return Ia(a,i,ZD(l),u)}const US=({current:a})=>a?a.ownerDocument.defaultView:null,b0=(a,i)=>Math.abs(a-i);function XD(a,i){const l=b0(a.x,i.x),u=b0(a.y,i.y);return Math.sqrt(l**2+u**2)}const v0=new Set(["auto","scroll"]);class jS{constructor(i,l,{transformPagePoint:u,contextWindow:h=window,dragSnapToOrigin:m=!1,distanceThreshold:f=3,element:_}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=R=>{this.handleScroll(R.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Go(this.lastRawMoveEventInfo,this.transformPagePoint));const R=id(this.lastMoveEventInfo,this.history),P=this.startEvent!==null,j=XD(R.offset,{x:0,y:0})>=this.distanceThreshold;if(!P&&!j)return;const{point:M}=R,{timestamp:B}=Ct;this.history.push({...M,timestamp:B});const{onStart:Y,onMove:H}=this.handlers;P||(Y&&Y(this.lastMoveEvent,R),this.startEvent=this.lastMoveEvent),H&&H(this.lastMoveEvent,R)},this.handlePointerMove=(R,P)=>{this.lastMoveEvent=R,this.lastRawMoveEventInfo=P,this.lastMoveEventInfo=Go(P,this.transformPagePoint),qe.update(this.updatePoint,!0)},this.handlePointerUp=(R,P)=>{this.end();const{onEnd:j,onSessionEnd:M,resumeAnimation:B}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&B&&B(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const Y=id(R.type==="pointercancel"?this.lastMoveEventInfo:Go(P,this.transformPagePoint),this.history);this.startEvent&&j&&j(R,Y),M&&M(R,Y)},!dh(i))return;this.dragSnapToOrigin=m,this.handlers=l,this.transformPagePoint=u,this.distanceThreshold=f,this.contextWindow=h||window;const b=Na(i),v=Go(b,this.transformPagePoint),{point:w}=v,{timestamp:E}=Ct;this.history=[{...w,timestamp:E}];const{onSessionStart:A}=l;A&&A(i,id(v,this.history)),this.removeListeners=Pa(ka(this.contextWindow,"pointermove",this.handlePointerMove),ka(this.contextWindow,"pointerup",this.handlePointerUp),ka(this.contextWindow,"pointercancel",this.handlePointerUp)),_&&this.startScrollTracking(_)}startScrollTracking(i){let l=i.parentElement;for(;l;){const u=getComputedStyle(l);(v0.has(u.overflowX)||v0.has(u.overflowY))&&this.scrollPositions.set(l,{x:l.scrollLeft,y:l.scrollTop}),l=l.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(i){const l=this.scrollPositions.get(i);if(!l)return;const u=i===window,h=u?{x:window.scrollX,y:window.scrollY}:{x:i.scrollLeft,y:i.scrollTop},m={x:h.x-l.x,y:h.y-l.y};m.x===0&&m.y===0||(u?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=m.x,this.lastMoveEventInfo.point.y+=m.y):this.history.length>0&&(this.history[0].x-=m.x,this.history[0].y-=m.y),this.scrollPositions.set(i,h),qe.update(this.updatePoint,!0))}updateHandlers(i){this.handlers=i}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ps(this.updatePoint)}}function Go(a,i){return i?{point:i(a.point)}:a}function w0(a,i){return{x:a.x-i.x,y:a.y-i.y}}function id({point:a},i){return{point:a,delta:w0(a,VS(i)),offset:w0(a,JD(i)),velocity:QD(i,.1)}}function JD(a){return a[0]}function VS(a){return a[a.length-1]}function QD(a,i){if(a.length<2)return{x:0,y:0};let l=a.length-1,u=null;const h=VS(a);for(;l>=0&&(u=a[l],!(h.timestamp-u.timestamp>Wt(i)));)l--;if(!u)return{x:0,y:0};u===a[0]&&a.length>2&&h.timestamp-u.timestamp>Wt(i)*2&&(u=a[1]);const m=bn(h.timestamp-u.timestamp);if(m===0)return{x:0,y:0};const f={x:(h.x-u.x)/m,y:(h.y-u.y)/m};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}function eO(a,{min:i,max:l},u){return i!==void 0&&a<i?a=u?rt(i,a,u.min):Math.max(a,i):l!==void 0&&a>l&&(a=u?rt(l,a,u.max):Math.min(a,l)),a}function S0(a,i,l){return{min:i!==void 0?a.min+i:void 0,max:l!==void 0?a.max+l-(a.max-a.min):void 0}}function tO(a,{top:i,left:l,bottom:u,right:h}){return{x:S0(a.x,l,h),y:S0(a.y,i,u)}}function x0(a,i){let l=i.min-a.min,u=i.max-a.max;return i.max-i.min<a.max-a.min&&([l,u]=[u,l]),{min:l,max:u}}function nO(a,i){return{x:x0(a.x,i.x),y:x0(a.y,i.y)}}function sO(a,i){let l=.5;const u=Ft(a),h=Ft(i);return h>u?l=Ca(i.min,i.max-u,a.min):u>h&&(l=Ca(a.min,a.max-h,i.min)),Yn(0,1,l)}function rO(a,i){const l={};return i.min!==void 0&&(l.min=i.min-a.min),i.max!==void 0&&(l.max=i.max-a.min),l}const Fd=.35;function iO(a=Fd){return a===!1?a=0:a===!0&&(a=Fd),{x:E0(a,"left","right"),y:E0(a,"top","bottom")}}function E0(a,i,l){return{min:k0(a,i),max:k0(a,l)}}function k0(a,i){return typeof a=="number"?a:a[i]||0}const aO=new WeakMap;class oO{constructor(i){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=bt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=i}start(i,{snapToCursor:l=!1,distanceThreshold:u}={}){const{presenceContext:h}=this.visualElement;if(h&&h.isPresent===!1)return;const m=E=>{l&&this.snapToCursor(Na(E).point),this.stopAnimation()},f=(E,A)=>{const{drag:R,dragPropagation:P,onDragStart:j}=this.getProps();if(R&&!P&&(this.openDragLock&&this.openDragLock(),this.openDragLock=jR(R),!this.openDragLock))return;this.latestPointerEvent=E,this.latestPanInfo=A,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Gn(B=>{let Y=this.getAxisMotionValue(B).get()||0;if(Kn.test(Y)){const{projection:H}=this.visualElement;if(H&&H.layout){const Z=H.layout.layoutBox[B];Z&&(Y=Ft(Z)*(parseFloat(Y)/100))}}this.originPoint[B]=Y}),j&&qe.update(()=>j(E,A),!1,!0),Rd(this.visualElement,"transform");const{animationState:M}=this.visualElement;M&&M.setActive("whileDrag",!0)},_=(E,A)=>{this.latestPointerEvent=E,this.latestPanInfo=A;const{dragPropagation:R,dragDirectionLock:P,onDirectionLock:j,onDrag:M}=this.getProps();if(!R&&!this.openDragLock)return;const{offset:B}=A;if(P&&this.currentDirection===null){this.currentDirection=cO(B),this.currentDirection!==null&&j&&j(this.currentDirection);return}this.updateAxis("x",A.point,B),this.updateAxis("y",A.point,B),this.visualElement.render(),M&&qe.update(()=>M(E,A),!1,!0)},b=(E,A)=>{this.latestPointerEvent=E,this.latestPanInfo=A,this.stop(E,A),this.latestPointerEvent=null,this.latestPanInfo=null},v=()=>{const{dragSnapToOrigin:E}=this.getProps();(E||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:w}=this.getProps();this.panSession=new jS(i,{onSessionStart:m,onStart:f,onMove:_,onSessionEnd:b,resumeAnimation:v},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:w,distanceThreshold:u,contextWindow:US(this.visualElement),element:this.visualElement.current})}stop(i,l){const u=i||this.latestPointerEvent,h=l||this.latestPanInfo,m=this.isDragging;if(this.cancel(),!m||!h||!u)return;const{velocity:f}=h;this.startAnimation(f);const{onDragEnd:_}=this.getProps();_&&qe.postRender(()=>_(u,h))}cancel(){this.isDragging=!1;const{projection:i,animationState:l}=this.visualElement;i&&(i.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:u}=this.getProps();!u&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),l&&l.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(i,l,u){const{drag:h}=this.getProps();if(!u||!Ko(i,h,this.currentDirection))return;const m=this.getAxisMotionValue(i);let f=this.originPoint[i]+u[i];this.constraints&&this.constraints[i]&&(f=eO(f,this.constraints[i],this.elastic[i])),m.set(f)}resolveConstraints(){var m;const{dragConstraints:i,dragElastic:l}=this.getProps(),u=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(m=this.visualElement.projection)==null?void 0:m.layout,h=this.constraints;i&&Qr(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&u?this.constraints=tO(u.layoutBox,i):this.constraints=!1,this.elastic=iO(l),h!==this.constraints&&!Qr(i)&&u&&this.constraints&&!this.hasMutatedConstraints&&Gn(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=rO(u.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:i,onMeasureDragConstraints:l}=this.getProps();if(!i||!Qr(i))return!1;const u=i.current;cs(u!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:h}=this.visualElement;if(!h||!h.layout)return!1;const m=gP(u,h.root,this.visualElement.getTransformPagePoint());let f=nO(h.layout.layoutBox,m);if(l){const _=l(pP(f));this.hasMutatedConstraints=!!_,_&&(f=cS(_))}return f}startAnimation(i){const{drag:l,dragMomentum:u,dragElastic:h,dragTransition:m,dragSnapToOrigin:f,onDragTransitionEnd:_}=this.getProps(),b=this.constraints||{},v=Gn(w=>{if(!Ko(w,l,this.currentDirection))return;let E=b&&b[w]||{};f&&(E={min:0,max:0});const A=h?200:1e6,R=h?40:1e7,P={type:"inertia",velocity:u?i[w]:0,bounceStiffness:A,bounceDamping:R,timeConstant:750,restDelta:1,restSpeed:10,...m,...E};return this.startAxisValueAnimation(w,P)});return Promise.all(v).then(_)}startAxisValueAnimation(i,l){const u=this.getAxisMotionValue(i);return Rd(this.visualElement,i),u.start(ah(i,u,0,l,this.visualElement,!1))}stopAnimation(){Gn(i=>this.getAxisMotionValue(i).stop())}getAxisMotionValue(i){const l=`_drag${i.toUpperCase()}`,u=this.visualElement.getProps(),h=u[l];return h||this.visualElement.getValue(i,(u.initial?u.initial[i]:void 0)||0)}snapToCursor(i){Gn(l=>{const{drag:u}=this.getProps();if(!Ko(l,u,this.currentDirection))return;const{projection:h}=this.visualElement,m=this.getAxisMotionValue(l);if(h&&h.layout){const{min:f,max:_}=h.layout.layoutBox[l],b=m.get()||0;m.set(i[l]-rt(f,_,.5)+b)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:i,dragConstraints:l}=this.getProps(),{projection:u}=this.visualElement;if(!Qr(l)||!u||!this.constraints)return;this.stopAnimation();const h={x:0,y:0};Gn(f=>{const _=this.getAxisMotionValue(f);if(_&&this.constraints!==!1){const b=_.get();h[f]=sO({min:b,max:b},this.constraints[f])}});const{transformTemplate:m}=this.visualElement.getProps();this.visualElement.current.style.transform=m?m({},""):"none",u.root&&u.root.updateScroll(),u.updateLayout(),this.constraints=!1,this.resolveConstraints(),Gn(f=>{if(!Ko(f,i,null))return;const _=this.getAxisMotionValue(f),{min:b,max:v}=this.constraints[f];_.set(rt(b,v,h[f]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;aO.set(this.visualElement,this);const i=this.visualElement.current,l=ka(i,"pointerdown",v=>{const{drag:w,dragListener:E=!0}=this.getProps(),A=v.target,R=A!==i&&GR(A);w&&E&&!R&&this.start(v)});let u;const h=()=>{const{dragConstraints:v}=this.getProps();Qr(v)&&v.current&&(this.constraints=this.resolveRefConstraints(),u||(u=lO(i,v.current,()=>this.scalePositionWithinConstraints())))},{projection:m}=this.visualElement,f=m.addEventListener("measure",h);m&&!m.layout&&(m.root&&m.root.updateScroll(),m.updateLayout()),qe.read(h);const _=Ia(window,"resize",()=>this.scalePositionWithinConstraints()),b=m.addEventListener("didUpdate",(({delta:v,hasLayoutChanged:w})=>{this.isDragging&&w&&(Gn(E=>{const A=this.getAxisMotionValue(E);A&&(this.originPoint[E]+=v[E].translate,A.set(A.get()+v[E].translate))}),this.visualElement.render())}));return()=>{_(),l(),f(),b&&b(),u&&u()}}getProps(){const i=this.visualElement.getProps(),{drag:l=!1,dragDirectionLock:u=!1,dragPropagation:h=!1,dragConstraints:m=!1,dragElastic:f=Fd,dragMomentum:_=!0}=i;return{...i,drag:l,dragDirectionLock:u,dragPropagation:h,dragConstraints:m,dragElastic:f,dragMomentum:_}}}function C0(a){let i=!0;return()=>{if(i){i=!1;return}a()}}function lO(a,i,l){const u=N2(a,C0(l)),h=N2(i,C0(l));return()=>{u(),h()}}function Ko(a,i,l){return(i===!0||i===a)&&(l===null||l===a)}function cO(a,i=10){let l=null;return Math.abs(a.y)>i?l="y":Math.abs(a.x)>i&&(l="x"),l}class uO extends Ds{constructor(i){super(i),this.removeGroupControls=vn,this.removeListeners=vn,this.controls=new oO(i)}mount(){const{dragControls:i}=this.node.getProps();i&&(this.removeGroupControls=i.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vn}update(){const{dragControls:i}=this.node.getProps(),{dragControls:l}=this.node.prevProps||{};i!==l&&(this.removeGroupControls(),i&&(this.removeGroupControls=i.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ad=a=>(i,l)=>{a&&qe.update(()=>a(i,l),!1,!0)};class dO extends Ds{constructor(){super(...arguments),this.removePointerDownListener=vn}onPointerDown(i){this.session=new jS(i,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:US(this.node)})}createPanHandlers(){const{onPanSessionStart:i,onPanStart:l,onPan:u,onPanEnd:h}=this.node.getProps();return{onSessionStart:ad(i),onStart:ad(l),onMove:ad(u),onEnd:(m,f)=>{delete this.session,h&&qe.postRender(()=>h(m,f))}}}mount(){this.removePointerDownListener=ka(this.node.current,"pointerdown",i=>this.onPointerDown(i))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let od=!1;class hO extends q.Component{componentDidMount(){const{visualElement:i,layoutGroup:l,switchLayoutGroup:u,layoutId:h}=this.props,{projection:m}=i;m&&(l.group&&l.group.add(m),u&&u.register&&h&&u.register(m),od&&m.root.didUpdate(),m.addEventListener("animationComplete",()=>{this.safeToRemove()}),m.setOptions({...m.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),il.hasEverUpdated=!0}getSnapshotBeforeUpdate(i){const{layoutDependency:l,visualElement:u,drag:h,isPresent:m}=this.props,{projection:f}=u;return f&&(f.isPresent=m,i.layoutDependency!==l&&f.setOptions({...f.options,layoutDependency:l}),od=!0,h||i.layoutDependency!==l||l===void 0||i.isPresent!==m?f.willUpdate():this.safeToRemove(),i.isPresent!==m&&(m?f.promote():f.relegate()||qe.postRender(()=>{const _=f.getStack();(!_||!_.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:i}=this.props.visualElement;i&&(i.root.didUpdate(),uh.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:i,layoutGroup:l,switchLayoutGroup:u}=this.props,{projection:h}=i;od=!0,h&&(h.scheduleCheckAfterUnmount(),l&&l.group&&l.group.remove(h),u&&u.deregister&&u.deregister(h))}safeToRemove(){const{safeToRemove:i}=this.props;i&&i()}render(){return null}}function HS(a){const[i,l]=bD(),u=q.useContext(iw);return O.jsx(hO,{...a,layoutGroup:u,switchLayoutGroup:q.useContext(FS),isPresent:i,safeToRemove:l})}const pO={pan:{Feature:dO},drag:{Feature:uO,ProjectionNode:RS,MeasureLayout:HS}};function A0(a,i,l){const{props:u}=a;a.animationState&&u.whileHover&&a.animationState.setActive("whileHover",l==="Start");const h="onHover"+l,m=u[h];m&&qe.postRender(()=>m(i,Na(i)))}class fO extends Ds{mount(){const{current:i}=this.node;i&&(this.unmount=HR(i,(l,u)=>(A0(this.node,u,"Start"),h=>A0(this.node,h,"End"))))}unmount(){}}class mO extends Ds{constructor(){super(...arguments),this.isActive=!1}onFocus(){let i=!1;try{i=this.node.current.matches(":focus-visible")}catch{i=!0}!i||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Pa(Ia(this.node.current,"focus",()=>this.onFocus()),Ia(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function T0(a,i,l){const{props:u}=a;if(a.current instanceof HTMLButtonElement&&a.current.disabled)return;a.animationState&&u.whileTap&&a.animationState.setActive("whileTap",l==="Start");const h="onTap"+(l==="End"?"":l),m=u[h];m&&qe.postRender(()=>m(i,Na(i)))}class gO extends Ds{mount(){const{current:i}=this.node;if(!i)return;const{globalTapTarget:l,propagate:u}=this.node.props;this.unmount=YR(i,(h,m)=>(T0(this.node,m,"Start"),(f,{success:_})=>T0(this.node,f,_?"End":"Cancel")),{useGlobalTarget:l,stopPropagation:(u==null?void 0:u.tap)===!1})}unmount(){}}const $d=new WeakMap,ld=new WeakMap,yO=a=>{const i=$d.get(a.target);i&&i(a)},_O=a=>{a.forEach(yO)};function bO({root:a,...i}){const l=a||document;ld.has(l)||ld.set(l,{});const u=ld.get(l),h=JSON.stringify(i);return u[h]||(u[h]=new IntersectionObserver(_O,{root:a,...i})),u[h]}function vO(a,i,l){const u=bO(i);return $d.set(a,l),u.observe(a),()=>{$d.delete(a),u.unobserve(a)}}const wO={some:0,all:1};class SO extends Ds{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:i={}}=this.node.getProps(),{root:l,margin:u,amount:h="some",once:m}=i,f={root:l?l.current:void 0,rootMargin:u,threshold:typeof h=="number"?h:wO[h]},_=b=>{const{isIntersecting:v}=b;if(this.isInView===v||(this.isInView=v,m&&!v&&this.hasEnteredView))return;v&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",v);const{onViewportEnter:w,onViewportLeave:E}=this.node.getProps(),A=v?w:E;A&&A(b)};return vO(this.node.current,f,_)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:i,prevProps:l}=this.node;["amount","margin","root"].some(xO(i,l))&&this.startObserver()}unmount(){}}function xO({viewport:a={}},{viewport:i={}}={}){return l=>a[l]!==i[l]}const EO={inView:{Feature:SO},tap:{Feature:gO},focus:{Feature:mO},hover:{Feature:fO}},kO={layout:{ProjectionNode:RS,MeasureLayout:HS}},CO={...YD,...EO,...pO,...kO},Ud=WD(CO,zD),AO={new:"#4ade80",modified:"#fb923c",deleted:"#f87171",unchanged:"transparent"},TO={new:"N",modified:"M",deleted:"D",unchanged:""};function WS(a){var h,m;const i=[],l=new Map,u=Object.keys(a).sort((f,_)=>{const b=f.split("/"),v=_.split("/");for(let w=0;w<Math.min(b.length,v.length);w++)if(b[w]!==v[w]){const E=w<b.length-1,A=w<v.length-1;return E&&!A?-1:!E&&A?1:b[w].localeCompare(v[w])}return b.length-v.length});for(const f of u){const _=f.split("/");for(let v=0;v<_.length-1;v++){const w=_.slice(0,v+1).join("/");if(!l.has(w)){const E={name:_[v],path:w,type:"directory",children:[]};if(l.set(w,E),v===0)i.push(E);else{const A=_.slice(0,v).join("/"),R=l.get(A);(h=R==null?void 0:R.children)==null||h.push(E)}}}const b={name:_[_.length-1],path:f,type:"file"};if(_.length===1)i.push(b);else{const v=_.slice(0,-1).join("/"),w=l.get(v);(m=w==null?void 0:w.children)==null||m.push(b)}}return i}function IO({expanded:a}){return O.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"shrink-0 transition-transform duration-150",style:{transform:a?"rotate(90deg)":"none"},children:O.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function RO({open:a}){return a?O.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"shrink-0",children:[O.jsx("path",{d:"M1.5 3.5A1 1 0 012.5 2.5h3.172a1 1 0 01.707.293L7.5 3.914a1 1 0 00.707.293H13.5a1 1 0 011 1v1.293H3.207a1 1 0 00-.966.741L1.5 10.5V3.5z",fill:"#dcb67a"}),O.jsx("path",{d:"M2.241 7.241A1 1 0 013.207 6.5H14.5a1 1 0 01.966 1.259l-1.5 5.5A1 1 0 0113 14H2.5a1 1 0 01-1-1V8.5a1 1 0 01.741-.966l0-.293z",fill:"#e8c87a"})]}):O.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"shrink-0",children:O.jsx("path",{d:"M1.5 3A1.5 1.5 0 013 1.5h3.172a1.5 1.5 0 011.06.44L8.354 3.06a.5.5 0 00.354.147H13A1.5 1.5 0 0114.5 4.707V12A1.5 1.5 0 0113 13.5H3A1.5 1.5 0 011.5 12V3z",fill:"#dcb67a"})})}function mt({children:a,className:i=""}){return O.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:`shrink-0 ${i}`,children:a})}function gt({color:a}){return O.jsxs(O.Fragment,{children:[O.jsx("path",{d:"M4 1.5h5.5L13 5v9.5a1 1 0 01-1 1H4a1 1 0 01-1-1v-13a1 1 0 011-1z",fill:a,opacity:"0.15"}),O.jsx("path",{d:"M4 1.5h5.5L13 5v9.5a1 1 0 01-1 1H4a1 1 0 01-1-1v-13a1 1 0 011-1z",stroke:a,strokeWidth:"0.8"}),O.jsx("path",{d:"M9.5 1.5V5H13",stroke:a,strokeWidth:"0.8"})]})}function zt({label:a,color:i,y:l="11.5",fontSize:u="5"}){return O.jsx("text",{x:"8",y:l,textAnchor:"middle",fill:i,fontSize:u,fontWeight:"700",fontFamily:"Arial, sans-serif",children:a})}function cd(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#f0db4f"}),O.jsx(zt,{label:"JS",color:"#f0db4f"})]})}function PO(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#61dafb"}),O.jsx(zt,{label:"JSX",color:"#61dafb",fontSize:"4.5"})]})}function ud(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#3178c6"}),O.jsx(zt,{label:"TS",color:"#3178c6"})]})}function DO(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#3178c6"}),O.jsx(zt,{label:"TSX",color:"#61dafb",fontSize:"4.5"})]})}function OO(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#a8b065"}),O.jsx("text",{x:"8",y:"11",textAnchor:"middle",fill:"#a8b065",fontSize:"7",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"{}"})]})}function I0(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#e44d26"}),O.jsx("text",{x:"8",y:"11.5",textAnchor:"middle",fill:"#e44d26",fontSize:"4.5",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"</>"})]})}function NO(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#264de4"}),O.jsx(zt,{label:"#",color:"#264de4",fontSize:"7"})]})}function dd(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#cd6799"}),O.jsx(zt,{label:"S",color:"#cd6799",fontSize:"7"})]})}function R0(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#9da5b4"}),O.jsx(zt,{label:"M↓",color:"#9da5b4",fontSize:"4.5"})]})}function BO(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#3776ab"}),O.jsx(zt,{label:"PY",color:"#3776ab"})]})}function LO(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#cc342d"}),O.jsx("text",{x:"8",y:"11.5",textAnchor:"middle",fill:"#cc342d",fontSize:"6",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"◆"})]})}function MO(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#00add8"}),O.jsx(zt,{label:"GO",color:"#00add8"})]})}function FO(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#dea584"}),O.jsx(zt,{label:"RS",color:"#dea584"})]})}function P0(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#cb171e"}),O.jsx(zt,{label:"YML",color:"#cb171e",fontSize:"4"})]})}function $O(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#ecd53f"}),O.jsx("text",{x:"8",y:"11.5",textAnchor:"middle",fill:"#ecd53f",fontSize:"6",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"⚙"})]})}function hd(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#89e051"}),O.jsx(zt,{label:"$_",color:"#89e051",fontSize:"5"})]})}function UO(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#e38c00"}),O.jsx(zt,{label:"SQL",color:"#e38c00",fontSize:"4"})]})}function jO(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#ffb13b"}),O.jsx(zt,{label:"SVG",color:"#ffb13b",fontSize:"4"})]})}function al(){return O.jsxs(mt,{children:[O.jsx(gt,{color:"#6b7280"}),O.jsx("text",{x:"8",y:"11.5",textAnchor:"middle",fill:"#6b7280",fontSize:"6",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"🔒"})]})}function VO(){return O.jsx(mt,{children:O.jsx(gt,{color:"#8c8c8c"})})}const D0={js:cd,mjs:cd,cjs:cd,jsx:PO,ts:ud,mts:ud,cts:ud,tsx:DO,json:OO,html:I0,htm:I0,css:NO,scss:dd,sass:dd,less:dd,md:R0,mdx:R0,py:BO,rb:LO,go:MO,rs:FO,yml:P0,yaml:P0,env:$O,sh:hd,bash:hd,zsh:hd,sql:UO,svg:jO,lock:al},HO={"package-lock.json":al,"yarn.lock":al,"pnpm-lock.yaml":al};function WO({name:a}){const i=a.toLowerCase(),l=HO[i];if(l)return O.jsx(l,{});const u=i.split(".").pop()||"",h=i.startsWith(".")?i.slice(1):"",m=D0[u]||D0[h]||VO;return O.jsx(m,{})}function zS({files:a,selectedFile:i,onSelectFile:l,fileChanges:u}){return O.jsxs("div",{className:"h-full overflow-auto bg-sb-sidebar text-sm select-none overscroll-contain",children:[O.jsx("div",{className:"px-3 py-2 text-[11px] font-semibold text-sb-text-muted uppercase tracking-wider border-b border-sb-border",children:"Explorer"}),O.jsx("div",{className:"py-1",children:a.map(h=>O.jsx(qS,{node:h,depth:0,selectedFile:i,onSelectFile:l,fileChanges:u},h.path))})]})}function qS({node:a,depth:i,selectedFile:l,onSelectFile:u,fileChanges:h}){var w;const[m,f]=q.useState(i<2),_=a.path===l,b=8+i*16,v=(h==null?void 0:h[a.path])??"unchanged";if(a.type==="directory"){const E=h&&((w=a.children)==null?void 0:w.some(A=>h[A.path]?!0:A.type==="directory"?Object.keys(h).some(R=>R.startsWith(A.path+"/")&&h[R]!=="unchanged"):!1));return O.jsxs("div",{children:[O.jsxs("button",{className:`w-full flex items-center gap-1 py-[3px] text-left hover:bg-sb-bg-hover transition-colors ${_?"bg-sb-bg-active text-sb-text-active":"text-sb-text"}`,style:{paddingLeft:b},onClick:()=>f(!m),children:[O.jsx(IO,{expanded:m}),O.jsx(RO,{open:m}),O.jsx("span",{className:"truncate ml-0.5 flex-1",children:a.name}),E&&O.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0 mr-2",style:{backgroundColor:"#fb923c"}})]}),m&&a.children&&O.jsx("div",{children:a.children.map(A=>O.jsx(qS,{node:A,depth:i+1,selectedFile:l,onSelectFile:u,fileChanges:h},A.path))})]})}return O.jsxs("button",{className:`w-full flex items-center gap-1 py-[3px] text-left hover:bg-sb-bg-hover transition-colors ${_?"bg-sb-bg-active text-sb-text-active":"text-sb-text"}`,style:{paddingLeft:b+20},onClick:()=>u(a.path),children:[O.jsx(WO,{name:a.name}),O.jsx("span",{className:"truncate ml-0.5 flex-1",children:a.name}),v!=="unchanged"&&O.jsx("span",{className:"text-[9px] font-bold shrink-0 mr-2",style:{color:AO[v]},title:v,children:TO[v]})]})}let ai=null,yl=null,Yo=null;function zO(){return ai&&yl?Promise.resolve():Yo||(Yo=import("@monaco-editor/react").then(a=>{ai=a.default||a.Editor,yl=a.DiffEditor}),Yo)}function qO(a){var u;const i=((u=a.split(".").pop())==null?void 0:u.toLowerCase())||"";return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"html",htm:"html",css:"css",scss:"scss",less:"less",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",yml:"yaml",yaml:"yaml",xml:"xml",sql:"sql",sh:"shell",bash:"shell",svg:"xml"}[i]||"plaintext"}const GO={new:"#4ade80",modified:"#fb923c",deleted:"#f87171",unchanged:"transparent"},KO={new:"New file",modified:"Modified",deleted:"Deleted",unchanged:""};function GS({files:a,originalFiles:i,fileChanges:l,activeFile:u,openFiles:h,onSelectFile:m,onCloseFile:f,onFileChange:_,readOnly:b=!1}){const[v,w]=q.useState(!!ai),[E,A]=q.useState(!1);q.useEffect(()=>{ai||zO().then(()=>w(!0))},[]);const R=u&&a[u]||"",P=u?i[u]??"":"",j=u?qO(u):"plaintext",M=u?l[u]==="modified"||l[u]==="new":!1;q.useEffect(()=>{!M&&E&&A(!1)},[M,E,u]);const B=q.useCallback(H=>{u&&H!==void 0&&_(u,H)},[u,_]),Y=q.useCallback(H=>{if(!H||!u)return;const Z=H.getModifiedEditor();Z.onDidChangeModelContent(()=>{const re=Z.getValue();_(u,re)})},[u,_]);return O.jsxs("div",{className:"flex flex-col h-full bg-sb-editor",children:[O.jsxs("div",{className:"flex items-center bg-sb-bg-alt border-b border-sb-border overflow-x-auto",children:[h.map(H=>{const Z=H.split("/").pop()||H,re=H===u,ge=l[H]||"unchanged";return O.jsxs("div",{className:`group flex items-center gap-2 px-3 py-1.5 text-xs cursor-pointer border-r border-sb-border
6
- ${re?"bg-sb-editor text-sb-text-active border-t-2 border-t-sb-accent":"bg-sb-bg-alt text-sb-text-muted hover:bg-sb-bg-hover border-t-2 border-t-transparent"}`,onClick:()=>m(H),children:[ge!=="unchanged"&&O.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:GO[ge]},title:KO[ge]}),O.jsx("span",{className:"truncate max-w-[120px]",children:Z}),O.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:text-sb-text-active ml-1 text-[10px]",onClick:se=>{se.stopPropagation(),f(H)},title:"Close",children:"✕"})]},H)}),O.jsx("div",{className:"flex-1"}),M&&O.jsx("button",{className:`shrink-0 px-2 py-1 mr-1 text-[10px] font-medium rounded transition-colors ${E?"bg-sb-accent text-white":"text-sb-text-muted hover:text-sb-text-active hover:bg-sb-bg-hover"}`,onClick:()=>A(H=>!H),title:E?"Switch to editor":"Show diff view",children:E?"Editor":"Diff"})]}),O.jsxs("div",{className:"flex-1 overflow-hidden",children:[!u&&O.jsx("div",{className:"flex items-center justify-center h-full text-sb-text-muted text-sm",children:"Select a file to edit"}),u&&v&&E&&yl&&O.jsx(yl,{height:"100%",language:j,original:P,modified:R,theme:"vs-dark",onMount:Y,options:{readOnly:b,minimap:{enabled:!1},fontSize:13,wordWrap:"on",scrollBeyondLastLine:!1,padding:{top:8},renderWhitespace:"selection",automaticLayout:!0,tabSize:2,renderSideBySide:!0,enableSplitViewResizing:!0,renderIndicators:!0,renderMarginRevertIcon:!1,originalEditable:!1}}),u&&v&&!E&&ai&&O.jsx(ai,{height:"100%",language:j,value:R,onChange:B,theme:"vs-dark",options:{readOnly:b,minimap:{enabled:!1},fontSize:13,lineNumbers:"on",wordWrap:"on",scrollBeyondLastLine:!1,padding:{top:8},renderWhitespace:"selection",automaticLayout:!0,tabSize:2}}),u&&!v&&O.jsx("div",{className:"flex items-center justify-center h-full text-sb-text-muted text-sm",children:"Loading editor..."})]})]})}function jd({output:a,className:i="",minimized:l=!1,onToggleMinimize:u}){const h=q.useRef(null);return q.useEffect(()=>{const m=h.current;m&&!l&&(m.scrollTop=m.scrollHeight)},[a.length,l]),O.jsxs("div",{className:`flex flex-col ${l?"":"h-full"} ${i}`,style:{background:"var(--sb-terminal)"},children:[O.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 border-t border-sb-border shrink-0 select-none cursor-pointer",style:{background:"var(--sb-terminal-header)"},onClick:u,children:[O.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",className:"shrink-0 transition-transform duration-150",style:{transform:l?"rotate(-90deg)":"rotate(0deg)",color:"var(--sb-text-muted)"},children:O.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),O.jsx("span",{className:"text-[11px] font-medium tracking-wider",style:{color:"var(--sb-text-muted)"},children:"TERMINAL"}),a.length>0&&O.jsxs("span",{className:"text-[10px] ml-auto tabular-nums",style:{color:"var(--sb-text-muted)",opacity:.6},children:[a.length," lines"]})]}),!l&&O.jsx("div",{ref:h,className:"flex-1 overflow-auto px-3.5 py-2 sb-terminal-output overscroll-contain min-h-0",children:a.length===0?O.jsxs("div",{style:{color:"var(--sb-text-muted)"},children:[O.jsx("span",{children:"$ "}),O.jsx("span",{className:"animate-pulse",children:"_"})]}):a.map((m,f)=>O.jsx("div",{className:"whitespace-pre-wrap",style:{color:"var(--sb-text)"},children:m},f))})]})}function YO(){return`
1
+ "use strict";var bS=Object.create;var M_=Object.defineProperty;var vS=Object.getOwnPropertyDescriptor;var wS=Object.getOwnPropertyNames;var SS=Object.getPrototypeOf,xS=Object.prototype.hasOwnProperty;var ES=(D,x,C,A)=>{if(x&&typeof x=="object"||typeof x=="function")for(let B of wS(x))!xS.call(D,B)&&B!==C&&M_(D,B,{get:()=>x[B],enumerable:!(A=vS(x,B))||A.enumerable});return D};var kS=(D,x,C)=>(C=D!=null?bS(SS(D)):{},ES(x||!D||!D.__esModule?M_(C,"default",{value:D,enumerable:!0}):C,D));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),J=require("react"),rc=require("allotment"),uc=require("framer-motion");require("allotment/dist/style.css");const CS={new:"#4ade80",modified:"#fb923c",deleted:"#f87171",unchanged:"transparent"},AS={new:"N",modified:"M",deleted:"D",unchanged:""};function ay(D){var B,j;const x=[],C=new Map,A=Object.keys(D).sort((U,$)=>{const Y=U.split("/"),V=$.split("/");for(let K=0;K<Math.min(Y.length,V.length);K++)if(Y[K]!==V[K]){const ie=K<Y.length-1,ce=K<V.length-1;return ie&&!ce?-1:!ie&&ce?1:Y[K].localeCompare(V[K])}return Y.length-V.length});for(const U of A){const $=U.split("/");for(let V=0;V<$.length-1;V++){const K=$.slice(0,V+1).join("/");if(!C.has(K)){const ie={name:$[V],path:K,type:"directory",children:[]};if(C.set(K,ie),V===0)x.push(ie);else{const ce=$.slice(0,V).join("/"),Le=C.get(ce);(B=Le==null?void 0:Le.children)==null||B.push(ie)}}}const Y={name:$[$.length-1],path:U,type:"file"};if($.length===1)x.push(Y);else{const V=$.slice(0,-1).join("/"),K=C.get(V);(j=K==null?void 0:K.children)==null||j.push(Y)}}return x}function TS({expanded:D}){return y.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"shrink-0 transition-transform duration-150",style:{transform:D?"rotate(90deg)":"none"},children:y.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function IS({open:D}){return D?y.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"shrink-0",children:[y.jsx("path",{d:"M1.5 3.5A1 1 0 012.5 2.5h3.172a1 1 0 01.707.293L7.5 3.914a1 1 0 00.707.293H13.5a1 1 0 011 1v1.293H3.207a1 1 0 00-.966.741L1.5 10.5V3.5z",fill:"#dcb67a"}),y.jsx("path",{d:"M2.241 7.241A1 1 0 013.207 6.5H14.5a1 1 0 01.966 1.259l-1.5 5.5A1 1 0 0113 14H2.5a1 1 0 01-1-1V8.5a1 1 0 01.741-.966l0-.293z",fill:"#e8c87a"})]}):y.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"shrink-0",children:y.jsx("path",{d:"M1.5 3A1.5 1.5 0 013 1.5h3.172a1.5 1.5 0 011.06.44L8.354 3.06a.5.5 0 00.354.147H13A1.5 1.5 0 0114.5 4.707V12A1.5 1.5 0 0113 13.5H3A1.5 1.5 0 011.5 12V3z",fill:"#dcb67a"})})}function je({children:D,className:x=""}){return y.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:`shrink-0 ${x}`,children:D})}function He({color:D}){return y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M4 1.5h5.5L13 5v9.5a1 1 0 01-1 1H4a1 1 0 01-1-1v-13a1 1 0 011-1z",fill:D,opacity:"0.15"}),y.jsx("path",{d:"M4 1.5h5.5L13 5v9.5a1 1 0 01-1 1H4a1 1 0 01-1-1v-13a1 1 0 011-1z",stroke:D,strokeWidth:"0.8"}),y.jsx("path",{d:"M9.5 1.5V5H13",stroke:D,strokeWidth:"0.8"})]})}function yn({label:D,color:x,y:C="11.5",fontSize:A="5"}){return y.jsx("text",{x:"8",y:C,textAnchor:"middle",fill:x,fontSize:A,fontWeight:"700",fontFamily:"Arial, sans-serif",children:D})}function sc(){return y.jsxs(je,{children:[y.jsx(He,{color:"#f0db4f"}),y.jsx(yn,{label:"JS",color:"#f0db4f"})]})}function RS(){return y.jsxs(je,{children:[y.jsx(He,{color:"#61dafb"}),y.jsx(yn,{label:"JSX",color:"#61dafb",fontSize:"4.5"})]})}function ic(){return y.jsxs(je,{children:[y.jsx(He,{color:"#3178c6"}),y.jsx(yn,{label:"TS",color:"#3178c6"})]})}function PS(){return y.jsxs(je,{children:[y.jsx(He,{color:"#3178c6"}),y.jsx(yn,{label:"TSX",color:"#61dafb",fontSize:"4.5"})]})}function DS(){return y.jsxs(je,{children:[y.jsx(He,{color:"#a8b065"}),y.jsx("text",{x:"8",y:"11",textAnchor:"middle",fill:"#a8b065",fontSize:"7",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"{}"})]})}function $_(){return y.jsxs(je,{children:[y.jsx(He,{color:"#e44d26"}),y.jsx("text",{x:"8",y:"11.5",textAnchor:"middle",fill:"#e44d26",fontSize:"4.5",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"</>"})]})}function OS(){return y.jsxs(je,{children:[y.jsx(He,{color:"#264de4"}),y.jsx(yn,{label:"#",color:"#264de4",fontSize:"7"})]})}function ac(){return y.jsxs(je,{children:[y.jsx(He,{color:"#cd6799"}),y.jsx(yn,{label:"S",color:"#cd6799",fontSize:"7"})]})}function U_(){return y.jsxs(je,{children:[y.jsx(He,{color:"#9da5b4"}),y.jsx(yn,{label:"M↓",color:"#9da5b4",fontSize:"4.5"})]})}function NS(){return y.jsxs(je,{children:[y.jsx(He,{color:"#3776ab"}),y.jsx(yn,{label:"PY",color:"#3776ab"})]})}function BS(){return y.jsxs(je,{children:[y.jsx(He,{color:"#cc342d"}),y.jsx("text",{x:"8",y:"11.5",textAnchor:"middle",fill:"#cc342d",fontSize:"6",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"◆"})]})}function LS(){return y.jsxs(je,{children:[y.jsx(He,{color:"#00add8"}),y.jsx(yn,{label:"GO",color:"#00add8"})]})}function FS(){return y.jsxs(je,{children:[y.jsx(He,{color:"#dea584"}),y.jsx(yn,{label:"RS",color:"#dea584"})]})}function j_(){return y.jsxs(je,{children:[y.jsx(He,{color:"#cb171e"}),y.jsx(yn,{label:"YML",color:"#cb171e",fontSize:"4"})]})}function MS(){return y.jsxs(je,{children:[y.jsx(He,{color:"#ecd53f"}),y.jsx("text",{x:"8",y:"11.5",textAnchor:"middle",fill:"#ecd53f",fontSize:"6",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"⚙"})]})}function oc(){return y.jsxs(je,{children:[y.jsx(He,{color:"#89e051"}),y.jsx(yn,{label:"$_",color:"#89e051",fontSize:"5"})]})}function $S(){return y.jsxs(je,{children:[y.jsx(He,{color:"#e38c00"}),y.jsx(yn,{label:"SQL",color:"#e38c00",fontSize:"4"})]})}function US(){return y.jsxs(je,{children:[y.jsx(He,{color:"#ffb13b"}),y.jsx(yn,{label:"SVG",color:"#ffb13b",fontSize:"4"})]})}function Ta(){return y.jsxs(je,{children:[y.jsx(He,{color:"#6b7280"}),y.jsx("text",{x:"8",y:"11.5",textAnchor:"middle",fill:"#6b7280",fontSize:"6",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"🔒"})]})}function jS(){return y.jsx(je,{children:y.jsx(He,{color:"#8c8c8c"})})}const H_={js:sc,mjs:sc,cjs:sc,jsx:RS,ts:ic,mts:ic,cts:ic,tsx:PS,json:DS,html:$_,htm:$_,css:OS,scss:ac,sass:ac,less:ac,md:U_,mdx:U_,py:NS,rb:BS,go:LS,rs:FS,yml:j_,yaml:j_,env:MS,sh:oc,bash:oc,zsh:oc,sql:$S,svg:US,lock:Ta},HS={"package-lock.json":Ta,"yarn.lock":Ta,"pnpm-lock.yaml":Ta};function WS({name:D}){const x=D.toLowerCase(),C=HS[x];if(C)return y.jsx(C,{});const A=x.split(".").pop()||"",B=x.startsWith(".")?x.slice(1):"",j=H_[A]||H_[B]||jS;return y.jsx(j,{})}function oy({files:D,selectedFile:x,onSelectFile:C,fileChanges:A}){return y.jsxs("div",{className:"h-full overflow-auto bg-sb-sidebar text-sm select-none overscroll-contain",children:[y.jsx("div",{className:"px-3 py-2 text-[11px] font-semibold text-sb-text-muted uppercase tracking-wider border-b border-sb-border",children:"Explorer"}),y.jsx("div",{className:"py-1",children:D.map(B=>y.jsx(ly,{node:B,depth:0,selectedFile:x,onSelectFile:C,fileChanges:A},B.path))})]})}function ly({node:D,depth:x,selectedFile:C,onSelectFile:A,fileChanges:B}){var K;const[j,U]=J.useState(x<2),$=D.path===C,Y=8+x*16,V=(B==null?void 0:B[D.path])??"unchanged";if(D.type==="directory"){const ie=B&&((K=D.children)==null?void 0:K.some(ce=>B[ce.path]?!0:ce.type==="directory"?Object.keys(B).some(Le=>Le.startsWith(ce.path+"/")&&B[Le]!=="unchanged"):!1));return y.jsxs("div",{children:[y.jsxs("button",{className:`w-full flex items-center gap-1 py-[3px] text-left hover:bg-sb-bg-hover transition-colors ${$?"bg-sb-bg-active text-sb-text-active":"text-sb-text"}`,style:{paddingLeft:Y},onClick:()=>U(!j),children:[y.jsx(TS,{expanded:j}),y.jsx(IS,{open:j}),y.jsx("span",{className:"truncate ml-0.5 flex-1",children:D.name}),ie&&y.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0 mr-2",style:{backgroundColor:"#fb923c"}})]}),j&&D.children&&y.jsx("div",{children:D.children.map(ce=>y.jsx(ly,{node:ce,depth:x+1,selectedFile:C,onSelectFile:A,fileChanges:B},ce.path))})]})}return y.jsxs("button",{className:`w-full flex items-center gap-1 py-[3px] text-left hover:bg-sb-bg-hover transition-colors ${$?"bg-sb-bg-active text-sb-text-active":"text-sb-text"}`,style:{paddingLeft:Y+20},onClick:()=>A(D.path),children:[y.jsx(WS,{name:D.name}),y.jsx("span",{className:"truncate ml-0.5 flex-1",children:D.name}),V!=="unchanged"&&y.jsx("span",{className:"text-[9px] font-bold shrink-0 mr-2",style:{color:CS[V]},title:V,children:AS[V]})]})}let os=null,Ra=null,xa=null;function VS(){return os&&Ra?Promise.resolve():xa||(xa=import("@monaco-editor/react").then(D=>{os=D.default||D.Editor,Ra=D.DiffEditor}),xa)}function qS(D){var A;const x=((A=D.split(".").pop())==null?void 0:A.toLowerCase())||"";return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"html",htm:"html",css:"css",scss:"scss",less:"less",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",yml:"yaml",yaml:"yaml",xml:"xml",sql:"sql",sh:"shell",bash:"shell",svg:"xml"}[x]||"plaintext"}const zS={new:"#4ade80",modified:"#fb923c",deleted:"#f87171",unchanged:"transparent"},GS={new:"New file",modified:"Modified",deleted:"Deleted",unchanged:""};function cy({files:D,originalFiles:x,fileChanges:C,activeFile:A,openFiles:B,onSelectFile:j,onCloseFile:U,onFileChange:$,readOnly:Y=!1}){const[V,K]=J.useState(!!os),[ie,ce]=J.useState(!1);J.useEffect(()=>{os||VS().then(()=>K(!0))},[]);const Le=A&&D[A]||"",sn=A?x[A]??"":"",An=A?qS(A):"plaintext",ye=A?C[A]==="modified"||C[A]==="new":!1;J.useEffect(()=>{!ye&&ie&&ce(!1)},[ye,ie,A]);const Fe=J.useCallback(we=>{A&&we!==void 0&&$(A,we)},[A,$]),Tn=J.useCallback(we=>{if(!we||!A)return;const ze=we.getModifiedEditor();ze.onDidChangeModelContent(()=>{const In=ze.getValue();$(A,In)})},[A,$]);return y.jsxs("div",{className:"flex flex-col h-full bg-sb-editor",children:[y.jsxs("div",{className:"flex items-center bg-sb-bg-alt border-b border-sb-border overflow-x-auto",children:[B.map(we=>{const ze=we.split("/").pop()||we,In=we===A,pn=C[we]||"unchanged";return y.jsxs("div",{className:`group flex items-center gap-2 px-3 py-1.5 text-xs cursor-pointer border-r border-sb-border
2
+ ${In?"bg-sb-editor text-sb-text-active border-t-2 border-t-sb-accent":"bg-sb-bg-alt text-sb-text-muted hover:bg-sb-bg-hover border-t-2 border-t-transparent"}`,onClick:()=>j(we),children:[pn!=="unchanged"&&y.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:zS[pn]},title:GS[pn]}),y.jsx("span",{className:"truncate max-w-[120px]",children:ze}),y.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:text-sb-text-active ml-1 text-[10px]",onClick:Zn=>{Zn.stopPropagation(),U(we)},title:"Close",children:"✕"})]},we)}),y.jsx("div",{className:"flex-1"}),ye&&y.jsx("button",{className:`shrink-0 px-2 py-1 mr-1 text-[10px] font-medium rounded transition-colors ${ie?"bg-sb-accent text-white":"text-sb-text-muted hover:text-sb-text-active hover:bg-sb-bg-hover"}`,onClick:()=>ce(we=>!we),title:ie?"Switch to editor":"Show diff view",children:ie?"Editor":"Diff"})]}),y.jsxs("div",{className:"flex-1 overflow-hidden",children:[!A&&y.jsx("div",{className:"flex items-center justify-center h-full text-sb-text-muted text-sm",children:"Select a file to edit"}),A&&V&&ie&&Ra&&y.jsx(Ra,{height:"100%",language:An,original:sn,modified:Le,theme:"vs-dark",onMount:Tn,options:{readOnly:Y,minimap:{enabled:!1},fontSize:13,wordWrap:"on",scrollBeyondLastLine:!1,padding:{top:8},renderWhitespace:"selection",automaticLayout:!0,tabSize:2,renderSideBySide:!0,enableSplitViewResizing:!0,renderIndicators:!0,renderMarginRevertIcon:!1,originalEditable:!1}}),A&&V&&!ie&&os&&y.jsx(os,{height:"100%",language:An,value:Le,onChange:Fe,theme:"vs-dark",options:{readOnly:Y,minimap:{enabled:!1},fontSize:13,lineNumbers:"on",wordWrap:"on",scrollBeyondLastLine:!1,padding:{top:8},renderWhitespace:"selection",automaticLayout:!0,tabSize:2}}),A&&!V&&y.jsx("div",{className:"flex items-center justify-center h-full text-sb-text-muted text-sm",children:"Loading editor..."})]})]})}function dc({output:D,className:x="",minimized:C=!1,onToggleMinimize:A}){const B=J.useRef(null);return J.useEffect(()=>{const j=B.current;j&&!C&&(j.scrollTop=j.scrollHeight)},[D.length,C]),y.jsxs("div",{className:`flex flex-col ${C?"":"h-full"} ${x}`,style:{background:"var(--sb-terminal)"},children:[y.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 border-t border-sb-border shrink-0 select-none cursor-pointer",style:{background:"var(--sb-terminal-header)"},onClick:A,children:[y.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",className:"shrink-0 transition-transform duration-150",style:{transform:C?"rotate(-90deg)":"rotate(0deg)",color:"var(--sb-text-muted)"},children:y.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),y.jsx("span",{className:"text-[11px] font-medium tracking-wider",style:{color:"var(--sb-text-muted)"},children:"TERMINAL"}),D.length>0&&y.jsxs("span",{className:"text-[10px] ml-auto tabular-nums",style:{color:"var(--sb-text-muted)",opacity:.6},children:[D.length," lines"]})]}),!C&&y.jsx("div",{ref:B,className:"flex-1 overflow-auto px-3.5 py-2 sb-terminal-output overscroll-contain min-h-0",children:D.length===0?y.jsxs("div",{style:{color:"var(--sb-text-muted)"},children:[y.jsx("span",{children:"$ "}),y.jsx("span",{className:"animate-pulse",children:"_"})]}):D.map((j,U)=>y.jsx("div",{className:"whitespace-pre-wrap",style:{color:"var(--sb-text)"},children:j},U))})]})}function KS(){return`
7
3
  (function() {
8
4
  // Guard against double-injection
9
5
  if (window.__sandboxErrorCapture) return;
@@ -65,39 +61,39 @@
65
61
  post('browser-console-error', parts.join(' '));
66
62
  };
67
63
  })();
68
- `}let ZO=0;function KS({url:a,className:i="",onBrowserError:l,reloadKey:u=0}){const h=q.useRef(null),m=q.useRef(l);m.current=l;const f=q.useRef(u),_=q.useCallback(()=>{var v;const b=h.current;if(b)try{const w=b.contentDocument||((v=b.contentWindow)==null?void 0:v.document);if(!w)return;const E=w.createElement("script");E.textContent=YO();const A=w.head||w.body||w.documentElement;A&&A.appendChild(E)}catch(w){console.warn("[CodeSandbox:Preview] Could not inject error capture:",w)}},[]);return q.useEffect(()=>{const b=v=>{if(!v.data||v.data.type!=="sandbox-error")return;const w=v.data,E=m.current;if(!E)return;let A;if(w.filename){const P=w.filename.match(/\/__(?:preview|virtual)__\/\d+(\/.*)/);A=P?P[1].replace(/^\//,""):void 0}const R={id:`browser_${++ZO}_${Date.now()}`,category:w.category,message:w.message,stack:w.stack,filePath:A,line:w.lineno??void 0,column:w.colno??void 0,timestamp:new Date().toISOString()};E(R)};return window.addEventListener("message",b),()=>window.removeEventListener("message",b)},[]),q.useEffect(()=>{h.current&&a&&(h.current.src=a)},[a]),q.useEffect(()=>{var b;if(u!==f.current){f.current=u;const v=h.current;if(v&&a)try{(b=v.contentWindow)==null||b.location.reload()}catch{v.src=a}}},[u,a]),O.jsx("div",{className:`h-full w-full bg-white ${i}`,children:a?O.jsx("iframe",{ref:h,src:a,className:"w-full h-full border-none",title:"Preview",sandbox:"allow-scripts allow-forms allow-same-origin allow-popups allow-modals",onLoad:_}):O.jsx("div",{className:"flex items-center justify-center h-full bg-sb-bg",children:O.jsxs("div",{className:"text-center px-4",children:[O.jsx("div",{className:"w-10 h-10 mx-auto mb-3 border-2 border-sb-accent border-t-transparent rounded-full animate-spin"}),O.jsx("p",{className:"text-sb-text-muted text-sm",children:"Waiting for dev server to start..."})]})})})}const O0={initializing:{icon:"⚡",label:"Initializing Runtime",color:"text-blue-400"},"writing-files":{icon:"📁",label:"Writing Project Files",color:"text-yellow-400"},installing:{icon:"📦",label:"Installing Dependencies",color:"text-purple-400"},starting:{icon:"🚀",label:"Starting Application",color:"text-green-400"},ready:{icon:"✅",label:"Application Ready",color:"text-green-400"},error:{icon:"❌",label:"Error",color:"text-red-400"}};function YS({progress:a,className:i=""}){const l=O0[a.stage]||O0.initializing;return a.stage==="ready"?null:O.jsx("div",{className:`absolute inset-0 z-50 flex items-center justify-center bg-sb-bg/95 backdrop-blur-sm ${i}`,children:O.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-md px-8",children:[O.jsx("div",{className:"text-5xl animate-bounce",children:l.icon}),O.jsxs("h2",{className:`text-xl font-semibold ${l.color}`,children:[l.label,a.stage!=="error"&&O.jsx(JO,{})]}),O.jsx("div",{className:"w-64 h-2 bg-sb-bg-active rounded-full overflow-hidden",children:O.jsx("div",{className:"h-full bg-sb-accent rounded-full transition-all duration-500 ease-out",style:{width:`${a.percent}%`}})}),O.jsx("p",{className:"text-sm text-sb-text-muted text-center",children:a.message}),O.jsx("div",{className:"flex items-center gap-2 mt-4",children:["initializing","writing-files","installing","starting"].map((u,h)=>{const m=XO(a.stage)>h,f=a.stage===u;return O.jsxs(q.Fragment,{children:[O.jsx("div",{className:`w-3 h-3 rounded-full transition-colors duration-300 ${m?"bg-sb-success":f?"bg-sb-accent animate-pulse":"bg-sb-bg-active"}`}),h<3&&O.jsx("div",{className:`w-8 h-0.5 transition-colors duration-300 ${m?"bg-sb-success":"bg-sb-bg-active"}`})]},u)})})]})})}function XO(a){return["initializing","writing-files","installing","starting","ready"].indexOf(a)}function JO(){return O.jsxs("span",{className:"inline-flex ml-1",children:[O.jsx("span",{className:"animate-pulse",style:{animationDelay:"0ms"},children:"."}),O.jsx("span",{className:"animate-pulse",style:{animationDelay:"200ms"},children:"."}),O.jsx("span",{className:"animate-pulse",style:{animationDelay:"400ms"},children:"."})]})}const QO=[.4,0,.2,1],N0=q.memo(function({selected:i,children:l,onClick:u}){return O.jsxs("button",{onClick:u,className:`relative px-3 py-1 rounded-full text-xs font-medium transition-colors ${i?"text-white":"text-sb-text-muted hover:text-sb-text"}`,children:[O.jsx("span",{className:"relative z-10",children:l}),i&&O.jsx(Ud.span,{layoutId:"view-slider-pill",transition:{duration:.2,ease:QO},className:"absolute inset-0 z-0 bg-sb-accent rounded-full"})]})}),ZS=q.memo(function({selected:i,onSelect:l}){return O.jsxs("div",{className:"flex items-center gap-0.5 bg-sb-bg rounded-full p-0.5 border border-sb-border",children:[O.jsx(N0,{selected:i==="code",onClick:()=>l("code"),children:"Code"}),O.jsx(N0,{selected:i==="preview",onClick:()=>l("preview"),children:"Preview"})]})});var eN=Object.defineProperty,tN=(a,i,l)=>i in a?eN(a,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[i]=l,W=(a,i,l)=>tN(a,typeof i!="symbol"?i+"":i,l);let B0,ya,z,Cn,ne,pd,L0,M0,F0,$0,Se,As,_a,Ke,ba,U0,j0,V0,H0,Zo,rr,Xr,ir,Jr,fd,va,ls,W0,z0,Xo,qn,Jo,ar,Qo,q0,An,wa,ol,G0,K0,Y0;(async()=>{var a,i,l;function h(e){const t=[];for(let n=0;n<e.length;n+=8192){const s=Math.min(n+8192,e.length);let r="";for(let o=n;o<s;o++)r+=String.fromCharCode(e[o]);t.push(r)}return btoa(t.join(""))}function m(e){const t=atob(e),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}const f=new Array(256);for(let e=0;e<256;e++)f[e]=(e<16?"0":"")+e.toString(16);function _(e){const t=new Array(e.length);for(let n=0;n<e.length;n++)t[n]=f[e[n]];return t.join("")}function b(e){const t=[];for(let n=0;n<e.length;n+=8192){const s=Math.min(n+8192,e.length);let r="";for(let o=n;o<s;o++)r+=String.fromCharCode(e[o]);t.push(r)}return t.join("")}const v=Object.freeze(Object.defineProperty({__proto__:null,base64ToBytes:m,bytesToBase64:h,bytesToHex:_,bytesToLatin1:b},Symbol.toStringTag,{value:"Module"}));_a={NODE:"v22.12.0",NODE_BARE:"22.12.0",NPM:"10.0.0",PNPM:"9.15.4",YARN:"4.6.0",BUN:"1.1.38",BUN_V:"v1.1.38",GIT:"2.43.0"};const w={node:_a.NODE_BARE,v8:"11.3.244.8",uv:"1.44.2",modules:"115",openssl:"3.0.13",napi:"9",webcontainer:"1.0.0"},E="https://registry.npmjs.org",R="https://esm.sh/pako@2.1.0",P=[".js",".ts",".jsx",".tsx",".mjs",".cjs",".json"],j={".ts":"ts",".tsx":"tsx",".js":"js",".mjs":"js",".cjs":"js",".jsx":"jsx",".json":"json",".css":"css",".map":"json",".txt":"text",".wasm":"file"},M={PLATFORM:"linux",ARCH:"x64",TYPE:"Linux",RELEASE:"5.10.0",VERSION:"#1 SMP",MACHINE:"x86_64",HOSTNAME:"localhost",HOMEDIR:"/home/user",TMPDIR:"/tmp",SHELL:"/bin/bash",USERNAME:"user",ENDIANNESS:"LE"},B={UID:1e3,GID:1e3},Y={BLOCK_SIZE:4096,BLOCK_CALC_SIZE:512},H={MODEL:"Virtual CPU",SPEED:2400,COUNT:2},Z={TOTAL:4*1024*1024*1024,FREE:2*1024*1024*1024,RSS:50*1024*1024,HEAP_TOTAL:30*1024*1024,HEAP_USED:20*1024*1024,EXTERNAL:1*1024*1024},re=[.5,.5,.5],ge={COLUMNS:80,ROWS:24,FONT_SIZE:13},se={PID:1,PPID:0,TITLE:"node",EXEC_PATH:"/usr/local/bin/node"};Cn={NODE_ENV:"development",PATH:"/usr/local/bin:/usr/bin:/bin",HOME:"/",SHELL:"/bin/sh",TERM:"xterm-256color",COLORTERM:"truecolor",REQUIRES_WASM:"true",npm_config_user_agent:`npm/${_a.NPM} node/${_a.NODE} linux x64 workspaces/false`,npm_execpath:"/usr/local/lib/node_modules/npm/bin/npm-cli.js",npm_node_execpath:"/usr/local/bin/node"},As={SYNC_OP:12e4,WAIT_LOOP_TICK:200,SW_HEARTBEAT:2e4,WORKER_REAP_INTERVAL:1e4,WORKER_IDLE_TIMEOUT:3e4,WORKER_INIT_TIMEOUT:3e4,HTTP_KEEP_ALIVE:5e3,HTTP_HEADERS:6e4,HTTP_DISPATCH_SAFETY:12e4};const ae={MAX_WORKERS_CAP:6},xe={BASE:3e3,RANGE:1e3},oe={TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10};class Fe{constructor(t){W(this,"_listeners",new Map),W(this,"_closeFn",null),this._closeFn=t}close(){this._closeFn&&(this._closeFn(),this._closeFn=null),this._listeners.clear()}ref(){return this}unref(){return this}on(t,n){return this._listeners.has(t)||this._listeners.set(t,[]),this._listeners.get(t).push(n),this}addListener(t,n){return this.on(t,n)}once(t,n){const s=(...r)=>{this.removeListener(t,s),n(...r)};return this.on(t,s)}off(t,n){return this.removeListener(t,n)}removeListener(t,n){const s=this._listeners.get(t);if(s){const r=s.indexOf(n);r>=0&&s.splice(r,1)}return this}removeAllListeners(t){return t?this._listeners.delete(t):this._listeners.clear(),this}emit(t,...n){const s=this._listeners.get(t);if(!s||s.length===0)return!1;for(const r of[...s])try{r(...n)}catch(o){console.error("[FSWatcher] listener error:",o)}return!0}}function ie(e,t,n,s){const r={ENOENT:-2,ENOTDIR:-20,EISDIR:-21,EEXIST:-17,ENOTEMPTY:-39},o={ENOENT:"no such file or directory",ENOTDIR:"not a directory",EISDIR:"is a directory",EEXIST:"file already exists",ENOTEMPTY:"directory not empty"},c=new Error(`${e}: ${o[e]}, ${t} '${n}'`);return c.code=e,c.errno=r[e],c.syscall=t,c.path=n,c}wa=class{constructor(e){W(this,"tree"),W(this,"textEncoder",new TextEncoder),W(this,"textDecoder",new TextDecoder),W(this,"activeWatchers",new Map),W(this,"subscribers",new Map),W(this,"_handler"),W(this,"globalChangeListeners",new Set),this._handler=e??null,this.tree={kind:"directory",children:new Map,modified:Date.now()}}on(e,t){return this.subscribers.has(e)||this.subscribers.set(e,new Set),this.subscribers.get(e).add(t),this}off(e,t){const n=this.subscribers.get(e);return n&&n.delete(t),this}broadcast(e,...t){const n=this.subscribers.get(e);if(n)for(const s of n)try{s(...t)}catch(r){console.error("Volume event handler error:",r)}}getStats(){let e=0,t=0,n=0;const s=o=>{var c;if(o.kind==="file")e++,t+=((c=o.content)==null?void 0:c.byteLength)??0;else if(o.kind==="directory"&&(n++,o.children))for(const d of o.children.values())s(d)};s(this.tree);let r=0;for(const o of this.activeWatchers.values())r+=o.size;return{fileCount:e,totalBytes:t,dirCount:n,watcherCount:r}}dispose(){this.activeWatchers.clear(),this.subscribers.clear(),this.globalChangeListeners.clear(),this._handler&&(this._handler.statCache.clear(),this._handler.pathNormCache.clear())}toSnapshot(e,t){const n=[];return this.collectEntries("/",this.tree,n,e,t),{entries:n}}collectEntries(e,t,n,s,r){if(s){for(const o of s)if(e===o||e.startsWith(o+"/"))return}if(t.kind==="file"){let o="";t.content&&t.content.length>0&&(o=h(t.content)),n.push({path:e,kind:"file",data:o})}else if(t.kind==="symlink")n.push({path:e,kind:"file",data:`symlink:${t.target}`});else if(t.kind==="directory"&&(n.push({path:e,kind:"directory"}),t.children))for(const[o,c]of t.children){if(r&&c.kind==="directory"&&r.has(o))continue;const d=e==="/"?`/${o}`:`${e}/${o}`;this.collectEntries(d,c,n,s,r)}}static fromBinarySnapshot(e){const t=new wa,n=new Uint8Array(e.data),s=[...e.manifest].sort((r,o)=>r.isDirectory&&!o.isDirectory?-1:!r.isDirectory&&o.isDirectory?1:r.path.split("/").length-o.path.split("/").length);for(const r of s)if(r.path!=="/")if(r.isDirectory)t.existsSync(r.path)||t.mkdirSync(r.path,{recursive:!0});else{const o=r.path.substring(0,r.path.lastIndexOf("/"))||"/";o!=="/"&&!t.existsSync(o)&&t.mkdirSync(o,{recursive:!0});const c=n.slice(r.offset,r.offset+r.length);t.writeInternal(t.normalize(r.path),c,!1)}return t}static fromSnapshot(e){const t=new wa,n=e.entries.map((s,r)=>({entry:s,depth:s.path.split("/").length,idx:r})).sort((s,r)=>s.depth-r.depth||s.idx-r.idx).map(s=>s.entry);for(const s of n)if(s.path!=="/"){if(s.kind==="directory")t.mkdirSync(s.path,{recursive:!0});else if(s.kind==="file"){let r;s.data?r=m(s.data):r=new Uint8Array(0);const o=s.path.substring(0,s.path.lastIndexOf("/"))||"/";o!=="/"&&!t.existsSync(o)&&t.mkdirSync(o,{recursive:!0}),t.writeInternal(t.normalize(s.path),r,!1)}}return t}normalize(e){if(this._handler){const r=this._handler.pathNormCache.get(e);if(r!==void 0)return r}e.startsWith("/")||(e="/"+e);const t=e.split("/").filter(Boolean),n=[];for(const r of t)r===".."?n.pop():r!=="."&&n.push(r);const s="/"+n.join("/");return this._handler&&this._handler.pathNormCache.set(e,s),s}segments(e){return e==="/"?[]:e.substring(1).split("/")}parentOf(e){const t=e.lastIndexOf("/");return t<=0?"/":e.slice(0,t)}nameOf(e){const t=e.lastIndexOf("/");return e.slice(t+1)}locateRaw(e){if(e==="/")return this.tree;let t=this.tree,n=1;const s=e.length;for(;n<s;){let r=e.indexOf("/",n);r===-1&&(r=s);const o=e.substring(n,r);if(n=r+1,t.kind==="symlink"){const d=this.locateRaw(t.target);if(!d||d.kind!=="directory")return;t=d}if(t.kind!=="directory"||!t.children)return;const c=t.children.get(o);if(!c)return;t=c}return t}locate(e){const t=this.locateRaw(e);if(t)return t.kind==="symlink"?this.locate(t.target):t}ensureDir(e){if(e==="/")return this.tree;let t=this.tree,n=1;const s=e.length;for(;n<s;){let r=e.indexOf("/",n);r===-1&&(r=s);const o=e.substring(n,r);n=r+1,t.children||(t.children=new Map);let c=t.children.get(o);if(!c)c={kind:"directory",children:new Map,modified:Date.now()},t.children.set(o,c);else if(c.kind!=="directory")throw new Error(`ENOTDIR: not a directory, '${e}'`);t=c}return t}writeInternal(e,t,n){const s=e.lastIndexOf("/"),r=s<=0?"/":e.slice(0,s),o=e.slice(s+1);if(!o)throw new Error(`EISDIR: illegal operation on a directory, '${e}'`);const c=this.ensureDir(r),d=c.children.has(o),p=typeof t=="string"?this.textEncoder.encode(t):t;c.children.set(o,{kind:"file",content:p,modified:Date.now()}),this._handler&&this._handler.invalidateStat(e),n&&(this.triggerWatchers(e,d?"change":"rename"),this.broadcast("change",e,typeof t=="string"?t:this.textDecoder.decode(t)),this.notifyGlobalListeners(e,d?"change":"add"))}existsSync(e){return this.locate(this.normalize(e))!==void 0}statSync(e){var t;const n=this.normalize(e);if(this._handler){const d=this._handler.statCache.get(n);if(d!==void 0)return d}const s=this.locate(n);if(!s)throw ie("ENOENT","stat",e);const r=s.kind==="file"&&((t=s.content)==null?void 0:t.length)||0,o=s.modified,c={isFile:()=>s.kind==="file",isDirectory:()=>s.kind==="directory",isSymbolicLink:()=>!1,isBlockDevice:()=>!1,isCharacterDevice:()=>!1,isFIFO:()=>!1,isSocket:()=>!1,size:r,mode:s.kind==="directory"?493:420,mtime:new Date(o),atime:new Date(o),ctime:new Date(o),birthtime:new Date(o),mtimeMs:o,atimeMs:o,ctimeMs:o,birthtimeMs:o,nlink:1,uid:B.UID,gid:B.GID,dev:0,ino:0,rdev:0,blksize:Y.BLOCK_SIZE,blocks:Math.ceil(r/Y.BLOCK_CALC_SIZE),atimeNs:BigInt(o)*1000000n,mtimeNs:BigInt(o)*1000000n,ctimeNs:BigInt(o)*1000000n,birthtimeNs:BigInt(o)*1000000n};return this._handler&&this._handler.statCache.set(n,c),c}lstatSync(e){const t=this.normalize(e),n=this.locateRaw(t);if(!n)throw ie("ENOENT","lstat",e);if(n.kind==="symlink"){const s=n.modified;return{isFile:()=>!1,isDirectory:()=>!1,isSymbolicLink:()=>!0,isBlockDevice:()=>!1,isCharacterDevice:()=>!1,isFIFO:()=>!1,isSocket:()=>!1,size:(n.target||"").length,mode:41471,mtime:new Date(s),atime:new Date(s),ctime:new Date(s),birthtime:new Date(s),mtimeMs:s,atimeMs:s,ctimeMs:s,birthtimeMs:s,nlink:1,uid:1e3,gid:1e3,dev:0,ino:0,rdev:0,blksize:Y.BLOCK_SIZE,blocks:0,atimeNs:BigInt(s)*1000000n,mtimeNs:BigInt(s)*1000000n,ctimeNs:BigInt(s)*1000000n,birthtimeNs:BigInt(s)*1000000n}}return this.statSync(t)}readFileSync(e,t){const n=this.normalize(e),s=this.locate(n);if(!s)throw ie("ENOENT","open",e);if(s.kind!=="file")throw ie("EISDIR","read",e);const r=s.content||new Uint8Array(0);return t==="utf8"||t==="utf-8"?this.textDecoder.decode(r):r}writeFileSync(e,t){const n=this.normalize(e);this.writeInternal(n,t,!0)}mkdirSync(e,t){const n=this.normalize(e);if(t!=null&&t.recursive){this.ensureDir(n);return}const s=this.parentOf(n),r=this.nameOf(n);if(!r)return;const o=this.locate(s);if(!o)throw ie("ENOENT","mkdir",s);if(o.kind!=="directory")throw ie("ENOTDIR","mkdir",s);if(o.children.has(r))throw ie("EEXIST","mkdir",e);o.children.set(r,{kind:"directory",children:new Map,modified:Date.now()})}readdirSync(e){const t=this.normalize(e),n=this.locate(t);if(!n)throw ie("ENOENT","scandir",e);if(n.kind!=="directory")throw ie("ENOTDIR","scandir",e);return Array.from(n.children.keys())}unlinkSync(e){const t=this.normalize(e),n=this.parentOf(t),s=this.nameOf(t),r=this.locate(n);if(!r||r.kind!=="directory")throw ie("ENOENT","unlink",e);const o=r.children.get(s);if(!o)throw ie("ENOENT","unlink",e);if(o.kind!=="file")throw ie("EISDIR","unlink",e);r.children.delete(s),this._handler&&this._handler.invalidateStat(t),this.triggerWatchers(t,"rename"),this.broadcast("delete",t),this.notifyGlobalListeners(t,"unlink")}rmdirSync(e){const t=this.normalize(e),n=this.parentOf(t),s=this.nameOf(t);if(!s)throw new Error(`EPERM: operation not permitted, '${e}'`);const r=this.locate(n);if(!r||r.kind!=="directory")throw ie("ENOENT","rmdir",e);const o=r.children.get(s);if(!o)throw ie("ENOENT","rmdir",e);if(o.kind!=="directory")throw ie("ENOTDIR","rmdir",e);if(o.children.size>0)throw ie("ENOTEMPTY","rmdir",e);r.children.delete(s),this._handler&&this._handler.invalidateStat(t)}renameSync(e,t){const n=this.normalize(e),s=this.normalize(t),r=this.locate(this.parentOf(n));if(!r||r.kind!=="directory")throw ie("ENOENT","rename",e);const o=this.nameOf(n),c=r.children.get(o);if(!c)throw ie("ENOENT","rename",e);const d=this.ensureDir(this.parentOf(s)),p=this.nameOf(s);r.children.delete(o),d.children.set(p,c),this.triggerWatchers(n,"rename"),this.triggerWatchers(s,"rename"),this.notifyGlobalListeners(n,"unlink"),this.notifyGlobalListeners(s,"add")}accessSync(e,t){if(!this.existsSync(e))throw ie("ENOENT","access",e)}copyFileSync(e,t){const n=this.readFileSync(e);this.writeFileSync(t,n)}realpathSync(e){const t=this.normalize(e),n=this.locateRaw(t);if(!n)throw ie("ENOENT","realpath",e);return n.kind==="symlink"?this.realpathSync(n.target):t}symlinkSync(e,t,n){const s=this.normalize(t),r=this.parentOf(s),o=this.nameOf(s);if(!o)throw new Error(`EISDIR: invalid symlink path, '${t}'`);this.ensureDir(r).children.set(o,{kind:"symlink",target:this.normalize(e),modified:Date.now()})}readlinkSync(e){const t=this.normalize(e),n=this.locateRaw(t);if(!n)throw ie("ENOENT","readlink",e);if(n.kind!=="symlink"){const s=new Error(`EINVAL: invalid argument, readlink '${e}'`);throw s.code="EINVAL",s.errno=-22,s.syscall="readlink",s.path=e,s}return n.target}linkSync(e,t){const n=this.locate(this.normalize(e));if(!n)throw ie("ENOENT","link",e);if(n.kind!=="file")throw ie("EISDIR","link",e);const s=this.normalize(t),r=this.parentOf(s),o=this.nameOf(s);this.ensureDir(r).children.set(o,{kind:"file",content:n.content,modified:n.modified})}chmodSync(e,t){const n=this.normalize(e);if(!this.locate(n))throw ie("ENOENT","chmod",e)}chownSync(e,t,n){const s=this.normalize(e);if(!this.locate(s))throw ie("ENOENT","chown",e)}appendFileSync(e,t){const n=this.normalize(e);let s=new Uint8Array(0);const r=this.locate(n);r&&r.kind==="file"&&(s=r.content||new Uint8Array(0));const o=typeof t=="string"?this.textEncoder.encode(t):t,c=new Uint8Array(s.length+o.length);c.set(s),c.set(o,s.length),this.writeInternal(n,c,!0)}truncateSync(e,t=0){const n=this.normalize(e),s=this.locate(n);if(!s)throw ie("ENOENT","truncate",e);if(s.kind!=="file")throw ie("EISDIR","truncate",e);const r=s.content||new Uint8Array(0);if(t<r.length)s.content=r.slice(0,t);else if(t>r.length){const o=new Uint8Array(t);o.set(r),s.content=o}s.modified=Date.now()}readFile(e,t,n){const s=typeof t=="function"?t:n,r=typeof t=="object"?t:void 0;try{const o=r!=null&&r.encoding?this.readFileSync(e,r.encoding):this.readFileSync(e);s&&setTimeout(()=>s(null,o),0)}catch(o){s&&setTimeout(()=>s(o),0)}}stat(e,t){try{const n=this.statSync(e);t&&setTimeout(()=>t(null,n),0)}catch(n){t&&setTimeout(()=>t(n),0)}}lstat(e,t){this.stat(e,t)}readdir(e,t,n){const s=typeof t=="function"?t:n;try{const r=this.readdirSync(e);s&&setTimeout(()=>s(null,r),0)}catch(r){s&&setTimeout(()=>s(r),0)}}realpath(e,t){try{const n=this.realpathSync(e);t&&setTimeout(()=>t(null,n),0)}catch(n){t&&setTimeout(()=>t(n),0)}}access(e,t,n){const s=typeof t=="function"?t:n;try{this.accessSync(e),s&&setTimeout(()=>s(null),0)}catch(r){s&&setTimeout(()=>s(r),0)}}watch(e,t,n){const s=this.normalize(e);let r={},o;typeof t=="function"?o=t:(t&&(r=t),o=n);const c=new Fe(()=>{d.active=!1;const p=this.activeWatchers.get(s);p&&(p.delete(d),p.size===0&&this.activeWatchers.delete(s))}),d={callback:(p,y)=>{o&&o(p,y),c.emit("change",p,y)},recursive:r.recursive||!1,active:!0};return this.activeWatchers.has(s)||this.activeWatchers.set(s,new Set),this.activeWatchers.get(s).add(d),c}triggerWatchers(e,t){const n=e,s=n.lastIndexOf("/"),r=n.slice(s+1),o=s<=0?"/":n.slice(0,s),c=this.activeWatchers.get(n);if(c){for(const y of c)if(y.active)try{y.callback(t,r)}catch(g){console.error("Watcher error:",g)}}let d=o,p=r;for(;d;){const y=this.activeWatchers.get(d);if(y){for(const k of y)if(k.active&&(k.recursive||d===o))try{k.callback(t,p)}catch(C){console.error("Watcher error:",C)}}if(d==="/")break;const g=d.lastIndexOf("/");p=d.slice(g+1)+"/"+p,d=g<=0?"/":d.slice(0,g)}}onGlobalChange(e){return this.globalChangeListeners.add(e),()=>{this.globalChangeListeners.delete(e)}}notifyGlobalListeners(e,t){for(const n of this.globalChangeListeners)try{n(e,t)}catch(s){console.error("Global VFS listener error:",s)}}createReadStream(e){const t=this,n={},s={on(r,o){return n[r]||(n[r]=[]),n[r].push(o),s},pipe(r){return r}};return setTimeout(()=>{var r,o,c;try{const d=t.readFileSync(e);(r=n.data)==null||r.forEach(p=>p(d)),(o=n.end)==null||o.forEach(p=>p())}catch(d){(c=n.error)==null||c.forEach(p=>p(d))}},0),s}createWriteStream(e){const t=this,n=[],s={},r=this.textEncoder;return{write(o){return n.push(typeof o=="string"?r.encode(o):o),!0},end(o){var c,d;o&&n.push(typeof o=="string"?r.encode(o):o);const p=n.reduce((x,k)=>x+k.length,0),y=new Uint8Array(p);let g=0;for(const x of n)y.set(x,g),g+=x.length;t.writeFileSync(e,y),(c=s.finish)==null||c.forEach(x=>x()),(d=s.close)==null||d.forEach(x=>x())},on(o,c){return s[o]||(s[o]=[]),s[o].push(c),this}}}};function Ee(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t.toString(36)}Qo=class{constructor(e){W(this,"_map",new Map),W(this,"_capacity"),this._capacity=Math.max(1,e)}get(e){if(!this._map.has(e))return;const t=this._map.get(e);return this._map.delete(e),this._map.set(e,t),t}set(e,t){if(this._map.has(e))this._map.delete(e);else if(this._map.size>=this._capacity){const n=this._map.keys().next().value;n!==void 0&&this._map.delete(n)}this._map.set(e,t)}has(e){return this._map.has(e)}delete(e){return this._map.delete(e)}clear(){this._map.clear()}get size(){return this._map.size}keys(){return this._map.keys()}values(){return this._map.values()}};const Be={pathNormCacheSize:2048,statCacheSize:512,resolveCacheSize:4096,manifestCacheSize:256,transformCacheSize:512,moduleSoftCacheSize:512,heapWarnThresholdMB:350,monitorIntervalMs:3e4,maxProcessOutputBytes:4194304};q0=class{constructor(e){W(this,"options"),W(this,"pathNormCache"),W(this,"statCache"),W(this,"transformCache"),W(this,"_monitorTimer",null),W(this,"_pressureCallbacks",[]),W(this,"_destroyed",!1),this.options={...Be,...e},this.pathNormCache=new Qo(this.options.pathNormCacheSize),this.statCache=new Qo(this.options.statCacheSize),this.transformCache=new Qo(this.options.transformCacheSize)}invalidateStat(e){this.statCache.delete(e)}onPressure(e){return this._pressureCallbacks.push(e),()=>{const t=this._pressureCallbacks.indexOf(e);t>=0&&this._pressureCallbacks.splice(t,1)}}startMonitoring(){this._monitorTimer||this._destroyed||(this._monitorTimer=setInterval(()=>this._checkHeap(),this.options.monitorIntervalMs))}stopMonitoring(){this._monitorTimer&&(clearInterval(this._monitorTimer),this._monitorTimer=null)}flush(){this.pathNormCache.clear(),this.statCache.clear(),this.transformCache.clear()}destroy(){this._destroyed=!0,this.stopMonitoring(),this.flush(),this._pressureCallbacks.length=0}_checkHeap(){const e=typeof performance<"u"?performance:null;if(!(e!=null&&e.memory))return;if(e.memory.usedJSHeapSize/1048576>this.options.heapWarnThresholdMB)for(const n of this._pressureCallbacks)try{n()}catch{}}};let ke=null;Xo=function(){return ke};const Ae=new Set;function We(){const e=Xo();if(e)for(const t of e.drainListeners)t();for(const t of Ae)t()}ls=function(){const e=Xo();e&&e.refCount++},An=function(){const e=Xo();e&&e.refCount>0&&e.refCount--,We()};const Re=10,Je=new WeakSet,vt=new Set;function ee(e){const t=globalThis.__nodepodVolume;if(!t||typeof t.onGlobalChange!="function")return;const n=new Map,s=50,r=t.onGlobalChange((c,d)=>{if(c.includes("/node_modules/")||c.includes("/.cache/"))return;const p=n.get(c);p&&clearTimeout(p.timer),n.set(c,{event:d,timer:setTimeout(()=>{n.delete(c),d==="change"?e.emit("change",c):d==="add"?e.emit("add",c):d==="unlink"&&e.emit("unlink",c)},s)})}),o=()=>{r(),vt.delete(o)};vt.add(o)}function pe(e){return e._registry||(e._registry=new Map),e._registry}function De(e,t){const n=pe(e);let s=n.get(t);return s||(s=[],n.set(t,s)),s}ne=function(){this&&!this._registry&&(this._registry=new Map),this&&this._ceiling===void 0&&(this._ceiling=Re)},ne.prototype.addListener=function(t,n){return De(this,t).push(n),t==="change"&&!Je.has(this)&&this._watched instanceof Map&&(Je.add(this),ee(this)),this},ne.prototype.on=ne.prototype.addListener,ne.prototype.once=function(t,n){const s=this,r=function(...c){s.removeListener(t,r),n.apply(s,c)};return De(this,t).push(r),this},ne.prototype.removeListener=function(t,n){const s=pe(this).get(t);if(s){const r=s.indexOf(n);r!==-1&&s.splice(r,1)}return this},ne.prototype.off=ne.prototype.removeListener,ne.prototype.removeAllListeners=function(t){return t!==void 0?pe(this).delete(t):pe(this).clear(),this},ne.prototype.emit=function(t,...n){const s=pe(this).get(t);if(!s||s.length===0){if(t==="error"){const c=n[0];throw c instanceof Error?c:new Error("Unhandled error event")}return!1}const r=c=>{c&&typeof c.then=="function"&&(ls(),c.then(()=>An(),()=>An()))};if(s.length===1){try{const c=s[0].apply(this,n);r(c)}catch{}return!0}const o=s.slice();for(const c of o)try{const d=c.apply(this,n);r(d)}catch{}return!0},ne.prototype.listeners=function(t){const n=pe(this).get(t);return n?n.slice():[]},ne.prototype.rawListeners=function(t){return this.listeners(t)},ne.prototype.listenerCount=function(t){const n=pe(this).get(t);return n?n.length:0},ne.prototype.eventNames=function(){return Array.from(pe(this).keys())},ne.prototype.setMaxListeners=function(t){return this._ceiling=t,this},ne.prototype.getMaxListeners=function(){return this._ceiling??Re},ne.prototype.prependListener=function(t,n){return De(this,t).unshift(n),this},ne.prototype.prependOnceListener=function(t,n){const s=this,r=function(...o){s.removeListener(t,r),n.apply(s,o)};return this.prependListener(t,r)},ne.listenerCount=function(e,t){return e.listenerCount(t)};const be=ne;be.EventEmitter=ne,be.once=async(e,t)=>new Promise((n,s)=>{const r=(...c)=>{e.removeListener("error",o),n(c)},o=(...c)=>{e.removeListener(t,r),s(c[0])};e.once(t,r),e.once("error",o)}),be.on=(e,t)=>({async next(){return new Promise(s=>{e.once(t,(...r)=>s({value:r,done:!1}))})},[Symbol.asyncIterator](){return this}}),be.getEventListeners=(e,t)=>e.listeners(t),be.listenerCount=(e,t)=>e.listenerCount(t),Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:ne,default:be},Symbol.toStringTag,{value:"Module"}));const Qe=new TextEncoder,it=new TextDecoder("utf-8"),Pe=new Uint8Array(128);for(let e=0;e<10;e++)Pe[48+e]=e;for(let e=0;e<6;e++)Pe[65+e]=10+e,Pe[97+e]=10+e;const fe=class kt extends Uint8Array{static from(t,n,s){if(typeof n=="function"){const o=Array.from(t,n,s);return new kt(o)}const r=n;if(Array.isArray(t))return new kt(t);if(typeof t=="string"){const o=(r||"utf8").toLowerCase();if(o==="base64"||o==="base64url"){let c=t;if(o==="base64url")for(c=c.replace(/-/g,"+").replace(/_/g,"/");c.length%4!==0;)c+="=";return new kt(m(c))}if(o==="hex"){const c=new Uint8Array(t.length>>>1);for(let d=0;d<t.length;d+=2)c[d>>>1]=Pe[t.charCodeAt(d)]<<4|Pe[t.charCodeAt(d+1)];return new kt(c)}if(o==="latin1"||o==="binary"){const c=new Uint8Array(t.length);for(let d=0;d<t.length;d++)c[d]=t.charCodeAt(d)&255;return new kt(c)}return new kt(Qe.encode(t))}return t instanceof ArrayBuffer?new kt(t):new kt(t)}static alloc(t,n){const s=new kt(t);return n!==void 0&&s.fill(n),s}static allocUnsafe(t){return new kt(t)}static allocUnsafeSlow(t){return new kt(t)}static concat(t){let n=0;for(const o of t)n+=o.length;const s=new kt(n);let r=0;for(const o of t)s.set(o,r),r+=o.length;return s}static isBuffer(t){return t instanceof kt||t instanceof Uint8Array}static isEncoding(t){const n=t.toLowerCase();return["utf8","utf-8","ascii","latin1","binary","base64","base64url","hex"].includes(n)}static byteLength(t,n){const s=(n||"utf8").toLowerCase();if(s==="base64"||s==="base64url"){const r=t.replace(/[=]/g,"");return Math.floor(r.length*3/4)}return s==="hex"?t.length>>>1:Qe.encode(t).length}toString(t="utf8"){const n=(t||"utf8").toLowerCase();return n==="base64"?h(this):n==="base64url"?h(this).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""):n==="hex"?_(this):n==="latin1"||n==="binary"?b(this):it.decode(this)}slice(t,n){return new kt(super.slice(t,n))}subarray(t,n){return new kt(super.subarray(t,n))}write(t,n,s,r){const o=typeof n=="number"?n:0,c=Qe.encode(t),d=typeof s=="number"?Math.min(s,c.length):c.length;return this.set(c.subarray(0,d),o),d}copy(t,n,s,r){const o=this.subarray(s||0,r);return t.set(o,n||0),o.length}compare(t){const n=Math.min(this.length,t.length);for(let s=0;s<n;s++){if(this[s]<t[s])return-1;if(this[s]>t[s])return 1}return this.length<t.length?-1:this.length>t.length?1:0}equals(t){return this.compare(t)===0}toJSON(){return{type:"Buffer",data:Array.from(this)}}hasOwnProperty(t){return Object.prototype.hasOwnProperty.call(this,t)}indexOf(t,n){const s=n||0;if(typeof t=="number"){for(let o=s;o<this.length;o++)if(this[o]===t)return o;return-1}const r=typeof t=="string"?kt.from(t):t;for(let o=s;o<=this.length-r.length;o++){let c=!0;for(let d=0;d<r.length;d++)if(this[o+d]!==r[d]){c=!1;break}if(c)return o}return-1}includes(t,n){return this.indexOf(t,n)!==-1}readUInt8(t){return this[t]}readUInt16BE(t){return this[t]<<8|this[t+1]}readUInt16LE(t){return this[t]|this[t+1]<<8}readUInt32BE(t){return(this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3])>>>0}readUInt32LE(t){return(this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24)>>>0}writeUInt8(t,n){return this[n]=t&255,n+1}writeUInt16BE(t,n){return this[n]=t>>>8&255,this[n+1]=t&255,n+2}writeUInt16LE(t,n){return this[n]=t&255,this[n+1]=t>>>8&255,n+2}writeUInt32BE(t,n){return this[n]=t>>>24&255,this[n+1]=t>>>16&255,this[n+2]=t>>>8&255,this[n+3]=t&255,n+4}writeUInt32LE(t,n){return this[n]=t&255,this[n+1]=t>>>8&255,this[n+2]=t>>>16&255,this[n+3]=t>>>24&255,n+4}readUint8(t){return this.readUInt8(t)}readUint16BE(t){return this.readUInt16BE(t)}readUint16LE(t){return this.readUInt16LE(t)}readUint32BE(t){return this.readUInt32BE(t)}readUint32LE(t){return this.readUInt32LE(t)}writeUint8(t,n){return this.writeUInt8(t,n)}writeUint16BE(t,n){return this.writeUInt16BE(t,n)}writeUint16LE(t,n){return this.writeUInt16LE(t,n)}writeUint32BE(t,n){return this.writeUInt32BE(t,n)}writeUint32LE(t,n){return this.writeUInt32LE(t,n)}readInt8(t){const n=this[t];return n&128?n-256:n}readInt16BE(t){const n=this.readUInt16BE(t);return n&32768?n-65536:n}readInt16LE(t){const n=this.readUInt16LE(t);return n&32768?n-65536:n}readInt32BE(t){return this.readUInt32BE(t)|0}readInt32LE(t){return this.readUInt32LE(t)|0}writeInt8(t,n){return this[n]=t&255,n+1}writeInt16BE(t,n){return this.writeUInt16BE(t&65535,n)}writeInt16LE(t,n){return this.writeUInt16LE(t&65535,n)}writeInt32BE(t,n){return this.writeUInt32BE(t>>>0,n)}writeInt32LE(t,n){return this.writeUInt32LE(t>>>0,n)}readBigUInt64LE(t){const n=BigInt(this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24)&0xffffffffn,s=BigInt(this[t+4]|this[t+5]<<8|this[t+6]<<16|this[t+7]<<24)&0xffffffffn;return n|s<<32n}readBigUInt64BE(t){const n=BigInt(this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3])&0xffffffffn;return BigInt(this[t+4]<<24|this[t+5]<<16|this[t+6]<<8|this[t+7])&0xffffffffn|n<<32n}readBigInt64LE(t){const n=this.readBigUInt64LE(t);return n>=0x8000000000000000n?n-0x10000000000000000n:n}readBigInt64BE(t){const n=this.readBigUInt64BE(t);return n>=0x8000000000000000n?n-0x10000000000000000n:n}writeBigUInt64LE(t,n){const s=t&0xffffffffn,r=t>>32n&0xffffffffn;return this[n]=Number(s&0xffn),this[n+1]=Number(s>>8n&0xffn),this[n+2]=Number(s>>16n&0xffn),this[n+3]=Number(s>>24n&0xffn),this[n+4]=Number(r&0xffn),this[n+5]=Number(r>>8n&0xffn),this[n+6]=Number(r>>16n&0xffn),this[n+7]=Number(r>>24n&0xffn),n+8}writeBigUInt64BE(t,n){const s=t&0xffffffffn,r=t>>32n&0xffffffffn;return this[n]=Number(r>>24n&0xffn),this[n+1]=Number(r>>16n&0xffn),this[n+2]=Number(r>>8n&0xffn),this[n+3]=Number(r&0xffn),this[n+4]=Number(s>>24n&0xffn),this[n+5]=Number(s>>16n&0xffn),this[n+6]=Number(s>>8n&0xffn),this[n+7]=Number(s&0xffn),n+8}writeBigInt64LE(t,n){const s=t<0n?t+0x10000000000000000n:t;return this.writeBigUInt64LE(s,n)}writeBigInt64BE(t,n){const s=t<0n?t+0x10000000000000000n:t;return this.writeBigUInt64BE(s,n)}readBigUint64LE(t){return this.readBigUInt64LE(t)}readBigUint64BE(t){return this.readBigUInt64BE(t)}writeBigUint64LE(t,n){return this.writeBigUInt64LE(t,n)}writeBigUint64BE(t,n){return this.writeBigUInt64BE(t,n)}readFloatLE(t){return new DataView(this.buffer,this.byteOffset+t,4).getFloat32(0,!0)}readFloatBE(t){return new DataView(this.buffer,this.byteOffset+t,4).getFloat32(0,!1)}readDoubleLE(t){return new DataView(this.buffer,this.byteOffset+t,8).getFloat64(0,!0)}readDoubleBE(t){return new DataView(this.buffer,this.byteOffset+t,8).getFloat64(0,!1)}writeFloatLE(t,n){return new DataView(this.buffer,this.byteOffset+n,4).setFloat32(0,t,!0),n+4}writeFloatBE(t,n){return new DataView(this.buffer,this.byteOffset+n,4).setFloat32(0,t,!1),n+4}writeDoubleLE(t,n){return new DataView(this.buffer,this.byteOffset+n,8).setFloat64(0,t,!0),n+8}writeDoubleBE(t,n){return new DataView(this.buffer,this.byteOffset+n,8).setFloat64(0,t,!1),n+8}readUIntLE(t,n){let s=0,r=1;for(let o=0;o<n;o++)s+=this[t+o]*r,r*=256;return s}readUintLE(t,n){return this.readUIntLE(t,n)}readUIntBE(t,n){let s=0,r=1;for(let o=n-1;o>=0;o--)s+=this[t+o]*r,r*=256;return s}readUintBE(t,n){return this.readUIntBE(t,n)}readIntLE(t,n){let s=this.readUIntLE(t,n);const r=Math.pow(2,n*8-1);return s>=r&&(s-=Math.pow(2,n*8)),s}readIntBE(t,n){let s=this.readUIntBE(t,n);const r=Math.pow(2,n*8-1);return s>=r&&(s-=Math.pow(2,n*8)),s}writeUIntLE(t,n,s){let r=t;for(let o=0;o<s;o++)this[n+o]=r&255,r=Math.floor(r/256);return n+s}writeUintLE(t,n,s){return this.writeUIntLE(t,n,s)}writeUIntBE(t,n,s){let r=t;for(let o=s-1;o>=0;o--)this[n+o]=r&255,r=Math.floor(r/256);return n+s}writeUintBE(t,n,s){return this.writeUIntBE(t,n,s)}writeIntLE(t,n,s){let r=t;return r<0&&(r+=Math.pow(2,s*8)),this.writeUIntLE(r,n,s)}writeIntBE(t,n,s){let r=t;return r<0&&(r+=Math.pow(2,s*8)),this.writeUIntBE(r,n,s)}swap16(){if(this.length%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<this.length;t+=2){const n=this[t];this[t]=this[t+1],this[t+1]=n}return this}swap32(){if(this.length%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<this.length;t+=4){const n=this[t],s=this[t+1];this[t]=this[t+3],this[t+1]=this[t+2],this[t+2]=s,this[t+3]=n}return this}swap64(){if(this.length%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<this.length;t+=8){const n=this[t],s=this[t+1],r=this[t+2],o=this[t+3];this[t]=this[t+7],this[t+1]=this[t+6],this[t+2]=this[t+5],this[t+3]=this[t+4],this[t+4]=o,this[t+5]=r,this[t+6]=s,this[t+7]=n}return this}};W(fe,"BYTES_PER_ELEMENT",1);let Ce=fe;z=new Proxy(Ce,{apply(e,t,n){return Ce.from(...n)}}),typeof globalThis.Buffer>"u"&&(globalThis.Buffer=z);function je(e){return e instanceof Uint8Array?e.byteLength:typeof e=="string"?z.byteLength(e):0}Se=function(t){if(!this)return;ne.call(this),this._queue=[],this._terminated=!1,this._active=!1,this._endFired=!1,this._endEmitted=!1,this._objectMode=!1,this._reading=!1,this._highWaterMark=16384,this._autoDestroy=!0,this._encoding=null,this._readableByteLength=0,this._draining=!1,this.readable=!0,this.readableEnded=!1,this.readableFlowing=null,this.destroyed=!1,this.closed=!1,this.errored=null,this.readableObjectMode=!1,this.readableHighWaterMark=16384,this.readableDidRead=!1,this.readableAborted=!1;const n=this;this._readableState={get objectMode(){return n._objectMode},get highWaterMark(){return n._highWaterMark},get ended(){return n._terminated},get endEmitted(){return n._endEmitted},set endEmitted(s){n._endEmitted=s},get flowing(){return n.readableFlowing},set flowing(s){n.readableFlowing=s},get reading(){return n._reading},get length(){return n.readableLength},get destroyed(){return n.destroyed},get errored(){return n.errored},get closed(){return n.closed},pipes:[],awaitDrainWriters:null,multiAwaitDrain:!1,readableListening:!1,resumeScheduled:!1,paused:!0,emitClose:!0,get autoDestroy(){return n._autoDestroy},defaultEncoding:"utf8",needReadable:!1,emittedReadable:!1,readingMore:!1,dataEmitted:!1},t&&(t.objectMode&&(this._objectMode=!0,this.readableObjectMode=!0,t.highWaterMark===void 0&&(this._highWaterMark=16,this.readableHighWaterMark=16)),t.highWaterMark!==void 0&&(this._highWaterMark=t.highWaterMark,this.readableHighWaterMark=t.highWaterMark),t.autoDestroy!==void 0&&(this._autoDestroy=t.autoDestroy),t.read&&(this._read=t.read.bind(this)),t.destroy&&(this._destroy=t.destroy.bind(this)))},Object.setPrototypeOf(Se.prototype,ne.prototype),Se.prototype._read=function(t){},Se.prototype._destroy=function(t,n){n(t)},Se.prototype._rawBind=function(t,n){return ne.prototype.addListener.call(this,t,n),this},Se.prototype.on=function(t,n){return this._rawBind(t,n),t==="data"&&!this._active&&this.resume(),t==="readable"&&(this.readableFlowing=!1),t==="end"&&this._endEmitted?queueMicrotask(()=>n()):t==="end"&&this._terminated&&this._queue.length===0&&!this._endFired&&(this._endFired=!0,queueMicrotask(()=>{this._endEmitted=!0,this.emit("end"),this._autoDestroy&&this.destroy()})),this},Se.prototype.addListener=function(t,n){return this.on(t,n)},Se.prototype.once=function(t,n){return t==="end"&&this._endEmitted?(queueMicrotask(()=>n()),this):t==="end"&&this._terminated&&this._queue.length===0&&!this._endFired?(this._endFired=!0,ne.prototype.once.call(this,t,n),queueMicrotask(()=>{this._endEmitted=!0,this.emit("end"),this._autoDestroy&&this.destroy()}),this):t==="data"&&!this._active?(ne.prototype.once.call(this,t,n),this.resume(),this):ne.prototype.once.call(this,t,n)},Se.prototype.push=function(t){if(t===null)return this._terminated=!0,this.readableEnded=!0,this.readable=!1,this._active&&this._queue.length===0&&!this._endFired&&(this._endFired=!0,queueMicrotask(()=>{this._endEmitted=!0,this.emit("end")})),!1;if(this._objectMode)this._queue.push(t);else{const n=typeof t=="string"?z.from(t):t;this._readableByteLength+=je(n),this._queue.push(n)}return this._active&&this._drain(),this._queue.length<this._highWaterMark},Se.prototype.unshift=function(t){if(t!==null)if(this._objectMode)this._queue.unshift(t);else{const n=typeof t=="string"?z.from(t):t;this._readableByteLength+=je(n),this._queue.unshift(n)}},Se.prototype._drain=function(){if(!this._draining){for(this._draining=!0;this._queue.length>0&&this._active;){const t=this._queue.shift();this._objectMode||(this._readableByteLength-=je(t)),this.readableDidRead=!0,this._encoding&&t instanceof Uint8Array?this.emit("data",z.from(t).toString(this._encoding)):this.emit("data",t)}this._draining=!1,this._terminated&&this._queue.length===0&&!this._endFired&&(this._endFired=!0,queueMicrotask(()=>{this._endEmitted=!0,this.emit("end"),this._autoDestroy&&this.destroy()})),!this._terminated&&this._queue.length===0&&this._active&&!this._reading&&(this._reading=!0,queueMicrotask(()=>{this._reading=!1,!this._terminated&&this._active&&this._read(this._highWaterMark)}))}},Se.prototype.read=function(t){if(this.readableDidRead=!0,!this._reading&&!this._terminated&&(this._reading=!0,this._read(t??this._highWaterMark),this._reading=!1),this._queue.length===0)return null;if(this._objectMode)return this._queue.shift();if(t===void 0||t===0){const r=z.concat(this._queue);return this._readableByteLength=0,this._queue.length=0,r}const n=[];let s=t;for(;s>0&&this._queue.length>0;){const r=this._queue[0];r.length<=s?(n.push(this._queue.shift()),this._readableByteLength-=r.length,s-=r.length):(n.push(r.slice(0,s)),this._queue[0]=r.slice(s),this._readableByteLength-=s,s=0)}return n.length>0?z.concat(n):null},Se.prototype.resume=function(){return this._active=!0,this.readableFlowing=!0,this._drain(),!this._terminated&&this._queue.length===0&&!this._reading&&(this._reading=!0,queueMicrotask(()=>{this._reading=!1,!this._terminated&&this._active&&this._read(this._highWaterMark)})),this},Se.prototype.pause=function(){return this._active=!1,this.readableFlowing=!1,this},Se.prototype.isPaused=function(){return!this._active},Se.prototype.pipe=function(t){const n=this;return n.on("data",function(r){!t.write(r)&&(n.pause(),t.once("drain",function(){n.resume()}))}),n.on("end",function(){t.end()}),n.resume(),t},Se.prototype.unpipe=function(t){return this.removeAllListeners("data"),this.removeAllListeners("end"),this},Se.prototype.setEncoding=function(t){return this._encoding=t,this},Se.prototype.close=function(t){this.destroy(),t&&t(null)},Se.prototype.destroy=function(t){return this.destroyed?this:(this.destroyed=!0,t&&(this.errored=t),this._destroy(t??null,n=>{n&&!t&&(this.errored=n),this._queue.length=0,this._readableByteLength=0,this._terminated=!0,this.readable=!1,(n||t)&&this.emit("error",n||t),this.closed=!0,this.emit("close")}),this)},Se.prototype.wrap=function(t){const n=this;return t.on("data",function(r){n.push(r)}),t.on("end",function(){n.push(null)}),t.on("error",function(r){n.destroy(r)}),this},Se.prototype[Symbol.asyncIterator]=function(){const t=this,n=[];let s=!1,r=null,o=null,c=null;const d=x=>{if(o){const k=o;o=null,c=null,k({value:x,done:!1})}else n.push(x)},p=()=>{if(s=!0,o){const x=o;o=null,c=null,x({value:void 0,done:!0})}g()},y=(...x)=>{if(r=x[0],c){const k=c;o=null,c=null,k(r)}g()},g=()=>{t.removeListener("data",d),t.removeListener("end",p),t.removeListener("error",y)};return t._rawBind("data",d),t._rawBind("end",p),t._rawBind("error",y),t._active||t.resume(),{next(){return n.length>0?Promise.resolve({value:n.shift(),done:!1}):r?Promise.reject(r):s?Promise.resolve({value:void 0,done:!0}):new Promise((x,k)=>{o=x,c=k})},return(){return g(),t.destroy(),Promise.resolve({value:void 0,done:!0})},throw(x){return g(),t.destroy(x),Promise.reject(x)},[Symbol.asyncIterator](){return this}}},Object.defineProperty(Se.prototype,"readableLength",{get:function(){return this._objectMode?this._queue.length:this._readableByteLength},configurable:!0}),Object.defineProperty(Se.prototype,"readableEncoding",{get:function(){return this._encoding},configurable:!0}),Se.toWeb=function(t){return new ReadableStream({start(n){t.on("data",s=>{const r=s instanceof Uint8Array?s:z.from(String(s));n.enqueue(r)}),t.on("end",()=>{n.close()}),t.on("error",s=>{n.error(s)}),t.resume()},cancel(){t.destroy()}})},Se.fromWeb=function(t,n){const s=t.getReader(),r=new Se({...n,read(){s.read().then(({value:o,done:c})=>{c?r.push(null):r.push(o)},o=>{r.destroy(o)})}});return r},Se.from=function(t,n){const s=new Se(n);return(async()=>{try{for await(const r of t)if(r!=null){const o=typeof r=="string"?z.from(r):r;s.push(o)}s.push(null)}catch(r){s.destroy(r)}})(),s},Ke=function(t){if(!this)return;ne.call(this),this._parts=[],this._closed=!1,this._objectMode=!1,this._highWaterMark=16384,this._autoDestroy=!0,this._corked=0,this._corkedWrites=[],this._writableByteLength=0,this.writable=!0,this.writableEnded=!1,this.writableFinished=!1,this.writableNeedDrain=!1,this.destroyed=!1,this.closed=!1,this.errored=null,this.writableObjectMode=!1,this.writableHighWaterMark=16384,this.writableCorked=0;const n=this;this._writableState={get objectMode(){return n._objectMode},get highWaterMark(){return n._highWaterMark},get finished(){return n.writableFinished},set finished(s){n.writableFinished=s},get ended(){return n.writableEnded},set ended(s){n.writableEnded=s},get destroyed(){return n.destroyed},get errored(){return n.errored},get closed(){return n.closed},get corked(){return n._corked},get length(){return n.writableLength},get needDrain(){return n.writableNeedDrain},writing:!1,errorEmitted:!1,emitClose:!0,get autoDestroy(){return n._autoDestroy},defaultEncoding:"utf8",finalCalled:!1,ending:!1,bufferedIndex:0},t&&(t.objectMode&&(this._objectMode=!0,this.writableObjectMode=!0,t.highWaterMark===void 0&&(this._highWaterMark=16,this.writableHighWaterMark=16)),t.highWaterMark!==void 0&&(this._highWaterMark=t.highWaterMark,this.writableHighWaterMark=t.highWaterMark),t.autoDestroy!==void 0&&(this._autoDestroy=t.autoDestroy),t.write&&(this._write=t.write.bind(this)),t.writev&&(this._writev=t.writev.bind(this)),t.final&&(this._final=t.final.bind(this)),t.destroy&&(this._destroy=t.destroy.bind(this)))},Object.setPrototypeOf(Ke.prototype,ne.prototype),Ke.prototype._write=function(t,n,s){s(null)},Ke.prototype._final=function(t){t(null)},Ke.prototype._destroy=function(t,n){n(t)},Ke.prototype.write=function(t,n,s){if(this._closed){const p=new Error("write after end");return typeof n=="function"?n(p):s&&s(p),!1}const r=typeof n=="string"?n:"utf8",o=typeof n=="function"?n:s,c=typeof t=="string"?z.from(t):t;if(this._parts.push(c),this._writableByteLength+=je(c),this._corked>0)return this._corkedWrites.push({chunk:t,encoding:r,callback:o}),this._writableByteLength<this._highWaterMark;this._write(t,r,p=>{this._writableByteLength-=je(c),o&&o(p),this.writableNeedDrain&&this._writableByteLength<this._highWaterMark&&(this.writableNeedDrain=!1,this.emit("drain"))});const d=this._writableByteLength<this._highWaterMark;return d||(this.writableNeedDrain=!0),d},Ke.prototype.end=function(t,n,s){typeof t=="function"?s=t:t!==void 0&&this.write(t),typeof n=="function"&&(s=n),this._closed=!0,this.writable=!1,this.writableEnded=!0;const r=this,o=()=>{r.writableFinished=!0,r.emit("finish"),r._autoDestroy&&(r.closed=!0,r.emit("close")),s&&s()};return queueMicrotask(()=>{r._final(c=>{if(c){r.errored=c,r.emit("error",c);return}o()})}),this},Ke.prototype.getBuffer=function(){return z.concat(this._parts)},Ke.prototype.getBufferAsString=function(t){return this.getBuffer().toString(t||"utf8")},Ke.prototype.close=function(t){this.destroy(),t&&t(null)},Ke.prototype.destroy=function(t){return this.destroyed?this:(this.destroyed=!0,t&&(this.errored=t),this._destroy(t??null,n=>{n&&!t&&(this.errored=n),this._parts.length=0,this._corkedWrites.length=0,this._writableByteLength=0,this._closed=!0,this.writable=!1,(n||t)&&this.emit("error",n||t),this.closed=!0,this.emit("close")}),this)},Ke.prototype.cork=function(){this._corked++,this.writableCorked=this._corked},Ke.prototype.uncork=function(){if(this._corked>0&&(this._corked--,this.writableCorked=this._corked),this._corked===0&&this._corkedWrites.length>0){const t=this._corkedWrites.splice(0);if(this._writev)this._writev(t.map(n=>({chunk:n.chunk,encoding:n.encoding})),n=>{for(const s of t)s.callback&&s.callback(n)});else for(const n of t)this._write(n.chunk,n.encoding,s=>{n.callback&&n.callback(s)})}},Ke.prototype.setDefaultEncoding=function(t){return this},Object.defineProperty(Ke.prototype,"writableLength",{get:function(){return this._objectMode?this._parts.length:this._writableByteLength},configurable:!0}),Ke.toWeb=function(t){return new WritableStream({write(n){return new Promise((s,r)=>{t.write(n,c=>{c?r(c):s()})&&s()})},close(){return new Promise(n=>{t.end(()=>n())})},abort(n){t.destroy(n instanceof Error?n:new Error(String(n)))}})},Ke.fromWeb=function(t,n){const s=t.getWriter();return new Ke({...n,write(r,o,c){s.write(r).then(()=>c(null),d=>c(d))},final(r){s.close().then(()=>r(null),o=>r(o))}})};const _e=function(t){if(!this)return;Se.call(this,{objectMode:(t==null?void 0:t.objectMode)||(t==null?void 0:t.readableObjectMode),highWaterMark:(t==null?void 0:t.readableHighWaterMark)??(t==null?void 0:t.highWaterMark),autoDestroy:t==null?void 0:t.autoDestroy,read:t==null?void 0:t.read,destroy:t==null?void 0:t.destroy}),this._writeParts=[],this._writeClosed=!1,this._writeObjectMode=!1,this._writeHighWaterMark=16384,this._writeAutoDestroy=!0,this._duplexCorked=0,this._duplexCorkedWrites=[],this._writableByteLen=0,this.writable=!0,this.writableEnded=!1,this.writableFinished=!1,this.writableNeedDrain=!1,this.writableObjectMode=!1,this.writableHighWaterMark=16384,this.writableCorked=0,this.allowHalfOpen=!0;const n=this;this._writableState={get objectMode(){return n._writeObjectMode},get highWaterMark(){return n._writeHighWaterMark},get finished(){return n.writableFinished},set finished(s){n.writableFinished=s},get ended(){return n.writableEnded},set ended(s){n.writableEnded=s},get destroyed(){return n.destroyed},get errored(){return n.errored},get closed(){return n.closed},get corked(){return n._duplexCorked},get length(){return n.writableLength},get needDrain(){return n.writableNeedDrain},writing:!1,errorEmitted:!1,emitClose:!0,get autoDestroy(){return n._writeAutoDestroy},defaultEncoding:"utf8",finalCalled:!1,ending:!1,bufferedIndex:0},t&&((t.objectMode||t.writableObjectMode)&&(this._writeObjectMode=!0,this.writableObjectMode=!0,(t.writableHighWaterMark??t.highWaterMark)===void 0&&(this._writeHighWaterMark=16,this.writableHighWaterMark=16)),t.writableHighWaterMark!==void 0?(this._writeHighWaterMark=t.writableHighWaterMark,this.writableHighWaterMark=t.writableHighWaterMark):t.highWaterMark!==void 0&&(this._writeHighWaterMark=t.highWaterMark,this.writableHighWaterMark=t.highWaterMark),t.autoDestroy!==void 0&&(this._writeAutoDestroy=t.autoDestroy),t.allowHalfOpen!==void 0&&(this.allowHalfOpen=t.allowHalfOpen),t.write&&(this._write=t.write.bind(this)),t.writev&&(this._writev=t.writev.bind(this)),t.final&&(this._final=t.final.bind(this)))};Object.setPrototypeOf(_e.prototype,Se.prototype),_e.prototype._write=function(t,n,s){s(null)},_e.prototype._final=function(t){t(null)},_e.prototype.write=function(t,n,s){if(this._writeClosed)return!1;const r=typeof n=="string"?n:"utf8",o=typeof n=="function"?n:s,c=typeof t=="string"?z.from(t):t;if(this._writeParts.push(c),this._writableByteLen+=je(c),this._duplexCorked>0)return this._duplexCorkedWrites.push({chunk:t,encoding:r,callback:o}),this._writableByteLen<this._writeHighWaterMark;this._write(t,r,p=>{this._writableByteLen-=je(c),o&&o(p),this.writableNeedDrain&&this._writableByteLen<this._writeHighWaterMark&&(this.writableNeedDrain=!1,this.emit("drain"))});const d=this._writableByteLen<this._writeHighWaterMark;return d||(this.writableNeedDrain=!0),d},_e.prototype.end=function(t,n,s){typeof t=="function"?s=t:t!==void 0&&this.write(t),typeof n=="function"&&(s=n),this._writeClosed=!0,this.writable=!1,this.writableEnded=!0;const r=this,o=()=>{r.writableFinished=!0,r.emit("finish"),s&&s()};return queueMicrotask(()=>{r._final(c=>{if(c){r.errored=c,r.emit("error",c);return}o()})}),this},_e.prototype.cork=function(){this._duplexCorked++,this.writableCorked=this._duplexCorked},_e.prototype.uncork=function(){if(this._duplexCorked>0&&(this._duplexCorked--,this.writableCorked=this._duplexCorked),this._duplexCorked===0&&this._duplexCorkedWrites.length>0){const t=this._duplexCorkedWrites.splice(0);if(this._writev)this._writev(t.map(n=>({chunk:n.chunk,encoding:n.encoding})),n=>{for(const s of t)s.callback&&s.callback(n)});else for(const n of t)this._write(n.chunk,n.encoding,s=>{n.callback&&n.callback(s)})}},_e.prototype.setDefaultEncoding=function(t){return this},Object.defineProperty(_e.prototype,"writableLength",{get:function(){return this._writeObjectMode?this._writeParts.length:this._writableByteLen},configurable:!0}),_e.from=function(t,n){const s=new _e;if(t instanceof ReadableStream){const r=t.getReader();(async()=>{try{for(;;){const{value:o,done:c}=await r.read();if(c){s.push(null);break}s.push(o)}}catch(o){s.destroy(o)}})()}else(async()=>{try{for await(const r of t)if(r!=null){const o=typeof r=="string"?z.from(r):r;s.push(o)}s.push(null)}catch(r){s.destroy(r)}})();return s},_e.toWeb=function(t){if(t instanceof _e){const n=Se.toWeb(t),s=Ke.toWeb(t);return{readable:n,writable:s}}return Se.toWeb(t)},_e.fromWeb=function(t,n){if(t instanceof ReadableStream)return Se.fromWeb(t,n);const s=t,r=new _e,o=s.readable.getReader();return(async()=>{try{for(;;){const{value:c,done:d}=await o.read();if(d){r.push(null);break}r.push(c)}}catch(c){r.destroy(c)}})(),r};const et=function(t){this&&_e.call(this,t)};Object.setPrototypeOf(et.prototype,_e.prototype),et.prototype.write=function(t,n,s){const r=typeof t=="string"?z.from(t):t;this.push(r);const o=typeof n=="function"?n:s;return o&&queueMicrotask(()=>o(null)),!0};const $t=function(t){this&&(_e.call(this,t),this._flushed=!1,t&&(t.transform&&(this._transform=t.transform.bind(this)),t.flush&&(this._flush=t.flush.bind(this))))};Object.setPrototypeOf($t.prototype,_e.prototype),$t.prototype._transform=function(t,n,s){s(null,t)},$t.prototype._flush=function(t){t(null)},$t.prototype._final=function(t){const n=this,s=()=>{t(null),n.push(null)};if(n._flushed){s();return}n._flushed=!0,n._flush((r,o)=>{if(r){t(r);return}o&&n.push(o),s()})},$t.prototype.write=function(t,n,s){const r=typeof t=="string"?z.from(t):t,o=typeof n=="string"?n:"utf8",c=typeof n=="function"?n:s;return this._transform(r,o,(d,p)=>{if(d){c&&c(d);return}p&&this.push(p),c&&c(null)}),!0},$t.prototype.end=function(t,n,s){return this._flushed||(this._flushed=!0,this._flush((r,o)=>{o&&this.push(o)})),_e.prototype.end.call(this,t,n,s)};const tn=function(){this&&ne.call(this)};Object.setPrototypeOf(tn.prototype,ne.prototype),tn.prototype.pipe=function(t){const n=this,s=o=>{t.write&&t.write(o)};n.on("data",s);const r=()=>{t.end&&t.end()};return n.on("end",r),n._pipeDests||(n._pipeDests=[]),n._pipeDests.push({dest:t,onData:s,onEnd:r}),t},tn.prototype.unpipe=function(t){const n=this._pipeDests||[];if(t){const s=n.findIndex(r=>r.dest===t);s!==-1&&(this.removeListener("data",n[s].onData),this.removeListener("end",n[s].onEnd),n.splice(s,1))}else{for(const s of n)this.removeListener("data",s.onData),this.removeListener("end",s.onEnd);this._pipeDests=[]}return this};function bh(e,t){if(e.aborted)t.destroy(new Error("The operation was aborted"));else{const n=()=>{t.destroy(new Error("The operation was aborted"))};e.addEventListener("abort",n,{once:!0});const s=t.destroy.bind(t);t.destroy=r=>(e.removeEventListener("abort",n),s(r))}return t}const wt=tn;wt.Readable=Se,wt.Writable=Ke,wt.Duplex=_e,wt.Transform=$t,wt.PassThrough=et,wt.Stream=tn,wt.from=Se.from,wt.addAbortSignal=bh;function wl(...e){const t=typeof e[e.length-1]=="function"?e.pop():null,n=e;if(n.length<2)return t&&setTimeout(()=>t(new Error("pipeline requires at least 2 streams")),0),n[0];for(let c=0;c<n.length;c++){const d=n[c];d&&typeof d.getReader=="function"&&typeof d.pipe!="function"&&typeof d.on!="function"&&(n[c]=Se.fromWeb(d))}let s=!1;const r=(...c)=>{const d=c[0];if(!s){s=!0;for(const p of n)typeof p.destroy=="function"&&p.destroy();t&&t(d)}};for(let c=0;c<n.length-1;c++){const d=n[c],p=n[c+1];typeof d.pipe=="function"&&d.pipe(p),d.on("error",r)}const o=n[n.length-1];if(o.on("error",r),t&&!s){const c=()=>{s||t(null)};o instanceof Se?o.on("end",c):o.on("finish",c)}return o}function Sl(e,t,n){const s=typeof t=="function"?t:n,r=e;let o=!1;const c=k=>{o||(o=!0,s&&s(k))},d=()=>{r.removeListener("end",p),r.removeListener("finish",y),r.removeListener("error",g),r.removeListener("close",x)},p=()=>{d(),c()},y=()=>{d(),c()},g=k=>{d(),c(k)},x=()=>{d(),c()};return r.on("end",p),r.on("finish",y),r.on("error",g),r.on("close",x),(r.readableEnded||r.writableFinished)&&queueMicrotask(()=>c()),d}let vh=16384,wh=16;function Sh(e){return e?wh:vh}function xh(e,t){e?wh=t:vh=t}const Eh={pipeline:async(...e)=>new Promise((t,n)=>{wl(...e,s=>{s?n(s):t()})}),finished:async(e,t)=>new Promise((n,s)=>{Sl(e,t,r=>{r?s(r):n()})})};wt.pipeline=wl,wt.finished=Sl,wt.promises=Eh,wt.getDefaultHighWaterMark=Sh,wt.setDefaultHighWaterMark=xh;function kh(...e){return new et}function xl(e){if(!e||typeof e!="object")return!1;const t=e;return!(typeof t.read!="function"||t.destroyed||t.readableEnded||t._terminated)}function Ch(e){if(!e||typeof e!="object")return!1;const t=e;return!(typeof t.write!="function"||t.destroyed||t.writableEnded||t.writableFinished)}function El(e){if(!e||typeof e!="object")return!1;const t=e;return!!t.readableDidRead||!!t._reading}function Ah(e){return!e||typeof e!="object"?!1:e.errored!=null}wt.compose=kh,wt.isReadable=xl,wt.isWritable=Ch,wt.isDisturbed=El,wt.isErrored=Ah,Se.isDisturbed=El,Se.isReadable=xl,Object.freeze(Object.defineProperty({__proto__:null,Duplex:_e,PassThrough:et,Readable:Se,Stream:tn,Transform:$t,Writable:Ke,addAbortSignal:bh,compose:kh,default:tn,finished:Sl,getDefaultHighWaterMark:Sh,isDisturbed:El,isErrored:Ah,isReadable:xl,isWritable:Ch,pipeline:wl,promises:Eh,setDefaultHighWaterMark:xh},Symbol.toStringTag,{value:"Module"})),new TextDecoder,new TextEncoder;const mi=function(t,n){this&&(this.path=t,this._entries=n,this._pos=0,this._closed=!1)};mi.prototype.readSync=function(){if(this._closed)throw new Error("ERR_DIR_CLOSED: Directory handle was closed");return this._pos>=this._entries.length?null:this._entries[this._pos++]},mi.prototype.read=function(t){if(t){try{const s=this.readSync();queueMicrotask(()=>t(null,s))}catch(s){queueMicrotask(()=>t(s,null))}return}const n=this;return new Promise((s,r)=>{try{s(n.readSync())}catch(o){r(o)}})},mi.prototype.closeSync=function(){this._closed=!0},mi.prototype.close=function(t){if(this._closed=!0,t){queueMicrotask(()=>t(null));return}return Promise.resolve()},mi.prototype[Symbol.asyncIterator]=function(){const e=this;return{async next(){const t=e.readSync();return t===null?{done:!0,value:void 0}:{done:!1,value:t}},[Symbol.asyncIterator](){return this}}};const kl="/",Cl=":";qn=function(e){if(!e)return".";const t=e.charAt(0)==="/",n=e.split("/").filter(o=>o.length>0),s=[];for(const o of n)o===".."?s.length>0&&s[s.length-1]!==".."?s.pop():t||s.push(".."):o!=="."&&s.push(o);let r=s.join("/");return t&&(r="/"+r),r||"."};function yt(...e){if(e.length===0)return".";const t=e.filter(n=>n!=="").join("/");return qn(t)}ar=function(...e){let t="";for(let n=e.length-1;n>=0;n--){const s=e[n];if(s&&(t=s+(t?"/"+t:""),t.charAt(0)==="/"))break}return t.charAt(0)!=="/"&&(t=(typeof globalThis<"u"&&globalThis.process&&typeof globalThis.process.cwd=="function"?globalThis.process.cwd():"/")+(t?"/"+t:"")),qn(t)};function gi(e){return e.charAt(0)==="/"}ir=function(e){if(!e)return".";const t=qn(e),n=t.lastIndexOf("/");return n<0?".":n===0?"/":t.substring(0,n)},rr=function(e,t){if(!e)return"";const n=qn(e);let s=n.substring(n.lastIndexOf("/")+1);return t&&s.endsWith(t)&&(s=s.substring(0,s.length-t.length)),s},Jr=function(e){const t=rr(e),n=t.lastIndexOf(".");return n<=0?"":t.substring(n)},ba=function(e,t){const n=ar(e),s=ar(t);if(n===s)return"";const r=n.split("/").filter(Boolean),o=s.split("/").filter(Boolean);let c=0;const d=Math.min(r.length,o.length);for(;c<d&&r[c]===o[c];)c++;const p=r.length-c,y=o.slice(c),g=[];for(let x=0;x<p;x++)g.push("..");return g.push(...y),g.join("/")||"."};function Ba(e){const t=qn(e),n=gi(t),s=ir(t),r=rr(t),o=Jr(t),c=r.substring(0,r.length-o.length);return{root:n?"/":"",dir:s,base:r,ext:o,name:c}}function La(e){const t=e.dir||e.root||"",n=e.base||(e.name||"")+(e.ext||"");return t?t===e.root?t+n:t+"/"+n:n}const Th={sep:kl,delimiter:Cl,normalize:qn,join:yt,resolve:ar,isAbsolute:gi,dirname:ir,basename:rr,extname:Jr,relative:ba,parse:Ba,format:La},Ih={sep:"\\",delimiter:";",normalize:qn,join:yt,resolve:ar,isAbsolute:gi,dirname:ir,basename:rr,extname:Jr,relative:ba,parse:Ba,format:La};Object.freeze(Object.defineProperty({__proto__:null,basename:rr,default:{sep:kl,delimiter:Cl,normalize:qn,join:yt,resolve:ar,isAbsolute:gi,dirname:ir,basename:rr,extname:Jr,relative:ba,parse:Ba,format:La,posix:Th,win32:Ih},delimiter:Cl,dirname:ir,extname:Jr,format:La,isAbsolute:gi,join:yt,normalize:qn,parse:Ba,posix:Th,relative:ba,resolve:ar,sep:kl,win32:Ih},Symbol.toStringTag,{value:"Module"}));const Rh=console;function Al(e,t){const n=new ne,s=o=>{t&&t(o)},r={isTTY:!1,columns:ge.COLUMNS,rows:ge.ROWS,isRaw:!1,on(o,c){return n.on(o,c),r},once(o,c){return n.once(o,c),r},off(o,c){return n.off(o,c),r},emit(o,...c){return n.emit(o,...c)},addListener(o,c){return n.addListener(o,c),r},removeListener(o,c){return n.removeListener(o,c),r},removeAllListeners(o){return n.removeAllListeners(o),r},setMaxListeners(o){return n.setMaxListeners(o),r},getMaxListeners(){return n.getMaxListeners()},listenerCount(o){return n.listenerCount(o)},listeners(o){return n.listeners(o)},rawListeners(o){return n.rawListeners(o)},prependListener(o,c){return n.prependListener(o,c),r},prependOnceListener(o,c){return n.prependOnceListener(o,c),r},eventNames(){return n.eventNames()},pause(){return r},resume(){return r},setEncoding(o){return r},write(o,c,d){if(e&&t&&o!=null){const p=typeof o=="string"?o:String(o);t(p)}return d&&queueMicrotask(d),!0},end(o,c){if(e&&t&&o!=null){const d=typeof o=="string"?o:String(o);t(d)}c&&queueMicrotask(c)},read(){return null},destroy(){return r},pipe(o){const c=d=>{o.write&&o.write(d)};return n.on("data",c),r._pipeDests||(r._pipeDests=[]),r._pipeDests.push({dest:o,onData:c}),o},unpipe(o){const c=r._pipeDests||[];if(o){const d=c.findIndex(p=>p.dest===o);d>=0&&(n.off("data",c[d].onData),c.splice(d,1))}else{for(const d of c)n.off("data",d.onData);c.length=0}return r},unshift(){},wrap(){return r},[Symbol.asyncIterator](){return{next:async()=>({done:!0,value:void 0})}},readable:!0,writable:!0,destroyed:!1,setRawMode(o){return r.isRaw=o,r},clearLine(o,c){return e&&s(o===-1?"\x1B[1K":o===1?"\x1B[0K":"\x1B[2K"),c&&c(),!0},cursorTo(o,c,d){return typeof c=="function"&&(d=c,c=void 0),e&&s(typeof c=="number"?`\x1B[${c+1};${o+1}H`:`\x1B[${o+1}G`),typeof d=="function"&&d(),!0},moveCursor(o,c,d){return e&&(o>0?s(`\x1B[${o}C`):o<0&&s(`\x1B[${-o}D`),c>0?s(`\x1B[${c}B`):c<0&&s(`\x1B[${-c}A`)),d&&d(),!0},getWindowSize(){return[r.columns,r.rows]},getColorDepth(o){return 8},hasColors(o,c){return 256>=(typeof o=="number"?o:256)}};return e&&t&&(r.write=(o,c,d)=>{const p=typeof o=="string"?o:o.toString(),y=t(p);return d&&queueMicrotask(d),y}),r}B0=function(e){let t=(e==null?void 0:e.cwd)||"/",n=18;const s=Date.now(),r=new ne,o={NODE_ENV:Cn.NODE_ENV,PATH:Cn.PATH,HOME:Cn.HOME,SHELL:Cn.SHELL,TERM:Cn.TERM,COLORTERM:Cn.COLORTERM,REQUIRES_WASM:Cn.REQUIRES_WASM,npm_config_user_agent:Cn.npm_config_user_agent,npm_execpath:Cn.npm_execpath,npm_node_execpath:Cn.npm_node_execpath,NAPI_RS_FORCE_WASM:"1",NEXT_TELEMETRY_DISABLED:"1",DO_NOT_TRACK:"1",...e==null?void 0:e.env},c=Al(!0,x=>(e!=null&&e.onStdout?e.onStdout(x):Rh.log(x),!0)),d=Al(!0,x=>(e!=null&&e.onStderr?e.onStderr(x):Rh.error(x),!0)),p=Al(!1),y=function(k){const C=performance.now(),T=Math.floor(C/1e3),L=Math.floor(C%1e3*1e6);return k?[T-k[0],L-k[1]]:[T,L]};y.bigint=()=>BigInt(Math.floor(performance.now()*1e6));const g={env:o,cwd(){return g._debugCwdCalls||(g._debugCwdCalls=0),g._debugCwdCalls++,t},chdir(x){x.startsWith("/")||(x=t+"/"+x),t=x,g._chdirHook&&g._chdirHook(x)},platform:M.PLATFORM,arch:M.ARCH,title:se.TITLE,version:_a.NODE,versions:{...w},argv:["node","/index.js"],argv0:"node",execPath:se.EXEC_PATH,execArgv:[],pid:(e==null?void 0:e.pid)??se.PID,ppid:(e==null?void 0:e.ppid)??se.PPID,exit(x=0){throw r.emit("exit",x),e!=null&&e.onExit&&e.onExit(x),new Error(`Process exited with code ${x}`)},nextTick(x,...k){queueMicrotask(()=>x(...k))},stdout:c,stderr:d,stdin:p,hrtime:y,memoryUsage:Object.assign(function(){return{rss:Z.RSS,heapTotal:Z.HEAP_TOTAL,heapUsed:Z.HEAP_USED,external:Z.EXTERNAL,arrayBuffers:0}},{rss:()=>Z.RSS}),uptime(){return(Date.now()-s)/1e3},cpuUsage(){return{user:0,system:0}},resourceUsage(){return{userCPUTime:0,systemCPUTime:0,maxRSS:Z.RSS/1024,sharedMemorySize:0,unsharedDataSize:0,unsharedStackSize:0,minorPageFault:0,majorPageFault:0,swappedOut:0,fsRead:0,fsWrite:0,ipcSent:0,ipcReceived:0,signalsCount:0,voluntaryContextSwitches:0,involuntaryContextSwitches:0}},abort(){throw new Error("process.abort() called")},kill(x,k){const C=typeof k=="string"?k:"SIGTERM";return r.emit(C),!0},umask(x){const k=n;return x!==void 0&&(n=x),k},config:{variables:{},target_defaults:{}},release:{name:"node",sourceUrl:"",headersUrl:""},features:{inspector:!1,debug:!1,uv:!0,ipv6:!0,tls_alpn:!0,tls_sni:!0,tls_ocsp:!0,tls:!0},debugPort:9229,allowedNodeEnvironmentFlags:new Set,mainModule:void 0,channel:void 0,noDeprecation:!1,throwDeprecation:!1,traceDeprecation:!1,traceProcessWarnings:!1,report:{directory:"",filename:"",getReport:()=>({}),reportOnFatalError:!1,reportOnSignal:!1,reportOnUncaughtException:!1,signal:"SIGUSR2",writeReport:()=>""},binding(x){if(x==="natives")return{};if(x==="config")return{exposeInternals:!1};if(x==="constants")return{os:{UV_UDP_REUSEADDR:4,signals:{SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGBUS:7,SIGFPE:8,SIGKILL:9,SIGUSR1:10,SIGSEGV:11,SIGUSR2:12,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGCHLD:17,SIGCONT:18,SIGSTOP:19,SIGTSTP:20,SIGTTIN:21,SIGTTOU:22,SIGURG:23,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28,SIGIO:29,SIGPWR:30,SIGSYS:31},errno:{}},fs:{O_RDONLY:0,O_WRONLY:1,O_RDWR:2,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_NONBLOCK:2048,O_DSYNC:4096,O_SYNC:1052672,O_DIRECT:16384,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_CLOEXEC:524288,UV_FS_O_FILEMAP:0,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,F_OK:0,R_OK:4,W_OK:2,X_OK:1},crypto:{},zlib:{}};if(x==="util")return{};if(x==="fs")return{};if(x==="buffer")return{};if(x==="stream_wrap")return{};if(x==="tcp_wrap")return{};if(x==="pipe_wrap")return{};throw new Error(`No such module: ${x}`)},_linkedBinding(x){return{}},dlopen(x,k,C){throw new Error("process.dlopen is not supported in browser environment")},reallyExit(x){},_getActiveRequests(){return[]},_getActiveHandles(){return[]},emitWarning(x,k,C){const T=typeof x=="string"?x:x.message,L=typeof k=="string"?k:(k==null?void 0:k.type)??"Warning";r.emit("warning",{name:L,message:T,code:C})},hasUncaughtExceptionCaptureCallback(){return!1},setUncaughtExceptionCaptureCallback(x){},sourceMapsEnabled:!1,setSourceMapsEnabled(x){},constrainedMemory(){return 0},availableMemory(){return 512*1024*1024},on(x,k){return r.on(x,k),g},once(x,k){return r.once(x,k),g},off(x,k){return r.off(x,k),g},emit(x,...k){return r.emit(x,...k)},addListener(x,k){return r.addListener(x,k),g},removeListener(x,k){return r.removeListener(x,k),g},removeAllListeners(x){return r.removeAllListeners(x),g},listeners(x){return r.listeners(x)},listenerCount(x){return r.listenerCount(x)},prependListener(x,k){return r.prependListener(x,k),g},prependOnceListener(x,k){return r.prependOnceListener(x,k),g},eventNames(){return r.eventNames()},setMaxListeners(x){return r.setMaxListeners(x),g},getMaxListeners(){return r.getMaxListeners()}};return g},B0();const ot=function(t){this&&(_e.call(this),this._isConnecting=!1,this._isConnected=!1,this._isDestroyed=!1,this._peerAddr="",this._peerPort=0,this._selfAddr="127.0.0.1",this._selfPort=0,this.localAddress="127.0.0.1",this.localPort=0,this.remoteAddress=void 0,this.remotePort=void 0,this.remoteFamily=void 0,this.connecting=!1,this.pending=!1,this.destroyed=!1,this.encrypted=!1,this.readyState="closed",this.bytesRead=0,this.bytesWritten=0)};Object.setPrototypeOf(ot.prototype,_e.prototype),ot.prototype.connect=function(t,n,s){let r,o="127.0.0.1",c;typeof t=="number"?(r=t,typeof n=="string"?(o=n,c=s):c=n):(r=t.port,o=t.host??"127.0.0.1",c=typeof n=="function"?n:s),this._isConnecting=!0,this.connecting=!0,this._peerAddr=o,this._peerPort=r,this.remoteAddress=o,this.remotePort=r,this.remoteFamily="IPv4",this.readyState="opening";const d=this;return queueMicrotask(()=>{d._isConnecting=!1,d._isConnected=!0,d.connecting=!1,d.readyState="open",d.emit("connect"),c&&c()}),this},ot.prototype.address=function(){return this._isConnected?{address:this._selfAddr,family:"IPv4",port:this._selfPort}:null},ot.prototype.setEncoding=function(t){return this},ot.prototype.setTimeout=function(t,n){return n&&this.once("timeout",n),this},ot.prototype.setNoDelay=function(t){return this},ot.prototype.setKeepAlive=function(t,n){return this},ot.prototype.ref=function(){return this},ot.prototype.unref=function(){return this},ot.prototype.destroy=function(t){if(this._isDestroyed)return this;this._isDestroyed=!0,this._isConnected=!1,this.destroyed=!0,this.readyState="closed",t&&this.emit("error",t);const n=this;return queueMicrotask(()=>n.emit("close",!!t)),this},ot.prototype._feedData=function(t){const n=typeof t=="string"?z.from(t):t;this.push(n)},ot.prototype._feedEnd=function(){this.push(null)};const nn=function(t,n){if(!this)return;ne.call(this),this._bound=!1,this._addr=null,this._peers=new Set,this._cap=1/0,this.listening=!1,this.maxConnections=void 0;let s;typeof t=="function"?s=t:s=n,s&&this.on("connection",s)};Object.setPrototypeOf(nn.prototype,ne.prototype),nn.prototype.listen=function(t,n,s,r){let o=0,c="0.0.0.0",d;typeof t=="number"?(o=t,typeof n=="string"?(c=n,d=typeof s=="function"?s:r):typeof n=="function"?d=n:d=typeof s=="function"?s:r):t&&(o=t.port??0,c=t.host??"0.0.0.0",d=typeof n=="function"?n:r),o===0&&(o=xe.BASE+Math.floor(Math.random()*xe.RANGE)),this._addr={address:c,family:"IPv4",port:o},this._bound=!0,this.listening=!0;const p=this;return queueMicrotask(()=>{p.emit("listening"),d&&d()}),this},nn.prototype.address=function(){return this._addr?{...this._addr,host:this._addr.address}:null},nn.prototype.close=function(t){this._bound=!1,this.listening=!1;for(const s of this._peers)s.destroy();this._peers.clear();const n=this;return queueMicrotask(()=>{n.emit("close"),t&&t()}),this},nn.prototype.getConnections=function(t){typeof t=="function"&&t(null,this._peers.size)},nn.prototype.ref=function(){return this},nn.prototype.unref=function(){return this},nn.prototype._acceptConnection=function(t){if(!this._bound){t.destroy();return}this._peers.add(t);const n=this;t.on("close",function(){n._peers.delete(t)}),this.emit("connection",t)};function Ph(e,t){return new nn(e,t)}function Tl(e,t,n){return new ot().connect(e,t,n)}const Dh=Tl;function Ma(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)?4:/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/.test(e)?6:0}function Oh(e){return Ma(e)===4}function Nh(e){return Ma(e)===6}Object.freeze(Object.defineProperty({__proto__:null,TcpServer:nn,TcpSocket:ot,connect:Dh,createConnection:Tl,createServer:Ph,default:{Socket:ot,Server:nn,createServer:Ph,createConnection:Tl,connect:Dh,isIP:Ma,isIPv4:Oh,isIPv6:Nh},isIP:Ma,isIPv4:Oh,isIPv6:Nh},Symbol.toStringTag,{value:"Module"}));function Fa(e){switch(e.toUpperCase().replace(/[^A-Z0-9]/g,"")){case"SHA1":return"SHA-1";case"SHA256":return"SHA-256";case"SHA384":return"SHA-384";case"SHA512":return"SHA-512";case"MD5":return"MD5";default:return e}}function Bh(e){return e.includes("512")?64:e.includes("384")?48:e.includes("1")||e==="SHA-1"?20:32}function Il(e,t){const n=Bh(t),s=new Uint8Array(n);let r=-559038737,o=1103547991;for(let c=0;c<e.length;c++)r=Math.imul(r^e[c],2654435761),o=Math.imul(o^e[c],1597334677);r=Math.imul(r^r>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507)^Math.imul(r^r>>>13,3266489909);for(let c=0;c<n;c++){const d=c<n>>>1?r:o;s[c]=d>>>(c&3)*8&255,r=Math.imul(r,1103515245)+12345|0,o=Math.imul(o,1103515245)+12345|0}return s}function Rl(e,t,n){const s=new Uint8Array(t.length+e.length);return s.set(t,0),s.set(e,t.length),Il(s,n)}function hr(e){let t=0;for(const r of e)t+=r.length;const n=new Uint8Array(t);let s=0;for(const r of e)n.set(r,s),s+=r.length;return n}function $a(e,t){return t==="hex"?Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join(""):t==="base64"?btoa(String.fromCharCode(...e)):z.from(e)}function Dt(e){const t=new Uint8Array(e);return crypto.getRandomValues(t),z.from(t)}function Pl(e,t,n){const s=t||0,r=n!==void 0?n:e.length-s,o=new Uint8Array(e.buffer,e.byteOffset+s,r);return crypto.getRandomValues(o),e}function Lh(){return crypto.randomUUID()}function Mh(e,t){t===void 0&&(t=e,e=0);const n=t-e,s=new Uint32Array(1);return crypto.getRandomValues(s),e+s[0]%n}function Fh(e){return crypto.getRandomValues(e)}const pr=function(t){this&&(this._alg=Fa(t),this._parts=[])};pr.prototype.update=function(t,n){if(t==null)throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received '+String(t));let s;return typeof t=="string"?s=n==="base64"?z.from(atob(t)):z.from(t):s=z.from(t),this._parts.push(s),this},pr.prototype.digestAsync=async function(t){const n=hr(this._parts),s=new Uint8Array(n).buffer,r=await crypto.subtle.digest(this._alg,s);return $a(new Uint8Array(r),t)},pr.prototype.digest=function(t){const n=hr(this._parts),s=Il(n,this._alg);return $a(s,t)},Xr=function(e){return new pr(e)};function $h(e,t,n){const s=Xr(e);return s.update(t),s.digest(n)}const fr=function(t,n){this&&(this._alg=Fa(t),this._key=typeof n=="string"?z.from(n):n,this._parts=[])};fr.prototype.update=function(t,n){if(t==null)throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received '+String(t));const s=typeof t=="string"?z.from(t):t;return this._parts.push(s),this},fr.prototype.digestAsync=async function(t){const n=hr(this._parts),s=new Uint8Array(this._key).buffer,r=new Uint8Array(n).buffer,o=await crypto.subtle.importKey("raw",s,{name:"HMAC",hash:this._alg},!1,["sign"]),c=await crypto.subtle.sign("HMAC",o,r);return $a(new Uint8Array(c),t)},fr.prototype.digest=function(t){const n=hr(this._parts),s=Rl(n,this._key,this._alg);return $a(s,t)};function Ua(e,t){return new fr(e,t)}function Uh(e,t,n,s,r,o){nx(e,t,n,s,r).then(c=>o(null,c)).catch(c=>o(c,z.alloc(0)))}async function nx(e,t,n,s,r){const o=typeof e=="string"?z.from(e):e,c=typeof t=="string"?z.from(t):t,d=new Uint8Array(o).buffer,p=new Uint8Array(c).buffer,y=await crypto.subtle.importKey("raw",d,"PBKDF2",!1,["deriveBits"]),g=await crypto.subtle.deriveBits({name:"PBKDF2",salt:p,iterations:n,hash:Fa(r)},y,s*8);return z.from(g)}function Dl(e,t,n,s,r){const o=typeof e=="string"?z.from(e):e,c=typeof t=="string"?z.from(t):t,d=Fa(r),p=Bh(d),y=Math.ceil(s/p),g=new Uint8Array(y*p);for(let x=1;x<=y;x++){const k=new Uint8Array(4);k[0]=x>>>24&255,k[1]=x>>>16&255,k[2]=x>>>8&255,k[3]=x&255;const C=new Uint8Array(c.length+4);C.set(c),C.set(k,c.length);let T=Rl(C,o,d);const L=new Uint8Array(T);for(let V=1;V<n;V++){T=Rl(T,o,d);for(let K=0;K<L.length;K++)L[K]^=T[K]}g.set(L,(x-1)*p)}return z.from(g.slice(0,s))}function jh(e,t,n,s,r){try{const o=Ol(e,t,n);setTimeout(()=>r(null,o),0)}catch(o){setTimeout(()=>r(o,z.alloc(0)),0)}}function Ol(e,t,n,s){return Dl(e,t,16384,n,"sha256")}function Os(e){if(e instanceof sn)return{raw:e._data,alg:e._alg,kind:e._kind,fmt:"raw"};if(typeof e=="object"&&"key"in e)return Os(e.key);const t=typeof e=="string"?e:e.toString();if(t.includes("-----BEGIN")){const s=t.includes("PRIVATE"),r=t.includes("PUBLIC"),o=t.replace(/-----BEGIN [^-]+-----/,"").replace(/-----END [^-]+-----/,"").replace(/\s/g,""),c=z.from(atob(o));let d;return t.includes("RSA")?d="RSA-SHA256":t.includes("EC")?d="ES256":t.includes("ED25519")&&(d="Ed25519"),{raw:c,alg:d,kind:s?"private":r?"public":"secret",fmt:"pem"}}return{raw:typeof e=="string"?z.from(e):e,kind:"secret",fmt:"raw"}}function ja(e,t,n){const s=n.raw instanceof Uint8Array?n.raw:new Uint8Array(0),r=new Uint8Array(s.length+t.length);return r.set(s,0),r.set(t,s.length),z.from(Il(r,e))}function Nl(e,t,n,s){const r=ja(e,t,n);return Ll(z.from(s),r)}function Vh(e,t,n,s){const r=Os(n),o=e||r.alg||"SHA-256";if(s){try{s(null,ja(o,t,r))}catch(c){s(c,null)}return}return ja(o,t,r)}function Hh(e,t,n,s,r){const o=Os(n),c=e||o.alg||"SHA-256";if(r){try{r(null,Nl(c,t,o,s))}catch(d){r(d,!1)}return}return Nl(c,t,o,s)}const yi=function(t){this&&(ne.call(this),this._alg=t,this._parts=[])};Object.setPrototypeOf(yi.prototype,ne.prototype),yi.prototype.update=function(t,n){return this._parts.push(typeof t=="string"?z.from(t):t),this},yi.prototype.sign=function(t,n){const s=hr(this._parts),r=Os(t),o=ja(this._alg,s,r);return n==="base64"?btoa(String.fromCharCode(...o)):n==="hex"?Array.from(o).map(c=>c.toString(16).padStart(2,"0")).join(""):o};const _i=function(t){this&&(ne.call(this),this._alg=t,this._parts=[])};Object.setPrototypeOf(_i.prototype,ne.prototype),_i.prototype.update=function(t,n){return this._parts.push(typeof t=="string"?z.from(t):t),this},_i.prototype.verify=function(t,n,s){const r=hr(this._parts),o=Os(t);let c;return typeof n=="string"?s==="base64"?c=z.from(atob(n)):s==="hex"?c=z.from(n.match(/.{2}/g).map(d=>parseInt(d,16))):c=z.from(n):c=n,Nl(this._alg,r,o,c)};function Wh(e){return new yi(e)}function zh(e){return new _i(e)}function qh(e,t,n){throw new Error("createCipheriv is not supported in the browser polyfill")}function Gh(e,t,n){throw new Error("createDecipheriv is not supported in the browser polyfill")}const sn=function(t,n,s){this&&(this._kind=t,this._data=n,this._alg=s)};Object.defineProperty(sn.prototype,"type",{get:function(){return this._kind},configurable:!0}),Object.defineProperty(sn.prototype,"asymmetricKeyType",{get:function(){var e,t,n,s;if(this._kind!=="secret"){if((e=this._alg)!=null&&e.includes("RSA"))return"rsa";if((t=this._alg)!=null&&t.includes("EC")||(n=this._alg)!=null&&n.includes("ES"))return"ec";if((s=this._alg)!=null&&s.includes("Ed"))return"ed25519"}},configurable:!0}),Object.defineProperty(sn.prototype,"symmetricKeySize",{get:function(){if(this._kind==="secret")return this._data instanceof Uint8Array?this._data.length*8:void 0},configurable:!0}),sn.prototype.export=function(t){if(this._data instanceof Uint8Array)return z.from(this._data);throw new Error("Cannot synchronously export a CryptoKey")};function Bl(e,t){const n=typeof e=="string"?z.from(e,t):e;return new sn("secret",n)}function Kh(e){const t=Os(e);return new sn("public",t.raw,t.alg)}function Yh(e){const t=Os(e);return new sn("private",t.raw,t.alg)}function Ll(e,t){if(e.length!==t.length)return!1;let n=0;for(let s=0;s<e.length;s++)n|=e[s]^t[s];return n===0}function Zh(){return["aes-128-cbc","aes-256-cbc","aes-128-gcm","aes-256-gcm"]}function Xh(){return["sha1","sha256","sha384","sha512"]}const Jh={SSL_OP_ALL:0,RSA_PKCS1_PADDING:1,RSA_PKCS1_OAEP_PADDING:4,RSA_PKCS1_PSS_PADDING:6};function Qh(e,t){const n=(t==null?void 0:t.length)||32,s=Dt(n);return Bl(s)}function ep(e,t){const n=((t==null?void 0:t.modulusLength)||2048)/8,s=Dt(n),r=Dt(n),o=new sn("private",s,e),c=new sn("public",r,e),d=t==null?void 0:t.publicKeyEncoding,p=t==null?void 0:t.privateKeyEncoding;return{publicKey:(d==null?void 0:d.format)==="pem"?`-----BEGIN PUBLIC KEY-----
69
- ${btoa(String.fromCharCode(...r))}
70
- -----END PUBLIC KEY-----`:c,privateKey:(p==null?void 0:p.format)==="pem"?`-----BEGIN PRIVATE KEY-----
64
+ `}let YS=0;function uy({url:D,className:x="",onBrowserError:C,reloadKey:A=0}){const B=J.useRef(null),j=J.useRef(C);j.current=C;const U=J.useRef(A),$=J.useCallback(()=>{var V;const Y=B.current;if(Y)try{const K=Y.contentDocument||((V=Y.contentWindow)==null?void 0:V.document);if(!K)return;const ie=K.createElement("script");ie.textContent=KS();const ce=K.head||K.body||K.documentElement;ce&&ce.appendChild(ie)}catch(K){console.warn("[CodeSandbox:Preview] Could not inject error capture:",K)}},[]);return J.useEffect(()=>{const Y=V=>{if(!V.data||V.data.type!=="sandbox-error")return;const K=V.data,ie=j.current;if(!ie)return;let ce;if(K.filename){const sn=K.filename.match(/\/__(?:preview|virtual)__\/\d+(\/.*)/);ce=sn?sn[1].replace(/^\//,""):void 0}const Le={id:`browser_${++YS}_${Date.now()}`,category:K.category,message:K.message,stack:K.stack,filePath:ce,line:K.lineno??void 0,column:K.colno??void 0,timestamp:new Date().toISOString()};ie(Le)};return window.addEventListener("message",Y),()=>window.removeEventListener("message",Y)},[]),J.useEffect(()=>{B.current&&D&&(B.current.src=D)},[D]),J.useEffect(()=>{var Y;if(A!==U.current){U.current=A;const V=B.current;if(V&&D)try{(Y=V.contentWindow)==null||Y.location.reload()}catch{V.src=D}}},[A,D]),y.jsx("div",{className:`h-full w-full bg-white ${x}`,children:D?y.jsx("iframe",{ref:B,src:D,className:"w-full h-full border-none",title:"Preview",sandbox:"allow-scripts allow-forms allow-same-origin allow-popups allow-modals",onLoad:$}):y.jsx("div",{className:"flex items-center justify-center h-full bg-sb-bg",children:y.jsxs("div",{className:"text-center px-4",children:[y.jsx("div",{className:"w-10 h-10 mx-auto mb-3 border-2 border-sb-accent border-t-transparent rounded-full animate-spin"}),y.jsx("p",{className:"text-sb-text-muted text-sm",children:"Waiting for dev server to start..."})]})})})}const W_={initializing:{icon:"⚡",label:"Initializing Runtime",color:"text-blue-400"},"writing-files":{icon:"📁",label:"Writing Project Files",color:"text-yellow-400"},installing:{icon:"📦",label:"Installing Dependencies",color:"text-purple-400"},starting:{icon:"🚀",label:"Starting Application",color:"text-green-400"},ready:{icon:"✅",label:"Application Ready",color:"text-green-400"},error:{icon:"❌",label:"Error",color:"text-red-400"}};function dy({progress:D,className:x=""}){const C=W_[D.stage]||W_.initializing;return D.stage==="ready"?null:y.jsx("div",{className:`absolute inset-0 z-50 flex items-center justify-center bg-sb-bg/95 backdrop-blur-sm ${x}`,children:y.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-md px-8",children:[y.jsx("div",{className:"text-5xl animate-bounce",children:C.icon}),y.jsxs("h2",{className:`text-xl font-semibold ${C.color}`,children:[C.label,D.stage!=="error"&&y.jsx(XS,{})]}),y.jsx("div",{className:"w-64 h-2 bg-sb-bg-active rounded-full overflow-hidden",children:y.jsx("div",{className:"h-full bg-sb-accent rounded-full transition-all duration-500 ease-out",style:{width:`${D.percent}%`}})}),y.jsx("p",{className:"text-sm text-sb-text-muted text-center",children:D.message}),y.jsx("div",{className:"flex items-center gap-2 mt-4",children:["initializing","writing-files","installing","starting"].map((A,B)=>{const j=ZS(D.stage)>B,U=D.stage===A;return y.jsxs(J.Fragment,{children:[y.jsx("div",{className:`w-3 h-3 rounded-full transition-colors duration-300 ${j?"bg-sb-success":U?"bg-sb-accent animate-pulse":"bg-sb-bg-active"}`}),B<3&&y.jsx("div",{className:`w-8 h-0.5 transition-colors duration-300 ${j?"bg-sb-success":"bg-sb-bg-active"}`})]},A)})})]})})}function ZS(D){return["initializing","writing-files","installing","starting","ready"].indexOf(D)}function XS(){return y.jsxs("span",{className:"inline-flex ml-1",children:[y.jsx("span",{className:"animate-pulse",style:{animationDelay:"0ms"},children:"."}),y.jsx("span",{className:"animate-pulse",style:{animationDelay:"200ms"},children:"."}),y.jsx("span",{className:"animate-pulse",style:{animationDelay:"400ms"},children:"."})]})}const JS=[.4,0,.2,1],V_=J.memo(function({selected:x,children:C,onClick:A}){return y.jsxs("button",{onClick:A,className:`relative px-3 py-1 rounded-full text-xs font-medium transition-colors ${x?"text-white":"text-sb-text-muted hover:text-sb-text"}`,children:[y.jsx("span",{className:"relative z-10",children:C}),x&&y.jsx(uc.motion.span,{layoutId:"view-slider-pill",transition:{duration:.2,ease:JS},className:"absolute inset-0 z-0 bg-sb-accent rounded-full"})]})}),py=J.memo(function({selected:x,onSelect:C}){return y.jsxs("div",{className:"flex items-center gap-0.5 bg-sb-bg rounded-full p-0.5 border border-sb-border",children:[y.jsx(V_,{selected:x==="code",onClick:()=>C("code"),children:"Code"}),y.jsx(V_,{selected:x==="preview",onClick:()=>C("preview"),children:"Preview"})]})});var QS=Object.defineProperty,ex=(D,x,C)=>x in D?QS(D,x,{enumerable:!0,configurable:!0,writable:!0,value:C}):D[x]=C,T=(D,x,C)=>ex(D,typeof x!="symbol"?x+"":x,C);let q_,ci,I,Kn,M,lc,z_,G_,K_,Y_,te,qt,ui,xe,di,Z_,X_,J_,Q_,Ea,gr,is,_r,as,cc,pi,Tt,ey,ny,ka,ft,Ca,yr,Aa,ty,Yn,hi,Ia,ry,sy,iy;(async()=>{var D,x,C;function B(e){const n=[];for(let t=0;t<e.length;t+=8192){const r=Math.min(t+8192,e.length);let s="";for(let i=t;i<r;i++)s+=String.fromCharCode(e[i]);n.push(s)}return btoa(n.join(""))}function j(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r<n.length;r++)t[r]=n.charCodeAt(r);return t}const U=new Array(256);for(let e=0;e<256;e++)U[e]=(e<16?"0":"")+e.toString(16);function $(e){const n=new Array(e.length);for(let t=0;t<e.length;t++)n[t]=U[e[t]];return n.join("")}function Y(e){const n=[];for(let t=0;t<e.length;t+=8192){const r=Math.min(t+8192,e.length);let s="";for(let i=t;i<r;i++)s+=String.fromCharCode(e[i]);n.push(s)}return n.join("")}const V=Object.freeze(Object.defineProperty({__proto__:null,base64ToBytes:j,bytesToBase64:B,bytesToHex:$,bytesToLatin1:Y},Symbol.toStringTag,{value:"Module"}));ui={NODE:"v22.12.0",NODE_BARE:"22.12.0",NPM:"10.0.0",PNPM:"9.15.4",YARN:"4.6.0",BUN:"1.1.38",BUN_V:"v1.1.38",GIT:"2.43.0"};const K={node:ui.NODE_BARE,v8:"11.3.244.8",uv:"1.44.2",modules:"115",openssl:"3.0.13",napi:"9",webcontainer:"1.0.0"},ie="https://registry.npmjs.org",Le="https://esm.sh/pako@2.1.0",sn=[".js",".ts",".jsx",".tsx",".mjs",".cjs",".json"],An={".ts":"ts",".tsx":"tsx",".js":"js",".mjs":"js",".cjs":"js",".jsx":"jsx",".json":"json",".css":"css",".map":"json",".txt":"text",".wasm":"file"},ye={PLATFORM:"linux",ARCH:"x64",TYPE:"Linux",RELEASE:"5.10.0",VERSION:"#1 SMP",MACHINE:"x86_64",HOSTNAME:"localhost",HOMEDIR:"/home/user",TMPDIR:"/tmp",SHELL:"/bin/bash",USERNAME:"user",ENDIANNESS:"LE"},Fe={UID:1e3,GID:1e3},Tn={BLOCK_SIZE:4096,BLOCK_CALC_SIZE:512},we={MODEL:"Virtual CPU",SPEED:2400,COUNT:2},ze={TOTAL:4*1024*1024*1024,FREE:2*1024*1024*1024,RSS:50*1024*1024,HEAP_TOTAL:30*1024*1024,HEAP_USED:20*1024*1024,EXTERNAL:1*1024*1024},In=[.5,.5,.5],pn={COLUMNS:80,ROWS:24,FONT_SIZE:13},Zn={PID:1,PPID:0,TITLE:"node",EXEC_PATH:"/usr/local/bin/node"};Kn={NODE_ENV:"development",PATH:"/usr/local/bin:/usr/bin:/bin",HOME:"/",SHELL:"/bin/sh",TERM:"xterm-256color",COLORTERM:"truecolor",REQUIRES_WASM:"true",npm_config_user_agent:`npm/${ui.NPM} node/${ui.NODE} linux x64 workspaces/false`,npm_execpath:"/usr/local/lib/node_modules/npm/bin/npm-cli.js",npm_node_execpath:"/usr/local/bin/node"},qt={SYNC_OP:12e4,WAIT_LOOP_TICK:200,SW_HEARTBEAT:2e4,WORKER_REAP_INTERVAL:1e4,WORKER_IDLE_TIMEOUT:3e4,WORKER_INIT_TIMEOUT:3e4,HTTP_KEEP_ALIVE:5e3,HTTP_HEADERS:6e4,HTTP_DISPATCH_SAFETY:12e4};const mt={MAX_WORKERS_CAP:6},Xn={BASE:3e3,RANGE:1e3},an={TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10};class ls{constructor(n){T(this,"_listeners",new Map),T(this,"_closeFn",null),this._closeFn=n}close(){this._closeFn&&(this._closeFn(),this._closeFn=null),this._listeners.clear()}ref(){return this}unref(){return this}on(n,t){return this._listeners.has(n)||this._listeners.set(n,[]),this._listeners.get(n).push(t),this}addListener(n,t){return this.on(n,t)}once(n,t){const r=(...s)=>{this.removeListener(n,r),t(...s)};return this.on(n,r)}off(n,t){return this.removeListener(n,t)}removeListener(n,t){const r=this._listeners.get(n);if(r){const s=r.indexOf(t);s>=0&&r.splice(s,1)}return this}removeAllListeners(n){return n?this._listeners.delete(n):this._listeners.clear(),this}emit(n,...t){const r=this._listeners.get(n);if(!r||r.length===0)return!1;for(const s of[...r])try{s(...t)}catch(i){console.error("[FSWatcher] listener error:",i)}return!0}}function me(e,n,t,r){const s={ENOENT:-2,ENOTDIR:-20,EISDIR:-21,EEXIST:-17,ENOTEMPTY:-39},i={ENOENT:"no such file or directory",ENOTDIR:"not a directory",EISDIR:"is a directory",EEXIST:"file already exists",ENOTEMPTY:"directory not empty"},a=new Error(`${e}: ${i[e]}, ${n} '${t}'`);return a.code=e,a.errno=s[e],a.syscall=n,a.path=t,a}hi=class{constructor(e){T(this,"tree"),T(this,"textEncoder",new TextEncoder),T(this,"textDecoder",new TextDecoder),T(this,"activeWatchers",new Map),T(this,"subscribers",new Map),T(this,"_handler"),T(this,"globalChangeListeners",new Set),this._handler=e??null,this.tree={kind:"directory",children:new Map,modified:Date.now()}}on(e,n){return this.subscribers.has(e)||this.subscribers.set(e,new Set),this.subscribers.get(e).add(n),this}off(e,n){const t=this.subscribers.get(e);return t&&t.delete(n),this}broadcast(e,...n){const t=this.subscribers.get(e);if(t)for(const r of t)try{r(...n)}catch(s){console.error("Volume event handler error:",s)}}getStats(){let e=0,n=0,t=0;const r=i=>{var a;if(i.kind==="file")e++,n+=((a=i.content)==null?void 0:a.byteLength)??0;else if(i.kind==="directory"&&(t++,i.children))for(const o of i.children.values())r(o)};r(this.tree);let s=0;for(const i of this.activeWatchers.values())s+=i.size;return{fileCount:e,totalBytes:n,dirCount:t,watcherCount:s}}dispose(){this.activeWatchers.clear(),this.subscribers.clear(),this.globalChangeListeners.clear(),this._handler&&(this._handler.statCache.clear(),this._handler.pathNormCache.clear())}toSnapshot(e,n){const t=[];return this.collectEntries("/",this.tree,t,e,n),{entries:t}}collectEntries(e,n,t,r,s){if(r){for(const i of r)if(e===i||e.startsWith(i+"/"))return}if(n.kind==="file"){let i="";n.content&&n.content.length>0&&(i=B(n.content)),t.push({path:e,kind:"file",data:i})}else if(n.kind==="symlink")t.push({path:e,kind:"file",data:`symlink:${n.target}`});else if(n.kind==="directory"&&(t.push({path:e,kind:"directory"}),n.children))for(const[i,a]of n.children){if(s&&a.kind==="directory"&&s.has(i))continue;const o=e==="/"?`/${i}`:`${e}/${i}`;this.collectEntries(o,a,t,r,s)}}static fromBinarySnapshot(e){const n=new hi,t=new Uint8Array(e.data),r=[...e.manifest].sort((s,i)=>s.isDirectory&&!i.isDirectory?-1:!s.isDirectory&&i.isDirectory?1:s.path.split("/").length-i.path.split("/").length);for(const s of r)if(s.path!=="/")if(s.isDirectory)n.existsSync(s.path)||n.mkdirSync(s.path,{recursive:!0});else{const i=s.path.substring(0,s.path.lastIndexOf("/"))||"/";i!=="/"&&!n.existsSync(i)&&n.mkdirSync(i,{recursive:!0});const a=t.slice(s.offset,s.offset+s.length);n.writeInternal(n.normalize(s.path),a,!1)}return n}static fromSnapshot(e){const n=new hi,t=e.entries.map((r,s)=>({entry:r,depth:r.path.split("/").length,idx:s})).sort((r,s)=>r.depth-s.depth||r.idx-s.idx).map(r=>r.entry);for(const r of t)if(r.path!=="/"){if(r.kind==="directory")n.mkdirSync(r.path,{recursive:!0});else if(r.kind==="file"){let s;r.data?s=j(r.data):s=new Uint8Array(0);const i=r.path.substring(0,r.path.lastIndexOf("/"))||"/";i!=="/"&&!n.existsSync(i)&&n.mkdirSync(i,{recursive:!0}),n.writeInternal(n.normalize(r.path),s,!1)}}return n}normalize(e){if(this._handler){const s=this._handler.pathNormCache.get(e);if(s!==void 0)return s}e.startsWith("/")||(e="/"+e);const n=e.split("/").filter(Boolean),t=[];for(const s of n)s===".."?t.pop():s!=="."&&t.push(s);const r="/"+t.join("/");return this._handler&&this._handler.pathNormCache.set(e,r),r}segments(e){return e==="/"?[]:e.substring(1).split("/")}parentOf(e){const n=e.lastIndexOf("/");return n<=0?"/":e.slice(0,n)}nameOf(e){const n=e.lastIndexOf("/");return e.slice(n+1)}locateRaw(e){if(e==="/")return this.tree;let n=this.tree,t=1;const r=e.length;for(;t<r;){let s=e.indexOf("/",t);s===-1&&(s=r);const i=e.substring(t,s);if(t=s+1,n.kind==="symlink"){const o=this.locateRaw(n.target);if(!o||o.kind!=="directory")return;n=o}if(n.kind!=="directory"||!n.children)return;const a=n.children.get(i);if(!a)return;n=a}return n}locate(e){const n=this.locateRaw(e);if(n)return n.kind==="symlink"?this.locate(n.target):n}ensureDir(e){if(e==="/")return this.tree;let n=this.tree,t=1;const r=e.length;for(;t<r;){let s=e.indexOf("/",t);s===-1&&(s=r);const i=e.substring(t,s);t=s+1,n.children||(n.children=new Map);let a=n.children.get(i);if(!a)a={kind:"directory",children:new Map,modified:Date.now()},n.children.set(i,a);else if(a.kind!=="directory")throw new Error(`ENOTDIR: not a directory, '${e}'`);n=a}return n}writeInternal(e,n,t){const r=e.lastIndexOf("/"),s=r<=0?"/":e.slice(0,r),i=e.slice(r+1);if(!i)throw new Error(`EISDIR: illegal operation on a directory, '${e}'`);const a=this.ensureDir(s),o=a.children.has(i),l=typeof n=="string"?this.textEncoder.encode(n):n;a.children.set(i,{kind:"file",content:l,modified:Date.now()}),this._handler&&this._handler.invalidateStat(e),t&&(this.triggerWatchers(e,o?"change":"rename"),this.broadcast("change",e,typeof n=="string"?n:this.textDecoder.decode(n)),this.notifyGlobalListeners(e,o?"change":"add"))}existsSync(e){return this.locate(this.normalize(e))!==void 0}statSync(e){var n;const t=this.normalize(e);if(this._handler){const o=this._handler.statCache.get(t);if(o!==void 0)return o}const r=this.locate(t);if(!r)throw me("ENOENT","stat",e);const s=r.kind==="file"&&((n=r.content)==null?void 0:n.length)||0,i=r.modified,a={isFile:()=>r.kind==="file",isDirectory:()=>r.kind==="directory",isSymbolicLink:()=>!1,isBlockDevice:()=>!1,isCharacterDevice:()=>!1,isFIFO:()=>!1,isSocket:()=>!1,size:s,mode:r.kind==="directory"?493:420,mtime:new Date(i),atime:new Date(i),ctime:new Date(i),birthtime:new Date(i),mtimeMs:i,atimeMs:i,ctimeMs:i,birthtimeMs:i,nlink:1,uid:Fe.UID,gid:Fe.GID,dev:0,ino:0,rdev:0,blksize:Tn.BLOCK_SIZE,blocks:Math.ceil(s/Tn.BLOCK_CALC_SIZE),atimeNs:BigInt(i)*1000000n,mtimeNs:BigInt(i)*1000000n,ctimeNs:BigInt(i)*1000000n,birthtimeNs:BigInt(i)*1000000n};return this._handler&&this._handler.statCache.set(t,a),a}lstatSync(e){const n=this.normalize(e),t=this.locateRaw(n);if(!t)throw me("ENOENT","lstat",e);if(t.kind==="symlink"){const r=t.modified;return{isFile:()=>!1,isDirectory:()=>!1,isSymbolicLink:()=>!0,isBlockDevice:()=>!1,isCharacterDevice:()=>!1,isFIFO:()=>!1,isSocket:()=>!1,size:(t.target||"").length,mode:41471,mtime:new Date(r),atime:new Date(r),ctime:new Date(r),birthtime:new Date(r),mtimeMs:r,atimeMs:r,ctimeMs:r,birthtimeMs:r,nlink:1,uid:1e3,gid:1e3,dev:0,ino:0,rdev:0,blksize:Tn.BLOCK_SIZE,blocks:0,atimeNs:BigInt(r)*1000000n,mtimeNs:BigInt(r)*1000000n,ctimeNs:BigInt(r)*1000000n,birthtimeNs:BigInt(r)*1000000n}}return this.statSync(n)}readFileSync(e,n){const t=this.normalize(e),r=this.locate(t);if(!r)throw me("ENOENT","open",e);if(r.kind!=="file")throw me("EISDIR","read",e);const s=r.content||new Uint8Array(0);return n==="utf8"||n==="utf-8"?this.textDecoder.decode(s):s}writeFileSync(e,n){const t=this.normalize(e);this.writeInternal(t,n,!0)}mkdirSync(e,n){const t=this.normalize(e);if(n!=null&&n.recursive){this.ensureDir(t);return}const r=this.parentOf(t),s=this.nameOf(t);if(!s)return;const i=this.locate(r);if(!i)throw me("ENOENT","mkdir",r);if(i.kind!=="directory")throw me("ENOTDIR","mkdir",r);if(i.children.has(s))throw me("EEXIST","mkdir",e);i.children.set(s,{kind:"directory",children:new Map,modified:Date.now()})}readdirSync(e){const n=this.normalize(e),t=this.locate(n);if(!t)throw me("ENOENT","scandir",e);if(t.kind!=="directory")throw me("ENOTDIR","scandir",e);return Array.from(t.children.keys())}unlinkSync(e){const n=this.normalize(e),t=this.parentOf(n),r=this.nameOf(n),s=this.locate(t);if(!s||s.kind!=="directory")throw me("ENOENT","unlink",e);const i=s.children.get(r);if(!i)throw me("ENOENT","unlink",e);if(i.kind!=="file")throw me("EISDIR","unlink",e);s.children.delete(r),this._handler&&this._handler.invalidateStat(n),this.triggerWatchers(n,"rename"),this.broadcast("delete",n),this.notifyGlobalListeners(n,"unlink")}rmdirSync(e){const n=this.normalize(e),t=this.parentOf(n),r=this.nameOf(n);if(!r)throw new Error(`EPERM: operation not permitted, '${e}'`);const s=this.locate(t);if(!s||s.kind!=="directory")throw me("ENOENT","rmdir",e);const i=s.children.get(r);if(!i)throw me("ENOENT","rmdir",e);if(i.kind!=="directory")throw me("ENOTDIR","rmdir",e);if(i.children.size>0)throw me("ENOTEMPTY","rmdir",e);s.children.delete(r),this._handler&&this._handler.invalidateStat(n)}renameSync(e,n){const t=this.normalize(e),r=this.normalize(n),s=this.locate(this.parentOf(t));if(!s||s.kind!=="directory")throw me("ENOENT","rename",e);const i=this.nameOf(t),a=s.children.get(i);if(!a)throw me("ENOENT","rename",e);const o=this.ensureDir(this.parentOf(r)),l=this.nameOf(r);s.children.delete(i),o.children.set(l,a),this.triggerWatchers(t,"rename"),this.triggerWatchers(r,"rename"),this.notifyGlobalListeners(t,"unlink"),this.notifyGlobalListeners(r,"add")}accessSync(e,n){if(!this.existsSync(e))throw me("ENOENT","access",e)}copyFileSync(e,n){const t=this.readFileSync(e);this.writeFileSync(n,t)}realpathSync(e){const n=this.normalize(e),t=this.locateRaw(n);if(!t)throw me("ENOENT","realpath",e);return t.kind==="symlink"?this.realpathSync(t.target):n}symlinkSync(e,n,t){const r=this.normalize(n),s=this.parentOf(r),i=this.nameOf(r);if(!i)throw new Error(`EISDIR: invalid symlink path, '${n}'`);this.ensureDir(s).children.set(i,{kind:"symlink",target:this.normalize(e),modified:Date.now()})}readlinkSync(e){const n=this.normalize(e),t=this.locateRaw(n);if(!t)throw me("ENOENT","readlink",e);if(t.kind!=="symlink"){const r=new Error(`EINVAL: invalid argument, readlink '${e}'`);throw r.code="EINVAL",r.errno=-22,r.syscall="readlink",r.path=e,r}return t.target}linkSync(e,n){const t=this.locate(this.normalize(e));if(!t)throw me("ENOENT","link",e);if(t.kind!=="file")throw me("EISDIR","link",e);const r=this.normalize(n),s=this.parentOf(r),i=this.nameOf(r);this.ensureDir(s).children.set(i,{kind:"file",content:t.content,modified:t.modified})}chmodSync(e,n){const t=this.normalize(e);if(!this.locate(t))throw me("ENOENT","chmod",e)}chownSync(e,n,t){const r=this.normalize(e);if(!this.locate(r))throw me("ENOENT","chown",e)}appendFileSync(e,n){const t=this.normalize(e);let r=new Uint8Array(0);const s=this.locate(t);s&&s.kind==="file"&&(r=s.content||new Uint8Array(0));const i=typeof n=="string"?this.textEncoder.encode(n):n,a=new Uint8Array(r.length+i.length);a.set(r),a.set(i,r.length),this.writeInternal(t,a,!0)}truncateSync(e,n=0){const t=this.normalize(e),r=this.locate(t);if(!r)throw me("ENOENT","truncate",e);if(r.kind!=="file")throw me("EISDIR","truncate",e);const s=r.content||new Uint8Array(0);if(n<s.length)r.content=s.slice(0,n);else if(n>s.length){const i=new Uint8Array(n);i.set(s),r.content=i}r.modified=Date.now()}readFile(e,n,t){const r=typeof n=="function"?n:t,s=typeof n=="object"?n:void 0;try{const i=s!=null&&s.encoding?this.readFileSync(e,s.encoding):this.readFileSync(e);r&&setTimeout(()=>r(null,i),0)}catch(i){r&&setTimeout(()=>r(i),0)}}stat(e,n){try{const t=this.statSync(e);n&&setTimeout(()=>n(null,t),0)}catch(t){n&&setTimeout(()=>n(t),0)}}lstat(e,n){this.stat(e,n)}readdir(e,n,t){const r=typeof n=="function"?n:t;try{const s=this.readdirSync(e);r&&setTimeout(()=>r(null,s),0)}catch(s){r&&setTimeout(()=>r(s),0)}}realpath(e,n){try{const t=this.realpathSync(e);n&&setTimeout(()=>n(null,t),0)}catch(t){n&&setTimeout(()=>n(t),0)}}access(e,n,t){const r=typeof n=="function"?n:t;try{this.accessSync(e),r&&setTimeout(()=>r(null),0)}catch(s){r&&setTimeout(()=>r(s),0)}}watch(e,n,t){const r=this.normalize(e);let s={},i;typeof n=="function"?i=n:(n&&(s=n),i=t);const a=new ls(()=>{o.active=!1;const l=this.activeWatchers.get(r);l&&(l.delete(o),l.size===0&&this.activeWatchers.delete(r))}),o={callback:(l,u)=>{i&&i(l,u),a.emit("change",l,u)},recursive:s.recursive||!1,active:!0};return this.activeWatchers.has(r)||this.activeWatchers.set(r,new Set),this.activeWatchers.get(r).add(o),a}triggerWatchers(e,n){const t=e,r=t.lastIndexOf("/"),s=t.slice(r+1),i=r<=0?"/":t.slice(0,r),a=this.activeWatchers.get(t);if(a){for(const u of a)if(u.active)try{u.callback(n,s)}catch(c){console.error("Watcher error:",c)}}let o=i,l=s;for(;o;){const u=this.activeWatchers.get(o);if(u){for(const h of u)if(h.active&&(h.recursive||o===i))try{h.callback(n,l)}catch(f){console.error("Watcher error:",f)}}if(o==="/")break;const c=o.lastIndexOf("/");l=o.slice(c+1)+"/"+l,o=c<=0?"/":o.slice(0,c)}}onGlobalChange(e){return this.globalChangeListeners.add(e),()=>{this.globalChangeListeners.delete(e)}}notifyGlobalListeners(e,n){for(const t of this.globalChangeListeners)try{t(e,n)}catch(r){console.error("Global VFS listener error:",r)}}createReadStream(e){const n=this,t={},r={on(s,i){return t[s]||(t[s]=[]),t[s].push(i),r},pipe(s){return s}};return setTimeout(()=>{var s,i,a;try{const o=n.readFileSync(e);(s=t.data)==null||s.forEach(l=>l(o)),(i=t.end)==null||i.forEach(l=>l())}catch(o){(a=t.error)==null||a.forEach(l=>l(o))}},0),r}createWriteStream(e){const n=this,t=[],r={},s=this.textEncoder;return{write(i){return t.push(typeof i=="string"?s.encode(i):i),!0},end(i){var a,o;i&&t.push(typeof i=="string"?s.encode(i):i);const l=t.reduce((p,h)=>p+h.length,0),u=new Uint8Array(l);let c=0;for(const p of t)u.set(p,c),c+=p.length;n.writeFileSync(e,u),(a=r.finish)==null||a.forEach(p=>p()),(o=r.close)==null||o.forEach(p=>p())},on(i,a){return r[i]||(r[i]=[]),r[i].push(a),this}}}};function Pa(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n.toString(36)}Aa=class{constructor(e){T(this,"_map",new Map),T(this,"_capacity"),this._capacity=Math.max(1,e)}get(e){if(!this._map.has(e))return;const n=this._map.get(e);return this._map.delete(e),this._map.set(e,n),n}set(e,n){if(this._map.has(e))this._map.delete(e);else if(this._map.size>=this._capacity){const t=this._map.keys().next().value;t!==void 0&&this._map.delete(t)}this._map.set(e,n)}has(e){return this._map.has(e)}delete(e){return this._map.delete(e)}clear(){this._map.clear()}get size(){return this._map.size}keys(){return this._map.keys()}values(){return this._map.values()}};const Da={pathNormCacheSize:2048,statCacheSize:512,resolveCacheSize:4096,manifestCacheSize:256,transformCacheSize:512,moduleSoftCacheSize:512,heapWarnThresholdMB:350,monitorIntervalMs:3e4,maxProcessOutputBytes:4194304};ty=class{constructor(e){T(this,"options"),T(this,"pathNormCache"),T(this,"statCache"),T(this,"transformCache"),T(this,"_monitorTimer",null),T(this,"_pressureCallbacks",[]),T(this,"_destroyed",!1),this.options={...Da,...e},this.pathNormCache=new Aa(this.options.pathNormCacheSize),this.statCache=new Aa(this.options.statCacheSize),this.transformCache=new Aa(this.options.transformCacheSize)}invalidateStat(e){this.statCache.delete(e)}onPressure(e){return this._pressureCallbacks.push(e),()=>{const n=this._pressureCallbacks.indexOf(e);n>=0&&this._pressureCallbacks.splice(n,1)}}startMonitoring(){this._monitorTimer||this._destroyed||(this._monitorTimer=setInterval(()=>this._checkHeap(),this.options.monitorIntervalMs))}stopMonitoring(){this._monitorTimer&&(clearInterval(this._monitorTimer),this._monitorTimer=null)}flush(){this.pathNormCache.clear(),this.statCache.clear(),this.transformCache.clear()}destroy(){this._destroyed=!0,this.stopMonitoring(),this.flush(),this._pressureCallbacks.length=0}_checkHeap(){const e=typeof performance<"u"?performance:null;if(!(e!=null&&e.memory))return;if(e.memory.usedJSHeapSize/1048576>this.options.heapWarnThresholdMB)for(const t of this._pressureCallbacks)try{t()}catch{}}};let Oa=null;ka=function(){return Oa};const Na=new Set;function Ba(){const e=ka();if(e)for(const n of e.drainListeners)n();for(const n of Na)n()}Tt=function(){const e=ka();e&&e.refCount++},Yn=function(){const e=ka();e&&e.refCount>0&&e.refCount--,Ba()};const fi=10,mi=new WeakSet,gi=new Set;function q(e){const n=globalThis.__nodepodVolume;if(!n||typeof n.onGlobalChange!="function")return;const t=new Map,r=50,s=n.onGlobalChange((a,o)=>{if(a.includes("/node_modules/")||a.includes("/.cache/"))return;const l=t.get(a);l&&clearTimeout(l.timer),t.set(a,{event:o,timer:setTimeout(()=>{t.delete(a),o==="change"?e.emit("change",a):o==="add"?e.emit("add",a):o==="unlink"&&e.emit("unlink",a)},r)})}),i=()=>{s(),gi.delete(i)};gi.add(i)}function Q(e){return e._registry||(e._registry=new Map),e._registry}function Ee(e,n){const t=Q(e);let r=t.get(n);return r||(r=[],t.set(n,r)),r}M=function(){this&&!this._registry&&(this._registry=new Map),this&&this._ceiling===void 0&&(this._ceiling=fi)},M.prototype.addListener=function(n,t){return Ee(this,n).push(t),n==="change"&&!mi.has(this)&&this._watched instanceof Map&&(mi.add(this),q(this)),this},M.prototype.on=M.prototype.addListener,M.prototype.once=function(n,t){const r=this,s=function(...a){r.removeListener(n,s),t.apply(r,a)};return Ee(this,n).push(s),this},M.prototype.removeListener=function(n,t){const r=Q(this).get(n);if(r){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}return this},M.prototype.off=M.prototype.removeListener,M.prototype.removeAllListeners=function(n){return n!==void 0?Q(this).delete(n):Q(this).clear(),this},M.prototype.emit=function(n,...t){const r=Q(this).get(n);if(!r||r.length===0){if(n==="error"){const a=t[0];throw a instanceof Error?a:new Error("Unhandled error event")}return!1}const s=a=>{a&&typeof a.then=="function"&&(Tt(),a.then(()=>Yn(),()=>Yn()))};if(r.length===1){try{const a=r[0].apply(this,t);s(a)}catch{}return!0}const i=r.slice();for(const a of i)try{const o=a.apply(this,t);s(o)}catch{}return!0},M.prototype.listeners=function(n){const t=Q(this).get(n);return t?t.slice():[]},M.prototype.rawListeners=function(n){return this.listeners(n)},M.prototype.listenerCount=function(n){const t=Q(this).get(n);return t?t.length:0},M.prototype.eventNames=function(){return Array.from(Q(this).keys())},M.prototype.setMaxListeners=function(n){return this._ceiling=n,this},M.prototype.getMaxListeners=function(){return this._ceiling??fi},M.prototype.prependListener=function(n,t){return Ee(this,n).unshift(t),this},M.prototype.prependOnceListener=function(n,t){const r=this,s=function(...i){r.removeListener(n,s),t.apply(r,i)};return this.prependListener(n,s)},M.listenerCount=function(e,n){return e.listenerCount(n)};const ae=M;ae.EventEmitter=M,ae.once=async(e,n)=>new Promise((t,r)=>{const s=(...a)=>{e.removeListener("error",i),t(a)},i=(...a)=>{e.removeListener(n,s),r(a[0])};e.once(n,s),e.once("error",i)}),ae.on=(e,n)=>({async next(){return new Promise(r=>{e.once(n,(...s)=>r({value:s,done:!1}))})},[Symbol.asyncIterator](){return this}}),ae.getEventListeners=(e,n)=>e.listeners(n),ae.listenerCount=(e,n)=>e.listenerCount(n),Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:M,default:ae},Symbol.toStringTag,{value:"Module"}));const Ge=new TextEncoder,We=new TextDecoder("utf-8"),ue=new Uint8Array(128);for(let e=0;e<10;e++)ue[48+e]=e;for(let e=0;e<6;e++)ue[65+e]=10+e,ue[97+e]=10+e;const Ke=class Qe extends Uint8Array{static from(n,t,r){if(typeof t=="function"){const i=Array.from(n,t,r);return new Qe(i)}const s=t;if(Array.isArray(n))return new Qe(n);if(typeof n=="string"){const i=(s||"utf8").toLowerCase();if(i==="base64"||i==="base64url"){let a=n;if(i==="base64url")for(a=a.replace(/-/g,"+").replace(/_/g,"/");a.length%4!==0;)a+="=";return new Qe(j(a))}if(i==="hex"){const a=new Uint8Array(n.length>>>1);for(let o=0;o<n.length;o+=2)a[o>>>1]=ue[n.charCodeAt(o)]<<4|ue[n.charCodeAt(o+1)];return new Qe(a)}if(i==="latin1"||i==="binary"){const a=new Uint8Array(n.length);for(let o=0;o<n.length;o++)a[o]=n.charCodeAt(o)&255;return new Qe(a)}return new Qe(Ge.encode(n))}return n instanceof ArrayBuffer?new Qe(n):new Qe(n)}static alloc(n,t){const r=new Qe(n);return t!==void 0&&r.fill(t),r}static allocUnsafe(n){return new Qe(n)}static allocUnsafeSlow(n){return new Qe(n)}static concat(n){let t=0;for(const i of n)t+=i.length;const r=new Qe(t);let s=0;for(const i of n)r.set(i,s),s+=i.length;return r}static isBuffer(n){return n instanceof Qe||n instanceof Uint8Array}static isEncoding(n){const t=n.toLowerCase();return["utf8","utf-8","ascii","latin1","binary","base64","base64url","hex"].includes(t)}static byteLength(n,t){const r=(t||"utf8").toLowerCase();if(r==="base64"||r==="base64url"){const s=n.replace(/[=]/g,"");return Math.floor(s.length*3/4)}return r==="hex"?n.length>>>1:Ge.encode(n).length}toString(n="utf8"){const t=(n||"utf8").toLowerCase();return t==="base64"?B(this):t==="base64url"?B(this).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""):t==="hex"?$(this):t==="latin1"||t==="binary"?Y(this):We.decode(this)}slice(n,t){return new Qe(super.slice(n,t))}subarray(n,t){return new Qe(super.subarray(n,t))}write(n,t,r,s){const i=typeof t=="number"?t:0,a=Ge.encode(n),o=typeof r=="number"?Math.min(r,a.length):a.length;return this.set(a.subarray(0,o),i),o}copy(n,t,r,s){const i=this.subarray(r||0,s);return n.set(i,t||0),i.length}compare(n){const t=Math.min(this.length,n.length);for(let r=0;r<t;r++){if(this[r]<n[r])return-1;if(this[r]>n[r])return 1}return this.length<n.length?-1:this.length>n.length?1:0}equals(n){return this.compare(n)===0}toJSON(){return{type:"Buffer",data:Array.from(this)}}hasOwnProperty(n){return Object.prototype.hasOwnProperty.call(this,n)}indexOf(n,t){const r=t||0;if(typeof n=="number"){for(let i=r;i<this.length;i++)if(this[i]===n)return i;return-1}const s=typeof n=="string"?Qe.from(n):n;for(let i=r;i<=this.length-s.length;i++){let a=!0;for(let o=0;o<s.length;o++)if(this[i+o]!==s[o]){a=!1;break}if(a)return i}return-1}includes(n,t){return this.indexOf(n,t)!==-1}readUInt8(n){return this[n]}readUInt16BE(n){return this[n]<<8|this[n+1]}readUInt16LE(n){return this[n]|this[n+1]<<8}readUInt32BE(n){return(this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3])>>>0}readUInt32LE(n){return(this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24)>>>0}writeUInt8(n,t){return this[t]=n&255,t+1}writeUInt16BE(n,t){return this[t]=n>>>8&255,this[t+1]=n&255,t+2}writeUInt16LE(n,t){return this[t]=n&255,this[t+1]=n>>>8&255,t+2}writeUInt32BE(n,t){return this[t]=n>>>24&255,this[t+1]=n>>>16&255,this[t+2]=n>>>8&255,this[t+3]=n&255,t+4}writeUInt32LE(n,t){return this[t]=n&255,this[t+1]=n>>>8&255,this[t+2]=n>>>16&255,this[t+3]=n>>>24&255,t+4}readUint8(n){return this.readUInt8(n)}readUint16BE(n){return this.readUInt16BE(n)}readUint16LE(n){return this.readUInt16LE(n)}readUint32BE(n){return this.readUInt32BE(n)}readUint32LE(n){return this.readUInt32LE(n)}writeUint8(n,t){return this.writeUInt8(n,t)}writeUint16BE(n,t){return this.writeUInt16BE(n,t)}writeUint16LE(n,t){return this.writeUInt16LE(n,t)}writeUint32BE(n,t){return this.writeUInt32BE(n,t)}writeUint32LE(n,t){return this.writeUInt32LE(n,t)}readInt8(n){const t=this[n];return t&128?t-256:t}readInt16BE(n){const t=this.readUInt16BE(n);return t&32768?t-65536:t}readInt16LE(n){const t=this.readUInt16LE(n);return t&32768?t-65536:t}readInt32BE(n){return this.readUInt32BE(n)|0}readInt32LE(n){return this.readUInt32LE(n)|0}writeInt8(n,t){return this[t]=n&255,t+1}writeInt16BE(n,t){return this.writeUInt16BE(n&65535,t)}writeInt16LE(n,t){return this.writeUInt16LE(n&65535,t)}writeInt32BE(n,t){return this.writeUInt32BE(n>>>0,t)}writeInt32LE(n,t){return this.writeUInt32LE(n>>>0,t)}readBigUInt64LE(n){const t=BigInt(this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24)&0xffffffffn,r=BigInt(this[n+4]|this[n+5]<<8|this[n+6]<<16|this[n+7]<<24)&0xffffffffn;return t|r<<32n}readBigUInt64BE(n){const t=BigInt(this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3])&0xffffffffn;return BigInt(this[n+4]<<24|this[n+5]<<16|this[n+6]<<8|this[n+7])&0xffffffffn|t<<32n}readBigInt64LE(n){const t=this.readBigUInt64LE(n);return t>=0x8000000000000000n?t-0x10000000000000000n:t}readBigInt64BE(n){const t=this.readBigUInt64BE(n);return t>=0x8000000000000000n?t-0x10000000000000000n:t}writeBigUInt64LE(n,t){const r=n&0xffffffffn,s=n>>32n&0xffffffffn;return this[t]=Number(r&0xffn),this[t+1]=Number(r>>8n&0xffn),this[t+2]=Number(r>>16n&0xffn),this[t+3]=Number(r>>24n&0xffn),this[t+4]=Number(s&0xffn),this[t+5]=Number(s>>8n&0xffn),this[t+6]=Number(s>>16n&0xffn),this[t+7]=Number(s>>24n&0xffn),t+8}writeBigUInt64BE(n,t){const r=n&0xffffffffn,s=n>>32n&0xffffffffn;return this[t]=Number(s>>24n&0xffn),this[t+1]=Number(s>>16n&0xffn),this[t+2]=Number(s>>8n&0xffn),this[t+3]=Number(s&0xffn),this[t+4]=Number(r>>24n&0xffn),this[t+5]=Number(r>>16n&0xffn),this[t+6]=Number(r>>8n&0xffn),this[t+7]=Number(r&0xffn),t+8}writeBigInt64LE(n,t){const r=n<0n?n+0x10000000000000000n:n;return this.writeBigUInt64LE(r,t)}writeBigInt64BE(n,t){const r=n<0n?n+0x10000000000000000n:n;return this.writeBigUInt64BE(r,t)}readBigUint64LE(n){return this.readBigUInt64LE(n)}readBigUint64BE(n){return this.readBigUInt64BE(n)}writeBigUint64LE(n,t){return this.writeBigUInt64LE(n,t)}writeBigUint64BE(n,t){return this.writeBigUInt64BE(n,t)}readFloatLE(n){return new DataView(this.buffer,this.byteOffset+n,4).getFloat32(0,!0)}readFloatBE(n){return new DataView(this.buffer,this.byteOffset+n,4).getFloat32(0,!1)}readDoubleLE(n){return new DataView(this.buffer,this.byteOffset+n,8).getFloat64(0,!0)}readDoubleBE(n){return new DataView(this.buffer,this.byteOffset+n,8).getFloat64(0,!1)}writeFloatLE(n,t){return new DataView(this.buffer,this.byteOffset+t,4).setFloat32(0,n,!0),t+4}writeFloatBE(n,t){return new DataView(this.buffer,this.byteOffset+t,4).setFloat32(0,n,!1),t+4}writeDoubleLE(n,t){return new DataView(this.buffer,this.byteOffset+t,8).setFloat64(0,n,!0),t+8}writeDoubleBE(n,t){return new DataView(this.buffer,this.byteOffset+t,8).setFloat64(0,n,!1),t+8}readUIntLE(n,t){let r=0,s=1;for(let i=0;i<t;i++)r+=this[n+i]*s,s*=256;return r}readUintLE(n,t){return this.readUIntLE(n,t)}readUIntBE(n,t){let r=0,s=1;for(let i=t-1;i>=0;i--)r+=this[n+i]*s,s*=256;return r}readUintBE(n,t){return this.readUIntBE(n,t)}readIntLE(n,t){let r=this.readUIntLE(n,t);const s=Math.pow(2,t*8-1);return r>=s&&(r-=Math.pow(2,t*8)),r}readIntBE(n,t){let r=this.readUIntBE(n,t);const s=Math.pow(2,t*8-1);return r>=s&&(r-=Math.pow(2,t*8)),r}writeUIntLE(n,t,r){let s=n;for(let i=0;i<r;i++)this[t+i]=s&255,s=Math.floor(s/256);return t+r}writeUintLE(n,t,r){return this.writeUIntLE(n,t,r)}writeUIntBE(n,t,r){let s=n;for(let i=r-1;i>=0;i--)this[t+i]=s&255,s=Math.floor(s/256);return t+r}writeUintBE(n,t,r){return this.writeUIntBE(n,t,r)}writeIntLE(n,t,r){let s=n;return s<0&&(s+=Math.pow(2,r*8)),this.writeUIntLE(s,t,r)}writeIntBE(n,t,r){let s=n;return s<0&&(s+=Math.pow(2,r*8)),this.writeUIntBE(s,t,r)}swap16(){if(this.length%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let n=0;n<this.length;n+=2){const t=this[n];this[n]=this[n+1],this[n+1]=t}return this}swap32(){if(this.length%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let n=0;n<this.length;n+=4){const t=this[n],r=this[n+1];this[n]=this[n+3],this[n+1]=this[n+2],this[n+2]=r,this[n+3]=t}return this}swap64(){if(this.length%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let n=0;n<this.length;n+=8){const t=this[n],r=this[n+1],s=this[n+2],i=this[n+3];this[n]=this[n+7],this[n+1]=this[n+6],this[n+2]=this[n+5],this[n+3]=this[n+4],this[n+4]=i,this[n+5]=s,this[n+6]=r,this[n+7]=t}return this}};T(Ke,"BYTES_PER_ELEMENT",1);let vr=Ke;I=new Proxy(vr,{apply(e,n,t){return vr.from(...t)}}),typeof globalThis.Buffer>"u"&&(globalThis.Buffer=I);function Jn(e){return e instanceof Uint8Array?e.byteLength:typeof e=="string"?I.byteLength(e):0}te=function(n){if(!this)return;M.call(this),this._queue=[],this._terminated=!1,this._active=!1,this._endFired=!1,this._endEmitted=!1,this._objectMode=!1,this._reading=!1,this._highWaterMark=16384,this._autoDestroy=!0,this._encoding=null,this._readableByteLength=0,this._draining=!1,this.readable=!0,this.readableEnded=!1,this.readableFlowing=null,this.destroyed=!1,this.closed=!1,this.errored=null,this.readableObjectMode=!1,this.readableHighWaterMark=16384,this.readableDidRead=!1,this.readableAborted=!1;const t=this;this._readableState={get objectMode(){return t._objectMode},get highWaterMark(){return t._highWaterMark},get ended(){return t._terminated},get endEmitted(){return t._endEmitted},set endEmitted(r){t._endEmitted=r},get flowing(){return t.readableFlowing},set flowing(r){t.readableFlowing=r},get reading(){return t._reading},get length(){return t.readableLength},get destroyed(){return t.destroyed},get errored(){return t.errored},get closed(){return t.closed},pipes:[],awaitDrainWriters:null,multiAwaitDrain:!1,readableListening:!1,resumeScheduled:!1,paused:!0,emitClose:!0,get autoDestroy(){return t._autoDestroy},defaultEncoding:"utf8",needReadable:!1,emittedReadable:!1,readingMore:!1,dataEmitted:!1},n&&(n.objectMode&&(this._objectMode=!0,this.readableObjectMode=!0,n.highWaterMark===void 0&&(this._highWaterMark=16,this.readableHighWaterMark=16)),n.highWaterMark!==void 0&&(this._highWaterMark=n.highWaterMark,this.readableHighWaterMark=n.highWaterMark),n.autoDestroy!==void 0&&(this._autoDestroy=n.autoDestroy),n.read&&(this._read=n.read.bind(this)),n.destroy&&(this._destroy=n.destroy.bind(this)))},Object.setPrototypeOf(te.prototype,M.prototype),te.prototype._read=function(n){},te.prototype._destroy=function(n,t){t(n)},te.prototype._rawBind=function(n,t){return M.prototype.addListener.call(this,n,t),this},te.prototype.on=function(n,t){return this._rawBind(n,t),n==="data"&&!this._active&&this.resume(),n==="readable"&&(this.readableFlowing=!1),n==="end"&&this._endEmitted?queueMicrotask(()=>t()):n==="end"&&this._terminated&&this._queue.length===0&&!this._endFired&&(this._endFired=!0,queueMicrotask(()=>{this._endEmitted=!0,this.emit("end"),this._autoDestroy&&this.destroy()})),this},te.prototype.addListener=function(n,t){return this.on(n,t)},te.prototype.once=function(n,t){return n==="end"&&this._endEmitted?(queueMicrotask(()=>t()),this):n==="end"&&this._terminated&&this._queue.length===0&&!this._endFired?(this._endFired=!0,M.prototype.once.call(this,n,t),queueMicrotask(()=>{this._endEmitted=!0,this.emit("end"),this._autoDestroy&&this.destroy()}),this):n==="data"&&!this._active?(M.prototype.once.call(this,n,t),this.resume(),this):M.prototype.once.call(this,n,t)},te.prototype.push=function(n){if(n===null)return this._terminated=!0,this.readableEnded=!0,this.readable=!1,this._active&&this._queue.length===0&&!this._endFired&&(this._endFired=!0,queueMicrotask(()=>{this._endEmitted=!0,this.emit("end")})),!1;if(this._objectMode)this._queue.push(n);else{const t=typeof n=="string"?I.from(n):n;this._readableByteLength+=Jn(t),this._queue.push(t)}return this._active&&this._drain(),this._queue.length<this._highWaterMark},te.prototype.unshift=function(n){if(n!==null)if(this._objectMode)this._queue.unshift(n);else{const t=typeof n=="string"?I.from(n):n;this._readableByteLength+=Jn(t),this._queue.unshift(t)}},te.prototype._drain=function(){if(!this._draining){for(this._draining=!0;this._queue.length>0&&this._active;){const n=this._queue.shift();this._objectMode||(this._readableByteLength-=Jn(n)),this.readableDidRead=!0,this._encoding&&n instanceof Uint8Array?this.emit("data",I.from(n).toString(this._encoding)):this.emit("data",n)}this._draining=!1,this._terminated&&this._queue.length===0&&!this._endFired&&(this._endFired=!0,queueMicrotask(()=>{this._endEmitted=!0,this.emit("end"),this._autoDestroy&&this.destroy()})),!this._terminated&&this._queue.length===0&&this._active&&!this._reading&&(this._reading=!0,queueMicrotask(()=>{this._reading=!1,!this._terminated&&this._active&&this._read(this._highWaterMark)}))}},te.prototype.read=function(n){if(this.readableDidRead=!0,!this._reading&&!this._terminated&&(this._reading=!0,this._read(n??this._highWaterMark),this._reading=!1),this._queue.length===0)return null;if(this._objectMode)return this._queue.shift();if(n===void 0||n===0){const s=I.concat(this._queue);return this._readableByteLength=0,this._queue.length=0,s}const t=[];let r=n;for(;r>0&&this._queue.length>0;){const s=this._queue[0];s.length<=r?(t.push(this._queue.shift()),this._readableByteLength-=s.length,r-=s.length):(t.push(s.slice(0,r)),this._queue[0]=s.slice(r),this._readableByteLength-=r,r=0)}return t.length>0?I.concat(t):null},te.prototype.resume=function(){return this._active=!0,this.readableFlowing=!0,this._drain(),!this._terminated&&this._queue.length===0&&!this._reading&&(this._reading=!0,queueMicrotask(()=>{this._reading=!1,!this._terminated&&this._active&&this._read(this._highWaterMark)})),this},te.prototype.pause=function(){return this._active=!1,this.readableFlowing=!1,this},te.prototype.isPaused=function(){return!this._active},te.prototype.pipe=function(n){const t=this;return t.on("data",function(s){!n.write(s)&&(t.pause(),n.once("drain",function(){t.resume()}))}),t.on("end",function(){n.end()}),t.resume(),n},te.prototype.unpipe=function(n){return this.removeAllListeners("data"),this.removeAllListeners("end"),this},te.prototype.setEncoding=function(n){return this._encoding=n,this},te.prototype.close=function(n){this.destroy(),n&&n(null)},te.prototype.destroy=function(n){return this.destroyed?this:(this.destroyed=!0,n&&(this.errored=n),this._destroy(n??null,t=>{t&&!n&&(this.errored=t),this._queue.length=0,this._readableByteLength=0,this._terminated=!0,this.readable=!1,(t||n)&&this.emit("error",t||n),this.closed=!0,this.emit("close")}),this)},te.prototype.wrap=function(n){const t=this;return n.on("data",function(s){t.push(s)}),n.on("end",function(){t.push(null)}),n.on("error",function(s){t.destroy(s)}),this},te.prototype[Symbol.asyncIterator]=function(){const n=this,t=[];let r=!1,s=null,i=null,a=null;const o=p=>{if(i){const h=i;i=null,a=null,h({value:p,done:!1})}else t.push(p)},l=()=>{if(r=!0,i){const p=i;i=null,a=null,p({value:void 0,done:!0})}c()},u=(...p)=>{if(s=p[0],a){const h=a;i=null,a=null,h(s)}c()},c=()=>{n.removeListener("data",o),n.removeListener("end",l),n.removeListener("error",u)};return n._rawBind("data",o),n._rawBind("end",l),n._rawBind("error",u),n._active||n.resume(),{next(){return t.length>0?Promise.resolve({value:t.shift(),done:!1}):s?Promise.reject(s):r?Promise.resolve({value:void 0,done:!0}):new Promise((p,h)=>{i=p,a=h})},return(){return c(),n.destroy(),Promise.resolve({value:void 0,done:!0})},throw(p){return c(),n.destroy(p),Promise.reject(p)},[Symbol.asyncIterator](){return this}}},Object.defineProperty(te.prototype,"readableLength",{get:function(){return this._objectMode?this._queue.length:this._readableByteLength},configurable:!0}),Object.defineProperty(te.prototype,"readableEncoding",{get:function(){return this._encoding},configurable:!0}),te.toWeb=function(n){return new ReadableStream({start(t){n.on("data",r=>{const s=r instanceof Uint8Array?r:I.from(String(r));t.enqueue(s)}),n.on("end",()=>{t.close()}),n.on("error",r=>{t.error(r)}),n.resume()},cancel(){n.destroy()}})},te.fromWeb=function(n,t){const r=n.getReader(),s=new te({...t,read(){r.read().then(({value:i,done:a})=>{a?s.push(null):s.push(i)},i=>{s.destroy(i)})}});return s},te.from=function(n,t){const r=new te(t);return(async()=>{try{for await(const s of n)if(s!=null){const i=typeof s=="string"?I.from(s):s;r.push(i)}r.push(null)}catch(s){r.destroy(s)}})(),r},xe=function(n){if(!this)return;M.call(this),this._parts=[],this._closed=!1,this._objectMode=!1,this._highWaterMark=16384,this._autoDestroy=!0,this._corked=0,this._corkedWrites=[],this._writableByteLength=0,this.writable=!0,this.writableEnded=!1,this.writableFinished=!1,this.writableNeedDrain=!1,this.destroyed=!1,this.closed=!1,this.errored=null,this.writableObjectMode=!1,this.writableHighWaterMark=16384,this.writableCorked=0;const t=this;this._writableState={get objectMode(){return t._objectMode},get highWaterMark(){return t._highWaterMark},get finished(){return t.writableFinished},set finished(r){t.writableFinished=r},get ended(){return t.writableEnded},set ended(r){t.writableEnded=r},get destroyed(){return t.destroyed},get errored(){return t.errored},get closed(){return t.closed},get corked(){return t._corked},get length(){return t.writableLength},get needDrain(){return t.writableNeedDrain},writing:!1,errorEmitted:!1,emitClose:!0,get autoDestroy(){return t._autoDestroy},defaultEncoding:"utf8",finalCalled:!1,ending:!1,bufferedIndex:0},n&&(n.objectMode&&(this._objectMode=!0,this.writableObjectMode=!0,n.highWaterMark===void 0&&(this._highWaterMark=16,this.writableHighWaterMark=16)),n.highWaterMark!==void 0&&(this._highWaterMark=n.highWaterMark,this.writableHighWaterMark=n.highWaterMark),n.autoDestroy!==void 0&&(this._autoDestroy=n.autoDestroy),n.write&&(this._write=n.write.bind(this)),n.writev&&(this._writev=n.writev.bind(this)),n.final&&(this._final=n.final.bind(this)),n.destroy&&(this._destroy=n.destroy.bind(this)))},Object.setPrototypeOf(xe.prototype,M.prototype),xe.prototype._write=function(n,t,r){r(null)},xe.prototype._final=function(n){n(null)},xe.prototype._destroy=function(n,t){t(n)},xe.prototype.write=function(n,t,r){if(this._closed){const l=new Error("write after end");return typeof t=="function"?t(l):r&&r(l),!1}const s=typeof t=="string"?t:"utf8",i=typeof t=="function"?t:r,a=typeof n=="string"?I.from(n):n;if(this._parts.push(a),this._writableByteLength+=Jn(a),this._corked>0)return this._corkedWrites.push({chunk:n,encoding:s,callback:i}),this._writableByteLength<this._highWaterMark;this._write(n,s,l=>{this._writableByteLength-=Jn(a),i&&i(l),this.writableNeedDrain&&this._writableByteLength<this._highWaterMark&&(this.writableNeedDrain=!1,this.emit("drain"))});const o=this._writableByteLength<this._highWaterMark;return o||(this.writableNeedDrain=!0),o},xe.prototype.end=function(n,t,r){typeof n=="function"?r=n:n!==void 0&&this.write(n),typeof t=="function"&&(r=t),this._closed=!0,this.writable=!1,this.writableEnded=!0;const s=this,i=()=>{s.writableFinished=!0,s.emit("finish"),s._autoDestroy&&(s.closed=!0,s.emit("close")),r&&r()};return queueMicrotask(()=>{s._final(a=>{if(a){s.errored=a,s.emit("error",a);return}i()})}),this},xe.prototype.getBuffer=function(){return I.concat(this._parts)},xe.prototype.getBufferAsString=function(n){return this.getBuffer().toString(n||"utf8")},xe.prototype.close=function(n){this.destroy(),n&&n(null)},xe.prototype.destroy=function(n){return this.destroyed?this:(this.destroyed=!0,n&&(this.errored=n),this._destroy(n??null,t=>{t&&!n&&(this.errored=t),this._parts.length=0,this._corkedWrites.length=0,this._writableByteLength=0,this._closed=!0,this.writable=!1,(t||n)&&this.emit("error",t||n),this.closed=!0,this.emit("close")}),this)},xe.prototype.cork=function(){this._corked++,this.writableCorked=this._corked},xe.prototype.uncork=function(){if(this._corked>0&&(this._corked--,this.writableCorked=this._corked),this._corked===0&&this._corkedWrites.length>0){const n=this._corkedWrites.splice(0);if(this._writev)this._writev(n.map(t=>({chunk:t.chunk,encoding:t.encoding})),t=>{for(const r of n)r.callback&&r.callback(t)});else for(const t of n)this._write(t.chunk,t.encoding,r=>{t.callback&&t.callback(r)})}},xe.prototype.setDefaultEncoding=function(n){return this},Object.defineProperty(xe.prototype,"writableLength",{get:function(){return this._objectMode?this._parts.length:this._writableByteLength},configurable:!0}),xe.toWeb=function(n){return new WritableStream({write(t){return new Promise((r,s)=>{n.write(t,a=>{a?s(a):r()})&&r()})},close(){return new Promise(t=>{n.end(()=>t())})},abort(t){n.destroy(t instanceof Error?t:new Error(String(t)))}})},xe.fromWeb=function(n,t){const r=n.getWriter();return new xe({...t,write(s,i,a){r.write(s).then(()=>a(null),o=>a(o))},final(s){r.close().then(()=>s(null),i=>s(i))}})};const ve=function(n){if(!this)return;te.call(this,{objectMode:(n==null?void 0:n.objectMode)||(n==null?void 0:n.readableObjectMode),highWaterMark:(n==null?void 0:n.readableHighWaterMark)??(n==null?void 0:n.highWaterMark),autoDestroy:n==null?void 0:n.autoDestroy,read:n==null?void 0:n.read,destroy:n==null?void 0:n.destroy}),this._writeParts=[],this._writeClosed=!1,this._writeObjectMode=!1,this._writeHighWaterMark=16384,this._writeAutoDestroy=!0,this._duplexCorked=0,this._duplexCorkedWrites=[],this._writableByteLen=0,this.writable=!0,this.writableEnded=!1,this.writableFinished=!1,this.writableNeedDrain=!1,this.writableObjectMode=!1,this.writableHighWaterMark=16384,this.writableCorked=0,this.allowHalfOpen=!0;const t=this;this._writableState={get objectMode(){return t._writeObjectMode},get highWaterMark(){return t._writeHighWaterMark},get finished(){return t.writableFinished},set finished(r){t.writableFinished=r},get ended(){return t.writableEnded},set ended(r){t.writableEnded=r},get destroyed(){return t.destroyed},get errored(){return t.errored},get closed(){return t.closed},get corked(){return t._duplexCorked},get length(){return t.writableLength},get needDrain(){return t.writableNeedDrain},writing:!1,errorEmitted:!1,emitClose:!0,get autoDestroy(){return t._writeAutoDestroy},defaultEncoding:"utf8",finalCalled:!1,ending:!1,bufferedIndex:0},n&&((n.objectMode||n.writableObjectMode)&&(this._writeObjectMode=!0,this.writableObjectMode=!0,(n.writableHighWaterMark??n.highWaterMark)===void 0&&(this._writeHighWaterMark=16,this.writableHighWaterMark=16)),n.writableHighWaterMark!==void 0?(this._writeHighWaterMark=n.writableHighWaterMark,this.writableHighWaterMark=n.writableHighWaterMark):n.highWaterMark!==void 0&&(this._writeHighWaterMark=n.highWaterMark,this.writableHighWaterMark=n.highWaterMark),n.autoDestroy!==void 0&&(this._writeAutoDestroy=n.autoDestroy),n.allowHalfOpen!==void 0&&(this.allowHalfOpen=n.allowHalfOpen),n.write&&(this._write=n.write.bind(this)),n.writev&&(this._writev=n.writev.bind(this)),n.final&&(this._final=n.final.bind(this)))};Object.setPrototypeOf(ve.prototype,te.prototype),ve.prototype._write=function(n,t,r){r(null)},ve.prototype._final=function(n){n(null)},ve.prototype.write=function(n,t,r){if(this._writeClosed)return!1;const s=typeof t=="string"?t:"utf8",i=typeof t=="function"?t:r,a=typeof n=="string"?I.from(n):n;if(this._writeParts.push(a),this._writableByteLen+=Jn(a),this._duplexCorked>0)return this._duplexCorkedWrites.push({chunk:n,encoding:s,callback:i}),this._writableByteLen<this._writeHighWaterMark;this._write(n,s,l=>{this._writableByteLen-=Jn(a),i&&i(l),this.writableNeedDrain&&this._writableByteLen<this._writeHighWaterMark&&(this.writableNeedDrain=!1,this.emit("drain"))});const o=this._writableByteLen<this._writeHighWaterMark;return o||(this.writableNeedDrain=!0),o},ve.prototype.end=function(n,t,r){typeof n=="function"?r=n:n!==void 0&&this.write(n),typeof t=="function"&&(r=t),this._writeClosed=!0,this.writable=!1,this.writableEnded=!0;const s=this,i=()=>{s.writableFinished=!0,s.emit("finish"),r&&r()};return queueMicrotask(()=>{s._final(a=>{if(a){s.errored=a,s.emit("error",a);return}i()})}),this},ve.prototype.cork=function(){this._duplexCorked++,this.writableCorked=this._duplexCorked},ve.prototype.uncork=function(){if(this._duplexCorked>0&&(this._duplexCorked--,this.writableCorked=this._duplexCorked),this._duplexCorked===0&&this._duplexCorkedWrites.length>0){const n=this._duplexCorkedWrites.splice(0);if(this._writev)this._writev(n.map(t=>({chunk:t.chunk,encoding:t.encoding})),t=>{for(const r of n)r.callback&&r.callback(t)});else for(const t of n)this._write(t.chunk,t.encoding,r=>{t.callback&&t.callback(r)})}},ve.prototype.setDefaultEncoding=function(n){return this},Object.defineProperty(ve.prototype,"writableLength",{get:function(){return this._writeObjectMode?this._writeParts.length:this._writableByteLen},configurable:!0}),ve.from=function(n,t){const r=new ve;if(n instanceof ReadableStream){const s=n.getReader();(async()=>{try{for(;;){const{value:i,done:a}=await s.read();if(a){r.push(null);break}r.push(i)}}catch(i){r.destroy(i)}})()}else(async()=>{try{for await(const s of n)if(s!=null){const i=typeof s=="string"?I.from(s):s;r.push(i)}r.push(null)}catch(s){r.destroy(s)}})();return r},ve.toWeb=function(n){if(n instanceof ve){const t=te.toWeb(n),r=xe.toWeb(n);return{readable:t,writable:r}}return te.toWeb(n)},ve.fromWeb=function(n,t){if(n instanceof ReadableStream)return te.fromWeb(n,t);const r=n,s=new ve,i=r.readable.getReader();return(async()=>{try{for(;;){const{value:a,done:o}=await i.read();if(o){s.push(null);break}s.push(a)}}catch(a){s.destroy(a)}})(),s};const Te=function(n){this&&ve.call(this,n)};Object.setPrototypeOf(Te.prototype,ve.prototype),Te.prototype.write=function(n,t,r){const s=typeof n=="string"?I.from(n):n;this.push(s);const i=typeof t=="function"?t:r;return i&&queueMicrotask(()=>i(null)),!0};const hn=function(n){this&&(ve.call(this,n),this._flushed=!1,n&&(n.transform&&(this._transform=n.transform.bind(this)),n.flush&&(this._flush=n.flush.bind(this))))};Object.setPrototypeOf(hn.prototype,ve.prototype),hn.prototype._transform=function(n,t,r){r(null,n)},hn.prototype._flush=function(n){n(null)},hn.prototype._final=function(n){const t=this,r=()=>{n(null),t.push(null)};if(t._flushed){r();return}t._flushed=!0,t._flush((s,i)=>{if(s){n(s);return}i&&t.push(i),r()})},hn.prototype.write=function(n,t,r){const s=typeof n=="string"?I.from(n):n,i=typeof t=="string"?t:"utf8",a=typeof t=="function"?t:r;return this._transform(s,i,(o,l)=>{if(o){a&&a(o);return}l&&this.push(l),a&&a(null)}),!0},hn.prototype.end=function(n,t,r){return this._flushed||(this._flushed=!0,this._flush((s,i)=>{i&&this.push(i)})),ve.prototype.end.call(this,n,t,r)};const Rn=function(){this&&M.call(this)};Object.setPrototypeOf(Rn.prototype,M.prototype),Rn.prototype.pipe=function(n){const t=this,r=i=>{n.write&&n.write(i)};t.on("data",r);const s=()=>{n.end&&n.end()};return t.on("end",s),t._pipeDests||(t._pipeDests=[]),t._pipeDests.push({dest:n,onData:r,onEnd:s}),n},Rn.prototype.unpipe=function(n){const t=this._pipeDests||[];if(n){const r=t.findIndex(s=>s.dest===n);r!==-1&&(this.removeListener("data",t[r].onData),this.removeListener("end",t[r].onEnd),t.splice(r,1))}else{for(const r of t)this.removeListener("data",r.onData),this.removeListener("end",r.onEnd);this._pipeDests=[]}return this};function pc(e,n){if(e.aborted)n.destroy(new Error("The operation was aborted"));else{const t=()=>{n.destroy(new Error("The operation was aborted"))};e.addEventListener("abort",t,{once:!0});const r=n.destroy.bind(n);n.destroy=s=>(e.removeEventListener("abort",t),r(s))}return n}const Ye=Rn;Ye.Readable=te,Ye.Writable=xe,Ye.Duplex=ve,Ye.Transform=hn,Ye.PassThrough=Te,Ye.Stream=Rn,Ye.from=te.from,Ye.addAbortSignal=pc;function La(...e){const n=typeof e[e.length-1]=="function"?e.pop():null,t=e;if(t.length<2)return n&&setTimeout(()=>n(new Error("pipeline requires at least 2 streams")),0),t[0];for(let a=0;a<t.length;a++){const o=t[a];o&&typeof o.getReader=="function"&&typeof o.pipe!="function"&&typeof o.on!="function"&&(t[a]=te.fromWeb(o))}let r=!1;const s=(...a)=>{const o=a[0];if(!r){r=!0;for(const l of t)typeof l.destroy=="function"&&l.destroy();n&&n(o)}};for(let a=0;a<t.length-1;a++){const o=t[a],l=t[a+1];typeof o.pipe=="function"&&o.pipe(l),o.on("error",s)}const i=t[t.length-1];if(i.on("error",s),n&&!r){const a=()=>{r||n(null)};i instanceof te?i.on("end",a):i.on("finish",a)}return i}function Fa(e,n,t){const r=typeof n=="function"?n:t,s=e;let i=!1;const a=h=>{i||(i=!0,r&&r(h))},o=()=>{s.removeListener("end",l),s.removeListener("finish",u),s.removeListener("error",c),s.removeListener("close",p)},l=()=>{o(),a()},u=()=>{o(),a()},c=h=>{o(),a(h)},p=()=>{o(),a()};return s.on("end",l),s.on("finish",u),s.on("error",c),s.on("close",p),(s.readableEnded||s.writableFinished)&&queueMicrotask(()=>a()),o}let hc=16384,fc=16;function mc(e){return e?fc:hc}function gc(e,n){e?fc=n:hc=n}const _c={pipeline:async(...e)=>new Promise((n,t)=>{La(...e,r=>{r?t(r):n()})}),finished:async(e,n)=>new Promise((t,r)=>{Fa(e,n,s=>{s?r(s):t()})})};Ye.pipeline=La,Ye.finished=Fa,Ye.promises=_c,Ye.getDefaultHighWaterMark=mc,Ye.setDefaultHighWaterMark=gc;function yc(...e){return new Te}function Ma(e){if(!e||typeof e!="object")return!1;const n=e;return!(typeof n.read!="function"||n.destroyed||n.readableEnded||n._terminated)}function bc(e){if(!e||typeof e!="object")return!1;const n=e;return!(typeof n.write!="function"||n.destroyed||n.writableEnded||n.writableFinished)}function $a(e){if(!e||typeof e!="object")return!1;const n=e;return!!n.readableDidRead||!!n._reading}function vc(e){return!e||typeof e!="object"?!1:e.errored!=null}Ye.compose=yc,Ye.isReadable=Ma,Ye.isWritable=bc,Ye.isDisturbed=$a,Ye.isErrored=vc,te.isDisturbed=$a,te.isReadable=Ma,Object.freeze(Object.defineProperty({__proto__:null,Duplex:ve,PassThrough:Te,Readable:te,Stream:Rn,Transform:hn,Writable:xe,addAbortSignal:pc,compose:yc,default:Rn,finished:Fa,getDefaultHighWaterMark:mc,isDisturbed:$a,isErrored:vc,isReadable:Ma,isWritable:bc,pipeline:La,promises:_c,setDefaultHighWaterMark:gc},Symbol.toStringTag,{value:"Module"})),new TextDecoder,new TextEncoder;const cs=function(n,t){this&&(this.path=n,this._entries=t,this._pos=0,this._closed=!1)};cs.prototype.readSync=function(){if(this._closed)throw new Error("ERR_DIR_CLOSED: Directory handle was closed");return this._pos>=this._entries.length?null:this._entries[this._pos++]},cs.prototype.read=function(n){if(n){try{const r=this.readSync();queueMicrotask(()=>n(null,r))}catch(r){queueMicrotask(()=>n(r,null))}return}const t=this;return new Promise((r,s)=>{try{r(t.readSync())}catch(i){s(i)}})},cs.prototype.closeSync=function(){this._closed=!0},cs.prototype.close=function(n){if(this._closed=!0,n){queueMicrotask(()=>n(null));return}return Promise.resolve()},cs.prototype[Symbol.asyncIterator]=function(){const e=this;return{async next(){const n=e.readSync();return n===null?{done:!0,value:void 0}:{done:!1,value:n}},[Symbol.asyncIterator](){return this}}};const Ua="/",ja=":";ft=function(e){if(!e)return".";const n=e.charAt(0)==="/",t=e.split("/").filter(i=>i.length>0),r=[];for(const i of t)i===".."?r.length>0&&r[r.length-1]!==".."?r.pop():n||r.push(".."):i!=="."&&r.push(i);let s=r.join("/");return n&&(s="/"+s),s||"."};function Ve(...e){if(e.length===0)return".";const n=e.filter(t=>t!=="").join("/");return ft(n)}yr=function(...e){let n="";for(let t=e.length-1;t>=0;t--){const r=e[t];if(r&&(n=r+(n?"/"+n:""),n.charAt(0)==="/"))break}return n.charAt(0)!=="/"&&(n=(typeof globalThis<"u"&&globalThis.process&&typeof globalThis.process.cwd=="function"?globalThis.process.cwd():"/")+(n?"/"+n:"")),ft(n)};function us(e){return e.charAt(0)==="/"}_r=function(e){if(!e)return".";const n=ft(e),t=n.lastIndexOf("/");return t<0?".":t===0?"/":n.substring(0,t)},gr=function(e,n){if(!e)return"";const t=ft(e);let r=t.substring(t.lastIndexOf("/")+1);return n&&r.endsWith(n)&&(r=r.substring(0,r.length-n.length)),r},as=function(e){const n=gr(e),t=n.lastIndexOf(".");return t<=0?"":n.substring(t)},di=function(e,n){const t=yr(e),r=yr(n);if(t===r)return"";const s=t.split("/").filter(Boolean),i=r.split("/").filter(Boolean);let a=0;const o=Math.min(s.length,i.length);for(;a<o&&s[a]===i[a];)a++;const l=s.length-a,u=i.slice(a),c=[];for(let p=0;p<l;p++)c.push("..");return c.push(...u),c.join("/")||"."};function _i(e){const n=ft(e),t=us(n),r=_r(n),s=gr(n),i=as(n),a=s.substring(0,s.length-i.length);return{root:t?"/":"",dir:r,base:s,ext:i,name:a}}function yi(e){const n=e.dir||e.root||"",t=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+t:n+"/"+t:t}const wc={sep:Ua,delimiter:ja,normalize:ft,join:Ve,resolve:yr,isAbsolute:us,dirname:_r,basename:gr,extname:as,relative:di,parse:_i,format:yi},Sc={sep:"\\",delimiter:";",normalize:ft,join:Ve,resolve:yr,isAbsolute:us,dirname:_r,basename:gr,extname:as,relative:di,parse:_i,format:yi};Object.freeze(Object.defineProperty({__proto__:null,basename:gr,default:{sep:Ua,delimiter:ja,normalize:ft,join:Ve,resolve:yr,isAbsolute:us,dirname:_r,basename:gr,extname:as,relative:di,parse:_i,format:yi,posix:wc,win32:Sc},delimiter:ja,dirname:_r,extname:as,format:yi,isAbsolute:us,join:Ve,normalize:ft,parse:_i,posix:wc,relative:di,resolve:yr,sep:Ua,win32:Sc},Symbol.toStringTag,{value:"Module"}));const xc=console;function Ha(e,n){const t=new M,r=i=>{n&&n(i)},s={isTTY:!1,columns:pn.COLUMNS,rows:pn.ROWS,isRaw:!1,on(i,a){return t.on(i,a),s},once(i,a){return t.once(i,a),s},off(i,a){return t.off(i,a),s},emit(i,...a){return t.emit(i,...a)},addListener(i,a){return t.addListener(i,a),s},removeListener(i,a){return t.removeListener(i,a),s},removeAllListeners(i){return t.removeAllListeners(i),s},setMaxListeners(i){return t.setMaxListeners(i),s},getMaxListeners(){return t.getMaxListeners()},listenerCount(i){return t.listenerCount(i)},listeners(i){return t.listeners(i)},rawListeners(i){return t.rawListeners(i)},prependListener(i,a){return t.prependListener(i,a),s},prependOnceListener(i,a){return t.prependOnceListener(i,a),s},eventNames(){return t.eventNames()},pause(){return s},resume(){return s},setEncoding(i){return s},write(i,a,o){if(e&&n&&i!=null){const l=typeof i=="string"?i:String(i);n(l)}return o&&queueMicrotask(o),!0},end(i,a){if(e&&n&&i!=null){const o=typeof i=="string"?i:String(i);n(o)}a&&queueMicrotask(a)},read(){return null},destroy(){return s},pipe(i){const a=o=>{i.write&&i.write(o)};return t.on("data",a),s._pipeDests||(s._pipeDests=[]),s._pipeDests.push({dest:i,onData:a}),i},unpipe(i){const a=s._pipeDests||[];if(i){const o=a.findIndex(l=>l.dest===i);o>=0&&(t.off("data",a[o].onData),a.splice(o,1))}else{for(const o of a)t.off("data",o.onData);a.length=0}return s},unshift(){},wrap(){return s},[Symbol.asyncIterator](){return{next:async()=>({done:!0,value:void 0})}},readable:!0,writable:!0,destroyed:!1,setRawMode(i){return s.isRaw=i,s},clearLine(i,a){return e&&r(i===-1?"\x1B[1K":i===1?"\x1B[0K":"\x1B[2K"),a&&a(),!0},cursorTo(i,a,o){return typeof a=="function"&&(o=a,a=void 0),e&&r(typeof a=="number"?`\x1B[${a+1};${i+1}H`:`\x1B[${i+1}G`),typeof o=="function"&&o(),!0},moveCursor(i,a,o){return e&&(i>0?r(`\x1B[${i}C`):i<0&&r(`\x1B[${-i}D`),a>0?r(`\x1B[${a}B`):a<0&&r(`\x1B[${-a}A`)),o&&o(),!0},getWindowSize(){return[s.columns,s.rows]},getColorDepth(i){return 8},hasColors(i,a){return 256>=(typeof i=="number"?i:256)}};return e&&n&&(s.write=(i,a,o)=>{const l=typeof i=="string"?i:i.toString(),u=n(l);return o&&queueMicrotask(o),u}),s}q_=function(e){let n=(e==null?void 0:e.cwd)||"/",t=18;const r=Date.now(),s=new M,i={NODE_ENV:Kn.NODE_ENV,PATH:Kn.PATH,HOME:Kn.HOME,SHELL:Kn.SHELL,TERM:Kn.TERM,COLORTERM:Kn.COLORTERM,REQUIRES_WASM:Kn.REQUIRES_WASM,npm_config_user_agent:Kn.npm_config_user_agent,npm_execpath:Kn.npm_execpath,npm_node_execpath:Kn.npm_node_execpath,NAPI_RS_FORCE_WASM:"1",NEXT_TELEMETRY_DISABLED:"1",DO_NOT_TRACK:"1",...e==null?void 0:e.env},a=Ha(!0,p=>(e!=null&&e.onStdout?e.onStdout(p):xc.log(p),!0)),o=Ha(!0,p=>(e!=null&&e.onStderr?e.onStderr(p):xc.error(p),!0)),l=Ha(!1),u=function(h){const f=performance.now(),m=Math.floor(f/1e3),v=Math.floor(f%1e3*1e6);return h?[m-h[0],v-h[1]]:[m,v]};u.bigint=()=>BigInt(Math.floor(performance.now()*1e6));const c={env:i,cwd(){return c._debugCwdCalls||(c._debugCwdCalls=0),c._debugCwdCalls++,n},chdir(p){p.startsWith("/")||(p=n+"/"+p),n=p,c._chdirHook&&c._chdirHook(p)},platform:ye.PLATFORM,arch:ye.ARCH,title:Zn.TITLE,version:ui.NODE,versions:{...K},argv:["node","/index.js"],argv0:"node",execPath:Zn.EXEC_PATH,execArgv:[],pid:(e==null?void 0:e.pid)??Zn.PID,ppid:(e==null?void 0:e.ppid)??Zn.PPID,exit(p=0){throw s.emit("exit",p),e!=null&&e.onExit&&e.onExit(p),new Error(`Process exited with code ${p}`)},nextTick(p,...h){queueMicrotask(()=>p(...h))},stdout:a,stderr:o,stdin:l,hrtime:u,memoryUsage:Object.assign(function(){return{rss:ze.RSS,heapTotal:ze.HEAP_TOTAL,heapUsed:ze.HEAP_USED,external:ze.EXTERNAL,arrayBuffers:0}},{rss:()=>ze.RSS}),uptime(){return(Date.now()-r)/1e3},cpuUsage(){return{user:0,system:0}},resourceUsage(){return{userCPUTime:0,systemCPUTime:0,maxRSS:ze.RSS/1024,sharedMemorySize:0,unsharedDataSize:0,unsharedStackSize:0,minorPageFault:0,majorPageFault:0,swappedOut:0,fsRead:0,fsWrite:0,ipcSent:0,ipcReceived:0,signalsCount:0,voluntaryContextSwitches:0,involuntaryContextSwitches:0}},abort(){throw new Error("process.abort() called")},kill(p,h){const f=typeof h=="string"?h:"SIGTERM";return s.emit(f),!0},umask(p){const h=t;return p!==void 0&&(t=p),h},config:{variables:{},target_defaults:{}},release:{name:"node",sourceUrl:"",headersUrl:""},features:{inspector:!1,debug:!1,uv:!0,ipv6:!0,tls_alpn:!0,tls_sni:!0,tls_ocsp:!0,tls:!0},debugPort:9229,allowedNodeEnvironmentFlags:new Set,mainModule:void 0,channel:void 0,noDeprecation:!1,throwDeprecation:!1,traceDeprecation:!1,traceProcessWarnings:!1,report:{directory:"",filename:"",getReport:()=>({}),reportOnFatalError:!1,reportOnSignal:!1,reportOnUncaughtException:!1,signal:"SIGUSR2",writeReport:()=>""},binding(p){if(p==="natives")return{};if(p==="config")return{exposeInternals:!1};if(p==="constants")return{os:{UV_UDP_REUSEADDR:4,signals:{SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGBUS:7,SIGFPE:8,SIGKILL:9,SIGUSR1:10,SIGSEGV:11,SIGUSR2:12,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGCHLD:17,SIGCONT:18,SIGSTOP:19,SIGTSTP:20,SIGTTIN:21,SIGTTOU:22,SIGURG:23,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28,SIGIO:29,SIGPWR:30,SIGSYS:31},errno:{}},fs:{O_RDONLY:0,O_WRONLY:1,O_RDWR:2,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_NONBLOCK:2048,O_DSYNC:4096,O_SYNC:1052672,O_DIRECT:16384,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_CLOEXEC:524288,UV_FS_O_FILEMAP:0,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,F_OK:0,R_OK:4,W_OK:2,X_OK:1},crypto:{},zlib:{}};if(p==="util")return{};if(p==="fs")return{};if(p==="buffer")return{};if(p==="stream_wrap")return{};if(p==="tcp_wrap")return{};if(p==="pipe_wrap")return{};throw new Error(`No such module: ${p}`)},_linkedBinding(p){return{}},dlopen(p,h,f){throw new Error("process.dlopen is not supported in browser environment")},reallyExit(p){},_getActiveRequests(){return[]},_getActiveHandles(){return[]},emitWarning(p,h,f){const m=typeof p=="string"?p:p.message,v=typeof h=="string"?h:(h==null?void 0:h.type)??"Warning";s.emit("warning",{name:v,message:m,code:f})},hasUncaughtExceptionCaptureCallback(){return!1},setUncaughtExceptionCaptureCallback(p){},sourceMapsEnabled:!1,setSourceMapsEnabled(p){},constrainedMemory(){return 0},availableMemory(){return 512*1024*1024},on(p,h){return s.on(p,h),c},once(p,h){return s.once(p,h),c},off(p,h){return s.off(p,h),c},emit(p,...h){return s.emit(p,...h)},addListener(p,h){return s.addListener(p,h),c},removeListener(p,h){return s.removeListener(p,h),c},removeAllListeners(p){return s.removeAllListeners(p),c},listeners(p){return s.listeners(p)},listenerCount(p){return s.listenerCount(p)},prependListener(p,h){return s.prependListener(p,h),c},prependOnceListener(p,h){return s.prependOnceListener(p,h),c},eventNames(){return s.eventNames()},setMaxListeners(p){return s.setMaxListeners(p),c},getMaxListeners(){return s.getMaxListeners()}};return c},q_();const De=function(n){this&&(ve.call(this),this._isConnecting=!1,this._isConnected=!1,this._isDestroyed=!1,this._peerAddr="",this._peerPort=0,this._selfAddr="127.0.0.1",this._selfPort=0,this.localAddress="127.0.0.1",this.localPort=0,this.remoteAddress=void 0,this.remotePort=void 0,this.remoteFamily=void 0,this.connecting=!1,this.pending=!1,this.destroyed=!1,this.encrypted=!1,this.readyState="closed",this.bytesRead=0,this.bytesWritten=0)};Object.setPrototypeOf(De.prototype,ve.prototype),De.prototype.connect=function(n,t,r){let s,i="127.0.0.1",a;typeof n=="number"?(s=n,typeof t=="string"?(i=t,a=r):a=t):(s=n.port,i=n.host??"127.0.0.1",a=typeof t=="function"?t:r),this._isConnecting=!0,this.connecting=!0,this._peerAddr=i,this._peerPort=s,this.remoteAddress=i,this.remotePort=s,this.remoteFamily="IPv4",this.readyState="opening";const o=this;return queueMicrotask(()=>{o._isConnecting=!1,o._isConnected=!0,o.connecting=!1,o.readyState="open",o.emit("connect"),a&&a()}),this},De.prototype.address=function(){return this._isConnected?{address:this._selfAddr,family:"IPv4",port:this._selfPort}:null},De.prototype.setEncoding=function(n){return this},De.prototype.setTimeout=function(n,t){return t&&this.once("timeout",t),this},De.prototype.setNoDelay=function(n){return this},De.prototype.setKeepAlive=function(n,t){return this},De.prototype.ref=function(){return this},De.prototype.unref=function(){return this},De.prototype.destroy=function(n){if(this._isDestroyed)return this;this._isDestroyed=!0,this._isConnected=!1,this.destroyed=!0,this.readyState="closed",n&&this.emit("error",n);const t=this;return queueMicrotask(()=>t.emit("close",!!n)),this},De.prototype._feedData=function(n){const t=typeof n=="string"?I.from(n):n;this.push(t)},De.prototype._feedEnd=function(){this.push(null)};const Pn=function(n,t){if(!this)return;M.call(this),this._bound=!1,this._addr=null,this._peers=new Set,this._cap=1/0,this.listening=!1,this.maxConnections=void 0;let r;typeof n=="function"?r=n:r=t,r&&this.on("connection",r)};Object.setPrototypeOf(Pn.prototype,M.prototype),Pn.prototype.listen=function(n,t,r,s){let i=0,a="0.0.0.0",o;typeof n=="number"?(i=n,typeof t=="string"?(a=t,o=typeof r=="function"?r:s):typeof t=="function"?o=t:o=typeof r=="function"?r:s):n&&(i=n.port??0,a=n.host??"0.0.0.0",o=typeof t=="function"?t:s),i===0&&(i=Xn.BASE+Math.floor(Math.random()*Xn.RANGE)),this._addr={address:a,family:"IPv4",port:i},this._bound=!0,this.listening=!0;const l=this;return queueMicrotask(()=>{l.emit("listening"),o&&o()}),this},Pn.prototype.address=function(){return this._addr?{...this._addr,host:this._addr.address}:null},Pn.prototype.close=function(n){this._bound=!1,this.listening=!1;for(const r of this._peers)r.destroy();this._peers.clear();const t=this;return queueMicrotask(()=>{t.emit("close"),n&&n()}),this},Pn.prototype.getConnections=function(n){typeof n=="function"&&n(null,this._peers.size)},Pn.prototype.ref=function(){return this},Pn.prototype.unref=function(){return this},Pn.prototype._acceptConnection=function(n){if(!this._bound){n.destroy();return}this._peers.add(n);const t=this;n.on("close",function(){t._peers.delete(n)}),this.emit("connection",n)};function Ec(e,n){return new Pn(e,n)}function Wa(e,n,t){return new De().connect(e,n,t)}const kc=Wa;function bi(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)?4:/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/.test(e)?6:0}function Cc(e){return bi(e)===4}function Ac(e){return bi(e)===6}Object.freeze(Object.defineProperty({__proto__:null,TcpServer:Pn,TcpSocket:De,connect:kc,createConnection:Wa,createServer:Ec,default:{Socket:De,Server:Pn,createServer:Ec,createConnection:Wa,connect:kc,isIP:bi,isIPv4:Cc,isIPv6:Ac},isIP:bi,isIPv4:Cc,isIPv6:Ac},Symbol.toStringTag,{value:"Module"}));function vi(e){switch(e.toUpperCase().replace(/[^A-Z0-9]/g,"")){case"SHA1":return"SHA-1";case"SHA256":return"SHA-256";case"SHA384":return"SHA-384";case"SHA512":return"SHA-512";case"MD5":return"MD5";default:return e}}function Tc(e){return e.includes("512")?64:e.includes("384")?48:e.includes("1")||e==="SHA-1"?20:32}function Va(e,n){const t=Tc(n),r=new Uint8Array(t);let s=-559038737,i=1103547991;for(let a=0;a<e.length;a++)s=Math.imul(s^e[a],2654435761),i=Math.imul(i^e[a],1597334677);s=Math.imul(s^s>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(s^s>>>13,3266489909);for(let a=0;a<t;a++){const o=a<t>>>1?s:i;r[a]=o>>>(a&3)*8&255,s=Math.imul(s,1103515245)+12345|0,i=Math.imul(i,1103515245)+12345|0}return r}function qa(e,n,t){const r=new Uint8Array(n.length+e.length);return r.set(n,0),r.set(e,n.length),Va(r,t)}function wr(e){let n=0;for(const s of e)n+=s.length;const t=new Uint8Array(n);let r=0;for(const s of e)t.set(s,r),r+=s.length;return t}function wi(e,n){return n==="hex"?Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join(""):n==="base64"?btoa(String.fromCharCode(...e)):I.from(e)}function on(e){const n=new Uint8Array(e);return crypto.getRandomValues(n),I.from(n)}function za(e,n,t){const r=n||0,s=t!==void 0?t:e.length-r,i=new Uint8Array(e.buffer,e.byteOffset+r,s);return crypto.getRandomValues(i),e}function Ic(){return crypto.randomUUID()}function Rc(e,n){n===void 0&&(n=e,e=0);const t=n-e,r=new Uint32Array(1);return crypto.getRandomValues(r),e+r[0]%t}function Pc(e){return crypto.getRandomValues(e)}const Sr=function(n){this&&(this._alg=vi(n),this._parts=[])};Sr.prototype.update=function(n,t){if(n==null)throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received '+String(n));let r;return typeof n=="string"?r=t==="base64"?I.from(atob(n)):I.from(n):r=I.from(n),this._parts.push(r),this},Sr.prototype.digestAsync=async function(n){const t=wr(this._parts),r=new Uint8Array(t).buffer,s=await crypto.subtle.digest(this._alg,r);return wi(new Uint8Array(s),n)},Sr.prototype.digest=function(n){const t=wr(this._parts),r=Va(t,this._alg);return wi(r,n)},is=function(e){return new Sr(e)};function Dc(e,n,t){const r=is(e);return r.update(n),r.digest(t)}const xr=function(n,t){this&&(this._alg=vi(n),this._key=typeof t=="string"?I.from(t):t,this._parts=[])};xr.prototype.update=function(n,t){if(n==null)throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received '+String(n));const r=typeof n=="string"?I.from(n):n;return this._parts.push(r),this},xr.prototype.digestAsync=async function(n){const t=wr(this._parts),r=new Uint8Array(this._key).buffer,s=new Uint8Array(t).buffer,i=await crypto.subtle.importKey("raw",r,{name:"HMAC",hash:this._alg},!1,["sign"]),a=await crypto.subtle.sign("HMAC",i,s);return wi(new Uint8Array(a),n)},xr.prototype.digest=function(n){const t=wr(this._parts),r=qa(t,this._key,this._alg);return wi(r,n)};function Si(e,n){return new xr(e,n)}function Oc(e,n,t,r,s,i){yy(e,n,t,r,s).then(a=>i(null,a)).catch(a=>i(a,I.alloc(0)))}async function yy(e,n,t,r,s){const i=typeof e=="string"?I.from(e):e,a=typeof n=="string"?I.from(n):n,o=new Uint8Array(i).buffer,l=new Uint8Array(a).buffer,u=await crypto.subtle.importKey("raw",o,"PBKDF2",!1,["deriveBits"]),c=await crypto.subtle.deriveBits({name:"PBKDF2",salt:l,iterations:t,hash:vi(s)},u,r*8);return I.from(c)}function Ga(e,n,t,r,s){const i=typeof e=="string"?I.from(e):e,a=typeof n=="string"?I.from(n):n,o=vi(s),l=Tc(o),u=Math.ceil(r/l),c=new Uint8Array(u*l);for(let p=1;p<=u;p++){const h=new Uint8Array(4);h[0]=p>>>24&255,h[1]=p>>>16&255,h[2]=p>>>8&255,h[3]=p&255;const f=new Uint8Array(a.length+4);f.set(a),f.set(h,a.length);let m=qa(f,i,o);const v=new Uint8Array(m);for(let k=1;k<t;k++){m=qa(m,i,o);for(let P=0;P<v.length;P++)v[P]^=m[P]}c.set(v,(p-1)*l)}return I.from(c.slice(0,r))}function Nc(e,n,t,r,s){try{const i=Ka(e,n,t);setTimeout(()=>s(null,i),0)}catch(i){setTimeout(()=>s(i,I.alloc(0)),0)}}function Ka(e,n,t,r){return Ga(e,n,16384,t,"sha256")}function zt(e){if(e instanceof Dn)return{raw:e._data,alg:e._alg,kind:e._kind,fmt:"raw"};if(typeof e=="object"&&"key"in e)return zt(e.key);const n=typeof e=="string"?e:e.toString();if(n.includes("-----BEGIN")){const r=n.includes("PRIVATE"),s=n.includes("PUBLIC"),i=n.replace(/-----BEGIN [^-]+-----/,"").replace(/-----END [^-]+-----/,"").replace(/\s/g,""),a=I.from(atob(i));let o;return n.includes("RSA")?o="RSA-SHA256":n.includes("EC")?o="ES256":n.includes("ED25519")&&(o="Ed25519"),{raw:a,alg:o,kind:r?"private":s?"public":"secret",fmt:"pem"}}return{raw:typeof e=="string"?I.from(e):e,kind:"secret",fmt:"raw"}}function xi(e,n,t){const r=t.raw instanceof Uint8Array?t.raw:new Uint8Array(0),s=new Uint8Array(r.length+n.length);return s.set(r,0),s.set(n,r.length),I.from(Va(s,e))}function Ya(e,n,t,r){const s=xi(e,n,t);return Xa(I.from(r),s)}function Bc(e,n,t,r){const s=zt(t),i=e||s.alg||"SHA-256";if(r){try{r(null,xi(i,n,s))}catch(a){r(a,null)}return}return xi(i,n,s)}function Lc(e,n,t,r,s){const i=zt(t),a=e||i.alg||"SHA-256";if(s){try{s(null,Ya(a,n,i,r))}catch(o){s(o,!1)}return}return Ya(a,n,i,r)}const ds=function(n){this&&(M.call(this),this._alg=n,this._parts=[])};Object.setPrototypeOf(ds.prototype,M.prototype),ds.prototype.update=function(n,t){return this._parts.push(typeof n=="string"?I.from(n):n),this},ds.prototype.sign=function(n,t){const r=wr(this._parts),s=zt(n),i=xi(this._alg,r,s);return t==="base64"?btoa(String.fromCharCode(...i)):t==="hex"?Array.from(i).map(a=>a.toString(16).padStart(2,"0")).join(""):i};const ps=function(n){this&&(M.call(this),this._alg=n,this._parts=[])};Object.setPrototypeOf(ps.prototype,M.prototype),ps.prototype.update=function(n,t){return this._parts.push(typeof n=="string"?I.from(n):n),this},ps.prototype.verify=function(n,t,r){const s=wr(this._parts),i=zt(n);let a;return typeof t=="string"?r==="base64"?a=I.from(atob(t)):r==="hex"?a=I.from(t.match(/.{2}/g).map(o=>parseInt(o,16))):a=I.from(t):a=t,Ya(this._alg,s,i,a)};function Fc(e){return new ds(e)}function Mc(e){return new ps(e)}function $c(e,n,t){throw new Error("createCipheriv is not supported in the browser polyfill")}function Uc(e,n,t){throw new Error("createDecipheriv is not supported in the browser polyfill")}const Dn=function(n,t,r){this&&(this._kind=n,this._data=t,this._alg=r)};Object.defineProperty(Dn.prototype,"type",{get:function(){return this._kind},configurable:!0}),Object.defineProperty(Dn.prototype,"asymmetricKeyType",{get:function(){var e,n,t,r;if(this._kind!=="secret"){if((e=this._alg)!=null&&e.includes("RSA"))return"rsa";if((n=this._alg)!=null&&n.includes("EC")||(t=this._alg)!=null&&t.includes("ES"))return"ec";if((r=this._alg)!=null&&r.includes("Ed"))return"ed25519"}},configurable:!0}),Object.defineProperty(Dn.prototype,"symmetricKeySize",{get:function(){if(this._kind==="secret")return this._data instanceof Uint8Array?this._data.length*8:void 0},configurable:!0}),Dn.prototype.export=function(n){if(this._data instanceof Uint8Array)return I.from(this._data);throw new Error("Cannot synchronously export a CryptoKey")};function Za(e,n){const t=typeof e=="string"?I.from(e,n):e;return new Dn("secret",t)}function jc(e){const n=zt(e);return new Dn("public",n.raw,n.alg)}function Hc(e){const n=zt(e);return new Dn("private",n.raw,n.alg)}function Xa(e,n){if(e.length!==n.length)return!1;let t=0;for(let r=0;r<e.length;r++)t|=e[r]^n[r];return t===0}function Wc(){return["aes-128-cbc","aes-256-cbc","aes-128-gcm","aes-256-gcm"]}function Vc(){return["sha1","sha256","sha384","sha512"]}const qc={SSL_OP_ALL:0,RSA_PKCS1_PADDING:1,RSA_PKCS1_OAEP_PADDING:4,RSA_PKCS1_PSS_PADDING:6};function zc(e,n){const t=(n==null?void 0:n.length)||32,r=on(t);return Za(r)}function Gc(e,n){const t=((n==null?void 0:n.modulusLength)||2048)/8,r=on(t),s=on(t),i=new Dn("private",r,e),a=new Dn("public",s,e),o=n==null?void 0:n.publicKeyEncoding,l=n==null?void 0:n.privateKeyEncoding;return{publicKey:(o==null?void 0:o.format)==="pem"?`-----BEGIN PUBLIC KEY-----
71
65
  ${btoa(String.fromCharCode(...s))}
72
- -----END PRIVATE KEY-----`:o}}function Ml(e,t){const n=Dt(Math.ceil(e/8));if(n[0]|=128,n[n.length-1]|=1,t!=null&&t.bigint){let s=BigInt(0);for(let r=0;r<n.length;r++)s=s<<BigInt(8)|BigInt(n[r]);return s}return n}function tp(e,t,n){try{const s=Ml(e,t);setTimeout(()=>n(null,s),0)}catch(s){setTimeout(()=>n(s,z.alloc(0)),0)}}function Fl(e){return!0}function np(e,t){setTimeout(()=>t(null,Fl()),0)}function sp(e,t,n,s){let r=0,o=e.length,c=s;typeof t=="function"?c=t:(r=t,typeof n=="function"?c=n:n!==void 0&&(o=n));try{Pl(e,r,o),c&&setTimeout(()=>c(null,e),0)}catch(d){c&&setTimeout(()=>c(d,e),0)}}function $l(e,t,n,s,r){const o=z.from(n),c=z.from(t),d=z.from(s),p=Ua(e,o).update(c).digest(),y=p.length,g=Math.ceil(r/y),x=z.alloc(g*y);let k=z.alloc(0);for(let C=0;C<g;C++){const T=z.concat([k,d,z.from([C+1])]);k=z.from(Ua(e,p).update(T).digest()),k.copy(x,C*y)}return x.slice(0,r)}function rp(e,t,n,s,r,o){try{const c=$l(e,t,n,s,r);setTimeout(()=>o(null,c),0)}catch(c){setTimeout(()=>o(c,z.alloc(0)),0)}}function Ul(e){return{generateKeys:()=>Dt(256),computeSecret:t=>Dt(32),getPrime:()=>Dt(256),getGenerator:()=>z.from([2]),getPublicKey:()=>Dt(256),getPrivateKey:()=>Dt(256),setPublicKey:()=>{},setPrivateKey:()=>{}}}function ip(e,t){return Ul()}function ap(e){return{generateKeys:(t,n)=>Dt(65),computeSecret:t=>Dt(32),getPublicKey:(t,n)=>Dt(65),getPrivateKey:t=>Dt(32),setPublicKey:()=>{},setPrivateKey:()=>{}}}function op(){return["P-256","P-384","P-521","secp256k1"]}function lp(e){}function cp(){return 0}function up(){return{total:0,min:0,used:0}}const dp=globalThis.crypto,sx=Object.freeze(Object.defineProperty({__proto__:null,Hash:pr,Hmac:fr,KeyObject:sn,SignStream:yi,VerifyStream:_i,checkPrime:np,checkPrimeSync:Fl,constants:Jh,createCipheriv:qh,createDecipheriv:Gh,createDiffieHellman:ip,createECDH:ap,createHash:Xr,createHmac:Ua,createPrivateKey:Yh,createPublicKey:Kh,createSecretKey:Bl,createSign:Wh,createVerify:zh,default:{randomBytes:Dt,randomFill:sp,randomFillSync:Pl,randomUUID:Lh,randomInt:Mh,getRandomValues:Fh,createHash:Xr,hash:$h,createHmac:Ua,createSign:Wh,createVerify:zh,createCipheriv:qh,createDecipheriv:Gh,sign:Vh,verify:Hh,pbkdf2:Uh,pbkdf2Sync:Dl,scrypt:jh,scryptSync:Ol,hkdf:rp,hkdfSync:$l,timingSafeEqual:Ll,getCiphers:Zh,getHashes:Xh,getCurves:op,constants:Jh,KeyObject:sn,createSecretKey:Bl,createPublicKey:Kh,createPrivateKey:Yh,generateKeySync:Qh,generateKeyPairSync:ep,generatePrimeSync:Ml,generatePrime:tp,checkPrimeSync:Fl,checkPrime:np,createDiffieHellman:ip,getDiffieHellman:Ul,createECDH:ap,setFips:lp,getFips:cp,secureHeapUsed:up,webcrypto:dp,Hash:pr,Hmac:fr},generateKeyPairSync:ep,generateKeySync:Qh,generatePrime:tp,generatePrimeSync:Ml,getCiphers:Zh,getCurves:op,getDiffieHellman:Ul,getFips:cp,getHashes:Xh,getRandomValues:Fh,hash:$h,hkdf:rp,hkdfSync:$l,pbkdf2:Uh,pbkdf2Sync:Dl,randomBytes:Dt,randomFill:sp,randomFillSync:Pl,randomInt:Mh,randomUUID:Lh,scrypt:jh,scryptSync:Ol,secureHeapUsed:up,setFips:lp,sign:Vh,timingSafeEqual:Ll,verify:Hh,webcrypto:dp},Symbol.toStringTag,{value:"Module"})),rx=typeof window<"u"&&typeof window.document<"u"&&typeof globalThis.WebSocket=="function"?globalThis.WebSocket:null,Ot=function(t){this&&(Se.call(this),this.httpVersion="1.1",this.httpVersionMajor=1,this.httpVersionMinor=1,this.complete=!1,this.headers={},this.rawHeaders=[],this.trailers={},this.rawTrailers=[],this.method=void 0,this.url=void 0,this.statusCode=void 0,this.statusMessage=void 0,this.aborted=!1,this._payload=null,this.socket=t??new ot,this.connection=this.socket)};Object.setPrototypeOf(Ot.prototype,Se.prototype),Ot.prototype.setTimeout=function(t,n){return n&&this.once("timeout",n),this},Ot.prototype.destroy=function(t){return Se.prototype.destroy.call(this,t),this},Ot.prototype._injectBody=function(t){t===null?this._payload=null:this._payload=typeof t=="string"?z.from(t):t;const n=this;queueMicrotask(()=>{n._payload&&n.push(n._payload),n.push(null),n.complete=!0})},Ot.build=function(t,n,s,r){const o=new ot;o.remoteAddress="127.0.0.1",o.remotePort=0,o.remoteFamily="IPv4";const c=new Ot(o);c.method=t,c.url=n;const d={};for(const[p,y]of Object.entries(s))d[p.toLowerCase()]=y,c.rawHeaders.push(p,y);return c.headers=d,r?c._injectBody(r):queueMicrotask(()=>{c.push(null),c.complete=!0}),c};const Ve=function(t){this&&(Ke.call(this),this.statusCode=200,this.statusMessage="OK",this.headersSent=!1,this.finished=!1,this.sendDate=!0,this.socket=t.socket,this.connection=t.socket,this.req=t,this._hdrs=new Map,this._chunks=[],this._completionCallback=void 0)};Object.setPrototypeOf(Ve.prototype,Ke.prototype),Ve.prototype._onComplete=function(t){this._completionCallback=t},Ve.prototype.assignSocket=function(t){this.socket=t,this.connection=t},Ve.prototype.detachSocket=function(t){this.socket=null,this.connection=null},Ve.prototype.setHeader=function(t,n){if(this.headersSent)throw new Error("Headers already dispatched");return this._hdrs.set(t.toLowerCase(),String(n)),this},Ve.prototype.getHeader=function(t){return this._hdrs.get(t.toLowerCase())},Ve.prototype.getHeaders=function(){const t={};return this._hdrs.forEach((n,s)=>{t[s]=n}),t},Ve.prototype.getHeaderNames=function(){return[...this._hdrs.keys()]},Ve.prototype.hasHeader=function(t){return this._hdrs.has(t.toLowerCase())},Ve.prototype.appendHeader=function(t,n){const s=t.toLowerCase(),r=this._hdrs.get(s);if(r===void 0)this._hdrs.set(s,Array.isArray(n)?n.join(", "):n);else{const o=Array.isArray(n)?n.join(", "):n,c=Array.isArray(r)?r.join(", "):r;this._hdrs.set(s,c+", "+o)}return this},Ve.prototype.removeHeader=function(t){if(this.headersSent)throw new Error("Headers already dispatched");this._hdrs.delete(t.toLowerCase())},Ve.prototype.flushHeaders=function(){this.headersSent=!0},Ve.prototype.writeContinue=function(){},Ve.prototype.writeProcessing=function(){},Ve.prototype.writeEarlyHints=function(t,n){n&&queueMicrotask(n)},Ve.prototype.writeHead=function(t,n,s){if(this.statusCode=t,typeof n=="string"){if(this.statusMessage=n,s)if(Array.isArray(s))for(let r=0;r<s.length;r+=2)this.setHeader(s[r],s[r+1]);else for(const[r,o]of Object.entries(s))this.setHeader(r,o)}else if(Array.isArray(n))for(let r=0;r<n.length;r+=2)this.setHeader(n[r],n[r+1]);else if(n)for(const[r,o]of Object.entries(n))this.setHeader(r,o);return this},Ve.prototype.write=function(t,n,s){this.headersSent=!0;const r=typeof t=="string"?z.from(t):t;this._chunks.push(r);const o=typeof n=="function"?n:s;return o&&queueMicrotask(()=>o(null)),!0},Ve.prototype.end=function(t,n,s){if(typeof t=="function"?s=t:t!==void 0&&this.write(t),typeof n=="function"&&(s=n),this.headersSent=!0,this.finished=!0,this.writableEnded=!0,this.writableFinished=!0,this._completionCallback){const o={};this._hdrs.forEach((d,p)=>{o[p]=Array.isArray(d)?d.join(", "):d});const c=z.concat(this._chunks);this._completionCallback({statusCode:this.statusCode,statusMessage:this.statusMessage,headers:o,body:c})}const r=this;return queueMicrotask(()=>{r.emit("finish"),s&&s()}),this},Ve.prototype.send=function(t){return typeof t=="object"&&!z.isBuffer(t)&&(this.setHeader("Content-Type","application/json"),t=JSON.stringify(t)),this.hasHeader("Content-Type")||this.setHeader("Content-Type","text/html"),this.write(t),this.end()},Ve.prototype.setTimeout=function(t,n){return n&&this.once("timeout",n),this},Ve.prototype.json=function(t){return this.setHeader("Content-Type","application/json"),this.end(JSON.stringify(t))},Ve.prototype.status=function(t){return this.statusCode=t,this},Ve.prototype.redirect=function(t,n){typeof t=="number"?(this.statusCode=t,this.setHeader("Location",n)):(this.statusCode=302,this.setHeader("Location",t)),this.end()},Ve.prototype.addTrailers=function(t){},Ve.prototype._collectedBody=function(){return z.concat(this._chunks)},Ve.prototype._collectedBodyText=function(){return this._collectedBody().toString("utf8")};const At=function(t,n){if(!this)return;ne.call(this),typeof t=="function"?this._handler=t:this._handler=n,this._tcp=new nn,this.listening=!1,this.maxHeadersCount=null,this.timeout=0,this.keepAliveTimeout=As.HTTP_KEEP_ALIVE,this.headersTimeout=As.HTTP_HEADERS,this.requestTimeout=0,this.maxRequestsPerSocket=null;const s=this;this._tcp.on("listening",function(){s.listening=!0,s.emit("listening")}),this._tcp.on("close",function(){s.listening=!1,s.emit("close")}),this._tcp.on("error",function(o){s.emit("error",o)})};Object.setPrototypeOf(At.prototype,ne.prototype),At.prototype.listen=function(t,n,s){let r,o,c;typeof t=="number"?(r=t,typeof n=="string"?(o=n,c=s):c=n):t&&(r=t.port,o=t.host,c=typeof n=="function"?n:s);const d=this,p=c;return c=function(){const g=d._tcp.address();g&&ax(g.port,d),p&&p()},this._tcp.listen(r,o,c),this},At.prototype.close=function(t){const n=this._tcp.address();return n&&ox(n.port),this._tcp.close(t),this},At.prototype.address=function(){return this._tcp.address()},At.prototype.setTimeout=function(t,n){return this.timeout=t||0,n&&this.on("timeout",n),this},At.prototype.ref=function(){return this._tcp.ref(),this},At.prototype.unref=function(){return this._tcp.unref(),this},At.prototype.closeAllConnections=function(){},At.prototype.closeIdleConnections=function(){},At.prototype.dispatchUpgrade=function(t,n){const s=new ot;s.cork=()=>{},s.uncork=()=>{},s._readableState={endEmitted:!1},s._writableState={finished:!1,errorEmitted:!1};const r=new Ot(s);r.method="GET",r.url=t,r.headers={...n,upgrade:"websocket",connection:"Upgrade"};for(const[c,d]of Object.entries(r.headers))typeof d=="string"&&r.rawHeaders.push(c,d);r.push(null),r.complete=!0;const o=this;return queueMicrotask(()=>{o.emit("upgrade",r,s,z.alloc(0))}),{req:r,socket:s}},At.prototype.dispatchRequest=async function(t,n,s,r){const o=this;return new Promise((c,d)=>{var p;const y=Ot.build(t,n,s,r),g=new Ve(y);g._onComplete(c);const x=o.timeout||As.HTTP_DISPATCH_SAFETY,k=setTimeout(()=>{d(new Error(`dispatchRequest timed out after ${x}ms for ${t} ${n}`))},x);g.on("finish",()=>{clearTimeout(k)});try{if(o.emit("request",y,g),typeof o._handler=="function"){const C=o._handler(y,g);C&&typeof C.then=="function"&&C.catch(T=>{var L;if(clearTimeout(k),console.error("[DEBUG] dispatchRequest async error:",(T==null?void 0:T.message)||T,(L=T==null?void 0:T.stack)==null?void 0:L.split(`
66
+ -----END PUBLIC KEY-----`:a,privateKey:(l==null?void 0:l.format)==="pem"?`-----BEGIN PRIVATE KEY-----
67
+ ${btoa(String.fromCharCode(...r))}
68
+ -----END PRIVATE KEY-----`:i}}function Ja(e,n){const t=on(Math.ceil(e/8));if(t[0]|=128,t[t.length-1]|=1,n!=null&&n.bigint){let r=BigInt(0);for(let s=0;s<t.length;s++)r=r<<BigInt(8)|BigInt(t[s]);return r}return t}function Kc(e,n,t){try{const r=Ja(e,n);setTimeout(()=>t(null,r),0)}catch(r){setTimeout(()=>t(r,I.alloc(0)),0)}}function Qa(e){return!0}function Yc(e,n){setTimeout(()=>n(null,Qa()),0)}function Zc(e,n,t,r){let s=0,i=e.length,a=r;typeof n=="function"?a=n:(s=n,typeof t=="function"?a=t:t!==void 0&&(i=t));try{za(e,s,i),a&&setTimeout(()=>a(null,e),0)}catch(o){a&&setTimeout(()=>a(o,e),0)}}function eo(e,n,t,r,s){const i=I.from(t),a=I.from(n),o=I.from(r),l=Si(e,i).update(a).digest(),u=l.length,c=Math.ceil(s/u),p=I.alloc(c*u);let h=I.alloc(0);for(let f=0;f<c;f++){const m=I.concat([h,o,I.from([f+1])]);h=I.from(Si(e,l).update(m).digest()),h.copy(p,f*u)}return p.slice(0,s)}function Xc(e,n,t,r,s,i){try{const a=eo(e,n,t,r,s);setTimeout(()=>i(null,a),0)}catch(a){setTimeout(()=>i(a,I.alloc(0)),0)}}function no(e){return{generateKeys:()=>on(256),computeSecret:n=>on(32),getPrime:()=>on(256),getGenerator:()=>I.from([2]),getPublicKey:()=>on(256),getPrivateKey:()=>on(256),setPublicKey:()=>{},setPrivateKey:()=>{}}}function Jc(e,n){return no()}function Qc(e){return{generateKeys:(n,t)=>on(65),computeSecret:n=>on(32),getPublicKey:(n,t)=>on(65),getPrivateKey:n=>on(32),setPublicKey:()=>{},setPrivateKey:()=>{}}}function eu(){return["P-256","P-384","P-521","secp256k1"]}function nu(e){}function tu(){return 0}function ru(){return{total:0,min:0,used:0}}const su=globalThis.crypto,by=Object.freeze(Object.defineProperty({__proto__:null,Hash:Sr,Hmac:xr,KeyObject:Dn,SignStream:ds,VerifyStream:ps,checkPrime:Yc,checkPrimeSync:Qa,constants:qc,createCipheriv:$c,createDecipheriv:Uc,createDiffieHellman:Jc,createECDH:Qc,createHash:is,createHmac:Si,createPrivateKey:Hc,createPublicKey:jc,createSecretKey:Za,createSign:Fc,createVerify:Mc,default:{randomBytes:on,randomFill:Zc,randomFillSync:za,randomUUID:Ic,randomInt:Rc,getRandomValues:Pc,createHash:is,hash:Dc,createHmac:Si,createSign:Fc,createVerify:Mc,createCipheriv:$c,createDecipheriv:Uc,sign:Bc,verify:Lc,pbkdf2:Oc,pbkdf2Sync:Ga,scrypt:Nc,scryptSync:Ka,hkdf:Xc,hkdfSync:eo,timingSafeEqual:Xa,getCiphers:Wc,getHashes:Vc,getCurves:eu,constants:qc,KeyObject:Dn,createSecretKey:Za,createPublicKey:jc,createPrivateKey:Hc,generateKeySync:zc,generateKeyPairSync:Gc,generatePrimeSync:Ja,generatePrime:Kc,checkPrimeSync:Qa,checkPrime:Yc,createDiffieHellman:Jc,getDiffieHellman:no,createECDH:Qc,setFips:nu,getFips:tu,secureHeapUsed:ru,webcrypto:su,Hash:Sr,Hmac:xr},generateKeyPairSync:Gc,generateKeySync:zc,generatePrime:Kc,generatePrimeSync:Ja,getCiphers:Wc,getCurves:eu,getDiffieHellman:no,getFips:tu,getHashes:Vc,getRandomValues:Pc,hash:Dc,hkdf:Xc,hkdfSync:eo,pbkdf2:Oc,pbkdf2Sync:Ga,randomBytes:on,randomFill:Zc,randomFillSync:za,randomInt:Rc,randomUUID:Ic,scrypt:Nc,scryptSync:Ka,secureHeapUsed:ru,setFips:nu,sign:Bc,timingSafeEqual:Xa,verify:Lc,webcrypto:su},Symbol.toStringTag,{value:"Module"})),vy=typeof window<"u"&&typeof window.document<"u"&&typeof globalThis.WebSocket=="function"?globalThis.WebSocket:null,ln=function(n){this&&(te.call(this),this.httpVersion="1.1",this.httpVersionMajor=1,this.httpVersionMinor=1,this.complete=!1,this.headers={},this.rawHeaders=[],this.trailers={},this.rawTrailers=[],this.method=void 0,this.url=void 0,this.statusCode=void 0,this.statusMessage=void 0,this.aborted=!1,this._payload=null,this.socket=n??new De,this.connection=this.socket)};Object.setPrototypeOf(ln.prototype,te.prototype),ln.prototype.setTimeout=function(n,t){return t&&this.once("timeout",t),this},ln.prototype.destroy=function(n){return te.prototype.destroy.call(this,n),this},ln.prototype._injectBody=function(n){n===null?this._payload=null:this._payload=typeof n=="string"?I.from(n):n;const t=this;queueMicrotask(()=>{t._payload&&t.push(t._payload),t.push(null),t.complete=!0})},ln.build=function(n,t,r,s){const i=new De;i.remoteAddress="127.0.0.1",i.remotePort=0,i.remoteFamily="IPv4";const a=new ln(i);a.method=n,a.url=t;const o={};for(const[l,u]of Object.entries(r))o[l.toLowerCase()]=u,a.rawHeaders.push(l,u);return a.headers=o,s?a._injectBody(s):queueMicrotask(()=>{a.push(null),a.complete=!0}),a};const ge=function(n){this&&(xe.call(this),this.statusCode=200,this.statusMessage="OK",this.headersSent=!1,this.finished=!1,this.sendDate=!0,this.socket=n.socket,this.connection=n.socket,this.req=n,this._hdrs=new Map,this._chunks=[],this._completionCallback=void 0)};Object.setPrototypeOf(ge.prototype,xe.prototype),ge.prototype._onComplete=function(n){this._completionCallback=n},ge.prototype.assignSocket=function(n){this.socket=n,this.connection=n},ge.prototype.detachSocket=function(n){this.socket=null,this.connection=null},ge.prototype.setHeader=function(n,t){if(this.headersSent)throw new Error("Headers already dispatched");return this._hdrs.set(n.toLowerCase(),String(t)),this},ge.prototype.getHeader=function(n){return this._hdrs.get(n.toLowerCase())},ge.prototype.getHeaders=function(){const n={};return this._hdrs.forEach((t,r)=>{n[r]=t}),n},ge.prototype.getHeaderNames=function(){return[...this._hdrs.keys()]},ge.prototype.hasHeader=function(n){return this._hdrs.has(n.toLowerCase())},ge.prototype.appendHeader=function(n,t){const r=n.toLowerCase(),s=this._hdrs.get(r);if(s===void 0)this._hdrs.set(r,Array.isArray(t)?t.join(", "):t);else{const i=Array.isArray(t)?t.join(", "):t,a=Array.isArray(s)?s.join(", "):s;this._hdrs.set(r,a+", "+i)}return this},ge.prototype.removeHeader=function(n){if(this.headersSent)throw new Error("Headers already dispatched");this._hdrs.delete(n.toLowerCase())},ge.prototype.flushHeaders=function(){this.headersSent=!0},ge.prototype.writeContinue=function(){},ge.prototype.writeProcessing=function(){},ge.prototype.writeEarlyHints=function(n,t){t&&queueMicrotask(t)},ge.prototype.writeHead=function(n,t,r){if(this.statusCode=n,typeof t=="string"){if(this.statusMessage=t,r)if(Array.isArray(r))for(let s=0;s<r.length;s+=2)this.setHeader(r[s],r[s+1]);else for(const[s,i]of Object.entries(r))this.setHeader(s,i)}else if(Array.isArray(t))for(let s=0;s<t.length;s+=2)this.setHeader(t[s],t[s+1]);else if(t)for(const[s,i]of Object.entries(t))this.setHeader(s,i);return this},ge.prototype.write=function(n,t,r){this.headersSent=!0;const s=typeof n=="string"?I.from(n):n;this._chunks.push(s);const i=typeof t=="function"?t:r;return i&&queueMicrotask(()=>i(null)),!0},ge.prototype.end=function(n,t,r){if(typeof n=="function"?r=n:n!==void 0&&this.write(n),typeof t=="function"&&(r=t),this.headersSent=!0,this.finished=!0,this.writableEnded=!0,this.writableFinished=!0,this._completionCallback){const i={};this._hdrs.forEach((o,l)=>{i[l]=Array.isArray(o)?o.join(", "):o});const a=I.concat(this._chunks);this._completionCallback({statusCode:this.statusCode,statusMessage:this.statusMessage,headers:i,body:a})}const s=this;return queueMicrotask(()=>{s.emit("finish"),r&&r()}),this},ge.prototype.send=function(n){return typeof n=="object"&&!I.isBuffer(n)&&(this.setHeader("Content-Type","application/json"),n=JSON.stringify(n)),this.hasHeader("Content-Type")||this.setHeader("Content-Type","text/html"),this.write(n),this.end()},ge.prototype.setTimeout=function(n,t){return t&&this.once("timeout",t),this},ge.prototype.json=function(n){return this.setHeader("Content-Type","application/json"),this.end(JSON.stringify(n))},ge.prototype.status=function(n){return this.statusCode=n,this},ge.prototype.redirect=function(n,t){typeof n=="number"?(this.statusCode=n,this.setHeader("Location",t)):(this.statusCode=302,this.setHeader("Location",n)),this.end()},ge.prototype.addTrailers=function(n){},ge.prototype._collectedBody=function(){return I.concat(this._chunks)},ge.prototype._collectedBodyText=function(){return this._collectedBody().toString("utf8")};const en=function(n,t){if(!this)return;M.call(this),typeof n=="function"?this._handler=n:this._handler=t,this._tcp=new Pn,this.listening=!1,this.maxHeadersCount=null,this.timeout=0,this.keepAliveTimeout=qt.HTTP_KEEP_ALIVE,this.headersTimeout=qt.HTTP_HEADERS,this.requestTimeout=0,this.maxRequestsPerSocket=null;const r=this;this._tcp.on("listening",function(){r.listening=!0,r.emit("listening")}),this._tcp.on("close",function(){r.listening=!1,r.emit("close")}),this._tcp.on("error",function(i){r.emit("error",i)})};Object.setPrototypeOf(en.prototype,M.prototype),en.prototype.listen=function(n,t,r){let s,i,a;typeof n=="number"?(s=n,typeof t=="string"?(i=t,a=r):a=t):n&&(s=n.port,i=n.host,a=typeof t=="function"?t:r);const o=this,l=a;return a=function(){const c=o._tcp.address();c&&Sy(c.port,o),l&&l()},this._tcp.listen(s,i,a),this},en.prototype.close=function(n){const t=this._tcp.address();return t&&xy(t.port),this._tcp.close(n),this},en.prototype.address=function(){return this._tcp.address()},en.prototype.setTimeout=function(n,t){return this.timeout=n||0,t&&this.on("timeout",t),this},en.prototype.ref=function(){return this._tcp.ref(),this},en.prototype.unref=function(){return this._tcp.unref(),this},en.prototype.closeAllConnections=function(){},en.prototype.closeIdleConnections=function(){},en.prototype.dispatchUpgrade=function(n,t){const r=new De;r.cork=()=>{},r.uncork=()=>{},r._readableState={endEmitted:!1},r._writableState={finished:!1,errorEmitted:!1};const s=new ln(r);s.method="GET",s.url=n,s.headers={...t,upgrade:"websocket",connection:"Upgrade"};for(const[a,o]of Object.entries(s.headers))typeof o=="string"&&s.rawHeaders.push(a,o);s.push(null),s.complete=!0;const i=this;return queueMicrotask(()=>{i.emit("upgrade",s,r,I.alloc(0))}),{req:s,socket:r}},en.prototype.dispatchRequest=async function(n,t,r,s){const i=this;return new Promise((a,o)=>{var l;const u=ln.build(n,t,r,s),c=new ge(u);c._onComplete(a);const p=i.timeout||qt.HTTP_DISPATCH_SAFETY,h=setTimeout(()=>{o(new Error(`dispatchRequest timed out after ${p}ms for ${n} ${t}`))},p);c.on("finish",()=>{clearTimeout(h)});try{if(i.emit("request",u,c),typeof i._handler=="function"){const f=i._handler(u,c);f&&typeof f.then=="function"&&f.catch(m=>{var v;if(clearTimeout(h),console.error("[DEBUG] dispatchRequest async error:",(m==null?void 0:m.message)||m,(v=m==null?void 0:m.stack)==null?void 0:v.split(`
73
69
  `).slice(0,5).join(`
74
- `)),g.headersSent)try{g.end()}catch{}else try{g.statusCode=500,g.end("Internal Server Error")}catch{}})}}catch(C){if(clearTimeout(k),console.error("[DEBUG] dispatchRequest sync error:",(C==null?void 0:C.message)||C,(p=C==null?void 0:C.stack)==null?void 0:p.split(`
70
+ `)),c.headersSent)try{c.end()}catch{}else try{c.statusCode=500,c.end("Internal Server Error")}catch{}})}}catch(f){if(clearTimeout(h),console.error("[DEBUG] dispatchRequest sync error:",(f==null?void 0:f.message)||f,(l=f==null?void 0:f.stack)==null?void 0:l.split(`
75
71
  `).slice(0,5).join(`
76
- `)),!g.headersSent)try{g.statusCode=500,g.end("Internal Server Error")}catch{}d(C)}})};function Va(e,t){return new At(e,t)}const bi={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",204:"No Content",301:"Moved Permanently",302:"Found",304:"Not Modified",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",408:"Request Timeout",409:"Conflict",410:"Gone",413:"Payload Too Large",415:"Unsupported Media Type",422:"Unprocessable Entity",429:"Too Many Requests",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"},Ha=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","CONNECT","TRACE"];function ix(){try{return typeof localStorage<"u"?localStorage.getItem("__corsProxyUrl")??null:null}catch{return null}}const tt=function(t,n){if(!this)return;if(Ke.call(this),this._opts=t,this._proto=n||"http",this.method=t.method??"GET",this.path=t.path??"/",this.headers={},this._pending=[],this._cancelled=!1,this._waitMs=null,this._waitTimer=null,this._sealed=!1,this._socket=new ot,this.finished=!1,this.aborted=!1,this.reusedSocket=!1,this.maxHeadersCount=null,t.headers)for(const[r,o]of Object.entries(t.headers))this.headers[r.toLowerCase()]=Array.isArray(o)?o.join(", "):o;const s=this;queueMicrotask(()=>s.emit("socket",s._socket))};Object.setPrototypeOf(tt.prototype,Ke.prototype),Object.defineProperty(tt.prototype,"socket",{get:function(){return this._socket},configurable:!0}),Object.defineProperty(tt.prototype,"connection",{get:function(){return this._socket},configurable:!0}),tt.prototype.setHeader=function(t,n){this.headers[t.toLowerCase()]=n},tt.prototype.getHeader=function(t){return this.headers[t.toLowerCase()]},tt.prototype.removeHeader=function(t){delete this.headers[t.toLowerCase()]},tt.prototype.write=function(t,n,s){const r=typeof t=="string"?z.from(t):t;this._pending.push(r);const o=typeof n=="function"?n:s;return o&&queueMicrotask(()=>o(null)),!0},tt.prototype.end=function(t,n,s){if(this._sealed)return this;this._sealed=!0,this.finished=!0;let r=s;typeof t=="function"?r=t:t!==void 0&&this.write(t),typeof n=="function"&&(r=n);const o=this;return o._dispatch().then(()=>{r&&r()}).catch(c=>o.emit("error",c)),this},tt.prototype.abort=function(){this._cancelled=!0,this.aborted=!0,this._waitTimer&&clearTimeout(this._waitTimer),this.emit("abort")},tt.prototype.setTimeout=function(t,n){return this._waitMs=t,n&&this.once("timeout",n),this},tt.prototype.flushHeaders=function(){},tt.prototype.setNoDelay=function(t){},tt.prototype.setSocketKeepAlive=function(t,n){},tt.prototype._dispatch=async function(){var t;if(!this._cancelled)try{const n=this._proto==="https"?"https:":"http:";let s=this._opts.hostname??"",r=this._opts.port?`:${this._opts.port}`:"";if(!s&&this._opts.host){const T=this._opts.host.split(":");s=T[0],!r&&T[1]&&(r=`:${T[1]}`)}s||(s="localhost");const o=`${n}//${s}${r}${this._opts.path??"/"}`;if(((t=this.headers.upgrade)==null?void 0:t.toLowerCase())==="websocket"){this._bridgeWebSocket(o);return}const c=s==="localhost"||s==="127.0.0.1"||s==="0.0.0.0",d=Number(this._opts.port)||(this._proto==="https"?443:80);if(c){const T=Pn.get(d);if(T){const V=this._pending.length>0?z.concat(this._pending):void 0;try{const K=await T.dispatchRequest(this.method,this._opts.path??"/",this.headers,V);if(this._cancelled)return;const J=new Ot;J.statusCode=K.statusCode,J.statusMessage=K.statusMessage;for(const[X,G]of Object.entries(K.headers))J.headers[X.toLowerCase()]=G,J.rawHeaders.push(X,G);J._injectBody(K.body),this.emit("response",J)}catch(K){this.emit("error",K)}return}const L=new Error(`connect ECONNREFUSED ${s}:${d}`);L.code="ECONNREFUSED",L.errno=-111,L.syscall="connect",L.address=s,L.port=d,this.emit("error",L);return}const p=ix(),y=p?p+encodeURIComponent(o):o,g={method:this.method,headers:this.headers};this._pending.length>0&&this.method!=="GET"&&this.method!=="HEAD"&&(g.body=z.concat(this._pending));const x=new AbortController;g.signal=x.signal,this._waitMs&&(this._waitTimer=setTimeout(()=>{x.abort(),this.emit("timeout")},this._waitMs));const k=await fetch(y,g);if(this._waitTimer&&(clearTimeout(this._waitTimer),this._waitTimer=null),this._cancelled)return;const C=await this._mapResponse(k);this.emit("response",C)}catch(n){if(this._waitTimer&&clearTimeout(this._waitTimer),this._cancelled||n instanceof Error&&n.name==="AbortError")return;this.emit("error",n)}},tt.prototype._mapResponse=async function(t){const n=new Ot;n.statusCode=t.status,n.statusMessage=t.statusText||bi[t.status]||"",t.headers.forEach((r,o)=>{n.headers[o.toLowerCase()]=r,n.rawHeaders.push(o,r)});const s=await t.arrayBuffer();return n._injectBody(z.from(s)),n},tt.prototype._bridgeWebSocket=function(t){const n=t.replace(/^https:/,"wss:").replace(/^http:/,"ws:"),s=this.headers["sec-websocket-key"]??"",r=rx;if(!r){const k=this;setTimeout(()=>k.emit("error",new TypeError("No WebSocket available")),0);return}const c=Xr("sha1").update(s+"258EAFA5-E914-47DA-95CA-C5AB0DC85B11").digest("base64");let d;try{d=new r(n),d.binaryType="arraybuffer"}catch(k){const C=this;setTimeout(()=>C.emit("error",k instanceof Error?k:new Error(String(k))),0);return}const p=new ot;p.cork=()=>{},p.uncork=()=>{},p._readableState={endEmitted:!1},p._writableState={finished:!1,errorEmitted:!1};let y=new Uint8Array(0);p.write=(k,C,T)=>{const L=typeof k=="string"?z.from(k):new Uint8Array(k),V=typeof C=="function"?C:T,K=new Uint8Array(y.length+L.length);for(K.set(y,0),K.set(L,y.length),y=K;y.length>=2;){const J=Ei(y);if(!J)break;if(y=y.slice(J.consumed),d.readyState===r.OPEN)switch(J.op){case 8:d.close();break;case 9:d.send(J.data);break;case 10:break;case 1:d.send(new TextDecoder().decode(J.data));break;case 2:d.send(J.data);break}}return V&&queueMicrotask(()=>V(null)),!0};const g=this;d.onopen=()=>{const k=new Ot(p);k.statusCode=101,k.statusMessage="Switching Protocols",k.headers={upgrade:"websocket",connection:"Upgrade","sec-websocket-accept":c},k.complete=!0,k.push(null),g.emit("upgrade",k,p,z.alloc(0))},d.onmessage=k=>{let C,T;if(typeof k.data=="string")C=new TextEncoder().encode(k.data),T=1;else if(k.data instanceof ArrayBuffer)C=new Uint8Array(k.data),T=2;else return;const L=wn(T,C,!1);p._feedData(z.from(L))},d.onclose=k=>{const C=k.code||1e3,T=new Uint8Array(2);T[0]=C>>8&255,T[1]=C&255;const L=wn(8,T,!1);p._feedData(z.from(L)),setTimeout(()=>{p._readableState.endEmitted=!0,p._feedEnd(),p.emit("close",!1)},10)},d.onerror=()=>{p.emit("error",new Error("WebSocket transport error")),p.destroy()};const x=p.destroy.bind(p);p.destroy=k=>((d.readyState===r.OPEN||d.readyState===r.CONNECTING)&&d.close(),x(k))};function jl(e,t,n){let s,r=n;if(typeof e=="string"||e instanceof URL){const o=new URL(e.toString());s={hostname:o.hostname,port:o.port?parseInt(o.port,10):void 0,path:o.pathname+o.search,method:"GET"},typeof t=="function"?r=t:t&&(s={...s,...t})}else s=e,typeof t=="function"&&(r=t);return{opts:s,cb:r}}function hp(e,t,n){const{opts:s,cb:r}=jl(e,t,n),o=new tt(s,"http");return r&&o.once("response",r),o}function pp(e,t,n){const{opts:s,cb:r}=jl(e,t,n),o=new tt({...s,method:"GET"},"http");return r&&o.once("response",r),o.end(),o}function Wa(e,t,n,s){const{opts:r,cb:o}=jl(e,t,n),c=new tt(r,s);return o&&c.once("response",o),c}const Pn=new Map,vi=new Map;let Vl=null,Hl=null;function ax(e,t,n){Pn.set(e,t),ls(),Vl&&Vl(e,t)}function ox(e){Pn.has(e)&&An(),Pn.delete(e),vi.delete(e),Hl&&Hl(e)}function wi(e){return Pn.get(e)}va=function(){return new Map(Pn)},W0=function(){for(const[,e]of Pn)try{e.close()}catch{}Pn.clear(),vi.clear()};function lx(e){for(const[t,n]of vi)if(n===e){const s=Pn.get(t);if(s)try{s.close()}catch{}Pn.delete(t),vi.delete(t)}}function cx(e){return vi.get(e)}function Si(e){Vl=e}function xi(e){Hl=e}const Dn=function(t){this&&(ne.call(this),this.options=t??{},this.maxSockets=(t==null?void 0:t.maxSockets)??1/0,this.maxFreeSockets=(t==null?void 0:t.maxFreeSockets)??256,this.maxTotalSockets=(t==null?void 0:t.maxTotalSockets)??1/0,this.sockets={},this.freeSockets={},this.requests={})};Object.setPrototypeOf(Dn.prototype,ne.prototype),Dn.prototype.createConnection=function(t,n){const s=new ot;return n&&n(null,s),s},Dn.prototype.getName=function(t){return`${t.host??"localhost"}:${t.port??80}:${t.localAddress??""}`},Dn.prototype.addRequest=function(t,n){},Dn.prototype.destroy=function(){this.sockets={},this.freeSockets={},this.requests={}};const za=new Dn;function Ei(e){if(e.length<2)return null;const t=e[0]&15,n=(e[1]&128)!==0;let s=e[1]&127,r=2;if(s===126){if(e.length<4)return null;s=e[2]<<8|e[3],r=4}else if(s===127){if(e.length<10)return null;s=e[6]<<24|e[7]<<16|e[8]<<8|e[9],r=10}if(n){if(e.length<r+4+s)return null;const o=e.slice(r,r+4);r+=4;const c=new Uint8Array(s);for(let d=0;d<s;d++)c[d]=e[r+d]^o[d&3];return{op:t,data:c,consumed:r+s}}return e.length<r+s?null:{op:t,data:e.slice(r,r+s),consumed:r+s}}function wn(e,t,n){const s=t.length;let r=2;s>125&&s<=65535?r+=2:s>65535&&(r+=8),n&&(r+=4);const o=new Uint8Array(r+s);o[0]=128|e;let c=2;if(s<=125?o[1]=(n?128:0)|s:s<=65535?(o[1]=(n?128:0)|126,o[2]=s>>8&255,o[3]=s&255,c=4):(o[1]=(n?128:0)|127,o[2]=0,o[3]=0,o[4]=0,o[5]=0,o[6]=s>>24&255,o[7]=s>>16&255,o[8]=s>>8&255,o[9]=s&255,c=10),n){const d=new Uint8Array(4);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(d);else for(let p=0;p<4;p++)d[p]=Math.floor(Math.random()*256);o.set(d,c),c+=4;for(let p=0;p<s;p++)o[c+p]=t[p]^d[p&3]}else o.set(t,c);return o}V0=Object.freeze(Object.defineProperty({__proto__:null,Agent:Dn,ClientRequest:tt,IncomingMessage:Ot,METHODS:Ha,STATUS_CODES:bi,Server:At,ServerResponse:Ve,_buildClientRequest:Wa,closeAllServers:W0,closeServersByPid:lx,createServer:Va,decodeFrame:Ei,default:{Server:At,IncomingMessage:Ot,ServerResponse:Ve,ClientRequest:tt,createServer:Va,request:hp,get:pp,STATUS_CODES:bi,METHODS:Ha,getServer:wi,getAllServers:va,setServerListenCallback:Si,setServerCloseCallback:xi,_buildClientRequest:Wa,Agent:Dn,globalAgent:za,decodeFrame:Ei,encodeFrame:wn},encodeFrame:wn,get:pp,getAllServers:va,getServer:wi,getServerOwner:cx,globalAgent:za,request:hp,setServerCloseCallback:xi,setServerListenCallback:Si},Symbol.toStringTag,{value:"Module"}));function fp(e,t,n){return Wa(e,t,n,"https")}function mp(e,t,n){const s=Wa(e,t,n,"https");return s.end(),s}const ux=Object.freeze(Object.defineProperty({__proto__:null,Agent:Dn,ClientRequest:tt,IncomingMessage:Ot,METHODS:Ha,STATUS_CODES:bi,Server:At,ServerResponse:Ve,createServer:Va,default:{Server:At,IncomingMessage:Ot,ServerResponse:Ve,ClientRequest:tt,createServer:Va,request:fp,get:mp,STATUS_CODES:bi,METHODS:Ha,getServer:wi,getAllServers:va,setServerListenCallback:Si,setServerCloseCallback:xi,Agent:Dn,globalAgent:za},get:mp,getAllServers:va,getServer:wi,globalAgent:za,request:fp,setServerCloseCallback:xi,setServerListenCallback:Si},Symbol.toStringTag,{value:"Module"}));function gp(e,t=!1,n=!1){try{const s=new globalThis.URL(e,"http://localhost"),r=s.username?`${s.username}:${s.password}`:null,o=t?Object.fromEntries(s.searchParams):s.search?s.search.substring(1):null;return{protocol:s.protocol,slashes:s.protocol.endsWith(":"),auth:r,host:s.host,port:s.port||null,hostname:s.hostname,hash:s.hash||null,search:s.search||null,query:o,pathname:s.pathname,path:s.pathname+s.search,href:s.href}}catch{return{protocol:null,slashes:null,auth:null,host:null,port:null,hostname:null,hash:null,search:null,query:null,pathname:e,path:e,href:e}}}function yp(e){if(e.href)return e.href;let t="";if(e.protocol&&(t+=e.protocol.endsWith(":")?e.protocol:e.protocol+":"),(e.slashes||e.protocol==="http:"||e.protocol==="https:")&&(t+="//"),e.auth&&(t+=e.auth+"@"),e.hostname?t+=e.hostname:e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.pathname&&(t+=e.pathname),e.search)t+=e.search;else if(e.query)if(typeof e.query=="string")t+="?"+e.query;else{const n=new globalThis.URLSearchParams;for(const[r,o]of Object.entries(e.query))if(Array.isArray(o))for(const c of o)n.append(r,c);else n.set(r,o);const s=n.toString();s&&(t+="?"+s)}return e.hash&&(t+=e.hash),t}function _p(e,t){try{return new globalThis.URL(t,e).href}catch{return t}}const bp=globalThis.URL,vp=globalThis.URLSearchParams;function wp(e){if(typeof e=="string"){if(e.startsWith("/"))return e;try{const t=new globalThis.URL(e);return t.protocol==="file:",decodeURIComponent(t.pathname)}catch{return e}}return e.protocol==="file:",decodeURIComponent(e.pathname)}function Sp(e){const t=encodeURIComponent(e).replace(/%2F/g,"/");return new globalThis.URL("file://"+t)}function xp(e){try{return new globalThis.URL(`http://${e}`).hostname}catch{return e}}function Ep(e){return e}Object.freeze(Object.defineProperty({__proto__:null,URL:bp,URLSearchParams:vp,default:{parse:gp,format:yp,resolve:_p,URL:bp,URLSearchParams:vp,fileURLToPath:wp,pathToFileURL:Sp,domainToASCII:xp,domainToUnicode:Ep},domainToASCII:xp,domainToUnicode:Ep,fileURLToPath:wp,format:yp,parse:gp,pathToFileURL:Sp,resolve:_p},Symbol.toStringTag,{value:"Module"}));function Wl(e,t="&",n="=",s){const r={};if(!e||typeof e!="string")return r;const o=(s==null?void 0:s.maxKeys)||1e3,c=e.split(t),d=o>0?Math.min(c.length,o):c.length;for(let p=0;p<d;p++){const y=c[p],g=y.indexOf(n);let x,k;if(g>=0?(x=decodeURIComponent(y.substring(0,g).replace(/\+/g," ")),k=decodeURIComponent(y.substring(g+1).replace(/\+/g," "))):(x=decodeURIComponent(y.replace(/\+/g," ")),k=""),x in r){const C=r[x];Array.isArray(C)?C.push(k):r[x]=[C,k]}else r[x]=k}return r}function zl(e,t="&",n="="){if(!e||typeof e!="object")return"";const s=[];for(const[r,o]of Object.entries(e)){if(o===void 0)continue;const c=encodeURIComponent(r);if(Array.isArray(o))for(const d of o)s.push(`${c}${n}${encodeURIComponent(String(d))}`);else s.push(`${c}${n}${encodeURIComponent(String(o))}`)}return s.join(t)}function kp(e){return encodeURIComponent(e)}function Cp(e){return decodeURIComponent(e.replace(/\+/g," "))}const Ap=zl,Tp=Wl;Object.freeze(Object.defineProperty({__proto__:null,decode:Tp,default:{parse:Wl,stringify:zl,escape:kp,unescape:Cp,encode:Ap,decode:Tp},encode:Ap,escape:kp,parse:Wl,stringify:zl,unescape:Cp},Symbol.toStringTag,{value:"Module"})),fd=function(e,...t){if(typeof e!="string")return[e,...t].map(r=>typeof r=="string"?r:ki(r)).join(" ");let n=0,s=e.replace(/%[sdjifoO%]/g,r=>{if(r==="%%")return"%";if(n>=t.length)return r;const o=t[n++];switch(r){case"%s":return String(o);case"%d":case"%i":return String(parseInt(String(o),10));case"%f":return String(parseFloat(String(o)));case"%j":try{return JSON.stringify(o)}catch{return"[Circular]"}case"%o":case"%O":return ki(o);default:return r}});for(;n<t.length;){const r=t[n++];s+=" "+(typeof r=="string"?r:ki(r))}return s};function ki(e,t){const n=new WeakSet,s=(t==null?void 0:t.depth)??2;function r(o,c){if(o===null)return"null";if(o===void 0)return"undefined";const d=typeof o;if(d==="string")return`'${o}'`;if(d==="number"||d==="boolean"||d==="bigint")return String(o);if(d==="symbol")return o.toString();if(d==="function")return`[Function: ${o.name||"anonymous"}]`;if(d!=="object")return String(o);if(n.has(o))return"[Circular]";if(n.add(o),c>s)return Array.isArray(o)?"[Array]":"[Object]";if(Array.isArray(o))return o.length===0?"[]":`[ ${o.map(x=>r(x,c+1)).join(", ")} ]`;if(o instanceof Date)return o.toISOString();if(o instanceof RegExp)return o.toString();if(o instanceof Error)return`${o.name}: ${o.message}`;if(o instanceof Map){const g=[...o.entries()].map(([x,k])=>`${r(x,c+1)} => ${r(k,c+1)}`);return`Map(${o.size}) { ${g.join(", ")} }`}if(o instanceof Set){const g=[...o].map(x=>r(x,c+1));return`Set(${o.size}) { ${g.join(", ")} }`}const p=Object.keys(o);return p.length===0?"{}":`{ ${p.map(g=>{const x=o[g];return`${g}: ${r(x,c+1)}`}).join(", ")} }`}return r(e,0)}function Ip(e,t){if(e==null)throw new TypeError("inherits: child constructor must be provided");t!=null&&t.prototype!==void 0&&(e.super_=t,Object.setPrototypeOf(e.prototype,t.prototype))}function Rp(e,t){if(t==null)return e;const n=Object.keys(t);for(let s=0;s<n.length;s++)e[n[s]]=t[n[s]];return e}function Pp(e,t,n){let s=!1;return function(...o){return s||(console.warn(`DeprecationWarning: ${t}${n?` (${n})`:""}`),s=!0),e.apply(this,o)}}function Dp(e){return(...t)=>new Promise((n,s)=>{e(...t,(r,o)=>{r?s(r):n(o)})})}function Op(e){return(...t)=>{const n=t.pop();e(...t).then(s=>n(null,s)).catch(s=>n(s,void 0))}}function qa(e,t){if(e===t)return!0;if(e===null||t===null||typeof e!=typeof t)return!1;if(typeof e=="object"){if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((r,o)=>qa(r,t[o]));if(Array.isArray(e)!==Array.isArray(t))return!1;const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every(r=>qa(e[r],t[r]))}return!1}function ql(e){return Array.isArray(e)}function Gl(e){return typeof e=="boolean"}function Kl(e){return e===null}function Yl(e){return e==null}function Zl(e){return typeof e=="number"}function Xl(e){return typeof e=="string"}function Jl(e){return e===void 0}function Ql(e){return e instanceof RegExp}function ec(e){return typeof e=="object"&&e!==null}function tc(e){return e instanceof Date}function nc(e){return e instanceof Error}function sc(e){return typeof e=="function"}function rc(e){return e===null||typeof e!="object"&&typeof e!="function"}function ic(e){return e instanceof Uint8Array}function ac(e){return e instanceof Promise}function oc(e){var t;return(typeof process<"u"&&((t=process.env)==null?void 0:t.NODE_DEBUG)||"").toLowerCase().includes(e.toLowerCase())?(...r)=>{console.error(`${e.toUpperCase()} ${(process==null?void 0:process.pid)||0}:`,...r)}:()=>{}}const Np=oc;function Bp(e){return e.replace(/\x1B\[[0-9;]*[a-zA-Z]|\x1B\].*?(\x07|\x1B\\)|\x1B[()][A-Z0-9]|\x1B[#=]|\x1B./g,"")}const Lp={isArray:ql,isBoolean:Gl,isNull:Kl,isNullOrUndefined:Yl,isNumber:Zl,isString:Xl,isUndefined:Jl,isRegExp:Ql,isObject:ec,isDate:tc,isError:nc,isFunction:sc,isPrimitive:rc,isBuffer:ic,isPromise:ac},dx={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]};function Mp(e,t){const n=Array.isArray(e)?e:[e];let s=t;for(const r of n){const o=dx[r];o&&(s=`\x1B[${o[0]}m${s}\x1B[${o[1]}m`)}return s}function Fp(e){const t=(e==null?void 0:e.args)??(typeof process<"u"?process.argv.slice(2):[]),n=(e==null?void 0:e.options)??{},s=(e==null?void 0:e.allowPositionals)??!(e!=null&&e.options),r=(e==null?void 0:e.strict)??!0,o=(e==null?void 0:e.tokens)??!1,c={};for(const[C,T]of Object.entries(n))T.short&&(c[T.short]=C);const d={},p=[],y=[];for(const[C,T]of Object.entries(n))T.default!==void 0&&(d[C]=T.default);let g=0,x=!1;for(;g<t.length;){const C=t[g];if(x||!C.startsWith("-")||C==="-"){if(!s&&r&&!x)throw new Error(`Unexpected argument '${C}'`);p.push(C),o&&y.push({kind:"positional",value:C,index:g}),g++;continue}if(C==="--"){x=!0,o&&y.push({kind:"option-terminator",index:g}),g++;continue}if(C.startsWith("--")){const T=C.indexOf("="),L=T!==-1?C.slice(2,T):C.slice(2),V=n[L];if(!V&&r)throw new Error(`Unknown option '--${L}'`);const K=(V==null?void 0:V.type)??"boolean";let J;if(K==="boolean")J=T!==-1?C.slice(T+1)!=="false":!0;else if(T!==-1)J=C.slice(T+1);else if(g+1<t.length)J=t[++g];else throw new Error(`Option '--${L}' requires a value`);if(V!=null&&V.multiple){const X=d[L]??[];X.push(J),d[L]=X}else d[L]=J;o&&y.push({kind:"option",name:L,value:J,index:g}),g++;continue}if(C.startsWith("-")&&C.length>1){const T=C.slice(1);for(let L=0;L<T.length;L++){const V=T[L],K=c[V];if(!K&&r)throw new Error(`Unknown option '-${V}'`);const J=K??V,X=K?n[K]:void 0,G=(X==null?void 0:X.type)??"boolean";let $;if(G==="boolean")$=!0;else{const te=T.slice(L+1);if(te.length>0)$=te,L=T.length;else if(g+1<t.length)$=t[++g];else throw new Error(`Option '-${V}' requires a value`)}if(X!=null&&X.multiple){const te=d[J]??[];te.push($),d[J]=te}else d[J]=$;o&&y.push({kind:"option",name:J,value:$,index:g})}g++;continue}g++}const k={values:d,positionals:p};return o&&(k.tokens=y),k}const $p=globalThis.TextEncoder,Up=globalThis.TextDecoder;Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:Up,TextEncoder:$p,_extend:Rp,callbackify:Op,debug:Np,debuglog:oc,default:{format:fd,inspect:ki,inherits:Ip,_extend:Rp,deprecate:Pp,promisify:Dp,callbackify:Op,isDeepStrictEqual:qa,debuglog:oc,debug:Np,stripVTControlCharacters:Bp,isArray:ql,isBoolean:Gl,isNull:Kl,isNullOrUndefined:Yl,isNumber:Zl,isString:Xl,isUndefined:Jl,isRegExp:Ql,isObject:ec,isDate:tc,isError:nc,isFunction:sc,isPrimitive:rc,isBuffer:ic,isPromise:ac,styleText:Mp,parseArgs:Fp,types:Lp,TextEncoder:$p,TextDecoder:Up},deprecate:Pp,format:fd,inherits:Ip,inspect:ki,isArray:ql,isBoolean:Gl,isBuffer:ic,isDate:tc,isDeepStrictEqual:qa,isError:nc,isFunction:sc,isNull:Kl,isNullOrUndefined:Yl,isNumber:Zl,isObject:ec,isPrimitive:rc,isPromise:ac,isRegExp:Ql,isString:Xl,isUndefined:Jl,parseArgs:Fp,promisify:Dp,stripVTControlCharacters:Bp,styleText:Mp,types:Lp},Symbol.toStringTag,{value:"Module"}));function jp(e){return!1}const lc=function(){this&&(this.isTTY=!1,this.isRaw=!1)};lc.prototype.setRawMode=function(t){return this.isRaw=t,this};const Zn=function(){this&&(this.isTTY=!1,this.columns=120,this.rows=40)};Zn.prototype.getColorDepth=function(){return 8},Zn.prototype.hasColors=function(t){return(t??1)<=256},Zn.prototype.getWindowSize=function(){return[this.columns,this.rows]},Zn.prototype.clearLine=function(t,n){return n==null||n(),!0},Zn.prototype.clearScreenDown=function(t){return t==null||t(),!0},Zn.prototype.cursorTo=function(t,n,s){return typeof n=="function"?n():s==null||s(),!0},Zn.prototype.moveCursor=function(t,n,s){return s==null||s(),!0},Object.freeze(Object.defineProperty({__proto__:null,ReadStream:lc,WriteStream:Zn,default:{isatty:jp,ReadStream:lc,WriteStream:Zn},isatty:jp},Symbol.toStringTag,{value:"Module"}));function Vp(){return M.HOSTNAME}function Hp(){return M.PLATFORM}function Wp(){return M.ARCH}function zp(){return M.TYPE}function qp(){return M.RELEASE}function Gp(){return M.VERSION}function Kp(){return M.MACHINE}function Yp(){return M.TMPDIR}function Zp(){return M.HOMEDIR}function Xp(){const e={model:H.MODEL,speed:H.SPEED,times:{user:0,nice:0,sys:0,idle:0,irq:0}};return Array.from({length:H.COUNT},()=>({...e}))}function Jp(){return Z.TOTAL}function Qp(){return Z.FREE}function ef(){return Math.floor(performance.now()/1e3)}function tf(){return[...re]}function nf(){return{lo:[{address:"127.0.0.1",netmask:"255.0.0.0",family:"IPv4",mac:"00:00:00:00:00:00",internal:!0,cidr:"127.0.0.1/8"}]}}function sf(){return{username:M.USERNAME,uid:B.UID,gid:B.GID,shell:M.SHELL,homedir:M.HOMEDIR}}function rf(){return M.ENDIANNESS}function af(e){return 0}function of(e,t){}const lf=`
77
- `,cf="/dev/null",uf={signals:{SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGBUS:7,SIGFPE:8,SIGKILL:9,SIGUSR1:10,SIGSEGV:11,SIGUSR2:12,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGCHLD:17,SIGCONT:18,SIGSTOP:19,SIGTSTP:20,SIGTTIN:21,SIGTTOU:22,SIGURG:23,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28,SIGIO:29,SIGPWR:30,SIGSYS:31},errno:{EPERM:-1,ENOENT:-2,ESRCH:-3,EINTR:-4,EIO:-5,ENXIO:-6,E2BIG:-7,ENOEXEC:-8,EBADF:-9,ECHILD:-10,EAGAIN:-11,ENOMEM:-12,EACCES:-13,EFAULT:-14,EBUSY:-16,EEXIST:-17,EXDEV:-18,ENODEV:-19,ENOTDIR:-20,EISDIR:-21,EINVAL:-22,ENFILE:-23,EMFILE:-24,ENOTTY:-25,EFBIG:-27,ENOSPC:-28,ESPIPE:-29,EROFS:-30,EMLINK:-31,EPIPE:-32,EDOM:-33,ERANGE:-34,ENOTEMPTY:-39,ENOSYS:-38,ELOOP:-40,ENAMETOOLONG:-36,ECONNRESET:-104,ECONNREFUSED:-111,EADDRINUSE:-98,EADDRNOTAVAIL:-99,ETIMEDOUT:-110},priority:{PRIORITY_LOW:19,PRIORITY_BELOW_NORMAL:10,PRIORITY_NORMAL:0,PRIORITY_ABOVE_NORMAL:-7,PRIORITY_HIGH:-14,PRIORITY_HIGHEST:-20}};Object.freeze(Object.defineProperty({__proto__:null,EOL:lf,arch:Wp,constants:uf,cpus:Xp,default:{hostname:Vp,platform:Hp,arch:Wp,type:zp,release:qp,version:Gp,machine:Kp,tmpdir:Yp,homedir:Zp,cpus:Xp,totalmem:Jp,freemem:Qp,uptime:ef,loadavg:tf,networkInterfaces:nf,userInfo:sf,endianness:rf,getPriority:af,setPriority:of,EOL:lf,devNull:cf,constants:uf},devNull:cf,endianness:rf,freemem:Qp,getPriority:af,homedir:Zp,hostname:Vp,loadavg:tf,machine:Kp,networkInterfaces:nf,platform:Hp,release:qp,setPriority:of,tmpdir:Yp,totalmem:Jp,type:zp,uptime:ef,userInfo:sf,version:Gp},Symbol.toStringTag,{value:"Module"}));const cc="0.20.0",df="4.9.0",hx="3.0.1",hf=`https://esm.sh/esbuild-wasm@${cc}`,uc=`https://esm.sh/esbuild-wasm@${cc}/esbuild.wasm`,px=`https://esm.sh/esbuild-wasm@${cc}/esm/browser.min.js`,fx=`https://esm.sh/@rollup/browser@${df}`,mx=`https://esm.sh/brotli-wasm@${hx}`,Ga=new Function("url","return import(url)"),gx=4,pf=0,ff=1,yx=2;function mr(e){let t=e.length;for(;--t>=0;)e[t]=0}const _x=0,mf=1,bx=2,vx=3,wx=258,dc=29,Ci=256,Ai=Ci+1+dc,gr=30,hc=19,gf=2*Ai+1,Ns=15,pc=16,Sx=7,fc=256,yf=16,_f=17,bf=18,mc=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Ka=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),xx=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),vf=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ex=512,Xn=new Array((Ai+2)*2);mr(Xn);const Ti=new Array(gr*2);mr(Ti);const Ii=new Array(Ex);mr(Ii);const Ri=new Array(wx-vx+1);mr(Ri);const gc=new Array(dc);mr(gc);const Ya=new Array(gr);mr(Ya);function yc(e,t,n,s,r){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=s,this.max_length=r,this.has_stree=e&&e.length}let wf,Sf,xf;function _c(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const Ef=e=>e<256?Ii[e]:Ii[256+(e>>>7)],Pi=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Ut=(e,t,n)=>{e.bi_valid>pc-n?(e.bi_buf|=t<<e.bi_valid&65535,Pi(e,e.bi_buf),e.bi_buf=t>>pc-e.bi_valid,e.bi_valid+=n-pc):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},On=(e,t,n)=>{Ut(e,n[t*2],n[t*2+1])},kf=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},kx=e=>{e.bi_valid===16?(Pi(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Cx=(e,t)=>{const n=t.dyn_tree,s=t.max_code,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length;let y,g,x,k,C,T,L=0;for(k=0;k<=Ns;k++)e.bl_count[k]=0;for(n[e.heap[e.heap_max]*2+1]=0,y=e.heap_max+1;y<gf;y++)g=e.heap[y],k=n[n[g*2+1]*2+1]+1,k>p&&(k=p,L++),n[g*2+1]=k,!(g>s)&&(e.bl_count[k]++,C=0,g>=d&&(C=c[g-d]),T=n[g*2],e.opt_len+=T*(k+C),o&&(e.static_len+=T*(r[g*2+1]+C)));if(L!==0){do{for(k=p-1;e.bl_count[k]===0;)k--;e.bl_count[k]--,e.bl_count[k+1]+=2,e.bl_count[p]--,L-=2}while(L>0);for(k=p;k!==0;k--)for(g=e.bl_count[k];g!==0;)x=e.heap[--y],!(x>s)&&(n[x*2+1]!==k&&(e.opt_len+=(k-n[x*2+1])*n[x*2],n[x*2+1]=k),g--)}},Cf=(e,t,n)=>{const s=new Array(Ns+1);let r=0,o,c;for(o=1;o<=Ns;o++)r=r+n[o-1]<<1,s[o]=r;for(c=0;c<=t;c++){let d=e[c*2+1];d!==0&&(e[c*2]=kf(s[d]++,d))}},Ax=()=>{let e,t,n,s,r;const o=new Array(Ns+1);for(n=0,s=0;s<dc-1;s++)for(gc[s]=n,e=0;e<1<<mc[s];e++)Ri[n++]=s;for(Ri[n-1]=s,r=0,s=0;s<16;s++)for(Ya[s]=r,e=0;e<1<<Ka[s];e++)Ii[r++]=s;for(r>>=7;s<gr;s++)for(Ya[s]=r<<7,e=0;e<1<<Ka[s]-7;e++)Ii[256+r++]=s;for(t=0;t<=Ns;t++)o[t]=0;for(e=0;e<=143;)Xn[e*2+1]=8,e++,o[8]++;for(;e<=255;)Xn[e*2+1]=9,e++,o[9]++;for(;e<=279;)Xn[e*2+1]=7,e++,o[7]++;for(;e<=287;)Xn[e*2+1]=8,e++,o[8]++;for(Cf(Xn,Ai+1,o),e=0;e<gr;e++)Ti[e*2+1]=5,Ti[e*2]=kf(e,5);wf=new yc(Xn,mc,Ci+1,Ai,Ns),Sf=new yc(Ti,Ka,0,gr,Ns),xf=new yc(new Array(0),xx,0,hc,Sx)},Af=e=>{let t;for(t=0;t<Ai;t++)e.dyn_ltree[t*2]=0;for(t=0;t<gr;t++)e.dyn_dtree[t*2]=0;for(t=0;t<hc;t++)e.bl_tree[t*2]=0;e.dyn_ltree[fc*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Tf=e=>{e.bi_valid>8?Pi(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},If=(e,t,n,s)=>{const r=t*2,o=n*2;return e[r]<e[o]||e[r]===e[o]&&s[t]<=s[n]},bc=(e,t,n)=>{const s=e.heap[n];let r=n<<1;for(;r<=e.heap_len&&(r<e.heap_len&&If(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!If(t,s,e.heap[r],e.depth));)e.heap[n]=e.heap[r],n=r,r<<=1;e.heap[n]=s},Rf=(e,t,n)=>{let s,r,o=0,c,d;if(e.sym_next!==0)do s=e.pending_buf[e.sym_buf+o++]&255,s+=(e.pending_buf[e.sym_buf+o++]&255)<<8,r=e.pending_buf[e.sym_buf+o++],s===0?On(e,r,t):(c=Ri[r],On(e,c+Ci+1,t),d=mc[c],d!==0&&(r-=gc[c],Ut(e,r,d)),s--,c=Ef(s),On(e,c,n),d=Ka[c],d!==0&&(s-=Ya[c],Ut(e,s,d)));while(o<e.sym_next);On(e,fc,t)},vc=(e,t)=>{const n=t.dyn_tree,s=t.stat_desc.static_tree,r=t.stat_desc.has_stree,o=t.stat_desc.elems;let c,d,p=-1,y;for(e.heap_len=0,e.heap_max=gf,c=0;c<o;c++)n[c*2]!==0?(e.heap[++e.heap_len]=p=c,e.depth[c]=0):n[c*2+1]=0;for(;e.heap_len<2;)y=e.heap[++e.heap_len]=p<2?++p:0,n[y*2]=1,e.depth[y]=0,e.opt_len--,r&&(e.static_len-=s[y*2+1]);for(t.max_code=p,c=e.heap_len>>1;c>=1;c--)bc(e,n,c);y=o;do c=e.heap[1],e.heap[1]=e.heap[e.heap_len--],bc(e,n,1),d=e.heap[1],e.heap[--e.heap_max]=c,e.heap[--e.heap_max]=d,n[y*2]=n[c*2]+n[d*2],e.depth[y]=(e.depth[c]>=e.depth[d]?e.depth[c]:e.depth[d])+1,n[c*2+1]=n[d*2+1]=y,e.heap[1]=y++,bc(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Cx(e,t),Cf(n,p,e.bl_count)},Pf=(e,t,n)=>{let s,r=-1,o,c=t[1],d=0,p=7,y=4;for(c===0&&(p=138,y=3),t[(n+1)*2+1]=65535,s=0;s<=n;s++)o=c,c=t[(s+1)*2+1],!(++d<p&&o===c)&&(d<y?e.bl_tree[o*2]+=d:o!==0?(o!==r&&e.bl_tree[o*2]++,e.bl_tree[yf*2]++):d<=10?e.bl_tree[_f*2]++:e.bl_tree[bf*2]++,d=0,r=o,c===0?(p=138,y=3):o===c?(p=6,y=3):(p=7,y=4))},Df=(e,t,n)=>{let s,r=-1,o,c=t[1],d=0,p=7,y=4;for(c===0&&(p=138,y=3),s=0;s<=n;s++)if(o=c,c=t[(s+1)*2+1],!(++d<p&&o===c)){if(d<y)do On(e,o,e.bl_tree);while(--d!==0);else o!==0?(o!==r&&(On(e,o,e.bl_tree),d--),On(e,yf,e.bl_tree),Ut(e,d-3,2)):d<=10?(On(e,_f,e.bl_tree),Ut(e,d-3,3)):(On(e,bf,e.bl_tree),Ut(e,d-11,7));d=0,r=o,c===0?(p=138,y=3):o===c?(p=6,y=3):(p=7,y=4)}},Tx=e=>{let t;for(Pf(e,e.dyn_ltree,e.l_desc.max_code),Pf(e,e.dyn_dtree,e.d_desc.max_code),vc(e,e.bl_desc),t=hc-1;t>=3&&e.bl_tree[vf[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},Ix=(e,t,n,s)=>{let r;for(Ut(e,t-257,5),Ut(e,n-1,5),Ut(e,s-4,4),r=0;r<s;r++)Ut(e,e.bl_tree[vf[r]*2+1],3);Df(e,e.dyn_ltree,t-1),Df(e,e.dyn_dtree,n-1)},Rx=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return pf;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return ff;for(n=32;n<Ci;n++)if(e.dyn_ltree[n*2]!==0)return ff;return pf};let Of=!1;const Px=e=>{Of||(Ax(),Of=!0),e.l_desc=new _c(e.dyn_ltree,wf),e.d_desc=new _c(e.dyn_dtree,Sf),e.bl_desc=new _c(e.bl_tree,xf),e.bi_buf=0,e.bi_valid=0,Af(e)},Nf=(e,t,n,s)=>{Ut(e,(_x<<1)+(s?1:0),3),Tf(e),Pi(e,n),Pi(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},Dx=e=>{Ut(e,mf<<1,3),On(e,fc,Xn),kx(e)},Ox=(e,t,n,s)=>{let r,o,c=0;e.level>0?(e.strm.data_type===yx&&(e.strm.data_type=Rx(e)),vc(e,e.l_desc),vc(e,e.d_desc),c=Tx(e),r=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=r&&(r=o)):r=o=n+5,n+4<=r&&t!==-1?Nf(e,t,n,s):e.strategy===gx||o===r?(Ut(e,(mf<<1)+(s?1:0),3),Rf(e,Xn,Ti)):(Ut(e,(bx<<1)+(s?1:0),3),Ix(e,e.l_desc.max_code+1,e.d_desc.max_code+1,c+1),Rf(e,e.dyn_ltree,e.dyn_dtree)),Af(e),s&&Tf(e)},Nx=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Ri[n]+Ci+1)*2]++,e.dyn_dtree[Ef(t)*2]++),e.sym_next===e.sym_end);var Bx=Px,Lx=Nf,Mx=Ox,Fx=Nx,$x=Dx,Ux={_tr_init:Bx,_tr_stored_block:Lx,_tr_flush_block:Mx,_tr_tally:Fx,_tr_align:$x},Di=(e,t,n,s)=>{let r=e&65535|0,o=e>>>16&65535|0,c=0;for(;n!==0;){c=n>2e3?2e3:n,n-=c;do r=r+t[s++]|0,o=o+r|0;while(--c);r%=65521,o%=65521}return r|o<<16|0};const jx=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var s=0;s<8;s++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},Vx=new Uint32Array(jx());var St=(e,t,n,s)=>{const r=Vx,o=s+n;e^=-1;for(let c=s;c<o;c++)e=e>>>8^r[(e^t[c])&255];return e^-1},Bs={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Oi={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Hx,_tr_stored_block:wc,_tr_flush_block:Wx,_tr_tally:ds,_tr_align:zx}=Ux,{Z_NO_FLUSH:hs,Z_PARTIAL_FLUSH:qx,Z_FULL_FLUSH:Gx,Z_FINISH:rn,Z_BLOCK:Bf,Z_OK:Et,Z_STREAM_END:Lf,Z_STREAM_ERROR:Nn,Z_DATA_ERROR:Kx,Z_BUF_ERROR:Sc,Z_DEFAULT_COMPRESSION:Yx,Z_FILTERED:Zx,Z_HUFFMAN_ONLY:Za,Z_RLE:Xx,Z_FIXED:Jx,Z_DEFAULT_STRATEGY:Qx,Z_UNKNOWN:eE,Z_DEFLATED:Xa}=Oi,tE=9,nE=15,sE=8,xc=256+1+29,rE=30,iE=19,aE=2*xc+1,oE=15,Le=3,ps=258,Bn=ps+Le+1,lE=32,yr=42,Ec=57,kc=69,Cc=73,Ac=91,Tc=103,Ls=113,Ni=666,Nt=1,_r=2,Ms=3,br=4,cE=3,Fs=(e,t)=>(e.msg=Bs[t],t),Mf=e=>e*2-(e>4?9:0),fs=e=>{let t=e.length;for(;--t>=0;)e[t]=0},uE=e=>{let t,n,s,r=e.w_size;t=e.hash_size,s=t;do n=e.head[--s],e.head[s]=n>=r?n-r:0;while(--t);t=r,s=t;do n=e.prev[--s],e.prev[s]=n>=r?n-r:0;while(--t)};let ms=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const qt=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},Gt=(e,t)=>{Wx(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,qt(e.strm)},He=(e,t)=>{e.pending_buf[e.pending++]=t},Bi=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Ic=(e,t,n,s)=>{let r=e.avail_in;return r>s&&(r=s),r===0?0:(e.avail_in-=r,t.set(e.input.subarray(e.next_in,e.next_in+r),n),e.state.wrap===1?e.adler=Di(e.adler,t,r,n):e.state.wrap===2&&(e.adler=St(e.adler,t,r,n)),e.next_in+=r,e.total_in+=r,r)},Ff=(e,t)=>{let n=e.max_chain_length,s=e.strstart,r,o,c=e.prev_length,d=e.nice_match;const p=e.strstart>e.w_size-Bn?e.strstart-(e.w_size-Bn):0,y=e.window,g=e.w_mask,x=e.prev,k=e.strstart+ps;let C=y[s+c-1],T=y[s+c];e.prev_length>=e.good_match&&(n>>=2),d>e.lookahead&&(d=e.lookahead);do if(r=t,!(y[r+c]!==T||y[r+c-1]!==C||y[r]!==y[s]||y[++r]!==y[s+1])){s+=2,r++;do;while(y[++s]===y[++r]&&y[++s]===y[++r]&&y[++s]===y[++r]&&y[++s]===y[++r]&&y[++s]===y[++r]&&y[++s]===y[++r]&&y[++s]===y[++r]&&y[++s]===y[++r]&&s<k);if(o=ps-(k-s),s=k-ps,o>c){if(e.match_start=t,c=o,o>=d)break;C=y[s+c-1],T=y[s+c]}}while((t=x[t&g])>p&&--n!==0);return c<=e.lookahead?c:e.lookahead},vr=e=>{const t=e.w_size;let n,s,r;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Bn)&&(e.window.set(e.window.subarray(t,t+t-s),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),uE(e),s+=t),e.strm.avail_in===0)break;if(n=Ic(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=n,e.lookahead+e.insert>=Le)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=ms(e,e.ins_h,e.window[r+1]);e.insert&&(e.ins_h=ms(e,e.ins_h,e.window[r+Le-1]),e.prev[r&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=r,r++,e.insert--,!(e.lookahead+e.insert<Le)););}while(e.lookahead<Bn&&e.strm.avail_in!==0)},$f=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s,r,o,c=0,d=e.strm.avail_in;do{if(s=65535,o=e.bi_valid+42>>3,e.strm.avail_out<o||(o=e.strm.avail_out-o,r=e.strstart-e.block_start,s>r+e.strm.avail_in&&(s=r+e.strm.avail_in),s>o&&(s=o),s<n&&(s===0&&t!==rn||t===hs||s!==r+e.strm.avail_in)))break;c=t===rn&&s===r+e.strm.avail_in?1:0,wc(e,0,0,c),e.pending_buf[e.pending-4]=s,e.pending_buf[e.pending-3]=s>>8,e.pending_buf[e.pending-2]=~s,e.pending_buf[e.pending-1]=~s>>8,qt(e.strm),r&&(r>s&&(r=s),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,s-=r),s&&(Ic(e.strm,e.strm.output,e.strm.next_out,s),e.strm.next_out+=s,e.strm.avail_out-=s,e.strm.total_out+=s)}while(c===0);return d-=e.strm.avail_in,d&&(d>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=d&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-d,e.strm.next_in),e.strstart),e.strstart+=d,e.insert+=d>e.w_size-e.insert?e.w_size-e.insert:d),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),c?br:t!==hs&&t!==rn&&e.strm.avail_in===0&&e.strstart===e.block_start?_r:(o=e.window_size-e.strstart,e.strm.avail_in>o&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(Ic(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water<e.strstart&&(e.high_water=e.strstart),o=e.bi_valid+42>>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,n=o>e.w_size?e.w_size:o,r=e.strstart-e.block_start,(r>=n||(r||t===rn)&&t!==hs&&e.strm.avail_in===0&&r<=o)&&(s=r>o?o:r,c=t===rn&&e.strm.avail_in===0&&s===r?1:0,wc(e,e.block_start,s,c),e.block_start+=s,qt(e.strm)),c?Ms:Nt)},Rc=(e,t)=>{let n,s;for(;;){if(e.lookahead<Bn){if(vr(e),e.lookahead<Bn&&t===hs)return Nt;if(e.lookahead===0)break}if(n=0,e.lookahead>=Le&&(e.ins_h=ms(e,e.ins_h,e.window[e.strstart+Le-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Bn&&(e.match_length=Ff(e,n)),e.match_length>=Le)if(s=ds(e,e.strstart-e.match_start,e.match_length-Le),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Le){e.match_length--;do e.strstart++,e.ins_h=ms(e,e.ins_h,e.window[e.strstart+Le-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=ms(e,e.ins_h,e.window[e.strstart+1]);else s=ds(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(s&&(Gt(e,!1),e.strm.avail_out===0))return Nt}return e.insert=e.strstart<Le-1?e.strstart:Le-1,t===rn?(Gt(e,!0),e.strm.avail_out===0?Ms:br):e.sym_next&&(Gt(e,!1),e.strm.avail_out===0)?Nt:_r},wr=(e,t)=>{let n,s,r;for(;;){if(e.lookahead<Bn){if(vr(e),e.lookahead<Bn&&t===hs)return Nt;if(e.lookahead===0)break}if(n=0,e.lookahead>=Le&&(e.ins_h=ms(e,e.ins_h,e.window[e.strstart+Le-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Le-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Bn&&(e.match_length=Ff(e,n),e.match_length<=5&&(e.strategy===Zx||e.match_length===Le&&e.strstart-e.match_start>4096)&&(e.match_length=Le-1)),e.prev_length>=Le&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-Le,s=ds(e,e.strstart-1-e.prev_match,e.prev_length-Le),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=r&&(e.ins_h=ms(e,e.ins_h,e.window[e.strstart+Le-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Le-1,e.strstart++,s&&(Gt(e,!1),e.strm.avail_out===0))return Nt}else if(e.match_available){if(s=ds(e,0,e.window[e.strstart-1]),s&&Gt(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Nt}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(s=ds(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Le-1?e.strstart:Le-1,t===rn?(Gt(e,!0),e.strm.avail_out===0?Ms:br):e.sym_next&&(Gt(e,!1),e.strm.avail_out===0)?Nt:_r},dE=(e,t)=>{let n,s,r,o;const c=e.window;for(;;){if(e.lookahead<=ps){if(vr(e),e.lookahead<=ps&&t===hs)return Nt;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Le&&e.strstart>0&&(r=e.strstart-1,s=c[r],s===c[++r]&&s===c[++r]&&s===c[++r])){o=e.strstart+ps;do;while(s===c[++r]&&s===c[++r]&&s===c[++r]&&s===c[++r]&&s===c[++r]&&s===c[++r]&&s===c[++r]&&s===c[++r]&&r<o);e.match_length=ps-(o-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Le?(n=ds(e,1,e.match_length-Le),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=ds(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Gt(e,!1),e.strm.avail_out===0))return Nt}return e.insert=0,t===rn?(Gt(e,!0),e.strm.avail_out===0?Ms:br):e.sym_next&&(Gt(e,!1),e.strm.avail_out===0)?Nt:_r},hE=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(vr(e),e.lookahead===0)){if(t===hs)return Nt;break}if(e.match_length=0,n=ds(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Gt(e,!1),e.strm.avail_out===0))return Nt}return e.insert=0,t===rn?(Gt(e,!0),e.strm.avail_out===0?Ms:br):e.sym_next&&(Gt(e,!1),e.strm.avail_out===0)?Nt:_r};function Ln(e,t,n,s,r){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=s,this.func=r}const Li=[new Ln(0,0,0,0,$f),new Ln(4,4,8,4,Rc),new Ln(4,5,16,8,Rc),new Ln(4,6,32,32,Rc),new Ln(4,4,16,16,wr),new Ln(8,16,32,32,wr),new Ln(8,16,128,128,wr),new Ln(8,32,128,256,wr),new Ln(32,128,258,1024,wr),new Ln(32,258,258,4096,wr)],pE=e=>{e.window_size=2*e.w_size,fs(e.head),e.max_lazy_match=Li[e.level].max_lazy,e.good_match=Li[e.level].good_length,e.nice_match=Li[e.level].nice_length,e.max_chain_length=Li[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Le-1,e.match_available=0,e.ins_h=0};function fE(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Xa,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(aE*2),this.dyn_dtree=new Uint16Array((2*rE+1)*2),this.bl_tree=new Uint16Array((2*iE+1)*2),fs(this.dyn_ltree),fs(this.dyn_dtree),fs(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(oE+1),this.heap=new Uint16Array(2*xc+1),fs(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*xc+1),fs(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Mi=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==yr&&t.status!==Ec&&t.status!==kc&&t.status!==Cc&&t.status!==Ac&&t.status!==Tc&&t.status!==Ls&&t.status!==Ni?1:0},Uf=e=>{if(Mi(e))return Fs(e,Nn);e.total_in=e.total_out=0,e.data_type=eE;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?Ec:t.wrap?yr:Ls,e.adler=t.wrap===2?0:1,t.last_flush=-2,Hx(t),Et},jf=e=>{const t=Uf(e);return t===Et&&pE(e.state),t},mE=(e,t)=>Mi(e)||e.state.wrap!==2?Nn:(e.state.gzhead=t,Et),Vf=(e,t,n,s,r,o)=>{if(!e)return Nn;let c=1;if(t===Yx&&(t=6),s<0?(c=0,s=-s):s>15&&(c=2,s-=16),r<1||r>tE||n!==Xa||s<8||s>15||t<0||t>9||o<0||o>Jx||s===8&&c!==1)return Fs(e,Nn);s===8&&(s=9);const d=new fE;return e.state=d,d.strm=e,d.status=yr,d.wrap=c,d.gzhead=null,d.w_bits=s,d.w_size=1<<d.w_bits,d.w_mask=d.w_size-1,d.hash_bits=r+7,d.hash_size=1<<d.hash_bits,d.hash_mask=d.hash_size-1,d.hash_shift=~~((d.hash_bits+Le-1)/Le),d.window=new Uint8Array(d.w_size*2),d.head=new Uint16Array(d.hash_size),d.prev=new Uint16Array(d.w_size),d.lit_bufsize=1<<r+6,d.pending_buf_size=d.lit_bufsize*4,d.pending_buf=new Uint8Array(d.pending_buf_size),d.sym_buf=d.lit_bufsize,d.sym_end=(d.lit_bufsize-1)*3,d.level=t,d.strategy=o,d.method=n,jf(e)},gE=(e,t)=>Vf(e,t,Xa,nE,sE,Qx),yE=(e,t)=>{if(Mi(e)||t>Bf||t<0)return e?Fs(e,Nn):Nn;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===Ni&&t!==rn)return Fs(e,e.avail_out===0?Sc:Nn);const s=n.last_flush;if(n.last_flush=t,n.pending!==0){if(qt(e),e.avail_out===0)return n.last_flush=-1,Et}else if(e.avail_in===0&&Mf(t)<=Mf(s)&&t!==rn)return Fs(e,Sc);if(n.status===Ni&&e.avail_in!==0)return Fs(e,Sc);if(n.status===yr&&n.wrap===0&&(n.status=Ls),n.status===yr){let r=Xa+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=Za||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,r|=o<<6,n.strstart!==0&&(r|=lE),r+=31-r%31,Bi(n,r),n.strstart!==0&&(Bi(n,e.adler>>>16),Bi(n,e.adler&65535)),e.adler=1,n.status=Ls,qt(e),n.pending!==0)return n.last_flush=-1,Et}if(n.status===Ec){if(e.adler=0,He(n,31),He(n,139),He(n,8),n.gzhead)He(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),He(n,n.gzhead.time&255),He(n,n.gzhead.time>>8&255),He(n,n.gzhead.time>>16&255),He(n,n.gzhead.time>>24&255),He(n,n.level===9?2:n.strategy>=Za||n.level<2?4:0),He(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(He(n,n.gzhead.extra.length&255),He(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=St(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=kc;else if(He(n,0),He(n,0),He(n,0),He(n,0),He(n,0),He(n,n.level===9?2:n.strategy>=Za||n.level<2?4:0),He(n,cE),n.status=Ls,qt(e),n.pending!==0)return n.last_flush=-1,Et}if(n.status===kc){if(n.gzhead.extra){let r=n.pending,o=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+o>n.pending_buf_size;){let d=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+d),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>r&&(e.adler=St(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex+=d,qt(e),n.pending!==0)return n.last_flush=-1,Et;r=0,o-=d}let c=new Uint8Array(n.gzhead.extra);n.pending_buf.set(c.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>r&&(e.adler=St(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=Cc}if(n.status===Cc){if(n.gzhead.name){let r=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=St(e.adler,n.pending_buf,n.pending-r,r)),qt(e),n.pending!==0)return n.last_flush=-1,Et;r=0}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,He(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>r&&(e.adler=St(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=Ac}if(n.status===Ac){if(n.gzhead.comment){let r=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=St(e.adler,n.pending_buf,n.pending-r,r)),qt(e),n.pending!==0)return n.last_flush=-1,Et;r=0}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,He(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>r&&(e.adler=St(e.adler,n.pending_buf,n.pending-r,r))}n.status=Tc}if(n.status===Tc){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(qt(e),n.pending!==0))return n.last_flush=-1,Et;He(n,e.adler&255),He(n,e.adler>>8&255),e.adler=0}if(n.status=Ls,qt(e),n.pending!==0)return n.last_flush=-1,Et}if(e.avail_in!==0||n.lookahead!==0||t!==hs&&n.status!==Ni){let r=n.level===0?$f(n,t):n.strategy===Za?hE(n,t):n.strategy===Xx?dE(n,t):Li[n.level].func(n,t);if((r===Ms||r===br)&&(n.status=Ni),r===Nt||r===Ms)return e.avail_out===0&&(n.last_flush=-1),Et;if(r===_r&&(t===qx?zx(n):t!==Bf&&(wc(n,0,0,!1),t===Gx&&(fs(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),qt(e),e.avail_out===0))return n.last_flush=-1,Et}return t!==rn?Et:n.wrap<=0?Lf:(n.wrap===2?(He(n,e.adler&255),He(n,e.adler>>8&255),He(n,e.adler>>16&255),He(n,e.adler>>24&255),He(n,e.total_in&255),He(n,e.total_in>>8&255),He(n,e.total_in>>16&255),He(n,e.total_in>>24&255)):(Bi(n,e.adler>>>16),Bi(n,e.adler&65535)),qt(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Et:Lf)},_E=e=>{if(Mi(e))return Nn;const t=e.state.status;return e.state=null,t===Ls?Fs(e,Kx):Et},bE=(e,t)=>{let n=t.length;if(Mi(e))return Nn;const s=e.state,r=s.wrap;if(r===2||r===1&&s.status!==yr||s.lookahead)return Nn;if(r===1&&(e.adler=Di(e.adler,t,n,0)),s.wrap=0,n>=s.w_size){r===0&&(fs(s.head),s.strstart=0,s.block_start=0,s.insert=0);let p=new Uint8Array(s.w_size);p.set(t.subarray(n-s.w_size,n),0),t=p,n=s.w_size}const o=e.avail_in,c=e.next_in,d=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,vr(s);s.lookahead>=Le;){let p=s.strstart,y=s.lookahead-(Le-1);do s.ins_h=ms(s,s.ins_h,s.window[p+Le-1]),s.prev[p&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=p,p++;while(--y);s.strstart=p,s.lookahead=Le-1,vr(s)}return s.strstart+=s.lookahead,s.block_start=s.strstart,s.insert=s.lookahead,s.lookahead=0,s.match_length=s.prev_length=Le-1,s.match_available=0,e.next_in=c,e.input=d,e.avail_in=o,s.wrap=r,Et};var vE=gE,wE=Vf,SE=jf,xE=Uf,EE=mE,kE=yE,CE=_E,AE=bE,TE="pako deflate (from Nodeca project)",Fi={deflateInit:vE,deflateInit2:wE,deflateReset:SE,deflateResetKeep:xE,deflateSetHeader:EE,deflate:kE,deflateEnd:CE,deflateSetDictionary:AE,deflateInfo:TE};const IE=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var RE=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const s in n)IE(n,s)&&(e[s]=n[s])}}return e},PE=e=>{let t=0;for(let s=0,r=e.length;s<r;s++)t+=e[s].length;const n=new Uint8Array(t);for(let s=0,r=0,o=e.length;s<o;s++){let c=e[s];n.set(c,r),r+=c.length}return n},Ja={assign:RE,flattenChunks:PE};let Hf=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Hf=!1}const $i=new Uint8Array(256);for(let e=0;e<256;e++)$i[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;$i[254]=$i[254]=1;var DE=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,s,r,o,c=e.length,d=0;for(r=0;r<c;r++)n=e.charCodeAt(r),(n&64512)===55296&&r+1<c&&(s=e.charCodeAt(r+1),(s&64512)===56320&&(n=65536+(n-55296<<10)+(s-56320),r++)),d+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(d),o=0,r=0;o<d;r++)n=e.charCodeAt(r),(n&64512)===55296&&r+1<c&&(s=e.charCodeAt(r+1),(s&64512)===56320&&(n=65536+(n-55296<<10)+(s-56320),r++)),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|n&63):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|n&63):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|n&63);return t};const OE=(e,t)=>{if(t<65534&&e.subarray&&Hf)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let s=0;s<t;s++)n+=String.fromCharCode(e[s]);return n};var NE=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let s,r;const o=new Array(n*2);for(r=0,s=0;s<n;){let c=e[s++];if(c<128){o[r++]=c;continue}let d=$i[c];if(d>4){o[r++]=65533,s+=d-1;continue}for(c&=d===2?31:d===3?15:7;d>1&&s<n;)c=c<<6|e[s++]&63,d--;if(d>1){o[r++]=65533;continue}c<65536?o[r++]=c:(c-=65536,o[r++]=55296|c>>10&1023,o[r++]=56320|c&1023)}return OE(o,r)},BE=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+$i[e[n]]>t?n:t},Ui={string2buf:DE,buf2string:NE,utf8border:BE};function LE(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Wf=LE;const zf=Object.prototype.toString,{Z_NO_FLUSH:ME,Z_SYNC_FLUSH:FE,Z_FULL_FLUSH:$E,Z_FINISH:UE,Z_OK:Qa,Z_STREAM_END:jE,Z_DEFAULT_COMPRESSION:VE,Z_DEFAULT_STRATEGY:HE,Z_DEFLATED:WE}=Oi;function ji(e){this.options=Ja.assign({level:VE,method:WE,chunkSize:16384,windowBits:15,memLevel:8,strategy:HE},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Wf,this.strm.avail_out=0;let n=Fi.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Qa)throw new Error(Bs[n]);if(t.header&&Fi.deflateSetHeader(this.strm,t.header),t.dictionary){let s;if(typeof t.dictionary=="string"?s=Ui.string2buf(t.dictionary):zf.call(t.dictionary)==="[object ArrayBuffer]"?s=new Uint8Array(t.dictionary):s=t.dictionary,n=Fi.deflateSetDictionary(this.strm,s),n!==Qa)throw new Error(Bs[n]);this._dict_set=!0}}ji.prototype.push=function(e,t){const n=this.strm,s=this.options.chunkSize;let r,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?UE:ME,typeof e=="string"?n.input=Ui.string2buf(e):zf.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(s),n.next_out=0,n.avail_out=s),(o===FE||o===$E)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(r=Fi.deflate(n,o),r===jE)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=Fi.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Qa;if(n.avail_out===0){this.onData(n.output);continue}if(o>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0},ji.prototype.onData=function(e){this.chunks.push(e)},ji.prototype.onEnd=function(e){e===Qa&&(this.result=Ja.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Pc(e,t){const n=new ji(t);if(n.push(e,!0),n.err)throw n.msg||Bs[n.err];return n.result}function zE(e,t){return t=t||{},t.raw=!0,Pc(e,t)}function qE(e,t){return t=t||{},t.gzip=!0,Pc(e,t)}var GE=ji,KE=Pc,YE=zE,ZE=qE,XE={Deflate:GE,deflate:KE,deflateRaw:YE,gzip:ZE};const eo=16209,JE=16191;var QE=function(t,n){let s,r,o,c,d,p,y,g,x,k,C,T,L,V,K,J,X,G,$,te,I,D,F,U;const N=t.state;s=t.next_in,F=t.input,r=s+(t.avail_in-5),o=t.next_out,U=t.output,c=o-(n-t.avail_out),d=o+(t.avail_out-257),p=N.dmax,y=N.wsize,g=N.whave,x=N.wnext,k=N.window,C=N.hold,T=N.bits,L=N.lencode,V=N.distcode,K=(1<<N.lenbits)-1,J=(1<<N.distbits)-1;e:do{T<15&&(C+=F[s++]<<T,T+=8,C+=F[s++]<<T,T+=8),X=L[C&K];t:for(;;){if(G=X>>>24,C>>>=G,T-=G,G=X>>>16&255,G===0)U[o++]=X&65535;else if(G&16){$=X&65535,G&=15,G&&(T<G&&(C+=F[s++]<<T,T+=8),$+=C&(1<<G)-1,C>>>=G,T-=G),T<15&&(C+=F[s++]<<T,T+=8,C+=F[s++]<<T,T+=8),X=V[C&J];n:for(;;){if(G=X>>>24,C>>>=G,T-=G,G=X>>>16&255,G&16){if(te=X&65535,G&=15,T<G&&(C+=F[s++]<<T,T+=8,T<G&&(C+=F[s++]<<T,T+=8)),te+=C&(1<<G)-1,te>p){t.msg="invalid distance too far back",N.mode=eo;break e}if(C>>>=G,T-=G,G=o-c,te>G){if(G=te-G,G>g&&N.sane){t.msg="invalid distance too far back",N.mode=eo;break e}if(I=0,D=k,x===0){if(I+=y-G,G<$){$-=G;do U[o++]=k[I++];while(--G);I=o-te,D=U}}else if(x<G){if(I+=y+x-G,G-=x,G<$){$-=G;do U[o++]=k[I++];while(--G);if(I=0,x<$){G=x,$-=G;do U[o++]=k[I++];while(--G);I=o-te,D=U}}}else if(I+=x-G,G<$){$-=G;do U[o++]=k[I++];while(--G);I=o-te,D=U}for(;$>2;)U[o++]=D[I++],U[o++]=D[I++],U[o++]=D[I++],$-=3;$&&(U[o++]=D[I++],$>1&&(U[o++]=D[I++]))}else{I=o-te;do U[o++]=U[I++],U[o++]=U[I++],U[o++]=U[I++],$-=3;while($>2);$&&(U[o++]=U[I++],$>1&&(U[o++]=U[I++]))}}else if((G&64)===0){X=V[(X&65535)+(C&(1<<G)-1)];continue n}else{t.msg="invalid distance code",N.mode=eo;break e}break}}else if((G&64)===0){X=L[(X&65535)+(C&(1<<G)-1)];continue t}else if(G&32){N.mode=JE;break e}else{t.msg="invalid literal/length code",N.mode=eo;break e}break}}while(s<r&&o<d);$=T>>3,s-=$,T-=$<<3,C&=(1<<T)-1,t.next_in=s,t.next_out=o,t.avail_in=s<r?5+(r-s):5-(s-r),t.avail_out=o<d?257+(d-o):257-(o-d),N.hold=C,N.bits=T};const Sr=15,qf=852,Gf=592,Kf=0,Dc=1,Yf=2,e1=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),t1=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),n1=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),s1=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Vi=(e,t,n,s,r,o,c,d)=>{const p=d.bits;let y=0,g=0,x=0,k=0,C=0,T=0,L=0,V=0,K=0,J=0,X,G,$,te,I,D=null,F;const U=new Uint16Array(Sr+1),N=new Uint16Array(Sr+1);let Q=null,ce,le,me;for(y=0;y<=Sr;y++)U[y]=0;for(g=0;g<s;g++)U[t[n+g]]++;for(C=p,k=Sr;k>=1&&U[k]===0;k--);if(C>k&&(C=k),k===0)return r[o++]=1<<24|64<<16|0,r[o++]=1<<24|64<<16|0,d.bits=1,0;for(x=1;x<k&&U[x]===0;x++);for(C<x&&(C=x),V=1,y=1;y<=Sr;y++)if(V<<=1,V-=U[y],V<0)return-1;if(V>0&&(e===Kf||k!==1))return-1;for(N[1]=0,y=1;y<Sr;y++)N[y+1]=N[y]+U[y];for(g=0;g<s;g++)t[n+g]!==0&&(c[N[t[n+g]]++]=g);if(e===Kf?(D=Q=c,F=20):e===Dc?(D=e1,Q=t1,F=257):(D=n1,Q=s1,F=0),J=0,g=0,y=x,I=o,T=C,L=0,$=-1,K=1<<C,te=K-1,e===Dc&&K>qf||e===Yf&&K>Gf)return 1;for(;;){ce=y-L,c[g]+1<F?(le=0,me=c[g]):c[g]>=F?(le=Q[c[g]-F],me=D[c[g]-F]):(le=96,me=0),X=1<<y-L,G=1<<T,x=G;do G-=X,r[I+(J>>L)+G]=ce<<24|le<<16|me|0;while(G!==0);for(X=1<<y-1;J&X;)X>>=1;if(X!==0?(J&=X-1,J+=X):J=0,g++,--U[y]===0){if(y===k)break;y=t[n+c[g]]}if(y>C&&(J&te)!==$){for(L===0&&(L=C),I+=x,T=y-L,V=1<<T;T+L<k&&(V-=U[T+L],!(V<=0));)T++,V<<=1;if(K+=1<<T,e===Dc&&K>qf||e===Yf&&K>Gf)return 1;$=J&te,r[$]=C<<24|T<<16|I-o|0}}return J!==0&&(r[I+J]=y-L<<24|64<<16|0),d.bits=C,0};const r1=0,Zf=1,Xf=2,{Z_FINISH:Jf,Z_BLOCK:i1,Z_TREES:to,Z_OK:$s,Z_STREAM_END:a1,Z_NEED_DICT:o1,Z_STREAM_ERROR:an,Z_DATA_ERROR:Qf,Z_MEM_ERROR:em,Z_BUF_ERROR:l1,Z_DEFLATED:tm}=Oi,no=16180,nm=16181,sm=16182,rm=16183,im=16184,am=16185,om=16186,lm=16187,cm=16188,um=16189,so=16190,Jn=16191,Oc=16192,dm=16193,Nc=16194,hm=16195,pm=16196,fm=16197,mm=16198,ro=16199,io=16200,gm=16201,ym=16202,_m=16203,bm=16204,vm=16205,Bc=16206,wm=16207,Sm=16208,Ye=16209,xm=16210,Em=16211,c1=852,u1=592,d1=15,km=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function h1(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Us=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<no||t.mode>Em?1:0},Cm=e=>{if(Us(e))return an;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=no,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(c1),t.distcode=t.distdyn=new Int32Array(u1),t.sane=1,t.back=-1,$s},Am=e=>{if(Us(e))return an;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Cm(e)},Tm=(e,t)=>{let n;if(Us(e))return an;const s=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?an:(s.window!==null&&s.wbits!==t&&(s.window=null),s.wrap=n,s.wbits=t,Am(e))},Im=(e,t)=>{if(!e)return an;const n=new h1;e.state=n,n.strm=e,n.window=null,n.mode=no;const s=Tm(e,t);return s!==$s&&(e.state=null),s},p1=e=>Im(e,d1);let Rm=!0,Lc,Mc;const f1=e=>{if(Rm){Lc=new Int32Array(512),Mc=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Vi(Zf,e.lens,0,288,Lc,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Vi(Xf,e.lens,0,32,Mc,0,e.work,{bits:5}),Rm=!1}e.lencode=Lc,e.lenbits=9,e.distcode=Mc,e.distbits=5},Pm=(e,t,n,s)=>{let r;const o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),s>=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(r=o.wsize-o.wnext,r>s&&(r=s),o.window.set(t.subarray(n-s,n-s+r),o.wnext),s-=r,s?(o.window.set(t.subarray(n-s,n),0),o.wnext=s,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0},m1=(e,t)=>{let n,s,r,o,c,d,p,y,g,x,k,C,T,L,V=0,K,J,X,G,$,te,I,D;const F=new Uint8Array(4);let U,N;const Q=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Us(e)||!e.output||!e.input&&e.avail_in!==0)return an;n=e.state,n.mode===Jn&&(n.mode=Oc),c=e.next_out,r=e.output,p=e.avail_out,o=e.next_in,s=e.input,d=e.avail_in,y=n.hold,g=n.bits,x=d,k=p,D=$s;e:for(;;)switch(n.mode){case no:if(n.wrap===0){n.mode=Oc;break}for(;g<16;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(n.wrap&2&&y===35615){n.wbits===0&&(n.wbits=15),n.check=0,F[0]=y&255,F[1]=y>>>8&255,n.check=St(n.check,F,2,0),y=0,g=0,n.mode=nm;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((y&255)<<8)+(y>>8))%31){e.msg="incorrect header check",n.mode=Ye;break}if((y&15)!==tm){e.msg="unknown compression method",n.mode=Ye;break}if(y>>>=4,g-=4,I=(y&15)+8,n.wbits===0&&(n.wbits=I),I>15||I>n.wbits){e.msg="invalid window size",n.mode=Ye;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=y&512?um:Jn,y=0,g=0;break;case nm:for(;g<16;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(n.flags=y,(n.flags&255)!==tm){e.msg="unknown compression method",n.mode=Ye;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Ye;break}n.head&&(n.head.text=y>>8&1),n.flags&512&&n.wrap&4&&(F[0]=y&255,F[1]=y>>>8&255,n.check=St(n.check,F,2,0)),y=0,g=0,n.mode=sm;case sm:for(;g<32;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}n.head&&(n.head.time=y),n.flags&512&&n.wrap&4&&(F[0]=y&255,F[1]=y>>>8&255,F[2]=y>>>16&255,F[3]=y>>>24&255,n.check=St(n.check,F,4,0)),y=0,g=0,n.mode=rm;case rm:for(;g<16;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}n.head&&(n.head.xflags=y&255,n.head.os=y>>8),n.flags&512&&n.wrap&4&&(F[0]=y&255,F[1]=y>>>8&255,n.check=St(n.check,F,2,0)),y=0,g=0,n.mode=im;case im:if(n.flags&1024){for(;g<16;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}n.length=y,n.head&&(n.head.extra_len=y),n.flags&512&&n.wrap&4&&(F[0]=y&255,F[1]=y>>>8&255,n.check=St(n.check,F,2,0)),y=0,g=0}else n.head&&(n.head.extra=null);n.mode=am;case am:if(n.flags&1024&&(C=n.length,C>d&&(C=d),C&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(s.subarray(o,o+C),I)),n.flags&512&&n.wrap&4&&(n.check=St(n.check,s,C,o)),d-=C,o+=C,n.length-=C),n.length))break e;n.length=0,n.mode=om;case om:if(n.flags&2048){if(d===0)break e;C=0;do I=s[o+C++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I));while(I&&C<d);if(n.flags&512&&n.wrap&4&&(n.check=St(n.check,s,C,o)),d-=C,o+=C,I)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=lm;case lm:if(n.flags&4096){if(d===0)break e;C=0;do I=s[o+C++],n.head&&I&&n.length<65536&&(n.head.comment+=String.fromCharCode(I));while(I&&C<d);if(n.flags&512&&n.wrap&4&&(n.check=St(n.check,s,C,o)),d-=C,o+=C,I)break e}else n.head&&(n.head.comment=null);n.mode=cm;case cm:if(n.flags&512){for(;g<16;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(n.wrap&4&&y!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Ye;break}y=0,g=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Jn;break;case um:for(;g<32;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}e.adler=n.check=km(y),y=0,g=0,n.mode=so;case so:if(n.havedict===0)return e.next_out=c,e.avail_out=p,e.next_in=o,e.avail_in=d,n.hold=y,n.bits=g,o1;e.adler=n.check=1,n.mode=Jn;case Jn:if(t===i1||t===to)break e;case Oc:if(n.last){y>>>=g&7,g-=g&7,n.mode=Bc;break}for(;g<3;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}switch(n.last=y&1,y>>>=1,g-=1,y&3){case 0:n.mode=dm;break;case 1:if(f1(n),n.mode=ro,t===to){y>>>=2,g-=2;break e}break;case 2:n.mode=pm;break;case 3:e.msg="invalid block type",n.mode=Ye}y>>>=2,g-=2;break;case dm:for(y>>>=g&7,g-=g&7;g<32;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if((y&65535)!==(y>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Ye;break}if(n.length=y&65535,y=0,g=0,n.mode=Nc,t===to)break e;case Nc:n.mode=hm;case hm:if(C=n.length,C){if(C>d&&(C=d),C>p&&(C=p),C===0)break e;r.set(s.subarray(o,o+C),c),d-=C,o+=C,p-=C,c+=C,n.length-=C;break}n.mode=Jn;break;case pm:for(;g<14;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(n.nlen=(y&31)+257,y>>>=5,g-=5,n.ndist=(y&31)+1,y>>>=5,g-=5,n.ncode=(y&15)+4,y>>>=4,g-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Ye;break}n.have=0,n.mode=fm;case fm:for(;n.have<n.ncode;){for(;g<3;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}n.lens[Q[n.have++]]=y&7,y>>>=3,g-=3}for(;n.have<19;)n.lens[Q[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,U={bits:n.lenbits},D=Vi(r1,n.lens,0,19,n.lencode,0,n.work,U),n.lenbits=U.bits,D){e.msg="invalid code lengths set",n.mode=Ye;break}n.have=0,n.mode=mm;case mm:for(;n.have<n.nlen+n.ndist;){for(;V=n.lencode[y&(1<<n.lenbits)-1],K=V>>>24,J=V>>>16&255,X=V&65535,!(K<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(X<16)y>>>=K,g-=K,n.lens[n.have++]=X;else{if(X===16){for(N=K+2;g<N;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(y>>>=K,g-=K,n.have===0){e.msg="invalid bit length repeat",n.mode=Ye;break}I=n.lens[n.have-1],C=3+(y&3),y>>>=2,g-=2}else if(X===17){for(N=K+3;g<N;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}y>>>=K,g-=K,I=0,C=3+(y&7),y>>>=3,g-=3}else{for(N=K+7;g<N;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}y>>>=K,g-=K,I=0,C=11+(y&127),y>>>=7,g-=7}if(n.have+C>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Ye;break}for(;C--;)n.lens[n.have++]=I}}if(n.mode===Ye)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Ye;break}if(n.lenbits=9,U={bits:n.lenbits},D=Vi(Zf,n.lens,0,n.nlen,n.lencode,0,n.work,U),n.lenbits=U.bits,D){e.msg="invalid literal/lengths set",n.mode=Ye;break}if(n.distbits=6,n.distcode=n.distdyn,U={bits:n.distbits},D=Vi(Xf,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,U),n.distbits=U.bits,D){e.msg="invalid distances set",n.mode=Ye;break}if(n.mode=ro,t===to)break e;case ro:n.mode=io;case io:if(d>=6&&p>=258){e.next_out=c,e.avail_out=p,e.next_in=o,e.avail_in=d,n.hold=y,n.bits=g,QE(e,k),c=e.next_out,r=e.output,p=e.avail_out,o=e.next_in,s=e.input,d=e.avail_in,y=n.hold,g=n.bits,n.mode===Jn&&(n.back=-1);break}for(n.back=0;V=n.lencode[y&(1<<n.lenbits)-1],K=V>>>24,J=V>>>16&255,X=V&65535,!(K<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(J&&(J&240)===0){for(G=K,$=J,te=X;V=n.lencode[te+((y&(1<<G+$)-1)>>G)],K=V>>>24,J=V>>>16&255,X=V&65535,!(G+K<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}y>>>=G,g-=G,n.back+=G}if(y>>>=K,g-=K,n.back+=K,n.length=X,J===0){n.mode=vm;break}if(J&32){n.back=-1,n.mode=Jn;break}if(J&64){e.msg="invalid literal/length code",n.mode=Ye;break}n.extra=J&15,n.mode=gm;case gm:if(n.extra){for(N=n.extra;g<N;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}n.length+=y&(1<<n.extra)-1,y>>>=n.extra,g-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=ym;case ym:for(;V=n.distcode[y&(1<<n.distbits)-1],K=V>>>24,J=V>>>16&255,X=V&65535,!(K<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if((J&240)===0){for(G=K,$=J,te=X;V=n.distcode[te+((y&(1<<G+$)-1)>>G)],K=V>>>24,J=V>>>16&255,X=V&65535,!(G+K<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}y>>>=G,g-=G,n.back+=G}if(y>>>=K,g-=K,n.back+=K,J&64){e.msg="invalid distance code",n.mode=Ye;break}n.offset=X,n.extra=J&15,n.mode=_m;case _m:if(n.extra){for(N=n.extra;g<N;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}n.offset+=y&(1<<n.extra)-1,y>>>=n.extra,g-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Ye;break}n.mode=bm;case bm:if(p===0)break e;if(C=k-p,n.offset>C){if(C=n.offset-C,C>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Ye;break}C>n.wnext?(C-=n.wnext,T=n.wsize-C):T=n.wnext-C,C>n.length&&(C=n.length),L=n.window}else L=r,T=c-n.offset,C=n.length;C>p&&(C=p),p-=C,n.length-=C;do r[c++]=L[T++];while(--C);n.length===0&&(n.mode=io);break;case vm:if(p===0)break e;r[c++]=n.length,p--,n.mode=io;break;case Bc:if(n.wrap){for(;g<32;){if(d===0)break e;d--,y|=s[o++]<<g,g+=8}if(k-=p,e.total_out+=k,n.total+=k,n.wrap&4&&k&&(e.adler=n.check=n.flags?St(n.check,r,k,c-k):Di(n.check,r,k,c-k)),k=p,n.wrap&4&&(n.flags?y:km(y))!==n.check){e.msg="incorrect data check",n.mode=Ye;break}y=0,g=0}n.mode=wm;case wm:if(n.wrap&&n.flags){for(;g<32;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(n.wrap&4&&y!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Ye;break}y=0,g=0}n.mode=Sm;case Sm:D=a1;break e;case Ye:D=Qf;break e;case xm:return em;case Em:default:return an}return e.next_out=c,e.avail_out=p,e.next_in=o,e.avail_in=d,n.hold=y,n.bits=g,(n.wsize||k!==e.avail_out&&n.mode<Ye&&(n.mode<Bc||t!==Jf))&&Pm(e,e.output,e.next_out,k-e.avail_out),x-=e.avail_in,k-=e.avail_out,e.total_in+=x,e.total_out+=k,n.total+=k,n.wrap&4&&k&&(e.adler=n.check=n.flags?St(n.check,r,k,e.next_out-k):Di(n.check,r,k,e.next_out-k)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Jn?128:0)+(n.mode===ro||n.mode===Nc?256:0),(x===0&&k===0||t===Jf)&&D===$s&&(D=l1),D},g1=e=>{if(Us(e))return an;let t=e.state;return t.window&&(t.window=null),e.state=null,$s},y1=(e,t)=>{if(Us(e))return an;const n=e.state;return(n.wrap&2)===0?an:(n.head=t,t.done=!1,$s)},_1=(e,t)=>{const n=t.length;let s,r,o;return Us(e)||(s=e.state,s.wrap!==0&&s.mode!==so)?an:s.mode===so&&(r=1,r=Di(r,t,n,0),r!==s.check)?Qf:(o=Pm(e,t,n,n),o?(s.mode=xm,em):(s.havedict=1,$s))};var b1=Am,v1=Tm,w1=Cm,S1=p1,x1=Im,E1=m1,k1=g1,C1=y1,A1=_1,T1="pako inflate (from Nodeca project)",Qn={inflateReset:b1,inflateReset2:v1,inflateResetKeep:w1,inflateInit:S1,inflateInit2:x1,inflate:E1,inflateEnd:k1,inflateGetHeader:C1,inflateSetDictionary:A1,inflateInfo:T1};function I1(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var R1=I1;const Dm=Object.prototype.toString,{Z_NO_FLUSH:P1,Z_FINISH:D1,Z_OK:Hi,Z_STREAM_END:Fc,Z_NEED_DICT:$c,Z_STREAM_ERROR:O1,Z_DATA_ERROR:Om,Z_MEM_ERROR:N1}=Oi;function Wi(e){this.options=Ja.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Wf,this.strm.avail_out=0;let n=Qn.inflateInit2(this.strm,t.windowBits);if(n!==Hi)throw new Error(Bs[n]);if(this.header=new R1,Qn.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Ui.string2buf(t.dictionary):Dm.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Qn.inflateSetDictionary(this.strm,t.dictionary),n!==Hi)))throw new Error(Bs[n])}Wi.prototype.push=function(e,t){const n=this.strm,s=this.options.chunkSize,r=this.options.dictionary;let o,c,d;if(this.ended)return!1;for(t===~~t?c=t:c=t===!0?D1:P1,Dm.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(s),n.next_out=0,n.avail_out=s),o=Qn.inflate(n,c),o===$c&&r&&(o=Qn.inflateSetDictionary(n,r),o===Hi?o=Qn.inflate(n,c):o===Om&&(o=$c));n.avail_in>0&&o===Fc&&n.state.wrap>0&&e[n.next_in]!==0;)Qn.inflateReset(n),o=Qn.inflate(n,c);switch(o){case O1:case Om:case $c:case N1:return this.onEnd(o),this.ended=!0,!1}if(d=n.avail_out,n.next_out&&(n.avail_out===0||o===Fc))if(this.options.to==="string"){let p=Ui.utf8border(n.output,n.next_out),y=n.next_out-p,g=Ui.buf2string(n.output,p);n.next_out=y,n.avail_out=s-y,y&&n.output.set(n.output.subarray(p,p+y),0),this.onData(g)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(o===Hi&&d===0)){if(o===Fc)return o=Qn.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},Wi.prototype.onData=function(e){this.chunks.push(e)},Wi.prototype.onEnd=function(e){e===Hi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ja.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Uc(e,t){const n=new Wi(t);if(n.push(e),n.err)throw n.msg||Bs[n.err];return n.result}function B1(e,t){return t=t||{},t.raw=!0,Uc(e,t)}var L1=Wi,M1=Uc,F1=B1,$1=Uc,U1={Inflate:L1,inflate:M1,inflateRaw:F1,ungzip:$1};const{Deflate:j1,deflate:V1,deflateRaw:H1,gzip:W1}=XE,{Inflate:z1,inflate:q1,inflateRaw:G1,ungzip:K1}=U1;var Nm=j1,Bm=V1,Lm=H1,Mm=W1,Fm=z1,$m=q1,Um=G1,jm=K1,Vm=Oi,dt={Deflate:Nm,deflate:Bm,deflateRaw:Lm,gzip:Mm,Inflate:Fm,inflate:$m,inflateRaw:Um,ungzip:jm,constants:Vm};const Y1=Object.freeze(Object.defineProperty({__proto__:null,Deflate:Nm,Inflate:Fm,constants:Vm,default:dt,deflate:Bm,deflateRaw:Lm,gzip:Mm,inflate:$m,inflateRaw:Um,ungzip:jm},Symbol.toStringTag,{value:"Module"}));let on=null,jc=null;async function Hm(){return on||(jc||(jc=(async()=>{try{return on=await(await Ga(mx)).default,on}catch{return null}})()),jc)}function Wm(e,t){try{const n=typeof e=="string"?z.from(e):e,s=dt.gzip(n);t(null,z.from(s))}catch(n){t(n,z.alloc(0))}}function zm(e,t){try{const n=dt.ungzip(e);t(null,z.from(n))}catch(n){t(n,z.alloc(0))}}function qm(e,t){try{const n=typeof e=="string"?z.from(e):e,s=dt.deflate(n);t(null,z.from(s))}catch(n){t(n,z.alloc(0))}}function Gm(e,t){try{const n=dt.inflate(e);t(null,z.from(n))}catch(n){t(n,z.alloc(0))}}function Km(e,t){try{const n=typeof e=="string"?z.from(e):e,s=dt.deflateRaw(n);t(null,z.from(s))}catch(n){t(n,z.alloc(0))}}function Ym(e,t){try{const n=dt.inflateRaw(e);t(null,z.from(n))}catch(n){t(n,z.alloc(0))}}function Zm(e,t,n){const s=typeof t=="function"?t:n;Hm().then(r=>{if(!r){s(new Error("Brotli WASM is not available"),z.alloc(0));return}try{const o=typeof e=="string"?z.from(e):e,c=r.compress(new Uint8Array(o));s(null,z.from(c))}catch(o){s(o,z.alloc(0))}}).catch(r=>s(r,z.alloc(0)))}function Xm(e,t,n){const s=typeof t=="function"?t:n;Hm().then(r=>{if(!r){s(new Error("Brotli WASM is not available"),z.alloc(0));return}try{const o=r.decompress(new Uint8Array(e));s(null,z.from(o))}catch(o){s(o,z.alloc(0))}}).catch(r=>s(r,z.alloc(0)))}function Jm(e){const t=typeof e=="string"?z.from(e):e;return z.from(dt.gzip(t))}function Qm(e){return z.from(dt.ungzip(e))}function eg(e){const t=typeof e=="string"?z.from(e):e;return z.from(dt.deflate(t))}function tg(e){return z.from(dt.inflate(e))}function ng(e){const t=typeof e=="string"?z.from(e):e;return z.from(dt.deflateRaw(t))}function sg(e){return z.from(dt.inflateRaw(e))}function rg(e,t){if(!on)throw new Error("Brotli WASM not loaded yet. Use async brotliCompress first.");const n=typeof e=="string"?z.from(e):e;return z.from(on.compress(new Uint8Array(n)))}function ig(e,t){if(!on)throw new Error("Brotli WASM not loaded yet. Use async brotliDecompress first.");return z.from(on.decompress(new Uint8Array(e)))}function jt(e){if(e.chunks&&e.chunks.length>0){const t=e.chunks.splice(0);if(t.length===1)return z.from(t[0]);let n=0;for(const o of t)n+=o.length;const s=new Uint8Array(n);let r=0;for(const o of t)s.set(o,r),r+=o.length;return z.from(s)}if(e.result&&e.result.length>0){const t=z.from(e.result);return e.result=null,t}return null}const Ze=function(t){this&&($t.call(this),this._opts=t||{},this.bytesWritten=0,this._handle={close:()=>{}})};Object.setPrototypeOf(Ze.prototype,$t.prototype),Ze.prototype.close=function(t){this.destroy(),t&&queueMicrotask(t)},Ze.prototype.flush=function(t){t&&queueMicrotask(()=>t(null))},Ze.prototype.reset=function(){},Ze.prototype.params=function(t,n,s){s&&queueMicrotask(()=>s(null))},Ze.prototype._processChunk=function(t,n){let s=null;return this._transform(t,"buffer",(r,o)=>{if(r)throw r;o&&(s=z.from(o))}),n===4&&this._flush((r,o)=>{if(r)throw r;o&&(s=s?z.concat([s,z.from(o)]):z.from(o))}),s};const xr=function(t){this&&(Ze.call(this,t),this._engine=new dt.Deflate({...t||{},gzip:!0}))};Object.setPrototypeOf(xr.prototype,Ze.prototype),xr.prototype._transform=function(t,n,s){try{if(this._engine.push(t,!1),this._engine.err){s(new Error(this._engine.msg||"Gzip error"));return}const r=jt(this._engine);s(null,r??void 0)}catch(r){s(r)}},xr.prototype._flush=function(t){try{this._engine.push(new Uint8Array(0),!0);const n=jt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const Er=function(t){this&&(Ze.call(this,t),this._engine=new dt.Inflate({...t||{}}))};Object.setPrototypeOf(Er.prototype,Ze.prototype),Er.prototype._transform=function(t,n,s){try{if(this._engine.push(t,!1),this._engine.err){s(new Error(this._engine.msg||"Gunzip error"));return}const r=jt(this._engine);s(null,r??void 0)}catch(r){s(r)}},Er.prototype._flush=function(t){try{this._engine.push(new Uint8Array(0),!0);const n=jt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const kr=function(t){this&&(Ze.call(this,t),this._engine=new dt.Deflate({...t||{}}))};Object.setPrototypeOf(kr.prototype,Ze.prototype),kr.prototype._transform=function(t,n,s){try{if(this._engine.push(t,!1),this._engine.err){s(new Error(this._engine.msg||"Deflate error"));return}const r=jt(this._engine);s(null,r??void 0)}catch(r){s(r)}},kr.prototype._flush=function(t){try{this._engine.push(new Uint8Array(0),!0);const n=jt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const Cr=function(t){this&&(Ze.call(this,t),this._engine=new dt.Inflate({...t||{}}))};Object.setPrototypeOf(Cr.prototype,Ze.prototype),Cr.prototype._transform=function(t,n,s){try{if(this._engine.push(t,!1),this._engine.err){s(new Error(this._engine.msg||"Inflate error"));return}const r=jt(this._engine);s(null,r??void 0)}catch(r){s(r)}},Cr.prototype._flush=function(t){try{this._engine.push(new Uint8Array(0),!0);const n=jt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const Ar=function(t){this&&(Ze.call(this,t),this._engine=new dt.Deflate({...t||{},raw:!0}))};Object.setPrototypeOf(Ar.prototype,Ze.prototype),Ar.prototype._transform=function(t,n,s){try{if(this._engine.push(t,!1),this._engine.err){s(new Error(this._engine.msg||"DeflateRaw error"));return}const r=jt(this._engine);s(null,r??void 0)}catch(r){s(r)}},Ar.prototype._flush=function(t){try{this._engine.push(new Uint8Array(0),!0);const n=jt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const Tr=function(t){this&&(Ze.call(this,t),this._engine=new dt.Inflate({...t||{},raw:!0}))};Object.setPrototypeOf(Tr.prototype,Ze.prototype),Tr.prototype._transform=function(t,n,s){try{if(this._engine.push(t,!1),this._engine.err){s(new Error(this._engine.msg||"InflateRaw error"));return}const r=jt(this._engine);s(null,r??void 0)}catch(r){s(r)}},Tr.prototype._flush=function(t){try{this._engine.push(new Uint8Array(0),!0);const n=jt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const Ir=function(t){this&&(Ze.call(this,t),this._engine=null)};Object.setPrototypeOf(Ir.prototype,Ze.prototype),Ir.prototype._transform=function(t,n,s){try{if(!this._engine){const o=t instanceof Uint8Array?t:new Uint8Array(t),c=o.length>=2&&o[0]===31&&o[1]===139;this._engine=new dt.Inflate({windowBits:c?31:47})}if(this._engine.push(t,!1),this._engine.err){s(new Error(this._engine.msg||"Unzip error"));return}const r=jt(this._engine);s(null,r??void 0)}catch(r){s(r)}},Ir.prototype._flush=function(t){try{if(this._engine){this._engine.push(new Uint8Array(0),!0);const n=jt(this._engine);t(null,n??void 0)}else t(null)}catch(n){t(n)}};const Rr=function(t){this&&Ze.call(this,t)};Object.setPrototypeOf(Rr.prototype,Ze.prototype),Rr.prototype._transform=function(t,n,s){if(!on){s(new Error("Brotli WASM not loaded"));return}try{const r=t instanceof Uint8Array?t:new Uint8Array(t);s(null,z.from(on.compress(r)))}catch(r){s(r)}};const Pr=function(t){this&&Ze.call(this,t)};Object.setPrototypeOf(Pr.prototype,Ze.prototype),Pr.prototype._transform=function(t,n,s){if(!on){s(new Error("Brotli WASM not loaded"));return}try{const r=t instanceof Uint8Array?t:new Uint8Array(t);s(null,z.from(on.decompress(r)))}catch(r){s(r)}};const Z1=Rr,X1=Pr;function ag(e){return new xr(e)}function og(e){return new Er(e)}function lg(e){return new kr(e)}function cg(e){return new Cr(e)}function ug(e){return new Ar(e)}function dg(e){return new Tr(e)}function hg(e){return new Ir(e)}function pg(e){return new Rr(e)}function fg(e){return new Pr(e)}const mg={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,ZLIB_VERNUM:4784,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_DECODE:0,BROTLI_ENCODE:1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_PARAM_MODE:0,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_PARAM_QUALITY:1,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_PARAM_LGWIN:2,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_DEFAULT_WINDOW:22,BROTLI_PARAM_LGBLOCK:3,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24};Object.freeze(Object.defineProperty({__proto__:null,BrotliCompress:Z1,BrotliCompressStream:Rr,BrotliDecompress:X1,BrotliDecompressStream:Pr,Deflate:kr,DeflateRaw:Ar,Gunzip:Er,Gzip:xr,Inflate:Cr,InflateRaw:Tr,Unzip:Ir,brotliCompress:Zm,brotliCompressSync:rg,brotliDecompress:Xm,brotliDecompressSync:ig,constants:mg,createBrotliCompress:pg,createBrotliDecompress:fg,createDeflate:lg,createDeflateRaw:ug,createGunzip:og,createGzip:ag,createInflate:cg,createInflateRaw:dg,createUnzip:hg,default:{gzip:Wm,gunzip:zm,deflate:qm,inflate:Gm,deflateRaw:Km,inflateRaw:Ym,brotliCompress:Zm,brotliDecompress:Xm,gzipSync:Jm,gunzipSync:Qm,deflateSync:eg,inflateSync:tg,deflateRawSync:ng,inflateRawSync:sg,brotliCompressSync:rg,brotliDecompressSync:ig,Gzip:xr,Gunzip:Er,Deflate:kr,Inflate:Cr,DeflateRaw:Ar,InflateRaw:Tr,Unzip:Ir,BrotliCompress:Rr,BrotliDecompress:Pr,createGzip:ag,createGunzip:og,createDeflate:lg,createInflate:cg,createDeflateRaw:ug,createInflateRaw:dg,createUnzip:hg,createBrotliCompress:pg,createBrotliDecompress:fg,constants:mg},deflate:qm,deflateRaw:Km,deflateRawSync:ng,deflateSync:eg,gunzip:zm,gunzipSync:Qm,gzip:Wm,gzipSync:Jm,inflate:Gm,inflateRaw:Ym,inflateRawSync:sg,inflateSync:tg},Symbol.toStringTag,{value:"Module"}));function ao(e,t,n){const s=typeof t=="function"?t:n,r=typeof t=="object"?t:{},c=e==="localhost"||e==="127.0.0.1"?"127.0.0.1":"0.0.0.0";setTimeout(()=>{r.all?s(null,[{address:c,family:4}]):s(null,c,4)},0)}function oo(e,t){setTimeout(()=>t(null,["0.0.0.0"]),0)}function gg(e,t){oo(e,t)}function yg(e,t){setTimeout(()=>t(null,["::1"]),0)}function _g(e,t){setTimeout(()=>t(null,["localhost"]),0)}function bg(e){}function vg(){return[]}function wg(e){}function Sg(){return"verbatim"}const Vc={lookup(e,t){return new Promise((n,s)=>{t!=null&&t.all?ao(e,t,(r,o)=>{r?s(r):n(o??[])}):ao(e,t??{},(r,o,c)=>{r?s(r):n({address:o,family:c})})})},resolve(e){return new Promise((t,n)=>{oo(e,(s,r)=>s?n(s):t(r??[]))})},resolve4(e){return Vc.resolve(e)},resolve6(e){return Promise.resolve(["::1"])},reverse(e){return Promise.resolve(["localhost"])},setServers(e){},getServers(){return[]}},xg=0,Eg=0,kg=0;Object.freeze(Object.defineProperty({__proto__:null,ADDRCONFIG:xg,ALL:kg,V4MAPPED:Eg,default:{lookup:ao,resolve:oo,resolve4:gg,resolve6:yg,reverse:_g,setServers:bg,getServers:vg,setDefaultResultOrder:wg,getDefaultResultOrder:Sg,promises:Vc,ADDRCONFIG:xg,V4MAPPED:Eg,ALL:kg},getDefaultResultOrder:Sg,getServers:vg,lookup:ao,promises:Vc,resolve:oo,resolve4:gg,resolve6:yg,reverse:_g,setDefaultResultOrder:wg,setServers:bg},Symbol.toStringTag,{value:"Module"}));let Cg=null;function Ag(e){Cg=e}function Tg(){return Cg}function Ig(e){Ag(e)}const zi=function(){this&&(this.handlers=new Map)};zi.prototype.on=function(t,n){return this.handlers.has(t)||this.handlers.set(t,new Set),this.handlers.get(t).add(n),this},zi.prototype.off=function(t,n){var s;return(s=this.handlers.get(t))==null||s.delete(n),this},zi.prototype.fire=function(t,...n){const s=this.handlers.get(t);if(s)for(const r of s)try{r(...n)}catch{}};const Kt=function(t={}){if(!this)return;zi.call(this);const n=Tg();if(!n)throw new Error("chokidar: MemoryVolume not set. Call setVolume() first.");this.vol=n,this.cfg=t,this.handles=new Map,this.terminated=!1,this.initialised=!1};Object.setPrototypeOf(Kt.prototype,zi.prototype),Kt.prototype.add=function(t){if(this.terminated)return this;const n=Array.isArray(t)?t:[t],s=[];for(const r of n){const o=this.resolvePath(r);if(!(this.isExcluded(o)||this.handles.has(o)))try{if(!this.vol.existsSync(o)){const d=o.substring(0,o.lastIndexOf("/"))||"/";this.vol.existsSync(d)&&this.attachWatcher(d,o);continue}const c=this.vol.statSync(o);this.cfg.ignoreInitial||(c.isDirectory()?this.gatherInitial(o,s):s.push(()=>this.fire("add",o,c))),this.attachWatcher(o),c.isDirectory()&&this.watchSubtree(o)}catch(c){this.fire("error",c)}}return this.initialised||(this.initialised=!0,setTimeout(()=>{for(const r of s)r();this.fire("ready")},0)),this},Kt.prototype.unwatch=function(t){const n=Array.isArray(t)?t:[t];for(const s of n){const r=this.resolvePath(s),o=this.handles.get(r);o&&(o.close(),this.handles.delete(r))}return this},Kt.prototype.close=function(){this.terminated=!0;for(const t of this.handles.values())t.close();return this.handles.clear(),this.fire("close"),Promise.resolve()},Kt.prototype.getWatched=function(){const t={};for(const n of this.handles.keys()){const s=n.substring(0,n.lastIndexOf("/"))||"/",r=n.substring(n.lastIndexOf("/")+1);t[s]||(t[s]=[]),t[s].push(r)}return t},Kt.prototype.resolvePath=function(t){let n=t;return this.cfg.cwd&&!n.startsWith("/")&&(n=this.cfg.cwd+"/"+n),n.startsWith("/")||(n="/"+n),n},Kt.prototype.isExcluded=function(t){const{ignored:n}=this.cfg;if(!n)return!1;const s=Array.isArray(n)?n:[n];for(const r of s)if(typeof r=="string"){if(t===r||t.startsWith(r+"/"))return!0}else if(r instanceof RegExp){if(r.test(t))return!0}else if(typeof r=="function"&&r(t))return!0;return!1},Kt.prototype.gatherInitial=function(t,n){try{const s=this.vol.readdirSync(t);for(const r of s){const o=t==="/"?"/"+r:t+"/"+r;if(this.isExcluded(o))continue;const c=this.vol.statSync(o);c.isDirectory()?(n.push(()=>this.fire("addDir",o,c)),this.gatherInitial(o,n)):n.push(()=>this.fire("add",o,c))}}catch{}},Kt.prototype.attachWatcher=function(t,n){if(this.handles.has(t))return;const s=this,r=this.vol.watch(t,{recursive:!0},(o,c)=>{if(s.terminated)return;let d;if(c?d=t==="/"?"/"+c:t+"/"+c:d=t,!(n&&d!==n&&!d.startsWith(n+"/"))&&!s.isExcluded(d)){if(o==="rename")if(s.vol.existsSync(d))try{const p=s.vol.statSync(d),y=p.isDirectory()?"addDir":"add";s.fire(y,d,p),s.fire("all",y,d,p)}catch{}else s.fire("unlink",d),s.fire("all","unlink",d);else if(o==="change")try{const p=s.vol.statSync(d);s.fire("change",d,p),s.fire("all","change",d,p)}catch{s.fire("unlink",d),s.fire("all","unlink",d)}}});this.handles.set(t,r)},Kt.prototype.watchSubtree=function(t,n=0){if(!(this.cfg.depth!==void 0&&n>this.cfg.depth))try{const s=this.vol.readdirSync(t);for(const r of s){const o=t==="/"?"/"+r:t+"/"+r;if(!this.isExcluded(o))try{this.vol.statSync(o).isDirectory()&&(this.attachWatcher(o),this.watchSubtree(o,n+1))}catch{}}}catch{}};function Rg(e,t){const n=new Kt(t);return n.add(e),n}Object.freeze(Object.defineProperty({__proto__:null,PathWatcher:Kt,default:{watch:Rg,PathWatcher:Kt,setVolume:Ig},setVolume:Ig,watch:Rg},Symbol.toStringTag,{value:"Module"}));const js=typeof CloseEvent<"u"?CloseEvent:class extends Event{constructor(t,n){super(t),W(this,"code"),W(this,"reason"),W(this,"wasClean"),this.code=(n==null?void 0:n.code)??1e3,this.reason=(n==null?void 0:n.reason)??"",this.wasClean=(n==null?void 0:n.wasClean)??!0}},Dr=typeof MessageEvent<"u"?MessageEvent:class extends Event{constructor(t,n){super(t),W(this,"data"),this.data=n==null?void 0:n.data}};let ln=null;try{ln=new BroadcastChannel("nodepod-ws-bridge")}catch{}const Pg=new Map;let J1=0;const Vs=function(){this&&(this._listeners=new Map)};Vs.prototype.on=function(t,n){return this._listeners.has(t)||this._listeners.set(t,new Set),this._listeners.get(t).add(n),this},Vs.prototype.off=function(t,n){var s;return(s=this._listeners.get(t))==null||s.delete(n),this},Vs.prototype.emit=function(t,...n){const s=this._listeners.get(t);if(s)for(const r of s)try{r(...n)}catch{}};const qi=0,Mn=1,Gi=2,Yt=3,_t=function(t,n){if(!this)return;Vs.call(this),this.CONNECTING=qi,this.OPEN=Mn,this.CLOSING=Gi,this.CLOSED=Yt,this.readyState=qi,this.url=t,this.protocol="",this.extensions="",this.bufferedAmount=0,this.binaryType="blob",this._uid=`ws-${++J1}`,this._boundServer=null,this._native=null,this._tcpSocket=null,this._tcpInboundBuf=new Uint8Array(0),this.onopen=null,this.onclose=null,this.onerror=null,this.onmessage=null,n&&(this.protocol=Array.isArray(n)?n[0]:n);const s=this;setTimeout(()=>s._open(),0)};Object.setPrototypeOf(_t.prototype,Vs.prototype),_t.CONNECTING=qi,_t.OPEN=Mn,_t.CLOSING=Gi,_t.CLOSED=Yt,_t.prototype._open=function(){var t;if(this.url.startsWith("internal://")){this.readyState=Mn,this.emit("open"),(t=this.onopen)==null||t.call(this,new Event("open"));return}if(this.url.startsWith("ws://")||this.url.startsWith("wss://")){this._openNative();return}if(!ln){const o=this;setTimeout(()=>{var c;o.readyState=Mn,o.emit("open"),(c=o.onopen)==null||c.call(o,new Event("open"))},0);return}ln.postMessage({kind:"connect",uid:this._uid,url:this.url});const n=ln,s=this,r=o=>{var c,d,p,y;const g=o.data;if(g.targetUid===s._uid){if(g.kind==="connected")s.readyState=Mn,s.emit("open"),(c=s.onopen)==null||c.call(s,new Event("open"));else if(g.kind==="payload"){const x=new Dr("message",{data:g.body});s.emit("message",x),(d=s.onmessage)==null||d.call(s,x)}else if(g.kind==="closed"){s.readyState=Yt;const x=new js("close",{code:g.code||1e3,reason:g.reason||"",wasClean:!0});s.emit("close",x),(p=s.onclose)==null||p.call(s,x),n.removeEventListener("message",r)}else if(g.kind==="fault"){const x=new Event("error");s.emit("error",x),(y=s.onerror)==null||y.call(s,x)}}};n.addEventListener("message",r),setTimeout(()=>{var o;s.readyState===qi&&(s.readyState=Mn,s.emit("open"),(o=s.onopen)==null||o.call(s,new Event("open")))},100)},_t.prototype._openNative=function(){var t;const s=typeof window<"u"&&typeof window.document<"u"&&typeof globalThis.WebSocket=="function"&&globalThis.WebSocket!==_t?globalThis.WebSocket:null;if(!s){const o=this;setTimeout(()=>{var c;o.readyState=Mn,o.emit("open"),(c=o.onopen)==null||c.call(o,new Event("open"))},0);return}try{this._native=new s(this.url),this._native.binaryType=this.binaryType==="arraybuffer"?"arraybuffer":"blob"}catch{this.readyState=Yt;const o=new Event("error");this.emit("error",o),(t=this.onerror)==null||t.call(this,o);return}const r=this;this._native.onopen=()=>{var o;r.readyState=Mn,r.emit("open"),(o=r.onopen)==null||o.call(r,new Event("open"))},this._native.onmessage=o=>{var c;const d=new Dr("message",{data:o.data});r.emit("message",d),(c=r.onmessage)==null||c.call(r,d)},this._native.onclose=o=>{var c;r.readyState=Yt,r._native=null;const d=new js("close",{code:o.code,reason:o.reason,wasClean:o.wasClean});r.emit("close",d),(c=r.onclose)==null||c.call(r,d)},this._native.onerror=()=>{var o;const c=new Event("error");r.emit("error",c),(o=r.onerror)==null||o.call(r,c)}},_t.prototype.send=function(t){if(this.readyState!==Mn)throw new Error("WebSocket is not open");if(this._native){this._native.send(t);return}if(this._tcpSocket){let n,s;typeof t=="string"?(n=new TextEncoder().encode(t),s=1):t instanceof ArrayBuffer?(n=new Uint8Array(t),s=2):(n=t,s=2);const r=wn(s,n,!1);this._tcpSocket.write(z.from(r));return}if(this._boundServer){this._boundServer._injectClientPayload(this,t);return}ln&&ln.postMessage({kind:"payload",uid:this._uid,url:this.url,body:t})},_t.prototype.close=function(t,n){if(this.readyState===Yt||this.readyState===Gi)return;if(this.readyState=Gi,this._native){this._native.close(t,n);return}if(this._tcpSocket){const r=t??1e3,o=new Uint8Array(2);o[0]=r>>8&255,o[1]=r&255;const c=wn(8,o,!1);try{this._tcpSocket.write(z.from(c))}catch{}const d=this;setTimeout(()=>{var p;d.readyState=Yt;const y=new js("close",{code:r,reason:n||"",wasClean:!0});d.emit("close",y),(p=d.onclose)==null||p.call(d,y),d._tcpSocket=null},0);return}ln&&ln.postMessage({kind:"disconnect",uid:this._uid,url:this.url,code:t,reason:n});const s=this;setTimeout(()=>{var r;s.readyState=Yt;const o=new js("close",{code:t||1e3,reason:n||"",wasClean:!0});s.emit("close",o),(r=s.onclose)==null||r.call(s,o)},0)},_t.prototype.ping=function(){},_t.prototype.pong=function(){},_t.prototype.terminate=function(){var t;if(this._native&&(this._native.close(),this._native=null),this._tcpSocket){try{this._tcpSocket.destroy()}catch{}this._tcpSocket=null}this.readyState=Yt;const n=new js("close",{code:1006,reason:"Terminated",wasClean:!1});this.emit("close",n),(t=this.onclose)==null||t.call(this,n)},_t.prototype._bindServer=function(t){this._boundServer=t},_t.prototype._deliverMessage=function(t){var n;const s=new Dr("message",{data:t});this.emit("message",s),(n=this.onmessage)==null||n.call(this,s)};const Dg="258EAFA5-E914-47DA-95CA-5AB5DC76CB76";function Q1(e){try{const t=Xr("sha1");return t.update(e+Dg),t.digest("base64")}catch{return btoa(e+Dg).slice(0,28)}}const gs=function(t={}){this&&(Vs.call(this),this.clients=new Set,this.options=t,this._route=t.path||"/",this._channelCb=null,t.noServer||this._listen(),Pg.set(this._route,this))};Object.setPrototypeOf(gs.prototype,Vs.prototype),gs.prototype._listen=function(){if(!ln)return;const t=ln,n=this;this._channelCb=s=>{const r=s.data;if(r.kind==="connect"){const o=new _t("internal://"+n._route);o._bindServer(n),o._uid=r.uid,n.clients.add(o),t.postMessage({kind:"connected",targetUid:r.uid}),n.emit("connection",o,{url:r.url})}if(r.kind==="payload"){for(const o of n.clients)if(o._uid===r.uid){o._deliverMessage(r.body);break}}if(r.kind==="disconnect"){for(const o of n.clients)if(o._uid===r.uid){o.close(r.code,r.reason),n.clients.delete(o);break}}},t.addEventListener("message",this._channelCb)},gs.prototype._injectClientPayload=function(t,n){const s=new Dr("message",{data:n});t.emit("message",s)},gs.prototype.handleUpgrade=function(t,n,s,r){const o=new _t("internal://"+this._route);o._bindServer(this),this.options.clientTracking!==!1&&this.clients.add(o);const c=n;if(c&&typeof c.write=="function"&&typeof c._feedData=="function"){o._tcpSocket=c;const g=((t==null?void 0:t.headers)||{})["sec-websocket-key"]||"",k=`HTTP/1.1 101 Switching Protocols\r
72
+ `)),!c.headersSent)try{c.statusCode=500,c.end("Internal Server Error")}catch{}o(f)}})};function Ei(e,n){return new en(e,n)}const hs={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",204:"No Content",301:"Moved Permanently",302:"Found",304:"Not Modified",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",408:"Request Timeout",409:"Conflict",410:"Gone",413:"Payload Too Large",415:"Unsupported Media Type",422:"Unprocessable Entity",429:"Too Many Requests",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"},ki=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","CONNECT","TRACE"];function wy(){try{return typeof localStorage<"u"?localStorage.getItem("__corsProxyUrl")??null:null}catch{return null}}const Ie=function(n,t){if(!this)return;if(xe.call(this),this._opts=n,this._proto=t||"http",this.method=n.method??"GET",this.path=n.path??"/",this.headers={},this._pending=[],this._cancelled=!1,this._waitMs=null,this._waitTimer=null,this._sealed=!1,this._socket=new De,this.finished=!1,this.aborted=!1,this.reusedSocket=!1,this.maxHeadersCount=null,n.headers)for(const[s,i]of Object.entries(n.headers))this.headers[s.toLowerCase()]=Array.isArray(i)?i.join(", "):i;const r=this;queueMicrotask(()=>r.emit("socket",r._socket))};Object.setPrototypeOf(Ie.prototype,xe.prototype),Object.defineProperty(Ie.prototype,"socket",{get:function(){return this._socket},configurable:!0}),Object.defineProperty(Ie.prototype,"connection",{get:function(){return this._socket},configurable:!0}),Ie.prototype.setHeader=function(n,t){this.headers[n.toLowerCase()]=t},Ie.prototype.getHeader=function(n){return this.headers[n.toLowerCase()]},Ie.prototype.removeHeader=function(n){delete this.headers[n.toLowerCase()]},Ie.prototype.write=function(n,t,r){const s=typeof n=="string"?I.from(n):n;this._pending.push(s);const i=typeof t=="function"?t:r;return i&&queueMicrotask(()=>i(null)),!0},Ie.prototype.end=function(n,t,r){if(this._sealed)return this;this._sealed=!0,this.finished=!0;let s=r;typeof n=="function"?s=n:n!==void 0&&this.write(n),typeof t=="function"&&(s=t);const i=this;return i._dispatch().then(()=>{s&&s()}).catch(a=>i.emit("error",a)),this},Ie.prototype.abort=function(){this._cancelled=!0,this.aborted=!0,this._waitTimer&&clearTimeout(this._waitTimer),this.emit("abort")},Ie.prototype.setTimeout=function(n,t){return this._waitMs=n,t&&this.once("timeout",t),this},Ie.prototype.flushHeaders=function(){},Ie.prototype.setNoDelay=function(n){},Ie.prototype.setSocketKeepAlive=function(n,t){},Ie.prototype._dispatch=async function(){var n;if(!this._cancelled)try{const t=this._proto==="https"?"https:":"http:";let r=this._opts.hostname??"",s=this._opts.port?`:${this._opts.port}`:"";if(!r&&this._opts.host){const m=this._opts.host.split(":");r=m[0],!s&&m[1]&&(s=`:${m[1]}`)}r||(r="localhost");const i=`${t}//${r}${s}${this._opts.path??"/"}`;if(((n=this.headers.upgrade)==null?void 0:n.toLowerCase())==="websocket"){this._bridgeWebSocket(i);return}const a=r==="localhost"||r==="127.0.0.1"||r==="0.0.0.0",o=Number(this._opts.port)||(this._proto==="https"?443:80);if(a){const m=Qn.get(o);if(m){const k=this._pending.length>0?I.concat(this._pending):void 0;try{const P=await m.dispatchRequest(this.method,this._opts.path??"/",this.headers,k);if(this._cancelled)return;const N=new ln;N.statusCode=P.statusCode,N.statusMessage=P.statusMessage;for(const[O,R]of Object.entries(P.headers))N.headers[O.toLowerCase()]=R,N.rawHeaders.push(O,R);N._injectBody(P.body),this.emit("response",N)}catch(P){this.emit("error",P)}return}const v=new Error(`connect ECONNREFUSED ${r}:${o}`);v.code="ECONNREFUSED",v.errno=-111,v.syscall="connect",v.address=r,v.port=o,this.emit("error",v);return}const l=wy(),u=l?l+encodeURIComponent(i):i,c={method:this.method,headers:this.headers};this._pending.length>0&&this.method!=="GET"&&this.method!=="HEAD"&&(c.body=I.concat(this._pending));const p=new AbortController;c.signal=p.signal,this._waitMs&&(this._waitTimer=setTimeout(()=>{p.abort(),this.emit("timeout")},this._waitMs));const h=await fetch(u,c);if(this._waitTimer&&(clearTimeout(this._waitTimer),this._waitTimer=null),this._cancelled)return;const f=await this._mapResponse(h);this.emit("response",f)}catch(t){if(this._waitTimer&&clearTimeout(this._waitTimer),this._cancelled||t instanceof Error&&t.name==="AbortError")return;this.emit("error",t)}},Ie.prototype._mapResponse=async function(n){const t=new ln;t.statusCode=n.status,t.statusMessage=n.statusText||hs[n.status]||"",n.headers.forEach((s,i)=>{t.headers[i.toLowerCase()]=s,t.rawHeaders.push(i,s)});const r=await n.arrayBuffer();return t._injectBody(I.from(r)),t},Ie.prototype._bridgeWebSocket=function(n){const t=n.replace(/^https:/,"wss:").replace(/^http:/,"ws:"),r=this.headers["sec-websocket-key"]??"",s=vy;if(!s){const h=this;setTimeout(()=>h.emit("error",new TypeError("No WebSocket available")),0);return}const a=is("sha1").update(r+"258EAFA5-E914-47DA-95CA-C5AB0DC85B11").digest("base64");let o;try{o=new s(t),o.binaryType="arraybuffer"}catch(h){const f=this;setTimeout(()=>f.emit("error",h instanceof Error?h:new Error(String(h))),0);return}const l=new De;l.cork=()=>{},l.uncork=()=>{},l._readableState={endEmitted:!1},l._writableState={finished:!1,errorEmitted:!1};let u=new Uint8Array(0);l.write=(h,f,m)=>{const v=typeof h=="string"?I.from(h):new Uint8Array(h),k=typeof f=="function"?f:m,P=new Uint8Array(u.length+v.length);for(P.set(u,0),P.set(v,u.length),u=P;u.length>=2;){const N=ys(u);if(!N)break;if(u=u.slice(N.consumed),o.readyState===s.OPEN)switch(N.op){case 8:o.close();break;case 9:o.send(N.data);break;case 10:break;case 1:o.send(new TextDecoder().decode(N.data));break;case 2:o.send(N.data);break}}return k&&queueMicrotask(()=>k(null)),!0};const c=this;o.onopen=()=>{const h=new ln(l);h.statusCode=101,h.statusMessage="Switching Protocols",h.headers={upgrade:"websocket",connection:"Upgrade","sec-websocket-accept":a},h.complete=!0,h.push(null),c.emit("upgrade",h,l,I.alloc(0))},o.onmessage=h=>{let f,m;if(typeof h.data=="string")f=new TextEncoder().encode(h.data),m=1;else if(h.data instanceof ArrayBuffer)f=new Uint8Array(h.data),m=2;else return;const v=Vn(m,f,!1);l._feedData(I.from(v))},o.onclose=h=>{const f=h.code||1e3,m=new Uint8Array(2);m[0]=f>>8&255,m[1]=f&255;const v=Vn(8,m,!1);l._feedData(I.from(v)),setTimeout(()=>{l._readableState.endEmitted=!0,l._feedEnd(),l.emit("close",!1)},10)},o.onerror=()=>{l.emit("error",new Error("WebSocket transport error")),l.destroy()};const p=l.destroy.bind(l);l.destroy=h=>((o.readyState===s.OPEN||o.readyState===s.CONNECTING)&&o.close(),p(h))};function to(e,n,t){let r,s=t;if(typeof e=="string"||e instanceof URL){const i=new URL(e.toString());r={hostname:i.hostname,port:i.port?parseInt(i.port,10):void 0,path:i.pathname+i.search,method:"GET"},typeof n=="function"?s=n:n&&(r={...r,...n})}else r=e,typeof n=="function"&&(s=n);return{opts:r,cb:s}}function iu(e,n,t){const{opts:r,cb:s}=to(e,n,t),i=new Ie(r,"http");return s&&i.once("response",s),i}function au(e,n,t){const{opts:r,cb:s}=to(e,n,t),i=new Ie({...r,method:"GET"},"http");return s&&i.once("response",s),i.end(),i}function Ci(e,n,t,r){const{opts:s,cb:i}=to(e,n,t),a=new Ie(s,r);return i&&a.once("response",i),a}const Qn=new Map,fs=new Map;let ro=null,so=null;function Sy(e,n,t){Qn.set(e,n),Tt(),ro&&ro(e,n)}function xy(e){Qn.has(e)&&Yn(),Qn.delete(e),fs.delete(e),so&&so(e)}function ms(e){return Qn.get(e)}pi=function(){return new Map(Qn)},ey=function(){for(const[,e]of Qn)try{e.close()}catch{}Qn.clear(),fs.clear()};function Ey(e){for(const[n,t]of fs)if(t===e){const r=Qn.get(n);if(r)try{r.close()}catch{}Qn.delete(n),fs.delete(n)}}function ky(e){return fs.get(e)}function gs(e){ro=e}function _s(e){so=e}const et=function(n){this&&(M.call(this),this.options=n??{},this.maxSockets=(n==null?void 0:n.maxSockets)??1/0,this.maxFreeSockets=(n==null?void 0:n.maxFreeSockets)??256,this.maxTotalSockets=(n==null?void 0:n.maxTotalSockets)??1/0,this.sockets={},this.freeSockets={},this.requests={})};Object.setPrototypeOf(et.prototype,M.prototype),et.prototype.createConnection=function(n,t){const r=new De;return t&&t(null,r),r},et.prototype.getName=function(n){return`${n.host??"localhost"}:${n.port??80}:${n.localAddress??""}`},et.prototype.addRequest=function(n,t){},et.prototype.destroy=function(){this.sockets={},this.freeSockets={},this.requests={}};const Ai=new et;function ys(e){if(e.length<2)return null;const n=e[0]&15,t=(e[1]&128)!==0;let r=e[1]&127,s=2;if(r===126){if(e.length<4)return null;r=e[2]<<8|e[3],s=4}else if(r===127){if(e.length<10)return null;r=e[6]<<24|e[7]<<16|e[8]<<8|e[9],s=10}if(t){if(e.length<s+4+r)return null;const i=e.slice(s,s+4);s+=4;const a=new Uint8Array(r);for(let o=0;o<r;o++)a[o]=e[s+o]^i[o&3];return{op:n,data:a,consumed:s+r}}return e.length<s+r?null:{op:n,data:e.slice(s,s+r),consumed:s+r}}function Vn(e,n,t){const r=n.length;let s=2;r>125&&r<=65535?s+=2:r>65535&&(s+=8),t&&(s+=4);const i=new Uint8Array(s+r);i[0]=128|e;let a=2;if(r<=125?i[1]=(t?128:0)|r:r<=65535?(i[1]=(t?128:0)|126,i[2]=r>>8&255,i[3]=r&255,a=4):(i[1]=(t?128:0)|127,i[2]=0,i[3]=0,i[4]=0,i[5]=0,i[6]=r>>24&255,i[7]=r>>16&255,i[8]=r>>8&255,i[9]=r&255,a=10),t){const o=new Uint8Array(4);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(o);else for(let l=0;l<4;l++)o[l]=Math.floor(Math.random()*256);i.set(o,a),a+=4;for(let l=0;l<r;l++)i[a+l]=n[l]^o[l&3]}else i.set(n,a);return i}J_=Object.freeze(Object.defineProperty({__proto__:null,Agent:et,ClientRequest:Ie,IncomingMessage:ln,METHODS:ki,STATUS_CODES:hs,Server:en,ServerResponse:ge,_buildClientRequest:Ci,closeAllServers:ey,closeServersByPid:Ey,createServer:Ei,decodeFrame:ys,default:{Server:en,IncomingMessage:ln,ServerResponse:ge,ClientRequest:Ie,createServer:Ei,request:iu,get:au,STATUS_CODES:hs,METHODS:ki,getServer:ms,getAllServers:pi,setServerListenCallback:gs,setServerCloseCallback:_s,_buildClientRequest:Ci,Agent:et,globalAgent:Ai,decodeFrame:ys,encodeFrame:Vn},encodeFrame:Vn,get:au,getAllServers:pi,getServer:ms,getServerOwner:ky,globalAgent:Ai,request:iu,setServerCloseCallback:_s,setServerListenCallback:gs},Symbol.toStringTag,{value:"Module"}));function ou(e,n,t){return Ci(e,n,t,"https")}function lu(e,n,t){const r=Ci(e,n,t,"https");return r.end(),r}const Cy=Object.freeze(Object.defineProperty({__proto__:null,Agent:et,ClientRequest:Ie,IncomingMessage:ln,METHODS:ki,STATUS_CODES:hs,Server:en,ServerResponse:ge,createServer:Ei,default:{Server:en,IncomingMessage:ln,ServerResponse:ge,ClientRequest:Ie,createServer:Ei,request:ou,get:lu,STATUS_CODES:hs,METHODS:ki,getServer:ms,getAllServers:pi,setServerListenCallback:gs,setServerCloseCallback:_s,Agent:et,globalAgent:Ai},get:lu,getAllServers:pi,getServer:ms,globalAgent:Ai,request:ou,setServerCloseCallback:_s,setServerListenCallback:gs},Symbol.toStringTag,{value:"Module"}));function cu(e,n=!1,t=!1){try{const r=new globalThis.URL(e,"http://localhost"),s=r.username?`${r.username}:${r.password}`:null,i=n?Object.fromEntries(r.searchParams):r.search?r.search.substring(1):null;return{protocol:r.protocol,slashes:r.protocol.endsWith(":"),auth:s,host:r.host,port:r.port||null,hostname:r.hostname,hash:r.hash||null,search:r.search||null,query:i,pathname:r.pathname,path:r.pathname+r.search,href:r.href}}catch{return{protocol:null,slashes:null,auth:null,host:null,port:null,hostname:null,hash:null,search:null,query:null,pathname:e,path:e,href:e}}}function uu(e){if(e.href)return e.href;let n="";if(e.protocol&&(n+=e.protocol.endsWith(":")?e.protocol:e.protocol+":"),(e.slashes||e.protocol==="http:"||e.protocol==="https:")&&(n+="//"),e.auth&&(n+=e.auth+"@"),e.hostname?n+=e.hostname:e.host&&(n+=e.host),e.port&&(n+=":"+e.port),e.pathname&&(n+=e.pathname),e.search)n+=e.search;else if(e.query)if(typeof e.query=="string")n+="?"+e.query;else{const t=new globalThis.URLSearchParams;for(const[s,i]of Object.entries(e.query))if(Array.isArray(i))for(const a of i)t.append(s,a);else t.set(s,i);const r=t.toString();r&&(n+="?"+r)}return e.hash&&(n+=e.hash),n}function du(e,n){try{return new globalThis.URL(n,e).href}catch{return n}}const pu=globalThis.URL,hu=globalThis.URLSearchParams;function fu(e){if(typeof e=="string"){if(e.startsWith("/"))return e;try{const n=new globalThis.URL(e);return n.protocol==="file:",decodeURIComponent(n.pathname)}catch{return e}}return e.protocol==="file:",decodeURIComponent(e.pathname)}function mu(e){const n=encodeURIComponent(e).replace(/%2F/g,"/");return new globalThis.URL("file://"+n)}function gu(e){try{return new globalThis.URL(`http://${e}`).hostname}catch{return e}}function _u(e){return e}Object.freeze(Object.defineProperty({__proto__:null,URL:pu,URLSearchParams:hu,default:{parse:cu,format:uu,resolve:du,URL:pu,URLSearchParams:hu,fileURLToPath:fu,pathToFileURL:mu,domainToASCII:gu,domainToUnicode:_u},domainToASCII:gu,domainToUnicode:_u,fileURLToPath:fu,format:uu,parse:cu,pathToFileURL:mu,resolve:du},Symbol.toStringTag,{value:"Module"}));function io(e,n="&",t="=",r){const s={};if(!e||typeof e!="string")return s;const i=(r==null?void 0:r.maxKeys)||1e3,a=e.split(n),o=i>0?Math.min(a.length,i):a.length;for(let l=0;l<o;l++){const u=a[l],c=u.indexOf(t);let p,h;if(c>=0?(p=decodeURIComponent(u.substring(0,c).replace(/\+/g," ")),h=decodeURIComponent(u.substring(c+1).replace(/\+/g," "))):(p=decodeURIComponent(u.replace(/\+/g," ")),h=""),p in s){const f=s[p];Array.isArray(f)?f.push(h):s[p]=[f,h]}else s[p]=h}return s}function ao(e,n="&",t="="){if(!e||typeof e!="object")return"";const r=[];for(const[s,i]of Object.entries(e)){if(i===void 0)continue;const a=encodeURIComponent(s);if(Array.isArray(i))for(const o of i)r.push(`${a}${t}${encodeURIComponent(String(o))}`);else r.push(`${a}${t}${encodeURIComponent(String(i))}`)}return r.join(n)}function yu(e){return encodeURIComponent(e)}function bu(e){return decodeURIComponent(e.replace(/\+/g," "))}const vu=ao,wu=io;Object.freeze(Object.defineProperty({__proto__:null,decode:wu,default:{parse:io,stringify:ao,escape:yu,unescape:bu,encode:vu,decode:wu},encode:vu,escape:yu,parse:io,stringify:ao,unescape:bu},Symbol.toStringTag,{value:"Module"})),cc=function(e,...n){if(typeof e!="string")return[e,...n].map(s=>typeof s=="string"?s:bs(s)).join(" ");let t=0,r=e.replace(/%[sdjifoO%]/g,s=>{if(s==="%%")return"%";if(t>=n.length)return s;const i=n[t++];switch(s){case"%s":return String(i);case"%d":case"%i":return String(parseInt(String(i),10));case"%f":return String(parseFloat(String(i)));case"%j":try{return JSON.stringify(i)}catch{return"[Circular]"}case"%o":case"%O":return bs(i);default:return s}});for(;t<n.length;){const s=n[t++];r+=" "+(typeof s=="string"?s:bs(s))}return r};function bs(e,n){const t=new WeakSet,r=(n==null?void 0:n.depth)??2;function s(i,a){if(i===null)return"null";if(i===void 0)return"undefined";const o=typeof i;if(o==="string")return`'${i}'`;if(o==="number"||o==="boolean"||o==="bigint")return String(i);if(o==="symbol")return i.toString();if(o==="function")return`[Function: ${i.name||"anonymous"}]`;if(o!=="object")return String(i);if(t.has(i))return"[Circular]";if(t.add(i),a>r)return Array.isArray(i)?"[Array]":"[Object]";if(Array.isArray(i))return i.length===0?"[]":`[ ${i.map(p=>s(p,a+1)).join(", ")} ]`;if(i instanceof Date)return i.toISOString();if(i instanceof RegExp)return i.toString();if(i instanceof Error)return`${i.name}: ${i.message}`;if(i instanceof Map){const c=[...i.entries()].map(([p,h])=>`${s(p,a+1)} => ${s(h,a+1)}`);return`Map(${i.size}) { ${c.join(", ")} }`}if(i instanceof Set){const c=[...i].map(p=>s(p,a+1));return`Set(${i.size}) { ${c.join(", ")} }`}const l=Object.keys(i);return l.length===0?"{}":`{ ${l.map(c=>{const p=i[c];return`${c}: ${s(p,a+1)}`}).join(", ")} }`}return s(e,0)}function Su(e,n){if(e==null)throw new TypeError("inherits: child constructor must be provided");n!=null&&n.prototype!==void 0&&(e.super_=n,Object.setPrototypeOf(e.prototype,n.prototype))}function xu(e,n){if(n==null)return e;const t=Object.keys(n);for(let r=0;r<t.length;r++)e[t[r]]=n[t[r]];return e}function Eu(e,n,t){let r=!1;return function(...i){return r||(console.warn(`DeprecationWarning: ${n}${t?` (${t})`:""}`),r=!0),e.apply(this,i)}}function ku(e){return(...n)=>new Promise((t,r)=>{e(...n,(s,i)=>{s?r(s):t(i)})})}function Cu(e){return(...n)=>{const t=n.pop();e(...n).then(r=>t(null,r)).catch(r=>t(r,void 0))}}function Ti(e,n){if(e===n)return!0;if(e===null||n===null||typeof e!=typeof n)return!1;if(typeof e=="object"){if(Array.isArray(e)&&Array.isArray(n))return e.length!==n.length?!1:e.every((s,i)=>Ti(s,n[i]));if(Array.isArray(e)!==Array.isArray(n))return!1;const t=Object.keys(e),r=Object.keys(n);return t.length!==r.length?!1:t.every(s=>Ti(e[s],n[s]))}return!1}function oo(e){return Array.isArray(e)}function lo(e){return typeof e=="boolean"}function co(e){return e===null}function uo(e){return e==null}function po(e){return typeof e=="number"}function ho(e){return typeof e=="string"}function fo(e){return e===void 0}function mo(e){return e instanceof RegExp}function go(e){return typeof e=="object"&&e!==null}function _o(e){return e instanceof Date}function yo(e){return e instanceof Error}function bo(e){return typeof e=="function"}function vo(e){return e===null||typeof e!="object"&&typeof e!="function"}function wo(e){return e instanceof Uint8Array}function So(e){return e instanceof Promise}function xo(e){var n;return(typeof process<"u"&&((n=process.env)==null?void 0:n.NODE_DEBUG)||"").toLowerCase().includes(e.toLowerCase())?(...s)=>{console.error(`${e.toUpperCase()} ${(process==null?void 0:process.pid)||0}:`,...s)}:()=>{}}const Au=xo;function Tu(e){return e.replace(/\x1B\[[0-9;]*[a-zA-Z]|\x1B\].*?(\x07|\x1B\\)|\x1B[()][A-Z0-9]|\x1B[#=]|\x1B./g,"")}const Iu={isArray:oo,isBoolean:lo,isNull:co,isNullOrUndefined:uo,isNumber:po,isString:ho,isUndefined:fo,isRegExp:mo,isObject:go,isDate:_o,isError:yo,isFunction:bo,isPrimitive:vo,isBuffer:wo,isPromise:So},Ay={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]};function Ru(e,n){const t=Array.isArray(e)?e:[e];let r=n;for(const s of t){const i=Ay[s];i&&(r=`\x1B[${i[0]}m${r}\x1B[${i[1]}m`)}return r}function Pu(e){const n=(e==null?void 0:e.args)??(typeof process<"u"?process.argv.slice(2):[]),t=(e==null?void 0:e.options)??{},r=(e==null?void 0:e.allowPositionals)??!(e!=null&&e.options),s=(e==null?void 0:e.strict)??!0,i=(e==null?void 0:e.tokens)??!1,a={};for(const[f,m]of Object.entries(t))m.short&&(a[m.short]=f);const o={},l=[],u=[];for(const[f,m]of Object.entries(t))m.default!==void 0&&(o[f]=m.default);let c=0,p=!1;for(;c<n.length;){const f=n[c];if(p||!f.startsWith("-")||f==="-"){if(!r&&s&&!p)throw new Error(`Unexpected argument '${f}'`);l.push(f),i&&u.push({kind:"positional",value:f,index:c}),c++;continue}if(f==="--"){p=!0,i&&u.push({kind:"option-terminator",index:c}),c++;continue}if(f.startsWith("--")){const m=f.indexOf("="),v=m!==-1?f.slice(2,m):f.slice(2),k=t[v];if(!k&&s)throw new Error(`Unknown option '--${v}'`);const P=(k==null?void 0:k.type)??"boolean";let N;if(P==="boolean")N=m!==-1?f.slice(m+1)!=="false":!0;else if(m!==-1)N=f.slice(m+1);else if(c+1<n.length)N=n[++c];else throw new Error(`Option '--${v}' requires a value`);if(k!=null&&k.multiple){const O=o[v]??[];O.push(N),o[v]=O}else o[v]=N;i&&u.push({kind:"option",name:v,value:N,index:c}),c++;continue}if(f.startsWith("-")&&f.length>1){const m=f.slice(1);for(let v=0;v<m.length;v++){const k=m[v],P=a[k];if(!P&&s)throw new Error(`Unknown option '-${k}'`);const N=P??k,O=P?t[P]:void 0,R=(O==null?void 0:O.type)??"boolean";let S;if(R==="boolean")S=!0;else{const F=m.slice(v+1);if(F.length>0)S=F,v=m.length;else if(c+1<n.length)S=n[++c];else throw new Error(`Option '-${k}' requires a value`)}if(O!=null&&O.multiple){const F=o[N]??[];F.push(S),o[N]=F}else o[N]=S;i&&u.push({kind:"option",name:N,value:S,index:c})}c++;continue}c++}const h={values:o,positionals:l};return i&&(h.tokens=u),h}const Du=globalThis.TextEncoder,Ou=globalThis.TextDecoder;Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:Ou,TextEncoder:Du,_extend:xu,callbackify:Cu,debug:Au,debuglog:xo,default:{format:cc,inspect:bs,inherits:Su,_extend:xu,deprecate:Eu,promisify:ku,callbackify:Cu,isDeepStrictEqual:Ti,debuglog:xo,debug:Au,stripVTControlCharacters:Tu,isArray:oo,isBoolean:lo,isNull:co,isNullOrUndefined:uo,isNumber:po,isString:ho,isUndefined:fo,isRegExp:mo,isObject:go,isDate:_o,isError:yo,isFunction:bo,isPrimitive:vo,isBuffer:wo,isPromise:So,styleText:Ru,parseArgs:Pu,types:Iu,TextEncoder:Du,TextDecoder:Ou},deprecate:Eu,format:cc,inherits:Su,inspect:bs,isArray:oo,isBoolean:lo,isBuffer:wo,isDate:_o,isDeepStrictEqual:Ti,isError:yo,isFunction:bo,isNull:co,isNullOrUndefined:uo,isNumber:po,isObject:go,isPrimitive:vo,isPromise:So,isRegExp:mo,isString:ho,isUndefined:fo,parseArgs:Pu,promisify:ku,stripVTControlCharacters:Tu,styleText:Ru,types:Iu},Symbol.toStringTag,{value:"Module"}));function Nu(e){return!1}const Eo=function(){this&&(this.isTTY=!1,this.isRaw=!1)};Eo.prototype.setRawMode=function(n){return this.isRaw=n,this};const gt=function(){this&&(this.isTTY=!1,this.columns=120,this.rows=40)};gt.prototype.getColorDepth=function(){return 8},gt.prototype.hasColors=function(n){return(n??1)<=256},gt.prototype.getWindowSize=function(){return[this.columns,this.rows]},gt.prototype.clearLine=function(n,t){return t==null||t(),!0},gt.prototype.clearScreenDown=function(n){return n==null||n(),!0},gt.prototype.cursorTo=function(n,t,r){return typeof t=="function"?t():r==null||r(),!0},gt.prototype.moveCursor=function(n,t,r){return r==null||r(),!0},Object.freeze(Object.defineProperty({__proto__:null,ReadStream:Eo,WriteStream:gt,default:{isatty:Nu,ReadStream:Eo,WriteStream:gt},isatty:Nu},Symbol.toStringTag,{value:"Module"}));function Bu(){return ye.HOSTNAME}function Lu(){return ye.PLATFORM}function Fu(){return ye.ARCH}function Mu(){return ye.TYPE}function $u(){return ye.RELEASE}function Uu(){return ye.VERSION}function ju(){return ye.MACHINE}function Hu(){return ye.TMPDIR}function Wu(){return ye.HOMEDIR}function Vu(){const e={model:we.MODEL,speed:we.SPEED,times:{user:0,nice:0,sys:0,idle:0,irq:0}};return Array.from({length:we.COUNT},()=>({...e}))}function qu(){return ze.TOTAL}function zu(){return ze.FREE}function Gu(){return Math.floor(performance.now()/1e3)}function Ku(){return[...In]}function Yu(){return{lo:[{address:"127.0.0.1",netmask:"255.0.0.0",family:"IPv4",mac:"00:00:00:00:00:00",internal:!0,cidr:"127.0.0.1/8"}]}}function Zu(){return{username:ye.USERNAME,uid:Fe.UID,gid:Fe.GID,shell:ye.SHELL,homedir:ye.HOMEDIR}}function Xu(){return ye.ENDIANNESS}function Ju(e){return 0}function Qu(e,n){}const ed=`
73
+ `,nd="/dev/null",td={signals:{SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGBUS:7,SIGFPE:8,SIGKILL:9,SIGUSR1:10,SIGSEGV:11,SIGUSR2:12,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGCHLD:17,SIGCONT:18,SIGSTOP:19,SIGTSTP:20,SIGTTIN:21,SIGTTOU:22,SIGURG:23,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28,SIGIO:29,SIGPWR:30,SIGSYS:31},errno:{EPERM:-1,ENOENT:-2,ESRCH:-3,EINTR:-4,EIO:-5,ENXIO:-6,E2BIG:-7,ENOEXEC:-8,EBADF:-9,ECHILD:-10,EAGAIN:-11,ENOMEM:-12,EACCES:-13,EFAULT:-14,EBUSY:-16,EEXIST:-17,EXDEV:-18,ENODEV:-19,ENOTDIR:-20,EISDIR:-21,EINVAL:-22,ENFILE:-23,EMFILE:-24,ENOTTY:-25,EFBIG:-27,ENOSPC:-28,ESPIPE:-29,EROFS:-30,EMLINK:-31,EPIPE:-32,EDOM:-33,ERANGE:-34,ENOTEMPTY:-39,ENOSYS:-38,ELOOP:-40,ENAMETOOLONG:-36,ECONNRESET:-104,ECONNREFUSED:-111,EADDRINUSE:-98,EADDRNOTAVAIL:-99,ETIMEDOUT:-110},priority:{PRIORITY_LOW:19,PRIORITY_BELOW_NORMAL:10,PRIORITY_NORMAL:0,PRIORITY_ABOVE_NORMAL:-7,PRIORITY_HIGH:-14,PRIORITY_HIGHEST:-20}};Object.freeze(Object.defineProperty({__proto__:null,EOL:ed,arch:Fu,constants:td,cpus:Vu,default:{hostname:Bu,platform:Lu,arch:Fu,type:Mu,release:$u,version:Uu,machine:ju,tmpdir:Hu,homedir:Wu,cpus:Vu,totalmem:qu,freemem:zu,uptime:Gu,loadavg:Ku,networkInterfaces:Yu,userInfo:Zu,endianness:Xu,getPriority:Ju,setPriority:Qu,EOL:ed,devNull:nd,constants:td},devNull:nd,endianness:Xu,freemem:zu,getPriority:Ju,homedir:Wu,hostname:Bu,loadavg:Ku,machine:ju,networkInterfaces:Yu,platform:Lu,release:$u,setPriority:Qu,tmpdir:Hu,totalmem:qu,type:Mu,uptime:Gu,userInfo:Zu,version:Uu},Symbol.toStringTag,{value:"Module"}));const ko="0.20.0",rd="4.9.0",Ty="3.0.1",sd=`https://esm.sh/esbuild-wasm@${ko}`,Co=`https://esm.sh/esbuild-wasm@${ko}/esbuild.wasm`,Iy=`https://esm.sh/esbuild-wasm@${ko}/esm/browser.min.js`,Ry=`https://esm.sh/@rollup/browser@${rd}`,Py=`https://esm.sh/brotli-wasm@${Ty}`,Ii=new Function("url","return import(url)"),Dy=4,id=0,ad=1,Oy=2;function Er(e){let n=e.length;for(;--n>=0;)e[n]=0}const Ny=0,od=1,By=2,Ly=3,Fy=258,Ao=29,vs=256,ws=vs+1+Ao,kr=30,To=19,ld=2*ws+1,Gt=15,Io=16,My=7,Ro=256,cd=16,ud=17,dd=18,Po=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Ri=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),$y=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),pd=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Uy=512,_t=new Array((ws+2)*2);Er(_t);const Ss=new Array(kr*2);Er(Ss);const xs=new Array(Uy);Er(xs);const Es=new Array(Fy-Ly+1);Er(Es);const Do=new Array(Ao);Er(Do);const Pi=new Array(kr);Er(Pi);function Oo(e,n,t,r,s){this.static_tree=e,this.extra_bits=n,this.extra_base=t,this.elems=r,this.max_length=s,this.has_stree=e&&e.length}let hd,fd,md;function No(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}const gd=e=>e<256?xs[e]:xs[256+(e>>>7)],ks=(e,n)=>{e.pending_buf[e.pending++]=n&255,e.pending_buf[e.pending++]=n>>>8&255},fn=(e,n,t)=>{e.bi_valid>Io-t?(e.bi_buf|=n<<e.bi_valid&65535,ks(e,e.bi_buf),e.bi_buf=n>>Io-e.bi_valid,e.bi_valid+=t-Io):(e.bi_buf|=n<<e.bi_valid&65535,e.bi_valid+=t)},nt=(e,n,t)=>{fn(e,t[n*2],t[n*2+1])},_d=(e,n)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--n>0);return t>>>1},jy=e=>{e.bi_valid===16?(ks(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Hy=(e,n)=>{const t=n.dyn_tree,r=n.max_code,s=n.stat_desc.static_tree,i=n.stat_desc.has_stree,a=n.stat_desc.extra_bits,o=n.stat_desc.extra_base,l=n.stat_desc.max_length;let u,c,p,h,f,m,v=0;for(h=0;h<=Gt;h++)e.bl_count[h]=0;for(t[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;u<ld;u++)c=e.heap[u],h=t[t[c*2+1]*2+1]+1,h>l&&(h=l,v++),t[c*2+1]=h,!(c>r)&&(e.bl_count[h]++,f=0,c>=o&&(f=a[c-o]),m=t[c*2],e.opt_len+=m*(h+f),i&&(e.static_len+=m*(s[c*2+1]+f)));if(v!==0){do{for(h=l-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[l]--,v-=2}while(v>0);for(h=l;h!==0;h--)for(c=e.bl_count[h];c!==0;)p=e.heap[--u],!(p>r)&&(t[p*2+1]!==h&&(e.opt_len+=(h-t[p*2+1])*t[p*2],t[p*2+1]=h),c--)}},yd=(e,n,t)=>{const r=new Array(Gt+1);let s=0,i,a;for(i=1;i<=Gt;i++)s=s+t[i-1]<<1,r[i]=s;for(a=0;a<=n;a++){let o=e[a*2+1];o!==0&&(e[a*2]=_d(r[o]++,o))}},Wy=()=>{let e,n,t,r,s;const i=new Array(Gt+1);for(t=0,r=0;r<Ao-1;r++)for(Do[r]=t,e=0;e<1<<Po[r];e++)Es[t++]=r;for(Es[t-1]=r,s=0,r=0;r<16;r++)for(Pi[r]=s,e=0;e<1<<Ri[r];e++)xs[s++]=r;for(s>>=7;r<kr;r++)for(Pi[r]=s<<7,e=0;e<1<<Ri[r]-7;e++)xs[256+s++]=r;for(n=0;n<=Gt;n++)i[n]=0;for(e=0;e<=143;)_t[e*2+1]=8,e++,i[8]++;for(;e<=255;)_t[e*2+1]=9,e++,i[9]++;for(;e<=279;)_t[e*2+1]=7,e++,i[7]++;for(;e<=287;)_t[e*2+1]=8,e++,i[8]++;for(yd(_t,ws+1,i),e=0;e<kr;e++)Ss[e*2+1]=5,Ss[e*2]=_d(e,5);hd=new Oo(_t,Po,vs+1,ws,Gt),fd=new Oo(Ss,Ri,0,kr,Gt),md=new Oo(new Array(0),$y,0,To,My)},bd=e=>{let n;for(n=0;n<ws;n++)e.dyn_ltree[n*2]=0;for(n=0;n<kr;n++)e.dyn_dtree[n*2]=0;for(n=0;n<To;n++)e.bl_tree[n*2]=0;e.dyn_ltree[Ro*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},vd=e=>{e.bi_valid>8?ks(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},wd=(e,n,t,r)=>{const s=n*2,i=t*2;return e[s]<e[i]||e[s]===e[i]&&r[n]<=r[t]},Bo=(e,n,t)=>{const r=e.heap[t];let s=t<<1;for(;s<=e.heap_len&&(s<e.heap_len&&wd(n,e.heap[s+1],e.heap[s],e.depth)&&s++,!wd(n,r,e.heap[s],e.depth));)e.heap[t]=e.heap[s],t=s,s<<=1;e.heap[t]=r},Sd=(e,n,t)=>{let r,s,i=0,a,o;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+i++]&255,r+=(e.pending_buf[e.sym_buf+i++]&255)<<8,s=e.pending_buf[e.sym_buf+i++],r===0?nt(e,s,n):(a=Es[s],nt(e,a+vs+1,n),o=Po[a],o!==0&&(s-=Do[a],fn(e,s,o)),r--,a=gd(r),nt(e,a,t),o=Ri[a],o!==0&&(r-=Pi[a],fn(e,r,o)));while(i<e.sym_next);nt(e,Ro,n)},Lo=(e,n)=>{const t=n.dyn_tree,r=n.stat_desc.static_tree,s=n.stat_desc.has_stree,i=n.stat_desc.elems;let a,o,l=-1,u;for(e.heap_len=0,e.heap_max=ld,a=0;a<i;a++)t[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):t[a*2+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,t[u*2]=1,e.depth[u]=0,e.opt_len--,s&&(e.static_len-=r[u*2+1]);for(n.max_code=l,a=e.heap_len>>1;a>=1;a--)Bo(e,t,a);u=i;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Bo(e,t,1),o=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=o,t[u*2]=t[a*2]+t[o*2],e.depth[u]=(e.depth[a]>=e.depth[o]?e.depth[a]:e.depth[o])+1,t[a*2+1]=t[o*2+1]=u,e.heap[1]=u++,Bo(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Hy(e,n),yd(t,l,e.bl_count)},xd=(e,n,t)=>{let r,s=-1,i,a=n[1],o=0,l=7,u=4;for(a===0&&(l=138,u=3),n[(t+1)*2+1]=65535,r=0;r<=t;r++)i=a,a=n[(r+1)*2+1],!(++o<l&&i===a)&&(o<u?e.bl_tree[i*2]+=o:i!==0?(i!==s&&e.bl_tree[i*2]++,e.bl_tree[cd*2]++):o<=10?e.bl_tree[ud*2]++:e.bl_tree[dd*2]++,o=0,s=i,a===0?(l=138,u=3):i===a?(l=6,u=3):(l=7,u=4))},Ed=(e,n,t)=>{let r,s=-1,i,a=n[1],o=0,l=7,u=4;for(a===0&&(l=138,u=3),r=0;r<=t;r++)if(i=a,a=n[(r+1)*2+1],!(++o<l&&i===a)){if(o<u)do nt(e,i,e.bl_tree);while(--o!==0);else i!==0?(i!==s&&(nt(e,i,e.bl_tree),o--),nt(e,cd,e.bl_tree),fn(e,o-3,2)):o<=10?(nt(e,ud,e.bl_tree),fn(e,o-3,3)):(nt(e,dd,e.bl_tree),fn(e,o-11,7));o=0,s=i,a===0?(l=138,u=3):i===a?(l=6,u=3):(l=7,u=4)}},Vy=e=>{let n;for(xd(e,e.dyn_ltree,e.l_desc.max_code),xd(e,e.dyn_dtree,e.d_desc.max_code),Lo(e,e.bl_desc),n=To-1;n>=3&&e.bl_tree[pd[n]*2+1]===0;n--);return e.opt_len+=3*(n+1)+5+5+4,n},qy=(e,n,t,r)=>{let s;for(fn(e,n-257,5),fn(e,t-1,5),fn(e,r-4,4),s=0;s<r;s++)fn(e,e.bl_tree[pd[s]*2+1],3);Ed(e,e.dyn_ltree,n-1),Ed(e,e.dyn_dtree,t-1)},zy=e=>{let n=4093624447,t;for(t=0;t<=31;t++,n>>>=1)if(n&1&&e.dyn_ltree[t*2]!==0)return id;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return ad;for(t=32;t<vs;t++)if(e.dyn_ltree[t*2]!==0)return ad;return id};let kd=!1;const Gy=e=>{kd||(Wy(),kd=!0),e.l_desc=new No(e.dyn_ltree,hd),e.d_desc=new No(e.dyn_dtree,fd),e.bl_desc=new No(e.bl_tree,md),e.bi_buf=0,e.bi_valid=0,bd(e)},Cd=(e,n,t,r)=>{fn(e,(Ny<<1)+(r?1:0),3),vd(e),ks(e,t),ks(e,~t),t&&e.pending_buf.set(e.window.subarray(n,n+t),e.pending),e.pending+=t},Ky=e=>{fn(e,od<<1,3),nt(e,Ro,_t),jy(e)},Yy=(e,n,t,r)=>{let s,i,a=0;e.level>0?(e.strm.data_type===Oy&&(e.strm.data_type=zy(e)),Lo(e,e.l_desc),Lo(e,e.d_desc),a=Vy(e),s=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=s&&(s=i)):s=i=t+5,t+4<=s&&n!==-1?Cd(e,n,t,r):e.strategy===Dy||i===s?(fn(e,(od<<1)+(r?1:0),3),Sd(e,_t,Ss)):(fn(e,(By<<1)+(r?1:0),3),qy(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),Sd(e,e.dyn_ltree,e.dyn_dtree)),bd(e),r&&vd(e)},Zy=(e,n,t)=>(e.pending_buf[e.sym_buf+e.sym_next++]=n,e.pending_buf[e.sym_buf+e.sym_next++]=n>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,n===0?e.dyn_ltree[t*2]++:(e.matches++,n--,e.dyn_ltree[(Es[t]+vs+1)*2]++,e.dyn_dtree[gd(n)*2]++),e.sym_next===e.sym_end);var Xy=Gy,Jy=Cd,Qy=Yy,eb=Zy,nb=Ky,tb={_tr_init:Xy,_tr_stored_block:Jy,_tr_flush_block:Qy,_tr_tally:eb,_tr_align:nb},Cs=(e,n,t,r)=>{let s=e&65535|0,i=e>>>16&65535|0,a=0;for(;t!==0;){a=t>2e3?2e3:t,t-=a;do s=s+n[r++]|0,i=i+s|0;while(--a);s%=65521,i%=65521}return s|i<<16|0};const rb=()=>{let e,n=[];for(var t=0;t<256;t++){e=t;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e}return n},sb=new Uint32Array(rb());var Ze=(e,n,t,r)=>{const s=sb,i=r+t;e^=-1;for(let a=r;a<i;a++)e=e>>>8^s[(e^n[a])&255];return e^-1},Kt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},As={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:ib,_tr_stored_block:Fo,_tr_flush_block:ab,_tr_tally:It,_tr_align:ob}=tb,{Z_NO_FLUSH:Rt,Z_PARTIAL_FLUSH:lb,Z_FULL_FLUSH:cb,Z_FINISH:On,Z_BLOCK:Ad,Z_OK:Je,Z_STREAM_END:Td,Z_STREAM_ERROR:tt,Z_DATA_ERROR:ub,Z_BUF_ERROR:Mo,Z_DEFAULT_COMPRESSION:db,Z_FILTERED:pb,Z_HUFFMAN_ONLY:Di,Z_RLE:hb,Z_FIXED:fb,Z_DEFAULT_STRATEGY:mb,Z_UNKNOWN:gb,Z_DEFLATED:Oi}=As,_b=9,yb=15,bb=8,$o=256+1+29,vb=30,wb=19,Sb=2*$o+1,xb=15,de=3,Pt=258,rt=Pt+de+1,Eb=32,Cr=42,Uo=57,jo=69,Ho=73,Wo=91,Vo=103,Yt=113,Ts=666,cn=1,Ar=2,Zt=3,Tr=4,kb=3,Xt=(e,n)=>(e.msg=Kt[n],n),Id=e=>e*2-(e>4?9:0),Dt=e=>{let n=e.length;for(;--n>=0;)e[n]=0},Cb=e=>{let n,t,r,s=e.w_size;n=e.hash_size,r=n;do t=e.head[--r],e.head[r]=t>=s?t-s:0;while(--n);n=s,r=n;do t=e.prev[--r],e.prev[r]=t>=s?t-s:0;while(--n)};let Ot=(e,n,t)=>(n<<e.hash_shift^t)&e.hash_mask;const bn=e=>{const n=e.state;let t=n.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(n.pending_buf.subarray(n.pending_out,n.pending_out+t),e.next_out),e.next_out+=t,n.pending_out+=t,e.total_out+=t,e.avail_out-=t,n.pending-=t,n.pending===0&&(n.pending_out=0))},vn=(e,n)=>{ab(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,n),e.block_start=e.strstart,bn(e.strm)},_e=(e,n)=>{e.pending_buf[e.pending++]=n},Is=(e,n)=>{e.pending_buf[e.pending++]=n>>>8&255,e.pending_buf[e.pending++]=n&255},qo=(e,n,t,r)=>{let s=e.avail_in;return s>r&&(s=r),s===0?0:(e.avail_in-=s,n.set(e.input.subarray(e.next_in,e.next_in+s),t),e.state.wrap===1?e.adler=Cs(e.adler,n,s,t):e.state.wrap===2&&(e.adler=Ze(e.adler,n,s,t)),e.next_in+=s,e.total_in+=s,s)},Rd=(e,n)=>{let t=e.max_chain_length,r=e.strstart,s,i,a=e.prev_length,o=e.nice_match;const l=e.strstart>e.w_size-rt?e.strstart-(e.w_size-rt):0,u=e.window,c=e.w_mask,p=e.prev,h=e.strstart+Pt;let f=u[r+a-1],m=u[r+a];e.prev_length>=e.good_match&&(t>>=2),o>e.lookahead&&(o=e.lookahead);do if(s=n,!(u[s+a]!==m||u[s+a-1]!==f||u[s]!==u[r]||u[++s]!==u[r+1])){r+=2,s++;do;while(u[++r]===u[++s]&&u[++r]===u[++s]&&u[++r]===u[++s]&&u[++r]===u[++s]&&u[++r]===u[++s]&&u[++r]===u[++s]&&u[++r]===u[++s]&&u[++r]===u[++s]&&r<h);if(i=Pt-(h-r),r=h-Pt,i>a){if(e.match_start=n,a=i,i>=o)break;f=u[r+a-1],m=u[r+a]}}while((n=p[n&c])>l&&--t!==0);return a<=e.lookahead?a:e.lookahead},Ir=e=>{const n=e.w_size;let t,r,s;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-rt)&&(e.window.set(e.window.subarray(n,n+n-r),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,e.insert>e.strstart&&(e.insert=e.strstart),Cb(e),r+=n),e.strm.avail_in===0)break;if(t=qo(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=t,e.lookahead+e.insert>=de)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=Ot(e,e.ins_h,e.window[s+1]);e.insert&&(e.ins_h=Ot(e,e.ins_h,e.window[s+de-1]),e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<de)););}while(e.lookahead<rt&&e.strm.avail_in!==0)},Pd=(e,n)=>{let t=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,s,i,a=0,o=e.strm.avail_in;do{if(r=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i||(i=e.strm.avail_out-i,s=e.strstart-e.block_start,r>s+e.strm.avail_in&&(r=s+e.strm.avail_in),r>i&&(r=i),r<t&&(r===0&&n!==On||n===Rt||r!==s+e.strm.avail_in)))break;a=n===On&&r===s+e.strm.avail_in?1:0,Fo(e,0,0,a),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,bn(e.strm),s&&(s>r&&(s=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+s),e.strm.next_out),e.strm.next_out+=s,e.strm.avail_out-=s,e.strm.total_out+=s,e.block_start+=s,r-=s),r&&(qo(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(a===0);return o-=e.strm.avail_in,o&&(o>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=o&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-o,e.strm.next_in),e.strstart),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?Tr:n!==Rt&&n!==On&&e.strm.avail_in===0&&e.strstart===e.block_start?Ar:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(qo(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,t=i>e.w_size?e.w_size:i,s=e.strstart-e.block_start,(s>=t||(s||n===On)&&n!==Rt&&e.strm.avail_in===0&&s<=i)&&(r=s>i?i:s,a=n===On&&e.strm.avail_in===0&&r===s?1:0,Fo(e,e.block_start,r,a),e.block_start+=r,bn(e.strm)),a?Zt:cn)},zo=(e,n)=>{let t,r;for(;;){if(e.lookahead<rt){if(Ir(e),e.lookahead<rt&&n===Rt)return cn;if(e.lookahead===0)break}if(t=0,e.lookahead>=de&&(e.ins_h=Ot(e,e.ins_h,e.window[e.strstart+de-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-rt&&(e.match_length=Rd(e,t)),e.match_length>=de)if(r=It(e,e.strstart-e.match_start,e.match_length-de),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=de){e.match_length--;do e.strstart++,e.ins_h=Ot(e,e.ins_h,e.window[e.strstart+de-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Ot(e,e.ins_h,e.window[e.strstart+1]);else r=It(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(vn(e,!1),e.strm.avail_out===0))return cn}return e.insert=e.strstart<de-1?e.strstart:de-1,n===On?(vn(e,!0),e.strm.avail_out===0?Zt:Tr):e.sym_next&&(vn(e,!1),e.strm.avail_out===0)?cn:Ar},Rr=(e,n)=>{let t,r,s;for(;;){if(e.lookahead<rt){if(Ir(e),e.lookahead<rt&&n===Rt)return cn;if(e.lookahead===0)break}if(t=0,e.lookahead>=de&&(e.ins_h=Ot(e,e.ins_h,e.window[e.strstart+de-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=de-1,t!==0&&e.prev_length<e.max_lazy_match&&e.strstart-t<=e.w_size-rt&&(e.match_length=Rd(e,t),e.match_length<=5&&(e.strategy===pb||e.match_length===de&&e.strstart-e.match_start>4096)&&(e.match_length=de-1)),e.prev_length>=de&&e.match_length<=e.prev_length){s=e.strstart+e.lookahead-de,r=It(e,e.strstart-1-e.prev_match,e.prev_length-de),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=s&&(e.ins_h=Ot(e,e.ins_h,e.window[e.strstart+de-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=de-1,e.strstart++,r&&(vn(e,!1),e.strm.avail_out===0))return cn}else if(e.match_available){if(r=It(e,0,e.window[e.strstart-1]),r&&vn(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return cn}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=It(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<de-1?e.strstart:de-1,n===On?(vn(e,!0),e.strm.avail_out===0?Zt:Tr):e.sym_next&&(vn(e,!1),e.strm.avail_out===0)?cn:Ar},Ab=(e,n)=>{let t,r,s,i;const a=e.window;for(;;){if(e.lookahead<=Pt){if(Ir(e),e.lookahead<=Pt&&n===Rt)return cn;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=de&&e.strstart>0&&(s=e.strstart-1,r=a[s],r===a[++s]&&r===a[++s]&&r===a[++s])){i=e.strstart+Pt;do;while(r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&s<i);e.match_length=Pt-(i-s),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=de?(t=It(e,1,e.match_length-de),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=It(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(vn(e,!1),e.strm.avail_out===0))return cn}return e.insert=0,n===On?(vn(e,!0),e.strm.avail_out===0?Zt:Tr):e.sym_next&&(vn(e,!1),e.strm.avail_out===0)?cn:Ar},Tb=(e,n)=>{let t;for(;;){if(e.lookahead===0&&(Ir(e),e.lookahead===0)){if(n===Rt)return cn;break}if(e.match_length=0,t=It(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(vn(e,!1),e.strm.avail_out===0))return cn}return e.insert=0,n===On?(vn(e,!0),e.strm.avail_out===0?Zt:Tr):e.sym_next&&(vn(e,!1),e.strm.avail_out===0)?cn:Ar};function st(e,n,t,r,s){this.good_length=e,this.max_lazy=n,this.nice_length=t,this.max_chain=r,this.func=s}const Rs=[new st(0,0,0,0,Pd),new st(4,4,8,4,zo),new st(4,5,16,8,zo),new st(4,6,32,32,zo),new st(4,4,16,16,Rr),new st(8,16,32,32,Rr),new st(8,16,128,128,Rr),new st(8,32,128,256,Rr),new st(32,128,258,1024,Rr),new st(32,258,258,4096,Rr)],Ib=e=>{e.window_size=2*e.w_size,Dt(e.head),e.max_lazy_match=Rs[e.level].max_lazy,e.good_match=Rs[e.level].good_length,e.nice_match=Rs[e.level].nice_length,e.max_chain_length=Rs[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=de-1,e.match_available=0,e.ins_h=0};function Rb(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Oi,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Sb*2),this.dyn_dtree=new Uint16Array((2*vb+1)*2),this.bl_tree=new Uint16Array((2*wb+1)*2),Dt(this.dyn_ltree),Dt(this.dyn_dtree),Dt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(xb+1),this.heap=new Uint16Array(2*$o+1),Dt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*$o+1),Dt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ps=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.status!==Cr&&n.status!==Uo&&n.status!==jo&&n.status!==Ho&&n.status!==Wo&&n.status!==Vo&&n.status!==Yt&&n.status!==Ts?1:0},Dd=e=>{if(Ps(e))return Xt(e,tt);e.total_in=e.total_out=0,e.data_type=gb;const n=e.state;return n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap===2?Uo:n.wrap?Cr:Yt,e.adler=n.wrap===2?0:1,n.last_flush=-2,ib(n),Je},Od=e=>{const n=Dd(e);return n===Je&&Ib(e.state),n},Pb=(e,n)=>Ps(e)||e.state.wrap!==2?tt:(e.state.gzhead=n,Je),Nd=(e,n,t,r,s,i)=>{if(!e)return tt;let a=1;if(n===db&&(n=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),s<1||s>_b||t!==Oi||r<8||r>15||n<0||n>9||i<0||i>fb||r===8&&a!==1)return Xt(e,tt);r===8&&(r=9);const o=new Rb;return e.state=o,o.strm=e,o.status=Cr,o.wrap=a,o.gzhead=null,o.w_bits=r,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=s+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+de-1)/de),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<s+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=n,o.strategy=i,o.method=t,Od(e)},Db=(e,n)=>Nd(e,n,Oi,yb,bb,mb),Ob=(e,n)=>{if(Ps(e)||n>Ad||n<0)return e?Xt(e,tt):tt;const t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===Ts&&n!==On)return Xt(e,e.avail_out===0?Mo:tt);const r=t.last_flush;if(t.last_flush=n,t.pending!==0){if(bn(e),e.avail_out===0)return t.last_flush=-1,Je}else if(e.avail_in===0&&Id(n)<=Id(r)&&n!==On)return Xt(e,Mo);if(t.status===Ts&&e.avail_in!==0)return Xt(e,Mo);if(t.status===Cr&&t.wrap===0&&(t.status=Yt),t.status===Cr){let s=Oi+(t.w_bits-8<<4)<<8,i=-1;if(t.strategy>=Di||t.level<2?i=0:t.level<6?i=1:t.level===6?i=2:i=3,s|=i<<6,t.strstart!==0&&(s|=Eb),s+=31-s%31,Is(t,s),t.strstart!==0&&(Is(t,e.adler>>>16),Is(t,e.adler&65535)),e.adler=1,t.status=Yt,bn(e),t.pending!==0)return t.last_flush=-1,Je}if(t.status===Uo){if(e.adler=0,_e(t,31),_e(t,139),_e(t,8),t.gzhead)_e(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),_e(t,t.gzhead.time&255),_e(t,t.gzhead.time>>8&255),_e(t,t.gzhead.time>>16&255),_e(t,t.gzhead.time>>24&255),_e(t,t.level===9?2:t.strategy>=Di||t.level<2?4:0),_e(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(_e(t,t.gzhead.extra.length&255),_e(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=Ze(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=jo;else if(_e(t,0),_e(t,0),_e(t,0),_e(t,0),_e(t,0),_e(t,t.level===9?2:t.strategy>=Di||t.level<2?4:0),_e(t,kb),t.status=Yt,bn(e),t.pending!==0)return t.last_flush=-1,Je}if(t.status===jo){if(t.gzhead.extra){let s=t.pending,i=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+i>t.pending_buf_size;){let o=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+o),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>s&&(e.adler=Ze(e.adler,t.pending_buf,t.pending-s,s)),t.gzindex+=o,bn(e),t.pending!==0)return t.last_flush=-1,Je;s=0,i-=o}let a=new Uint8Array(t.gzhead.extra);t.pending_buf.set(a.subarray(t.gzindex,t.gzindex+i),t.pending),t.pending+=i,t.gzhead.hcrc&&t.pending>s&&(e.adler=Ze(e.adler,t.pending_buf,t.pending-s,s)),t.gzindex=0}t.status=Ho}if(t.status===Ho){if(t.gzhead.name){let s=t.pending,i;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>s&&(e.adler=Ze(e.adler,t.pending_buf,t.pending-s,s)),bn(e),t.pending!==0)return t.last_flush=-1,Je;s=0}t.gzindex<t.gzhead.name.length?i=t.gzhead.name.charCodeAt(t.gzindex++)&255:i=0,_e(t,i)}while(i!==0);t.gzhead.hcrc&&t.pending>s&&(e.adler=Ze(e.adler,t.pending_buf,t.pending-s,s)),t.gzindex=0}t.status=Wo}if(t.status===Wo){if(t.gzhead.comment){let s=t.pending,i;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>s&&(e.adler=Ze(e.adler,t.pending_buf,t.pending-s,s)),bn(e),t.pending!==0)return t.last_flush=-1,Je;s=0}t.gzindex<t.gzhead.comment.length?i=t.gzhead.comment.charCodeAt(t.gzindex++)&255:i=0,_e(t,i)}while(i!==0);t.gzhead.hcrc&&t.pending>s&&(e.adler=Ze(e.adler,t.pending_buf,t.pending-s,s))}t.status=Vo}if(t.status===Vo){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(bn(e),t.pending!==0))return t.last_flush=-1,Je;_e(t,e.adler&255),_e(t,e.adler>>8&255),e.adler=0}if(t.status=Yt,bn(e),t.pending!==0)return t.last_flush=-1,Je}if(e.avail_in!==0||t.lookahead!==0||n!==Rt&&t.status!==Ts){let s=t.level===0?Pd(t,n):t.strategy===Di?Tb(t,n):t.strategy===hb?Ab(t,n):Rs[t.level].func(t,n);if((s===Zt||s===Tr)&&(t.status=Ts),s===cn||s===Zt)return e.avail_out===0&&(t.last_flush=-1),Je;if(s===Ar&&(n===lb?ob(t):n!==Ad&&(Fo(t,0,0,!1),n===cb&&(Dt(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),bn(e),e.avail_out===0))return t.last_flush=-1,Je}return n!==On?Je:t.wrap<=0?Td:(t.wrap===2?(_e(t,e.adler&255),_e(t,e.adler>>8&255),_e(t,e.adler>>16&255),_e(t,e.adler>>24&255),_e(t,e.total_in&255),_e(t,e.total_in>>8&255),_e(t,e.total_in>>16&255),_e(t,e.total_in>>24&255)):(Is(t,e.adler>>>16),Is(t,e.adler&65535)),bn(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?Je:Td)},Nb=e=>{if(Ps(e))return tt;const n=e.state.status;return e.state=null,n===Yt?Xt(e,ub):Je},Bb=(e,n)=>{let t=n.length;if(Ps(e))return tt;const r=e.state,s=r.wrap;if(s===2||s===1&&r.status!==Cr||r.lookahead)return tt;if(s===1&&(e.adler=Cs(e.adler,n,t,0)),r.wrap=0,t>=r.w_size){s===0&&(Dt(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(n.subarray(t-r.w_size,t),0),n=l,t=r.w_size}const i=e.avail_in,a=e.next_in,o=e.input;for(e.avail_in=t,e.next_in=0,e.input=n,Ir(r);r.lookahead>=de;){let l=r.strstart,u=r.lookahead-(de-1);do r.ins_h=Ot(r,r.ins_h,r.window[l+de-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--u);r.strstart=l,r.lookahead=de-1,Ir(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=de-1,r.match_available=0,e.next_in=a,e.input=o,e.avail_in=i,r.wrap=s,Je};var Lb=Db,Fb=Nd,Mb=Od,$b=Dd,Ub=Pb,jb=Ob,Hb=Nb,Wb=Bb,Vb="pako deflate (from Nodeca project)",Ds={deflateInit:Lb,deflateInit2:Fb,deflateReset:Mb,deflateResetKeep:$b,deflateSetHeader:Ub,deflate:jb,deflateEnd:Hb,deflateSetDictionary:Wb,deflateInfo:Vb};const qb=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var zb=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const t=n.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const r in t)qb(t,r)&&(e[r]=t[r])}}return e},Gb=e=>{let n=0;for(let r=0,s=e.length;r<s;r++)n+=e[r].length;const t=new Uint8Array(n);for(let r=0,s=0,i=e.length;r<i;r++){let a=e[r];t.set(a,s),s+=a.length}return t},Ni={assign:zb,flattenChunks:Gb};let Bd=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Bd=!1}const Os=new Uint8Array(256);for(let e=0;e<256;e++)Os[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Os[254]=Os[254]=1;var Kb=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let n,t,r,s,i,a=e.length,o=0;for(s=0;s<a;s++)t=e.charCodeAt(s),(t&64512)===55296&&s+1<a&&(r=e.charCodeAt(s+1),(r&64512)===56320&&(t=65536+(t-55296<<10)+(r-56320),s++)),o+=t<128?1:t<2048?2:t<65536?3:4;for(n=new Uint8Array(o),i=0,s=0;i<o;s++)t=e.charCodeAt(s),(t&64512)===55296&&s+1<a&&(r=e.charCodeAt(s+1),(r&64512)===56320&&(t=65536+(t-55296<<10)+(r-56320),s++)),t<128?n[i++]=t:t<2048?(n[i++]=192|t>>>6,n[i++]=128|t&63):t<65536?(n[i++]=224|t>>>12,n[i++]=128|t>>>6&63,n[i++]=128|t&63):(n[i++]=240|t>>>18,n[i++]=128|t>>>12&63,n[i++]=128|t>>>6&63,n[i++]=128|t&63);return n};const Yb=(e,n)=>{if(n<65534&&e.subarray&&Bd)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let t="";for(let r=0;r<n;r++)t+=String.fromCharCode(e[r]);return t};var Zb=(e,n)=>{const t=n||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,n));let r,s;const i=new Array(t*2);for(s=0,r=0;r<t;){let a=e[r++];if(a<128){i[s++]=a;continue}let o=Os[a];if(o>4){i[s++]=65533,r+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&r<t;)a=a<<6|e[r++]&63,o--;if(o>1){i[s++]=65533;continue}a<65536?i[s++]=a:(a-=65536,i[s++]=55296|a>>10&1023,i[s++]=56320|a&1023)}return Yb(i,s)},Xb=(e,n)=>{n=n||e.length,n>e.length&&(n=e.length);let t=n-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?n:t+Os[e[t]]>n?t:n},Ns={string2buf:Kb,buf2string:Zb,utf8border:Xb};function Jb(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Ld=Jb;const Fd=Object.prototype.toString,{Z_NO_FLUSH:Qb,Z_SYNC_FLUSH:e2,Z_FULL_FLUSH:n2,Z_FINISH:t2,Z_OK:Bi,Z_STREAM_END:r2,Z_DEFAULT_COMPRESSION:s2,Z_DEFAULT_STRATEGY:i2,Z_DEFLATED:a2}=As;function Bs(e){this.options=Ni.assign({level:s2,method:a2,chunkSize:16384,windowBits:15,memLevel:8,strategy:i2},e||{});let n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ld,this.strm.avail_out=0;let t=Ds.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(t!==Bi)throw new Error(Kt[t]);if(n.header&&Ds.deflateSetHeader(this.strm,n.header),n.dictionary){let r;if(typeof n.dictionary=="string"?r=Ns.string2buf(n.dictionary):Fd.call(n.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(n.dictionary):r=n.dictionary,t=Ds.deflateSetDictionary(this.strm,r),t!==Bi)throw new Error(Kt[t]);this._dict_set=!0}}Bs.prototype.push=function(e,n){const t=this.strm,r=this.options.chunkSize;let s,i;if(this.ended)return!1;for(n===~~n?i=n:i=n===!0?t2:Qb,typeof e=="string"?t.input=Ns.string2buf(e):Fd.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),(i===e2||i===n2)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(s=Ds.deflate(t,i),s===r2)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),s=Ds.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===Bi;if(t.avail_out===0){this.onData(t.output);continue}if(i>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0},Bs.prototype.onData=function(e){this.chunks.push(e)},Bs.prototype.onEnd=function(e){e===Bi&&(this.result=Ni.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Go(e,n){const t=new Bs(n);if(t.push(e,!0),t.err)throw t.msg||Kt[t.err];return t.result}function o2(e,n){return n=n||{},n.raw=!0,Go(e,n)}function l2(e,n){return n=n||{},n.gzip=!0,Go(e,n)}var c2=Bs,u2=Go,d2=o2,p2=l2,h2={Deflate:c2,deflate:u2,deflateRaw:d2,gzip:p2};const Li=16209,f2=16191;var m2=function(n,t){let r,s,i,a,o,l,u,c,p,h,f,m,v,k,P,N,O,R,S,F,g,_,w,E;const b=n.state;r=n.next_in,w=n.input,s=r+(n.avail_in-5),i=n.next_out,E=n.output,a=i-(t-n.avail_out),o=i+(n.avail_out-257),l=b.dmax,u=b.wsize,c=b.whave,p=b.wnext,h=b.window,f=b.hold,m=b.bits,v=b.lencode,k=b.distcode,P=(1<<b.lenbits)-1,N=(1<<b.distbits)-1;e:do{m<15&&(f+=w[r++]<<m,m+=8,f+=w[r++]<<m,m+=8),O=v[f&P];n:for(;;){if(R=O>>>24,f>>>=R,m-=R,R=O>>>16&255,R===0)E[i++]=O&65535;else if(R&16){S=O&65535,R&=15,R&&(m<R&&(f+=w[r++]<<m,m+=8),S+=f&(1<<R)-1,f>>>=R,m-=R),m<15&&(f+=w[r++]<<m,m+=8,f+=w[r++]<<m,m+=8),O=k[f&N];t:for(;;){if(R=O>>>24,f>>>=R,m-=R,R=O>>>16&255,R&16){if(F=O&65535,R&=15,m<R&&(f+=w[r++]<<m,m+=8,m<R&&(f+=w[r++]<<m,m+=8)),F+=f&(1<<R)-1,F>l){n.msg="invalid distance too far back",b.mode=Li;break e}if(f>>>=R,m-=R,R=i-a,F>R){if(R=F-R,R>c&&b.sane){n.msg="invalid distance too far back",b.mode=Li;break e}if(g=0,_=h,p===0){if(g+=u-R,R<S){S-=R;do E[i++]=h[g++];while(--R);g=i-F,_=E}}else if(p<R){if(g+=u+p-R,R-=p,R<S){S-=R;do E[i++]=h[g++];while(--R);if(g=0,p<S){R=p,S-=R;do E[i++]=h[g++];while(--R);g=i-F,_=E}}}else if(g+=p-R,R<S){S-=R;do E[i++]=h[g++];while(--R);g=i-F,_=E}for(;S>2;)E[i++]=_[g++],E[i++]=_[g++],E[i++]=_[g++],S-=3;S&&(E[i++]=_[g++],S>1&&(E[i++]=_[g++]))}else{g=i-F;do E[i++]=E[g++],E[i++]=E[g++],E[i++]=E[g++],S-=3;while(S>2);S&&(E[i++]=E[g++],S>1&&(E[i++]=E[g++]))}}else if((R&64)===0){O=k[(O&65535)+(f&(1<<R)-1)];continue t}else{n.msg="invalid distance code",b.mode=Li;break e}break}}else if((R&64)===0){O=v[(O&65535)+(f&(1<<R)-1)];continue n}else if(R&32){b.mode=f2;break e}else{n.msg="invalid literal/length code",b.mode=Li;break e}break}}while(r<s&&i<o);S=m>>3,r-=S,m-=S<<3,f&=(1<<m)-1,n.next_in=r,n.next_out=i,n.avail_in=r<s?5+(s-r):5-(r-s),n.avail_out=i<o?257+(o-i):257-(i-o),b.hold=f,b.bits=m};const Pr=15,Md=852,$d=592,Ud=0,Ko=1,jd=2,g2=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),_2=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),y2=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),b2=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Ls=(e,n,t,r,s,i,a,o)=>{const l=o.bits;let u=0,c=0,p=0,h=0,f=0,m=0,v=0,k=0,P=0,N=0,O,R,S,F,g,_=null,w;const E=new Uint16Array(Pr+1),b=new Uint16Array(Pr+1);let L=null,W,H,Z;for(u=0;u<=Pr;u++)E[u]=0;for(c=0;c<r;c++)E[n[t+c]]++;for(f=l,h=Pr;h>=1&&E[h]===0;h--);if(f>h&&(f=h),h===0)return s[i++]=1<<24|64<<16|0,s[i++]=1<<24|64<<16|0,o.bits=1,0;for(p=1;p<h&&E[p]===0;p++);for(f<p&&(f=p),k=1,u=1;u<=Pr;u++)if(k<<=1,k-=E[u],k<0)return-1;if(k>0&&(e===Ud||h!==1))return-1;for(b[1]=0,u=1;u<Pr;u++)b[u+1]=b[u]+E[u];for(c=0;c<r;c++)n[t+c]!==0&&(a[b[n[t+c]]++]=c);if(e===Ud?(_=L=a,w=20):e===Ko?(_=g2,L=_2,w=257):(_=y2,L=b2,w=0),N=0,c=0,u=p,g=i,m=f,v=0,S=-1,P=1<<f,F=P-1,e===Ko&&P>Md||e===jd&&P>$d)return 1;for(;;){W=u-v,a[c]+1<w?(H=0,Z=a[c]):a[c]>=w?(H=L[a[c]-w],Z=_[a[c]-w]):(H=96,Z=0),O=1<<u-v,R=1<<m,p=R;do R-=O,s[g+(N>>v)+R]=W<<24|H<<16|Z|0;while(R!==0);for(O=1<<u-1;N&O;)O>>=1;if(O!==0?(N&=O-1,N+=O):N=0,c++,--E[u]===0){if(u===h)break;u=n[t+a[c]]}if(u>f&&(N&F)!==S){for(v===0&&(v=f),g+=p,m=u-v,k=1<<m;m+v<h&&(k-=E[m+v],!(k<=0));)m++,k<<=1;if(P+=1<<m,e===Ko&&P>Md||e===jd&&P>$d)return 1;S=N&F,s[S]=f<<24|m<<16|g-i|0}}return N!==0&&(s[g+N]=u-v<<24|64<<16|0),o.bits=f,0};const v2=0,Hd=1,Wd=2,{Z_FINISH:Vd,Z_BLOCK:w2,Z_TREES:Fi,Z_OK:Jt,Z_STREAM_END:S2,Z_NEED_DICT:x2,Z_STREAM_ERROR:Nn,Z_DATA_ERROR:qd,Z_MEM_ERROR:zd,Z_BUF_ERROR:E2,Z_DEFLATED:Gd}=As,Mi=16180,Kd=16181,Yd=16182,Zd=16183,Xd=16184,Jd=16185,Qd=16186,ep=16187,np=16188,tp=16189,$i=16190,yt=16191,Yo=16192,rp=16193,Zo=16194,sp=16195,ip=16196,ap=16197,op=16198,Ui=16199,ji=16200,lp=16201,cp=16202,up=16203,dp=16204,pp=16205,Xo=16206,hp=16207,fp=16208,ke=16209,mp=16210,gp=16211,k2=852,C2=592,A2=15,_p=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function T2(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Qt=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.mode<Mi||n.mode>gp?1:0},yp=e=>{if(Qt(e))return Nn;const n=e.state;return e.total_in=e.total_out=n.total=0,e.msg="",n.wrap&&(e.adler=n.wrap&1),n.mode=Mi,n.last=0,n.havedict=0,n.flags=-1,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new Int32Array(k2),n.distcode=n.distdyn=new Int32Array(C2),n.sane=1,n.back=-1,Jt},bp=e=>{if(Qt(e))return Nn;const n=e.state;return n.wsize=0,n.whave=0,n.wnext=0,yp(e)},vp=(e,n)=>{let t;if(Qt(e))return Nn;const r=e.state;return n<0?(t=0,n=-n):(t=(n>>4)+5,n<48&&(n&=15)),n&&(n<8||n>15)?Nn:(r.window!==null&&r.wbits!==n&&(r.window=null),r.wrap=t,r.wbits=n,bp(e))},wp=(e,n)=>{if(!e)return Nn;const t=new T2;e.state=t,t.strm=e,t.window=null,t.mode=Mi;const r=vp(e,n);return r!==Jt&&(e.state=null),r},I2=e=>wp(e,A2);let Sp=!0,Jo,Qo;const R2=e=>{if(Sp){Jo=new Int32Array(512),Qo=new Int32Array(32);let n=0;for(;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(Ls(Hd,e.lens,0,288,Jo,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;Ls(Wd,e.lens,0,32,Qo,0,e.work,{bits:5}),Sp=!1}e.lencode=Jo,e.lenbits=9,e.distcode=Qo,e.distbits=5},xp=(e,n,t,r)=>{let s;const i=e.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),r>=i.wsize?(i.window.set(n.subarray(t-i.wsize,t),0),i.wnext=0,i.whave=i.wsize):(s=i.wsize-i.wnext,s>r&&(s=r),i.window.set(n.subarray(t-r,t-r+s),i.wnext),r-=s,r?(i.window.set(n.subarray(t-r,t),0),i.wnext=r,i.whave=i.wsize):(i.wnext+=s,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=s))),0},P2=(e,n)=>{let t,r,s,i,a,o,l,u,c,p,h,f,m,v,k=0,P,N,O,R,S,F,g,_;const w=new Uint8Array(4);let E,b;const L=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Qt(e)||!e.output||!e.input&&e.avail_in!==0)return Nn;t=e.state,t.mode===yt&&(t.mode=Yo),a=e.next_out,s=e.output,l=e.avail_out,i=e.next_in,r=e.input,o=e.avail_in,u=t.hold,c=t.bits,p=o,h=l,_=Jt;e:for(;;)switch(t.mode){case Mi:if(t.wrap===0){t.mode=Yo;break}for(;c<16;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}if(t.wrap&2&&u===35615){t.wbits===0&&(t.wbits=15),t.check=0,w[0]=u&255,w[1]=u>>>8&255,t.check=Ze(t.check,w,2,0),u=0,c=0,t.mode=Kd;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",t.mode=ke;break}if((u&15)!==Gd){e.msg="unknown compression method",t.mode=ke;break}if(u>>>=4,c-=4,g=(u&15)+8,t.wbits===0&&(t.wbits=g),g>15||g>t.wbits){e.msg="invalid window size",t.mode=ke;break}t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=u&512?tp:yt,u=0,c=0;break;case Kd:for(;c<16;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}if(t.flags=u,(t.flags&255)!==Gd){e.msg="unknown compression method",t.mode=ke;break}if(t.flags&57344){e.msg="unknown header flags set",t.mode=ke;break}t.head&&(t.head.text=u>>8&1),t.flags&512&&t.wrap&4&&(w[0]=u&255,w[1]=u>>>8&255,t.check=Ze(t.check,w,2,0)),u=0,c=0,t.mode=Yd;case Yd:for(;c<32;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}t.head&&(t.head.time=u),t.flags&512&&t.wrap&4&&(w[0]=u&255,w[1]=u>>>8&255,w[2]=u>>>16&255,w[3]=u>>>24&255,t.check=Ze(t.check,w,4,0)),u=0,c=0,t.mode=Zd;case Zd:for(;c<16;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}t.head&&(t.head.xflags=u&255,t.head.os=u>>8),t.flags&512&&t.wrap&4&&(w[0]=u&255,w[1]=u>>>8&255,t.check=Ze(t.check,w,2,0)),u=0,c=0,t.mode=Xd;case Xd:if(t.flags&1024){for(;c<16;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}t.length=u,t.head&&(t.head.extra_len=u),t.flags&512&&t.wrap&4&&(w[0]=u&255,w[1]=u>>>8&255,t.check=Ze(t.check,w,2,0)),u=0,c=0}else t.head&&(t.head.extra=null);t.mode=Jd;case Jd:if(t.flags&1024&&(f=t.length,f>o&&(f=o),f&&(t.head&&(g=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(r.subarray(i,i+f),g)),t.flags&512&&t.wrap&4&&(t.check=Ze(t.check,r,f,i)),o-=f,i+=f,t.length-=f),t.length))break e;t.length=0,t.mode=Qd;case Qd:if(t.flags&2048){if(o===0)break e;f=0;do g=r[i+f++],t.head&&g&&t.length<65536&&(t.head.name+=String.fromCharCode(g));while(g&&f<o);if(t.flags&512&&t.wrap&4&&(t.check=Ze(t.check,r,f,i)),o-=f,i+=f,g)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=ep;case ep:if(t.flags&4096){if(o===0)break e;f=0;do g=r[i+f++],t.head&&g&&t.length<65536&&(t.head.comment+=String.fromCharCode(g));while(g&&f<o);if(t.flags&512&&t.wrap&4&&(t.check=Ze(t.check,r,f,i)),o-=f,i+=f,g)break e}else t.head&&(t.head.comment=null);t.mode=np;case np:if(t.flags&512){for(;c<16;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}if(t.wrap&4&&u!==(t.check&65535)){e.msg="header crc mismatch",t.mode=ke;break}u=0,c=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=yt;break;case tp:for(;c<32;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}e.adler=t.check=_p(u),u=0,c=0,t.mode=$i;case $i:if(t.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=o,t.hold=u,t.bits=c,x2;e.adler=t.check=1,t.mode=yt;case yt:if(n===w2||n===Fi)break e;case Yo:if(t.last){u>>>=c&7,c-=c&7,t.mode=Xo;break}for(;c<3;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}switch(t.last=u&1,u>>>=1,c-=1,u&3){case 0:t.mode=rp;break;case 1:if(R2(t),t.mode=Ui,n===Fi){u>>>=2,c-=2;break e}break;case 2:t.mode=ip;break;case 3:e.msg="invalid block type",t.mode=ke}u>>>=2,c-=2;break;case rp:for(u>>>=c&7,c-=c&7;c<32;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}if((u&65535)!==(u>>>16^65535)){e.msg="invalid stored block lengths",t.mode=ke;break}if(t.length=u&65535,u=0,c=0,t.mode=Zo,n===Fi)break e;case Zo:t.mode=sp;case sp:if(f=t.length,f){if(f>o&&(f=o),f>l&&(f=l),f===0)break e;s.set(r.subarray(i,i+f),a),o-=f,i+=f,l-=f,a+=f,t.length-=f;break}t.mode=yt;break;case ip:for(;c<14;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}if(t.nlen=(u&31)+257,u>>>=5,c-=5,t.ndist=(u&31)+1,u>>>=5,c-=5,t.ncode=(u&15)+4,u>>>=4,c-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=ke;break}t.have=0,t.mode=ap;case ap:for(;t.have<t.ncode;){for(;c<3;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}t.lens[L[t.have++]]=u&7,u>>>=3,c-=3}for(;t.have<19;)t.lens[L[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,E={bits:t.lenbits},_=Ls(v2,t.lens,0,19,t.lencode,0,t.work,E),t.lenbits=E.bits,_){e.msg="invalid code lengths set",t.mode=ke;break}t.have=0,t.mode=op;case op:for(;t.have<t.nlen+t.ndist;){for(;k=t.lencode[u&(1<<t.lenbits)-1],P=k>>>24,N=k>>>16&255,O=k&65535,!(P<=c);){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}if(O<16)u>>>=P,c-=P,t.lens[t.have++]=O;else{if(O===16){for(b=P+2;c<b;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}if(u>>>=P,c-=P,t.have===0){e.msg="invalid bit length repeat",t.mode=ke;break}g=t.lens[t.have-1],f=3+(u&3),u>>>=2,c-=2}else if(O===17){for(b=P+3;c<b;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}u>>>=P,c-=P,g=0,f=3+(u&7),u>>>=3,c-=3}else{for(b=P+7;c<b;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}u>>>=P,c-=P,g=0,f=11+(u&127),u>>>=7,c-=7}if(t.have+f>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=ke;break}for(;f--;)t.lens[t.have++]=g}}if(t.mode===ke)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=ke;break}if(t.lenbits=9,E={bits:t.lenbits},_=Ls(Hd,t.lens,0,t.nlen,t.lencode,0,t.work,E),t.lenbits=E.bits,_){e.msg="invalid literal/lengths set",t.mode=ke;break}if(t.distbits=6,t.distcode=t.distdyn,E={bits:t.distbits},_=Ls(Wd,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,E),t.distbits=E.bits,_){e.msg="invalid distances set",t.mode=ke;break}if(t.mode=Ui,n===Fi)break e;case Ui:t.mode=ji;case ji:if(o>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=o,t.hold=u,t.bits=c,m2(e,h),a=e.next_out,s=e.output,l=e.avail_out,i=e.next_in,r=e.input,o=e.avail_in,u=t.hold,c=t.bits,t.mode===yt&&(t.back=-1);break}for(t.back=0;k=t.lencode[u&(1<<t.lenbits)-1],P=k>>>24,N=k>>>16&255,O=k&65535,!(P<=c);){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}if(N&&(N&240)===0){for(R=P,S=N,F=O;k=t.lencode[F+((u&(1<<R+S)-1)>>R)],P=k>>>24,N=k>>>16&255,O=k&65535,!(R+P<=c);){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}u>>>=R,c-=R,t.back+=R}if(u>>>=P,c-=P,t.back+=P,t.length=O,N===0){t.mode=pp;break}if(N&32){t.back=-1,t.mode=yt;break}if(N&64){e.msg="invalid literal/length code",t.mode=ke;break}t.extra=N&15,t.mode=lp;case lp:if(t.extra){for(b=t.extra;c<b;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}t.length+=u&(1<<t.extra)-1,u>>>=t.extra,c-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=cp;case cp:for(;k=t.distcode[u&(1<<t.distbits)-1],P=k>>>24,N=k>>>16&255,O=k&65535,!(P<=c);){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}if((N&240)===0){for(R=P,S=N,F=O;k=t.distcode[F+((u&(1<<R+S)-1)>>R)],P=k>>>24,N=k>>>16&255,O=k&65535,!(R+P<=c);){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}u>>>=R,c-=R,t.back+=R}if(u>>>=P,c-=P,t.back+=P,N&64){e.msg="invalid distance code",t.mode=ke;break}t.offset=O,t.extra=N&15,t.mode=up;case up:if(t.extra){for(b=t.extra;c<b;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}t.offset+=u&(1<<t.extra)-1,u>>>=t.extra,c-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=ke;break}t.mode=dp;case dp:if(l===0)break e;if(f=h-l,t.offset>f){if(f=t.offset-f,f>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=ke;break}f>t.wnext?(f-=t.wnext,m=t.wsize-f):m=t.wnext-f,f>t.length&&(f=t.length),v=t.window}else v=s,m=a-t.offset,f=t.length;f>l&&(f=l),l-=f,t.length-=f;do s[a++]=v[m++];while(--f);t.length===0&&(t.mode=ji);break;case pp:if(l===0)break e;s[a++]=t.length,l--,t.mode=ji;break;case Xo:if(t.wrap){for(;c<32;){if(o===0)break e;o--,u|=r[i++]<<c,c+=8}if(h-=l,e.total_out+=h,t.total+=h,t.wrap&4&&h&&(e.adler=t.check=t.flags?Ze(t.check,s,h,a-h):Cs(t.check,s,h,a-h)),h=l,t.wrap&4&&(t.flags?u:_p(u))!==t.check){e.msg="incorrect data check",t.mode=ke;break}u=0,c=0}t.mode=hp;case hp:if(t.wrap&&t.flags){for(;c<32;){if(o===0)break e;o--,u+=r[i++]<<c,c+=8}if(t.wrap&4&&u!==(t.total&4294967295)){e.msg="incorrect length check",t.mode=ke;break}u=0,c=0}t.mode=fp;case fp:_=S2;break e;case ke:_=qd;break e;case mp:return zd;case gp:default:return Nn}return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=o,t.hold=u,t.bits=c,(t.wsize||h!==e.avail_out&&t.mode<ke&&(t.mode<Xo||n!==Vd))&&xp(e,e.output,e.next_out,h-e.avail_out),p-=e.avail_in,h-=e.avail_out,e.total_in+=p,e.total_out+=h,t.total+=h,t.wrap&4&&h&&(e.adler=t.check=t.flags?Ze(t.check,s,h,e.next_out-h):Cs(t.check,s,h,e.next_out-h)),e.data_type=t.bits+(t.last?64:0)+(t.mode===yt?128:0)+(t.mode===Ui||t.mode===Zo?256:0),(p===0&&h===0||n===Vd)&&_===Jt&&(_=E2),_},D2=e=>{if(Qt(e))return Nn;let n=e.state;return n.window&&(n.window=null),e.state=null,Jt},O2=(e,n)=>{if(Qt(e))return Nn;const t=e.state;return(t.wrap&2)===0?Nn:(t.head=n,n.done=!1,Jt)},N2=(e,n)=>{const t=n.length;let r,s,i;return Qt(e)||(r=e.state,r.wrap!==0&&r.mode!==$i)?Nn:r.mode===$i&&(s=1,s=Cs(s,n,t,0),s!==r.check)?qd:(i=xp(e,n,t,t),i?(r.mode=mp,zd):(r.havedict=1,Jt))};var B2=bp,L2=vp,F2=yp,M2=I2,$2=wp,U2=P2,j2=D2,H2=O2,W2=N2,V2="pako inflate (from Nodeca project)",bt={inflateReset:B2,inflateReset2:L2,inflateResetKeep:F2,inflateInit:M2,inflateInit2:$2,inflate:U2,inflateEnd:j2,inflateGetHeader:H2,inflateSetDictionary:W2,inflateInfo:V2};function q2(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var z2=q2;const Ep=Object.prototype.toString,{Z_NO_FLUSH:G2,Z_FINISH:K2,Z_OK:Fs,Z_STREAM_END:el,Z_NEED_DICT:nl,Z_STREAM_ERROR:Y2,Z_DATA_ERROR:kp,Z_MEM_ERROR:Z2}=As;function Ms(e){this.options=Ni.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),n.windowBits>=0&&n.windowBits<16&&!(e&&e.windowBits)&&(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(n.windowBits&15)===0&&(n.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ld,this.strm.avail_out=0;let t=bt.inflateInit2(this.strm,n.windowBits);if(t!==Fs)throw new Error(Kt[t]);if(this.header=new z2,bt.inflateGetHeader(this.strm,this.header),n.dictionary&&(typeof n.dictionary=="string"?n.dictionary=Ns.string2buf(n.dictionary):Ep.call(n.dictionary)==="[object ArrayBuffer]"&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(t=bt.inflateSetDictionary(this.strm,n.dictionary),t!==Fs)))throw new Error(Kt[t])}Ms.prototype.push=function(e,n){const t=this.strm,r=this.options.chunkSize,s=this.options.dictionary;let i,a,o;if(this.ended)return!1;for(n===~~n?a=n:a=n===!0?K2:G2,Ep.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),i=bt.inflate(t,a),i===nl&&s&&(i=bt.inflateSetDictionary(t,s),i===Fs?i=bt.inflate(t,a):i===kp&&(i=nl));t.avail_in>0&&i===el&&t.state.wrap>0&&e[t.next_in]!==0;)bt.inflateReset(t),i=bt.inflate(t,a);switch(i){case Y2:case kp:case nl:case Z2:return this.onEnd(i),this.ended=!0,!1}if(o=t.avail_out,t.next_out&&(t.avail_out===0||i===el))if(this.options.to==="string"){let l=Ns.utf8border(t.output,t.next_out),u=t.next_out-l,c=Ns.buf2string(t.output,l);t.next_out=u,t.avail_out=r-u,u&&t.output.set(t.output.subarray(l,l+u),0),this.onData(c)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(i===Fs&&o===0)){if(i===el)return i=bt.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},Ms.prototype.onData=function(e){this.chunks.push(e)},Ms.prototype.onEnd=function(e){e===Fs&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ni.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function tl(e,n){const t=new Ms(n);if(t.push(e),t.err)throw t.msg||Kt[t.err];return t.result}function X2(e,n){return n=n||{},n.raw=!0,tl(e,n)}var J2=Ms,Q2=tl,ev=X2,nv=tl,tv={Inflate:J2,inflate:Q2,inflateRaw:ev,ungzip:nv};const{Deflate:rv,deflate:sv,deflateRaw:iv,gzip:av}=h2,{Inflate:ov,inflate:lv,inflateRaw:cv,ungzip:uv}=tv;var Cp=rv,Ap=sv,Tp=iv,Ip=av,Rp=ov,Pp=lv,Dp=cv,Op=uv,Np=As,Me={Deflate:Cp,deflate:Ap,deflateRaw:Tp,gzip:Ip,Inflate:Rp,inflate:Pp,inflateRaw:Dp,ungzip:Op,constants:Np};const dv=Object.freeze(Object.defineProperty({__proto__:null,Deflate:Cp,Inflate:Rp,constants:Np,default:Me,deflate:Ap,deflateRaw:Tp,gzip:Ip,inflate:Pp,inflateRaw:Dp,ungzip:Op},Symbol.toStringTag,{value:"Module"}));let Bn=null,rl=null;async function Bp(){return Bn||(rl||(rl=(async()=>{try{return Bn=await(await Ii(Py)).default,Bn}catch{return null}})()),rl)}function Lp(e,n){try{const t=typeof e=="string"?I.from(e):e,r=Me.gzip(t);n(null,I.from(r))}catch(t){n(t,I.alloc(0))}}function Fp(e,n){try{const t=Me.ungzip(e);n(null,I.from(t))}catch(t){n(t,I.alloc(0))}}function Mp(e,n){try{const t=typeof e=="string"?I.from(e):e,r=Me.deflate(t);n(null,I.from(r))}catch(t){n(t,I.alloc(0))}}function $p(e,n){try{const t=Me.inflate(e);n(null,I.from(t))}catch(t){n(t,I.alloc(0))}}function Up(e,n){try{const t=typeof e=="string"?I.from(e):e,r=Me.deflateRaw(t);n(null,I.from(r))}catch(t){n(t,I.alloc(0))}}function jp(e,n){try{const t=Me.inflateRaw(e);n(null,I.from(t))}catch(t){n(t,I.alloc(0))}}function Hp(e,n,t){const r=typeof n=="function"?n:t;Bp().then(s=>{if(!s){r(new Error("Brotli WASM is not available"),I.alloc(0));return}try{const i=typeof e=="string"?I.from(e):e,a=s.compress(new Uint8Array(i));r(null,I.from(a))}catch(i){r(i,I.alloc(0))}}).catch(s=>r(s,I.alloc(0)))}function Wp(e,n,t){const r=typeof n=="function"?n:t;Bp().then(s=>{if(!s){r(new Error("Brotli WASM is not available"),I.alloc(0));return}try{const i=s.decompress(new Uint8Array(e));r(null,I.from(i))}catch(i){r(i,I.alloc(0))}}).catch(s=>r(s,I.alloc(0)))}function Vp(e){const n=typeof e=="string"?I.from(e):e;return I.from(Me.gzip(n))}function qp(e){return I.from(Me.ungzip(e))}function zp(e){const n=typeof e=="string"?I.from(e):e;return I.from(Me.deflate(n))}function Gp(e){return I.from(Me.inflate(e))}function Kp(e){const n=typeof e=="string"?I.from(e):e;return I.from(Me.deflateRaw(n))}function Yp(e){return I.from(Me.inflateRaw(e))}function Zp(e,n){if(!Bn)throw new Error("Brotli WASM not loaded yet. Use async brotliCompress first.");const t=typeof e=="string"?I.from(e):e;return I.from(Bn.compress(new Uint8Array(t)))}function Xp(e,n){if(!Bn)throw new Error("Brotli WASM not loaded yet. Use async brotliDecompress first.");return I.from(Bn.decompress(new Uint8Array(e)))}function mn(e){if(e.chunks&&e.chunks.length>0){const n=e.chunks.splice(0);if(n.length===1)return I.from(n[0]);let t=0;for(const i of n)t+=i.length;const r=new Uint8Array(t);let s=0;for(const i of n)r.set(i,s),s+=i.length;return I.from(r)}if(e.result&&e.result.length>0){const n=I.from(e.result);return e.result=null,n}return null}const Ce=function(n){this&&(hn.call(this),this._opts=n||{},this.bytesWritten=0,this._handle={close:()=>{}})};Object.setPrototypeOf(Ce.prototype,hn.prototype),Ce.prototype.close=function(n){this.destroy(),n&&queueMicrotask(n)},Ce.prototype.flush=function(n){n&&queueMicrotask(()=>n(null))},Ce.prototype.reset=function(){},Ce.prototype.params=function(n,t,r){r&&queueMicrotask(()=>r(null))},Ce.prototype._processChunk=function(n,t){let r=null;return this._transform(n,"buffer",(s,i)=>{if(s)throw s;i&&(r=I.from(i))}),t===4&&this._flush((s,i)=>{if(s)throw s;i&&(r=r?I.concat([r,I.from(i)]):I.from(i))}),r};const Dr=function(n){this&&(Ce.call(this,n),this._engine=new Me.Deflate({...n||{},gzip:!0}))};Object.setPrototypeOf(Dr.prototype,Ce.prototype),Dr.prototype._transform=function(n,t,r){try{if(this._engine.push(n,!1),this._engine.err){r(new Error(this._engine.msg||"Gzip error"));return}const s=mn(this._engine);r(null,s??void 0)}catch(s){r(s)}},Dr.prototype._flush=function(n){try{this._engine.push(new Uint8Array(0),!0);const t=mn(this._engine);n(null,t??void 0)}catch(t){n(t)}};const Or=function(n){this&&(Ce.call(this,n),this._engine=new Me.Inflate({...n||{}}))};Object.setPrototypeOf(Or.prototype,Ce.prototype),Or.prototype._transform=function(n,t,r){try{if(this._engine.push(n,!1),this._engine.err){r(new Error(this._engine.msg||"Gunzip error"));return}const s=mn(this._engine);r(null,s??void 0)}catch(s){r(s)}},Or.prototype._flush=function(n){try{this._engine.push(new Uint8Array(0),!0);const t=mn(this._engine);n(null,t??void 0)}catch(t){n(t)}};const Nr=function(n){this&&(Ce.call(this,n),this._engine=new Me.Deflate({...n||{}}))};Object.setPrototypeOf(Nr.prototype,Ce.prototype),Nr.prototype._transform=function(n,t,r){try{if(this._engine.push(n,!1),this._engine.err){r(new Error(this._engine.msg||"Deflate error"));return}const s=mn(this._engine);r(null,s??void 0)}catch(s){r(s)}},Nr.prototype._flush=function(n){try{this._engine.push(new Uint8Array(0),!0);const t=mn(this._engine);n(null,t??void 0)}catch(t){n(t)}};const Br=function(n){this&&(Ce.call(this,n),this._engine=new Me.Inflate({...n||{}}))};Object.setPrototypeOf(Br.prototype,Ce.prototype),Br.prototype._transform=function(n,t,r){try{if(this._engine.push(n,!1),this._engine.err){r(new Error(this._engine.msg||"Inflate error"));return}const s=mn(this._engine);r(null,s??void 0)}catch(s){r(s)}},Br.prototype._flush=function(n){try{this._engine.push(new Uint8Array(0),!0);const t=mn(this._engine);n(null,t??void 0)}catch(t){n(t)}};const Lr=function(n){this&&(Ce.call(this,n),this._engine=new Me.Deflate({...n||{},raw:!0}))};Object.setPrototypeOf(Lr.prototype,Ce.prototype),Lr.prototype._transform=function(n,t,r){try{if(this._engine.push(n,!1),this._engine.err){r(new Error(this._engine.msg||"DeflateRaw error"));return}const s=mn(this._engine);r(null,s??void 0)}catch(s){r(s)}},Lr.prototype._flush=function(n){try{this._engine.push(new Uint8Array(0),!0);const t=mn(this._engine);n(null,t??void 0)}catch(t){n(t)}};const Fr=function(n){this&&(Ce.call(this,n),this._engine=new Me.Inflate({...n||{},raw:!0}))};Object.setPrototypeOf(Fr.prototype,Ce.prototype),Fr.prototype._transform=function(n,t,r){try{if(this._engine.push(n,!1),this._engine.err){r(new Error(this._engine.msg||"InflateRaw error"));return}const s=mn(this._engine);r(null,s??void 0)}catch(s){r(s)}},Fr.prototype._flush=function(n){try{this._engine.push(new Uint8Array(0),!0);const t=mn(this._engine);n(null,t??void 0)}catch(t){n(t)}};const Mr=function(n){this&&(Ce.call(this,n),this._engine=null)};Object.setPrototypeOf(Mr.prototype,Ce.prototype),Mr.prototype._transform=function(n,t,r){try{if(!this._engine){const i=n instanceof Uint8Array?n:new Uint8Array(n),a=i.length>=2&&i[0]===31&&i[1]===139;this._engine=new Me.Inflate({windowBits:a?31:47})}if(this._engine.push(n,!1),this._engine.err){r(new Error(this._engine.msg||"Unzip error"));return}const s=mn(this._engine);r(null,s??void 0)}catch(s){r(s)}},Mr.prototype._flush=function(n){try{if(this._engine){this._engine.push(new Uint8Array(0),!0);const t=mn(this._engine);n(null,t??void 0)}else n(null)}catch(t){n(t)}};const $r=function(n){this&&Ce.call(this,n)};Object.setPrototypeOf($r.prototype,Ce.prototype),$r.prototype._transform=function(n,t,r){if(!Bn){r(new Error("Brotli WASM not loaded"));return}try{const s=n instanceof Uint8Array?n:new Uint8Array(n);r(null,I.from(Bn.compress(s)))}catch(s){r(s)}};const Ur=function(n){this&&Ce.call(this,n)};Object.setPrototypeOf(Ur.prototype,Ce.prototype),Ur.prototype._transform=function(n,t,r){if(!Bn){r(new Error("Brotli WASM not loaded"));return}try{const s=n instanceof Uint8Array?n:new Uint8Array(n);r(null,I.from(Bn.decompress(s)))}catch(s){r(s)}};const pv=$r,hv=Ur;function Jp(e){return new Dr(e)}function Qp(e){return new Or(e)}function eh(e){return new Nr(e)}function nh(e){return new Br(e)}function th(e){return new Lr(e)}function rh(e){return new Fr(e)}function sh(e){return new Mr(e)}function ih(e){return new $r(e)}function ah(e){return new Ur(e)}const oh={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,ZLIB_VERNUM:4784,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_DECODE:0,BROTLI_ENCODE:1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_PARAM_MODE:0,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_PARAM_QUALITY:1,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_PARAM_LGWIN:2,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_DEFAULT_WINDOW:22,BROTLI_PARAM_LGBLOCK:3,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24};Object.freeze(Object.defineProperty({__proto__:null,BrotliCompress:pv,BrotliCompressStream:$r,BrotliDecompress:hv,BrotliDecompressStream:Ur,Deflate:Nr,DeflateRaw:Lr,Gunzip:Or,Gzip:Dr,Inflate:Br,InflateRaw:Fr,Unzip:Mr,brotliCompress:Hp,brotliCompressSync:Zp,brotliDecompress:Wp,brotliDecompressSync:Xp,constants:oh,createBrotliCompress:ih,createBrotliDecompress:ah,createDeflate:eh,createDeflateRaw:th,createGunzip:Qp,createGzip:Jp,createInflate:nh,createInflateRaw:rh,createUnzip:sh,default:{gzip:Lp,gunzip:Fp,deflate:Mp,inflate:$p,deflateRaw:Up,inflateRaw:jp,brotliCompress:Hp,brotliDecompress:Wp,gzipSync:Vp,gunzipSync:qp,deflateSync:zp,inflateSync:Gp,deflateRawSync:Kp,inflateRawSync:Yp,brotliCompressSync:Zp,brotliDecompressSync:Xp,Gzip:Dr,Gunzip:Or,Deflate:Nr,Inflate:Br,DeflateRaw:Lr,InflateRaw:Fr,Unzip:Mr,BrotliCompress:$r,BrotliDecompress:Ur,createGzip:Jp,createGunzip:Qp,createDeflate:eh,createInflate:nh,createDeflateRaw:th,createInflateRaw:rh,createUnzip:sh,createBrotliCompress:ih,createBrotliDecompress:ah,constants:oh},deflate:Mp,deflateRaw:Up,deflateRawSync:Kp,deflateSync:zp,gunzip:Fp,gunzipSync:qp,gzip:Lp,gzipSync:Vp,inflate:$p,inflateRaw:jp,inflateRawSync:Yp,inflateSync:Gp},Symbol.toStringTag,{value:"Module"}));function Hi(e,n,t){const r=typeof n=="function"?n:t,s=typeof n=="object"?n:{},a=e==="localhost"||e==="127.0.0.1"?"127.0.0.1":"0.0.0.0";setTimeout(()=>{s.all?r(null,[{address:a,family:4}]):r(null,a,4)},0)}function Wi(e,n){setTimeout(()=>n(null,["0.0.0.0"]),0)}function lh(e,n){Wi(e,n)}function ch(e,n){setTimeout(()=>n(null,["::1"]),0)}function uh(e,n){setTimeout(()=>n(null,["localhost"]),0)}function dh(e){}function ph(){return[]}function hh(e){}function fh(){return"verbatim"}const sl={lookup(e,n){return new Promise((t,r)=>{n!=null&&n.all?Hi(e,n,(s,i)=>{s?r(s):t(i??[])}):Hi(e,n??{},(s,i,a)=>{s?r(s):t({address:i,family:a})})})},resolve(e){return new Promise((n,t)=>{Wi(e,(r,s)=>r?t(r):n(s??[]))})},resolve4(e){return sl.resolve(e)},resolve6(e){return Promise.resolve(["::1"])},reverse(e){return Promise.resolve(["localhost"])},setServers(e){},getServers(){return[]}},mh=0,gh=0,_h=0;Object.freeze(Object.defineProperty({__proto__:null,ADDRCONFIG:mh,ALL:_h,V4MAPPED:gh,default:{lookup:Hi,resolve:Wi,resolve4:lh,resolve6:ch,reverse:uh,setServers:dh,getServers:ph,setDefaultResultOrder:hh,getDefaultResultOrder:fh,promises:sl,ADDRCONFIG:mh,V4MAPPED:gh,ALL:_h},getDefaultResultOrder:fh,getServers:ph,lookup:Hi,promises:sl,resolve:Wi,resolve4:lh,resolve6:ch,reverse:uh,setDefaultResultOrder:hh,setServers:dh},Symbol.toStringTag,{value:"Module"}));let yh=null;function bh(e){yh=e}function vh(){return yh}function wh(e){bh(e)}const $s=function(){this&&(this.handlers=new Map)};$s.prototype.on=function(n,t){return this.handlers.has(n)||this.handlers.set(n,new Set),this.handlers.get(n).add(t),this},$s.prototype.off=function(n,t){var r;return(r=this.handlers.get(n))==null||r.delete(t),this},$s.prototype.fire=function(n,...t){const r=this.handlers.get(n);if(r)for(const s of r)try{s(...t)}catch{}};const wn=function(n={}){if(!this)return;$s.call(this);const t=vh();if(!t)throw new Error("chokidar: MemoryVolume not set. Call setVolume() first.");this.vol=t,this.cfg=n,this.handles=new Map,this.terminated=!1,this.initialised=!1};Object.setPrototypeOf(wn.prototype,$s.prototype),wn.prototype.add=function(n){if(this.terminated)return this;const t=Array.isArray(n)?n:[n],r=[];for(const s of t){const i=this.resolvePath(s);if(!(this.isExcluded(i)||this.handles.has(i)))try{if(!this.vol.existsSync(i)){const o=i.substring(0,i.lastIndexOf("/"))||"/";this.vol.existsSync(o)&&this.attachWatcher(o,i);continue}const a=this.vol.statSync(i);this.cfg.ignoreInitial||(a.isDirectory()?this.gatherInitial(i,r):r.push(()=>this.fire("add",i,a))),this.attachWatcher(i),a.isDirectory()&&this.watchSubtree(i)}catch(a){this.fire("error",a)}}return this.initialised||(this.initialised=!0,setTimeout(()=>{for(const s of r)s();this.fire("ready")},0)),this},wn.prototype.unwatch=function(n){const t=Array.isArray(n)?n:[n];for(const r of t){const s=this.resolvePath(r),i=this.handles.get(s);i&&(i.close(),this.handles.delete(s))}return this},wn.prototype.close=function(){this.terminated=!0;for(const n of this.handles.values())n.close();return this.handles.clear(),this.fire("close"),Promise.resolve()},wn.prototype.getWatched=function(){const n={};for(const t of this.handles.keys()){const r=t.substring(0,t.lastIndexOf("/"))||"/",s=t.substring(t.lastIndexOf("/")+1);n[r]||(n[r]=[]),n[r].push(s)}return n},wn.prototype.resolvePath=function(n){let t=n;return this.cfg.cwd&&!t.startsWith("/")&&(t=this.cfg.cwd+"/"+t),t.startsWith("/")||(t="/"+t),t},wn.prototype.isExcluded=function(n){const{ignored:t}=this.cfg;if(!t)return!1;const r=Array.isArray(t)?t:[t];for(const s of r)if(typeof s=="string"){if(n===s||n.startsWith(s+"/"))return!0}else if(s instanceof RegExp){if(s.test(n))return!0}else if(typeof s=="function"&&s(n))return!0;return!1},wn.prototype.gatherInitial=function(n,t){try{const r=this.vol.readdirSync(n);for(const s of r){const i=n==="/"?"/"+s:n+"/"+s;if(this.isExcluded(i))continue;const a=this.vol.statSync(i);a.isDirectory()?(t.push(()=>this.fire("addDir",i,a)),this.gatherInitial(i,t)):t.push(()=>this.fire("add",i,a))}}catch{}},wn.prototype.attachWatcher=function(n,t){if(this.handles.has(n))return;const r=this,s=this.vol.watch(n,{recursive:!0},(i,a)=>{if(r.terminated)return;let o;if(a?o=n==="/"?"/"+a:n+"/"+a:o=n,!(t&&o!==t&&!o.startsWith(t+"/"))&&!r.isExcluded(o)){if(i==="rename")if(r.vol.existsSync(o))try{const l=r.vol.statSync(o),u=l.isDirectory()?"addDir":"add";r.fire(u,o,l),r.fire("all",u,o,l)}catch{}else r.fire("unlink",o),r.fire("all","unlink",o);else if(i==="change")try{const l=r.vol.statSync(o);r.fire("change",o,l),r.fire("all","change",o,l)}catch{r.fire("unlink",o),r.fire("all","unlink",o)}}});this.handles.set(n,s)},wn.prototype.watchSubtree=function(n,t=0){if(!(this.cfg.depth!==void 0&&t>this.cfg.depth))try{const r=this.vol.readdirSync(n);for(const s of r){const i=n==="/"?"/"+s:n+"/"+s;if(!this.isExcluded(i))try{this.vol.statSync(i).isDirectory()&&(this.attachWatcher(i),this.watchSubtree(i,t+1))}catch{}}}catch{}};function Sh(e,n){const t=new wn(n);return t.add(e),t}Object.freeze(Object.defineProperty({__proto__:null,PathWatcher:wn,default:{watch:Sh,PathWatcher:wn,setVolume:wh},setVolume:wh,watch:Sh},Symbol.toStringTag,{value:"Module"}));const er=typeof CloseEvent<"u"?CloseEvent:class extends Event{constructor(n,t){super(n),T(this,"code"),T(this,"reason"),T(this,"wasClean"),this.code=(t==null?void 0:t.code)??1e3,this.reason=(t==null?void 0:t.reason)??"",this.wasClean=(t==null?void 0:t.wasClean)??!0}},jr=typeof MessageEvent<"u"?MessageEvent:class extends Event{constructor(n,t){super(n),T(this,"data"),this.data=t==null?void 0:t.data}};let Ln=null;try{Ln=new BroadcastChannel("nodepod-ws-bridge")}catch{}const xh=new Map;let fv=0;const nr=function(){this&&(this._listeners=new Map)};nr.prototype.on=function(n,t){return this._listeners.has(n)||this._listeners.set(n,new Set),this._listeners.get(n).add(t),this},nr.prototype.off=function(n,t){var r;return(r=this._listeners.get(n))==null||r.delete(t),this},nr.prototype.emit=function(n,...t){const r=this._listeners.get(n);if(r)for(const s of r)try{s(...t)}catch{}};const Us=0,it=1,js=2,Sn=3,qe=function(n,t){if(!this)return;nr.call(this),this.CONNECTING=Us,this.OPEN=it,this.CLOSING=js,this.CLOSED=Sn,this.readyState=Us,this.url=n,this.protocol="",this.extensions="",this.bufferedAmount=0,this.binaryType="blob",this._uid=`ws-${++fv}`,this._boundServer=null,this._native=null,this._tcpSocket=null,this._tcpInboundBuf=new Uint8Array(0),this.onopen=null,this.onclose=null,this.onerror=null,this.onmessage=null,t&&(this.protocol=Array.isArray(t)?t[0]:t);const r=this;setTimeout(()=>r._open(),0)};Object.setPrototypeOf(qe.prototype,nr.prototype),qe.CONNECTING=Us,qe.OPEN=it,qe.CLOSING=js,qe.CLOSED=Sn,qe.prototype._open=function(){var n;if(this.url.startsWith("internal://")){this.readyState=it,this.emit("open"),(n=this.onopen)==null||n.call(this,new Event("open"));return}if(this.url.startsWith("ws://")||this.url.startsWith("wss://")){this._openNative();return}if(!Ln){const i=this;setTimeout(()=>{var a;i.readyState=it,i.emit("open"),(a=i.onopen)==null||a.call(i,new Event("open"))},0);return}Ln.postMessage({kind:"connect",uid:this._uid,url:this.url});const t=Ln,r=this,s=i=>{var a,o,l,u;const c=i.data;if(c.targetUid===r._uid){if(c.kind==="connected")r.readyState=it,r.emit("open"),(a=r.onopen)==null||a.call(r,new Event("open"));else if(c.kind==="payload"){const p=new jr("message",{data:c.body});r.emit("message",p),(o=r.onmessage)==null||o.call(r,p)}else if(c.kind==="closed"){r.readyState=Sn;const p=new er("close",{code:c.code||1e3,reason:c.reason||"",wasClean:!0});r.emit("close",p),(l=r.onclose)==null||l.call(r,p),t.removeEventListener("message",s)}else if(c.kind==="fault"){const p=new Event("error");r.emit("error",p),(u=r.onerror)==null||u.call(r,p)}}};t.addEventListener("message",s),setTimeout(()=>{var i;r.readyState===Us&&(r.readyState=it,r.emit("open"),(i=r.onopen)==null||i.call(r,new Event("open")))},100)},qe.prototype._openNative=function(){var n;const r=typeof window<"u"&&typeof window.document<"u"&&typeof globalThis.WebSocket=="function"&&globalThis.WebSocket!==qe?globalThis.WebSocket:null;if(!r){const i=this;setTimeout(()=>{var a;i.readyState=it,i.emit("open"),(a=i.onopen)==null||a.call(i,new Event("open"))},0);return}try{this._native=new r(this.url),this._native.binaryType=this.binaryType==="arraybuffer"?"arraybuffer":"blob"}catch{this.readyState=Sn;const i=new Event("error");this.emit("error",i),(n=this.onerror)==null||n.call(this,i);return}const s=this;this._native.onopen=()=>{var i;s.readyState=it,s.emit("open"),(i=s.onopen)==null||i.call(s,new Event("open"))},this._native.onmessage=i=>{var a;const o=new jr("message",{data:i.data});s.emit("message",o),(a=s.onmessage)==null||a.call(s,o)},this._native.onclose=i=>{var a;s.readyState=Sn,s._native=null;const o=new er("close",{code:i.code,reason:i.reason,wasClean:i.wasClean});s.emit("close",o),(a=s.onclose)==null||a.call(s,o)},this._native.onerror=()=>{var i;const a=new Event("error");s.emit("error",a),(i=s.onerror)==null||i.call(s,a)}},qe.prototype.send=function(n){if(this.readyState!==it)throw new Error("WebSocket is not open");if(this._native){this._native.send(n);return}if(this._tcpSocket){let t,r;typeof n=="string"?(t=new TextEncoder().encode(n),r=1):n instanceof ArrayBuffer?(t=new Uint8Array(n),r=2):(t=n,r=2);const s=Vn(r,t,!1);this._tcpSocket.write(I.from(s));return}if(this._boundServer){this._boundServer._injectClientPayload(this,n);return}Ln&&Ln.postMessage({kind:"payload",uid:this._uid,url:this.url,body:n})},qe.prototype.close=function(n,t){if(this.readyState===Sn||this.readyState===js)return;if(this.readyState=js,this._native){this._native.close(n,t);return}if(this._tcpSocket){const s=n??1e3,i=new Uint8Array(2);i[0]=s>>8&255,i[1]=s&255;const a=Vn(8,i,!1);try{this._tcpSocket.write(I.from(a))}catch{}const o=this;setTimeout(()=>{var l;o.readyState=Sn;const u=new er("close",{code:s,reason:t||"",wasClean:!0});o.emit("close",u),(l=o.onclose)==null||l.call(o,u),o._tcpSocket=null},0);return}Ln&&Ln.postMessage({kind:"disconnect",uid:this._uid,url:this.url,code:n,reason:t});const r=this;setTimeout(()=>{var s;r.readyState=Sn;const i=new er("close",{code:n||1e3,reason:t||"",wasClean:!0});r.emit("close",i),(s=r.onclose)==null||s.call(r,i)},0)},qe.prototype.ping=function(){},qe.prototype.pong=function(){},qe.prototype.terminate=function(){var n;if(this._native&&(this._native.close(),this._native=null),this._tcpSocket){try{this._tcpSocket.destroy()}catch{}this._tcpSocket=null}this.readyState=Sn;const t=new er("close",{code:1006,reason:"Terminated",wasClean:!1});this.emit("close",t),(n=this.onclose)==null||n.call(this,t)},qe.prototype._bindServer=function(n){this._boundServer=n},qe.prototype._deliverMessage=function(n){var t;const r=new jr("message",{data:n});this.emit("message",r),(t=this.onmessage)==null||t.call(this,r)};const Eh="258EAFA5-E914-47DA-95CA-5AB5DC76CB76";function mv(e){try{const n=is("sha1");return n.update(e+Eh),n.digest("base64")}catch{return btoa(e+Eh).slice(0,28)}}const Nt=function(n={}){this&&(nr.call(this),this.clients=new Set,this.options=n,this._route=n.path||"/",this._channelCb=null,n.noServer||this._listen(),xh.set(this._route,this))};Object.setPrototypeOf(Nt.prototype,nr.prototype),Nt.prototype._listen=function(){if(!Ln)return;const n=Ln,t=this;this._channelCb=r=>{const s=r.data;if(s.kind==="connect"){const i=new qe("internal://"+t._route);i._bindServer(t),i._uid=s.uid,t.clients.add(i),n.postMessage({kind:"connected",targetUid:s.uid}),t.emit("connection",i,{url:s.url})}if(s.kind==="payload"){for(const i of t.clients)if(i._uid===s.uid){i._deliverMessage(s.body);break}}if(s.kind==="disconnect"){for(const i of t.clients)if(i._uid===s.uid){i.close(s.code,s.reason),t.clients.delete(i);break}}},n.addEventListener("message",this._channelCb)},Nt.prototype._injectClientPayload=function(n,t){const r=new jr("message",{data:t});n.emit("message",r)},Nt.prototype.handleUpgrade=function(n,t,r,s){const i=new qe("internal://"+this._route);i._bindServer(this),this.options.clientTracking!==!1&&this.clients.add(i);const a=t;if(a&&typeof a.write=="function"&&typeof a._feedData=="function"){i._tcpSocket=a;const c=((n==null?void 0:n.headers)||{})["sec-websocket-key"]||"",h=`HTTP/1.1 101 Switching Protocols\r
78
74
  Upgrade: websocket\r
79
75
  Connection: Upgrade\r
80
- Sec-WebSocket-Accept: ${Q1(g)}\r
76
+ Sec-WebSocket-Accept: ${mv(c)}\r
81
77
  \r
82
- `;c.write(z.from(k)),c.on("data",C=>{var T,L,V;const K=C instanceof Uint8Array?C:new Uint8Array(C),J=new Uint8Array(o._tcpInboundBuf.length+K.length);for(J.set(o._tcpInboundBuf,0),J.set(K,o._tcpInboundBuf.length),o._tcpInboundBuf=J;o._tcpInboundBuf.length>=2;){const X=Ei(o._tcpInboundBuf);if(!X)break;switch(o._tcpInboundBuf=o._tcpInboundBuf.slice(X.consumed),X.op){case 1:{const G=new TextDecoder().decode(X.data),$=new Dr("message",{data:G});o.emit("message",$),(T=o.onmessage)==null||T.call(o,$);break}case 2:{const G=new Dr("message",{data:X.data.buffer});o.emit("message",G),(L=o.onmessage)==null||L.call(o,G);break}case 8:{const G=X.data.length>=2?X.data[0]<<8|X.data[1]:1e3;o.readyState=Yt;const $=new js("close",{code:G,reason:"",wasClean:!0});o.emit("close",$),(V=o.onclose)==null||V.call(o,$),o._tcpSocket=null;break}case 9:{const G=wn(10,X.data,!1);c.write(z.from(G));break}case 10:{o.emit("pong",X.data);break}}}}),c.on("close",()=>{var C;if(o.readyState!==Yt){o.readyState=Yt;const T=new js("close",{code:1006,reason:"Connection lost",wasClean:!1});o.emit("close",T),(C=o.onclose)==null||C.call(o,T)}o._tcpSocket=null})}const p=this;setTimeout(()=>{r(o,t),p.emit("connection",o,t)},0)},gs.prototype.close=function(t){for(const n of this.clients)n.close(1001,"Server closing");this.clients.clear(),Pg.delete(this._route),this._channelCb&&ln&&(ln.removeEventListener("message",this._channelCb),this._channelCb=null),this.emit("close"),t&&setTimeout(t,0)},gs.prototype.address=function(){return{port:this.options.port||0,family:"IPv4",address:this.options.host||"0.0.0.0"}},Object.freeze(Object.defineProperty({__proto__:null,CLOSED:Yt,CLOSING:Gi,CONNECTING:qi,OPEN:Mn,Server:gs,WebSocket:_t,WebSocketServer:gs,createWebSocketStream:()=>{throw new Error("createWebSocketStream is not available in the browser")},default:_t},Symbol.toStringTag,{value:"Module"}));const Og={kFSEventStreamEventFlagNone:0,kFSEventStreamEventFlagMustScanSubDirs:1,kFSEventStreamEventFlagUserDropped:2,kFSEventStreamEventFlagKernelDropped:4,kFSEventStreamEventFlagEventIdsWrapped:8,kFSEventStreamEventFlagHistoryDone:16,kFSEventStreamEventFlagRootChanged:32,kFSEventStreamEventFlagMount:64,kFSEventStreamEventFlagUnmount:128,kFSEventStreamEventFlagItemCreated:256,kFSEventStreamEventFlagItemRemoved:512,kFSEventStreamEventFlagItemInodeMetaMod:1024,kFSEventStreamEventFlagItemRenamed:2048,kFSEventStreamEventFlagItemModified:4096,kFSEventStreamEventFlagItemFinderInfoMod:8192,kFSEventStreamEventFlagItemChangeOwner:16384,kFSEventStreamEventFlagItemXattrMod:32768,kFSEventStreamEventFlagItemIsFile:65536,kFSEventStreamEventFlagItemIsDir:131072,kFSEventStreamEventFlagItemIsSymlink:262144};function Ng(e,t){return()=>Promise.resolve()}function Bg(e,t){return{event:"unknown",path:e,type:"file",changes:{inode:!1,finder:!1,access:!1,xattrs:!1},flags:t}}Object.freeze(Object.defineProperty({__proto__:null,constants:Og,default:{watch:Ng,getInfo:Bg,constants:Og},getInfo:Bg,watch:Ng},Symbol.toStringTag,{value:"Module"}));function ek(e){Ag(e)}const Zt=function(t,n={}){this&&(this.rootDir=t,this.cfg=n,this.results=[],this.scanned=!1,this.handlerMap=new Map)};Zt.prototype[Symbol.asyncIterator]=async function*(){this.runScan();for(const e of this.results)yield e},Zt.prototype.toArray=async function(){return this.runScan(),[...this.results]},Zt.prototype.on=function(t,n){return t==="data"?setTimeout(()=>{this.runScan();for(const s of this.results)n(s);this.fireEvent("end")},0):(this.handlerMap.has(t)||this.handlerMap.set(t,[]),this.handlerMap.get(t).push(n)),this},Zt.prototype.once=function(t,n){const s=this,r=(...o)=>{n(...o),s.off(t,r)};return this.on(t,r)},Zt.prototype.off=function(t,n){const s=this.handlerMap.get(t);if(s){const r=s.indexOf(n);r!==-1&&s.splice(r,1)}return this},Zt.prototype.fireEvent=function(t,...n){const s=this.handlerMap.get(t);if(s)for(const r of s)r(...n)},Zt.prototype.runScan=function(){this.scanned||(this.scanned=!0,this.crawl(this.rootDir,0,""))},Zt.prototype.crawl=function(t,n,s){const r=Tg();if(!r||this.cfg.depth!==void 0&&n>this.cfg.depth)return;let o;try{o=r.readdirSync(t)}catch{return}for(const c of o){const d=t==="/"?"/"+c:t+"/"+c,p=s?s+"/"+c:c;let y;try{y=r.statSync(d)}catch{continue}const g=y.isDirectory(),x={path:p,fullPath:d,basename:c,stats:this.cfg.alwaysStat?y:void 0,dirent:{isFile:()=>!g,isDirectory:()=>g,name:c}},k=this.cfg.type||"files";if(g){if(!this.applyFilter(x,this.cfg.directoryFilter))continue;(k==="directories"||k==="files_directories"||k==="all")&&this.results.push(x),this.crawl(d,n+1,p)}else(k==="files"||k==="files_directories"||k==="all")&&this.applyFilter(x,this.cfg.fileFilter)&&this.results.push(x)}},Zt.prototype.applyFilter=function(t,n){if(!n)return!0;if(typeof n=="function")return n(t);const s=Array.isArray(n)?n:[n];for(const r of s)if(r.startsWith("!")){if(this.globMatch(t.basename,r.slice(1)))return!1}else if(this.globMatch(t.basename,r))return!0;return s.length===0||s.every(r=>r.startsWith("!"))},Zt.prototype.globMatch=function(t,n){return n==="*"?!0:n.startsWith("*.")?t.endsWith(n.slice(1)):n.endsWith("*")?t.startsWith(n.slice(0,-1)):t===n};function Lg(e,t){return new Zt(e,t)}async function tk(e,t){return new Zt(e,t).toArray()}Object.freeze(Object.defineProperty({__proto__:null,DirectoryScanner:Zt,default:Lg,readdirp:Lg,readdirpPromise:tk,setVolume:ek},Symbol.toStringTag,{value:"Module"}));const lo=["assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","quic","readline","readline/promises","repl","sea","sqlite","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","test","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib"];function Mg(e){const t=e.startsWith("node:")?e.slice(5):e;if(lo.includes(t))return!0;const n=t.indexOf("/");return n!==-1?lo.includes(t.slice(0,n)):!1}function Fg(e){return function(n){throw new Error(`Cannot resolve module '${n}' from '${e}'`)}}const $g={},Ug={".js":()=>{},".json":()=>{},".node":()=>{}},jg={};function Vg(e,t,n,s){return e}function Hg(e){const t=e.split("/").filter(Boolean),n=[];for(let s=t.length;s>0;s--){const r="/"+t.slice(0,s).join("/");t[s-1]!=="node_modules"&&n.push(r+"/node_modules")}return n.push("/node_modules"),n}function Wg(e,t,n){throw new Error(`Cannot load module '${e}'`)}function zg(e,t,n){return e}function qg(e){return"(function (exports, require, module, __filename, __dirname) { "+e+`
83
- });`}const Gg=["(function (exports, require, module, __filename, __dirname) { ",`
84
- });`];function Kg(){}function Xe(e,t){this.id=e||"",this.filename=e||"",this.loaded=!1,this.parent=t||null,this.children=[],this.exports={},this.paths=[]}Xe.prototype.require=function(e){throw new Error(`Cannot resolve module '${e}' from '${this.filename}'`)},Xe.prototype.load=function(e){this.loaded=!0},Xe.prototype._compile=function(e,t){},Xe.createRequire=Fg,Xe.builtinModules=lo,Xe.isBuiltin=Mg,Xe._cache=$g,Xe._extensions=Ug,Xe._pathCache=jg,Xe._resolveFilename=Vg,Xe._nodeModulePaths=Hg,Xe._load=Wg,Xe._findPath=zg,Xe.syncBuiltinESMExports=Kg,Xe.wrap=qg,Xe.wrapper=Gg,Xe.Module=Xe,Xe.runMain=function(){},Xe._preloadModules=function(e){},Xe._initPaths=function(){},Xe.globalPaths=["/node_modules"],Object.freeze(Object.defineProperty({__proto__:null,Module:Xe,_cache:$g,_extensions:Ug,_findPath:zg,_load:Wg,_nodeModulePaths:Hg,_pathCache:jg,_resolveFilename:Vg,builtinModules:lo,createRequire:Fg,default:Xe,isBuiltin:Mg,syncBuiltinESMExports:Kg,wrap:qg,wrapper:Gg},Symbol.toStringTag,{value:"Module"}));const Yg=globalThis.performance??{now:()=>Date.now(),timeOrigin:Date.now(),mark:()=>{},measure:()=>{},getEntries:()=>[],getEntriesByName:()=>[],getEntriesByType:()=>[],clearMarks:()=>{},clearMeasures:()=>{},clearResourceTimings:()=>{}},Or=function(t){this&&(this._fn=t,this._types=[])};Or.supportedEntryTypes=["mark","measure","resource","navigation"],Or.prototype.observe=function(t){this._types=t.entryTypes??(t.type?[t.type]:[])},Or.prototype.disconnect=function(){this._types=[]},Or.prototype.takeRecords=function(){return[]};const Ki=function(){this&&(this.min=0,this.max=0,this.mean=0,this.stddev=0,this.percentiles=new Map,this.exceeds=0)};Ki.prototype.reset=function(){this.min=0,this.max=0,this.mean=0,this.stddev=0,this.percentiles.clear(),this.exceeds=0},Ki.prototype.percentile=function(t){return this.percentiles.get(t)??0};function Zg(){return new Ki}function Xg(e){return new Ki}Object.freeze(Object.defineProperty({__proto__:null,PerformanceObserver:Or,TimingHistogram:Ki,createHistogram:Zg,default:{performance:Yg,PerformanceObserver:Or,createHistogram:Zg,monitorEventLoopDelay:Xg},monitorEventLoopDelay:Xg,performance:Yg},Symbol.toStringTag,{value:"Module"}));let Jg=!0,Qg=null,ey=null,ty=0,Hc=null;function ny(e){Hc=e}let nk=1;const Fn=function(){this&&ne.call(this)};Object.setPrototypeOf(Fn.prototype,ne.prototype),Fn.prototype.postMessage=function(t,n){},Fn.prototype.start=function(){},Fn.prototype.close=function(){},Fn.prototype.ref=function(){},Fn.prototype.unref=function(){};const sy=function(){if(!this)return;this.port1=new Fn,this.port2=new Fn;const t=this.port1,n=this.port2;t.postMessage=s=>{queueMicrotask(()=>n.emit("message",s))},n.postMessage=s=>{queueMicrotask(()=>t.emit("message",s))}},ys=function(t,n){var s,r;if(!this)return;ne.call(this),this.threadId=nk++,this.resourceLimits={},this._handle=null,this._terminated=!1,this._isReffed=!1;const o=typeof t=="string"?t:t.href,c=this;if(!Hc){queueMicrotask(()=>{c.emit("error",new Error("[Nodepod] worker_threads.Worker requires worker mode. Ensure the process is running in a worker context."))});return}const d=(n==null?void 0:n.workerData)??null,p=!!(n!=null&&n.eval),y=n!=null&&n.env&&typeof n.env!="symbol"?n.env:{},g=Hc(o,{workerData:d,threadId:this.threadId,isEval:p,cwd:((r=(s=globalThis.process)==null?void 0:s.cwd)==null?void 0:r.call(s))??"/",env:y,onMessage:x=>{c.emit("message",x)},onError:x=>{c.emit("error",x)},onExit:x=>{c._isReffed&&(c._isReffed=!1,An()),c._terminated=!0,c.emit("exit",x)},onStdout:x=>{var k,C;const T=(C=(k=globalThis.process)==null?void 0:k.stdout)==null?void 0:C.write;typeof T=="function"&&T.call(globalThis.process.stdout,x)},onStderr:x=>{var k,C;const T=(C=(k=globalThis.process)==null?void 0:k.stderr)==null?void 0:C.write;typeof T=="function"&&T.call(globalThis.process.stderr,x)}});this._handle=g,this._isReffed=!0,ls(),queueMicrotask(()=>{c._terminated||c.emit("online")})};Object.setPrototypeOf(ys.prototype,ne.prototype),ys.prototype.postMessage=function(t,n){this._handle&&!this._terminated&&this._handle.postMessage(t)},ys.prototype.terminate=function(){return this._handle&&!this._terminated&&(this._isReffed&&(this._isReffed=!1,An()),this._terminated=!0,this._handle.terminate()),Promise.resolve(0)},ys.prototype.ref=function(){return!this._isReffed&&!this._terminated&&(this._isReffed=!0,ls()),this},ys.prototype.unref=function(){return this._isReffed&&(this._isReffed=!1,An()),this},ys.prototype.getHeapSnapshot=function(){return Promise.resolve({})};const Hs=function(t){this&&(ne.call(this),this.name=t)};Object.setPrototypeOf(Hs.prototype,ne.prototype),Hs.prototype.postMessage=function(t){},Hs.prototype.close=function(){},Hs.prototype.ref=function(){},Hs.prototype.unref=function(){};function ry(e,t){return e}function iy(e){}const ay=Symbol.for("nodejs.worker_threads.SHARE_ENV");function oy(e){}function ly(e){}function cy(e,t){}Object.freeze(Object.defineProperty({__proto__:null,BroadcastChannel:Hs,MessageChannel:sy,MessagePort:Fn,SHARE_ENV:ay,Worker:ys,default:{isMainThread:Jg,parentPort:Qg,workerData:ey,threadId:ty,Worker:ys,MessageChannel:sy,MessagePort:Fn,BroadcastChannel:Hs,moveMessagePortToContext:ry,receiveMessageOnPort:iy,SHARE_ENV:ay,markAsUntransferable:oy,getEnvironmentData:ly,setEnvironmentData:cy,setWorkerThreadForkCallback:ny},getEnvironmentData:ly,isMainThread:Jg,markAsUntransferable:oy,moveMessagePortToContext:ry,parentPort:Qg,receiveMessageOnPort:iy,setEnvironmentData:cy,setWorkerThreadForkCallback:ny,threadId:ty,workerData:ey},Symbol.toStringTag,{value:"Module"}));var sk=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],uy=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],rk="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",dy="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Wc={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},zc="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",ik={5:zc,"5module":zc+" export import",6:zc+" const class extends export import super"},ak=/^in(stanceof)?$/,ok=new RegExp("["+dy+"]"),lk=new RegExp("["+dy+rk+"]");function qc(e,t){for(var n=65536,s=0;s<t.length;s+=2){if(n+=t[s],n>e)return!1;if(n+=t[s+1],n>=e)return!0}return!1}function Sn(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&ok.test(String.fromCharCode(e)):t===!1?!1:qc(e,uy)}function es(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&lk.test(String.fromCharCode(e)):t===!1?!1:qc(e,uy)||qc(e,sk)}var $e=function(t,n){n===void 0&&(n={}),this.label=t,this.keyword=n.keyword,this.beforeExpr=!!n.beforeExpr,this.startsExpr=!!n.startsExpr,this.isLoop=!!n.isLoop,this.isAssign=!!n.isAssign,this.prefix=!!n.prefix,this.postfix=!!n.postfix,this.binop=n.binop||null,this.updateContext=null};function cn(e,t){return new $e(e,{beforeExpr:!0,binop:t})}var un={beforeExpr:!0},Vt={startsExpr:!0},co={};function Me(e,t){return t===void 0&&(t={}),t.keyword=e,co[e]=new $e(e,t)}var S={num:new $e("num",Vt),regexp:new $e("regexp",Vt),string:new $e("string",Vt),name:new $e("name",Vt),privateId:new $e("privateId",Vt),eof:new $e("eof"),bracketL:new $e("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new $e("]"),braceL:new $e("{",{beforeExpr:!0,startsExpr:!0}),braceR:new $e("}"),parenL:new $e("(",{beforeExpr:!0,startsExpr:!0}),parenR:new $e(")"),comma:new $e(",",un),semi:new $e(";",un),colon:new $e(":",un),dot:new $e("."),question:new $e("?",un),questionDot:new $e("?."),arrow:new $e("=>",un),template:new $e("template"),invalidTemplate:new $e("invalidTemplate"),ellipsis:new $e("...",un),backQuote:new $e("`",Vt),dollarBraceL:new $e("${",{beforeExpr:!0,startsExpr:!0}),eq:new $e("=",{beforeExpr:!0,isAssign:!0}),assign:new $e("_=",{beforeExpr:!0,isAssign:!0}),incDec:new $e("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new $e("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:cn("||",1),logicalAND:cn("&&",2),bitwiseOR:cn("|",3),bitwiseXOR:cn("^",4),bitwiseAND:cn("&",5),equality:cn("==/!=/===/!==",6),relational:cn("</>/<=/>=",7),bitShift:cn("<</>>/>>>",8),plusMin:new $e("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:cn("%",10),star:cn("*",10),slash:cn("/",10),starstar:new $e("**",{beforeExpr:!0}),coalesce:cn("??",1),_break:Me("break"),_case:Me("case",un),_catch:Me("catch"),_continue:Me("continue"),_debugger:Me("debugger"),_default:Me("default",un),_do:Me("do",{isLoop:!0,beforeExpr:!0}),_else:Me("else",un),_finally:Me("finally"),_for:Me("for",{isLoop:!0}),_function:Me("function",Vt),_if:Me("if"),_return:Me("return",un),_switch:Me("switch"),_throw:Me("throw",un),_try:Me("try"),_var:Me("var"),_const:Me("const"),_while:Me("while",{isLoop:!0}),_with:Me("with"),_new:Me("new",{beforeExpr:!0,startsExpr:!0}),_this:Me("this",Vt),_super:Me("super",Vt),_class:Me("class",Vt),_extends:Me("extends",un),_export:Me("export"),_import:Me("import",Vt),_null:Me("null",Vt),_true:Me("true",Vt),_false:Me("false",Vt),_in:Me("in",{beforeExpr:!0,binop:7}),_instanceof:Me("instanceof",{beforeExpr:!0,binop:7}),_typeof:Me("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Me("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Me("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Bt=/\r\n?|\n|\u2028|\u2029/,hy=new RegExp(Bt.source,"g");function Ws(e){return e===10||e===13||e===8232||e===8233}function py(e,t,n){n===void 0&&(n=e.length);for(var s=t;s<n;s++){var r=e.charCodeAt(s);if(Ws(r))return s<n-1&&r===13&&e.charCodeAt(s+1)===10?s+2:s+1}return-1}var Gc=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Tt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,fy=Object.prototype,ck=fy.hasOwnProperty,uk=fy.toString,Nr=Object.hasOwn||function(e,t){return ck.call(e,t)},my=Array.isArray||function(e){return uk.call(e)==="[object Array]"},gy=Object.create(null);function _s(e){return gy[e]||(gy[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function ts(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var dk=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Br=function(t,n){this.line=t,this.column=n};Br.prototype.offset=function(t){return new Br(this.line,this.column+t)};var Yi=function(t,n,s){this.start=n,this.end=s,t.sourceFile!==null&&(this.source=t.sourceFile)};function Kc(e,t){for(var n=1,s=0;;){var r=py(e,s,t);if(r<0)return new Br(n,t-s);++n,s=r}}var uo={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},yy=!1;function hk(e){var t={};for(var n in uo)t[n]=e&&Nr(e,n)?e[n]:uo[n];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!yy&&typeof console=="object"&&console.warn&&(yy=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
85
- Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),my(t.onToken)){var s=t.onToken;t.onToken=function(r){return s.push(r)}}return my(t.onComment)&&(t.onComment=pk(t,t.onComment)),t}function pk(e,t){return function(n,s,r,o,c,d){var p={type:n?"Block":"Line",value:s,start:r,end:o};e.locations&&(p.loc=new Yi(this,c,d)),e.ranges&&(p.range=[r,o]),t.push(p)}}var Zi=1,Lr=2,Yc=4,_y=8,Zc=16,by=32,ho=64,vy=128,zs=256,Xi=512,po=Zi|Lr|zs;function Xc(e,t){return Lr|(e?Yc:0)|(t?_y:0)}var fo=0,Jc=1,ns=2,wy=3,Sy=4,xy=5,nt=function(t,n,s){this.options=t=hk(t),this.sourceFile=t.sourceFile,this.keywords=_s(ik[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var r="";t.allowReserved!==!0&&(r=Wc[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(r+=" await")),this.reservedWords=_s(r);var o=(r?r+" ":"")+Wc.strict;this.reservedWordsStrict=_s(o),this.reservedWordsStrictBind=_s(o+" "+Wc.strictBind),this.input=String(n),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf(`
86
- `,s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Bt).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=S.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Zi),this.regexpState=null,this.privateNameStack=[]},$n={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};nt.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)},$n.inFunction.get=function(){return(this.currentVarScope().flags&Lr)>0},$n.inGenerator.get=function(){return(this.currentVarScope().flags&_y)>0},$n.inAsync.get=function(){return(this.currentVarScope().flags&Yc)>0},$n.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(zs|Xi))return!1;if(n&Lr)return(n&Yc)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},$n.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&ho)>0||this.options.allowSuperOutsideMethod},$n.allowDirectSuper.get=function(){return(this.currentThisScope().flags&vy)>0},$n.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},$n.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(zs|Xi)||n&Lr&&!(n&Zc))return!0}return!1},$n.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&zs)>0},nt.extend=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];for(var s=this,r=0;r<t.length;r++)s=t[r](s);return s},nt.parse=function(t,n){return new this(n,t).parse()},nt.parseExpressionAt=function(t,n,s){var r=new this(s,t,n);return r.nextToken(),r.parseExpression()},nt.tokenizer=function(t,n){return new this(n,t)},Object.defineProperties(nt.prototype,$n);var Lt=nt.prototype,fk=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Lt.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){Tt.lastIndex=e,e+=Tt.exec(this.input)[0].length;var t=fk.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){Tt.lastIndex=e+t[0].length;var n=Tt.exec(this.input),s=n.index+n[0].length,r=this.input.charAt(s);return r===";"||r==="}"||Bt.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="=")}e+=t[0].length,Tt.lastIndex=e,e+=Tt.exec(this.input)[0].length,this.input[e]===";"&&e++}},Lt.eat=function(e){return this.type===e?(this.next(),!0):!1},Lt.isContextual=function(e){return this.type===S.name&&this.value===e&&!this.containsEsc},Lt.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},Lt.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Lt.canInsertSemicolon=function(){return this.type===S.eof||this.type===S.braceR||Bt.test(this.input.slice(this.lastTokEnd,this.start))},Lt.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Lt.semicolon=function(){!this.eat(S.semi)&&!this.insertSemicolon()&&this.unexpected()},Lt.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Lt.expect=function(e){this.eat(e)||this.unexpected()},Lt.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var mo=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Lt.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?"Assigning to rvalue":"Parenthesized pattern")}},Lt.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,s=e.doubleProto;if(!t)return n>=0||s>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")},Lt.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},Lt.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var he=nt.prototype;he.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==S.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var s=0,r=Object.keys(this.undefinedExports);s<r.length;s+=1){var o=r[s];this.raiseRecoverable(this.undefinedExports[o].start,"Export '"+o+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var Qc={kind:"loop"},mk={kind:"switch"};he.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Tt.lastIndex=this.pos;var t=Tt.exec(this.input),n=this.pos+t[0].length,s=this.input.charCodeAt(n);if(s===91||s===92)return!0;if(e)return!1;if(s===123||s>55295&&s<56320)return!0;if(Sn(s,!0)){for(var r=n+1;es(s=this.input.charCodeAt(r),!0);)++r;if(s===92||s>55295&&s<56320)return!0;var o=this.input.slice(n,r);if(!ak.test(o))return!0}return!1},he.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Tt.lastIndex=this.pos;var e=Tt.exec(this.input),t=this.pos+e[0].length,n;return!Bt.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(es(n=this.input.charCodeAt(t+8))||n>55295&&n<56320))},he.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;Tt.lastIndex=this.pos;var n=Tt.exec(this.input),s=this.pos+n[0].length;if(Bt.test(this.input.slice(this.pos,s)))return!1;if(e){var r=s+5,o;if(this.input.slice(s,r)!=="using"||r===this.input.length||es(o=this.input.charCodeAt(r))||o>55295&&o<56320)return!1;Tt.lastIndex=r;var c=Tt.exec(this.input);if(c&&Bt.test(this.input.slice(r,r+c[0].length)))return!1}if(t){var d=s+2,p;if(this.input.slice(s,d)==="of"&&(d===this.input.length||!es(p=this.input.charCodeAt(d))&&!(p>55295&&p<56320)))return!1}var y=this.input.charCodeAt(s);return Sn(y,!0)||y===92},he.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},he.isUsing=function(e){return this.isUsingKeyword(!1,e)},he.parseStatement=function(e,t,n){var s=this.type,r=this.startNode(),o;switch(this.isLet(e)&&(s=S._var,o="let"),s){case S._break:case S._continue:return this.parseBreakContinueStatement(r,s.keyword);case S._debugger:return this.parseDebuggerStatement(r);case S._do:return this.parseDoStatement(r);case S._for:return this.parseForStatement(r);case S._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case S._class:return e&&this.unexpected(),this.parseClass(r,!0);case S._if:return this.parseIfStatement(r);case S._return:return this.parseReturnStatement(r);case S._switch:return this.parseSwitchStatement(r);case S._throw:return this.parseThrowStatement(r);case S._try:return this.parseTryStatement(r);case S._const:case S._var:return o=o||this.value,e&&o!=="var"&&this.unexpected(),this.parseVarStatement(r,o);case S._while:return this.parseWhileStatement(r);case S._with:return this.parseWithStatement(r);case S.braceL:return this.parseBlock(!0,r);case S.semi:return this.parseEmptyStatement(r);case S._export:case S._import:if(this.options.ecmaVersion>10&&s===S._import){Tt.lastIndex=this.pos;var c=Tt.exec(this.input),d=this.pos+c[0].length,p=this.input.charCodeAt(d);if(p===40||p===46)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===S._import?this.parseImport(r):this.parseExport(r,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);var y=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(y)return t&&this.options.sourceType==="script"&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),y==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(r,!1,y),this.semicolon(),this.finishNode(r,"VariableDeclaration");var g=this.value,x=this.parseExpression();return s===S.name&&x.type==="Identifier"&&this.eat(S.colon)?this.parseLabeledStatement(r,g,x,e):this.parseExpressionStatement(r,x)}},he.parseBreakContinueStatement=function(e,t){var n=t==="break";this.next(),this.eat(S.semi)||this.insertSemicolon()?e.label=null:this.type!==S.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var s=0;s<this.labels.length;++s){var r=this.labels[s];if((e.label==null||r.name===e.label.name)&&(r.kind!=null&&(n||r.kind==="loop")||e.label&&n))break}return s===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,n?"BreakStatement":"ContinueStatement")},he.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},he.parseDoStatement=function(e){return this.next(),this.labels.push(Qc),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(S._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(S.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},he.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Qc),this.enterScope(0),this.expect(S.parenL),this.type===S.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===S._var||this.type===S._const||n){var s=this.startNode(),r=n?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),this.parseForAfterInit(e,s,t)}var o=this.isContextual("let"),c=!1,d=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(d){var p=this.startNode();return this.next(),d==="await using"&&this.next(),this.parseVar(p,!0,d),this.finishNode(p,"VariableDeclaration"),this.parseForAfterInit(e,p,t)}var y=this.containsEsc,g=new mo,x=this.start,k=t>-1?this.parseExprSubscripts(g,"await"):this.parseExpression(!0,g);return this.type===S._in||(c=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===S._in&&this.unexpected(t),e.await=!0):c&&this.options.ecmaVersion>=8&&(k.start===x&&!y&&k.type==="Identifier"&&k.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),o&&c&&this.raise(k.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(k,!1,g),this.checkLValPattern(k),this.parseForIn(e,k)):(this.checkExpressionErrors(g,!0),t>-1&&this.unexpected(t),this.parseFor(e,k))},he.parseForAfterInit=function(e,t,n){return(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===S._in?n>-1&&this.unexpected(n):e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},he.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Ji|(n?0:eu),!1,t)},he.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(S._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},he.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(S.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},he.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(S.braceL),this.labels.push(mk),this.enterScope(0);for(var t,n=!1;this.type!==S.braceR;)if(this.type===S._case||this.type===S._default){var s=this.type===S._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),s?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect(S.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},he.parseThrowStatement=function(e){return this.next(),Bt.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var gk=[];he.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?by:0),this.checkLValPattern(e,t?Sy:ns),this.expect(S.parenR),e},he.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===S._catch){var t=this.startNode();this.next(),this.eat(S.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(S._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},he.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,"VariableDeclaration")},he.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Qc),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},he.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},he.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},he.parseLabeledStatement=function(e,t,n,s){for(var r=0,o=this.labels;r<o.length;r+=1){var c=o[r];c.name===t&&this.raise(n.start,"Label '"+t+"' is already declared")}for(var d=this.type.isLoop?"loop":this.type===S._switch?"switch":null,p=this.labels.length-1;p>=0;p--){var y=this.labels[p];if(y.statementStart===e.start)y.statementStart=this.start,y.kind=d;else break}return this.labels.push({name:t,kind:d,statementStart:this.start}),e.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},he.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},he.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(S.braceL),e&&this.enterScope(0);this.type!==S.braceR;){var s=this.parseStatement(null);t.body.push(s)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},he.parseFor=function(e,t){return e.init=t,this.expect(S.semi),e.test=this.type===S.semi?null:this.parseExpression(),this.expect(S.semi),e.update=this.type===S.parenR?null:this.parseExpression(),this.expect(S.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},he.parseForIn=function(e,t){var n=this.type===S._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(S.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")},he.parseVar=function(e,t,n,s){for(e.declarations=[],e.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(S.eq)?r.init=this.parseMaybeAssign(t):!s&&n==="const"&&!(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&(n==="using"||n==="await using")&&this.options.ecmaVersion>=17&&this.type!==S._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+n+" declaration"):!s&&r.id.type!=="Identifier"&&!(t&&(this.type===S._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(S.comma))break}return e},he.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Jc:ns,!1)};var Ji=1,eu=2,Ey=4;he.parseFunction=function(e,t,n,s,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===S.star&&t&eu&&this.unexpected(),e.generator=this.eat(S.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&Ji&&(e.id=t&Ey&&this.type!==S.name?null:this.parseIdent(),e.id&&!(t&eu)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Jc:ns:wy));var o=this.yieldPos,c=this.awaitPos,d=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Xc(e.async,e.generator)),t&Ji||(e.id=this.type===S.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,r),this.yieldPos=o,this.awaitPos=c,this.awaitIdentPos=d,this.finishNode(e,t&Ji?"FunctionDeclaration":"FunctionExpression")},he.parseFunctionParams=function(e){this.expect(S.parenL),e.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},he.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var s=this.enterClassBody(),r=this.startNode(),o=!1;for(r.body=[],this.expect(S.braceL);this.type!==S.braceR;){var c=this.parseClassElement(e.superClass!==null);c&&(r.body.push(c),c.type==="MethodDefinition"&&c.kind==="constructor"?(o&&this.raiseRecoverable(c.start,"Duplicate constructor in the same class"),o=!0):c.key&&c.key.type==="PrivateIdentifier"&&yk(s,c)&&this.raiseRecoverable(c.key.start,"Identifier '#"+c.key.name+"' has already been declared"))}return this.strict=n,this.next(),e.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},he.parseClassElement=function(e){if(this.eat(S.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),s="",r=!1,o=!1,c="method",d=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(S.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===S.star?d=!0:s="static"}if(n.static=d,!s&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===S.star)&&!this.canInsertSemicolon()?o=!0:s="async"),!s&&(t>=9||!o)&&this.eat(S.star)&&(r=!0),!s&&!o&&!r){var p=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?c=p:s=p)}if(s?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=s,this.finishNode(n.key,"Identifier")):this.parseClassElementName(n),t<13||this.type===S.parenL||c!=="method"||r||o){var y=!n.static&&go(n,"constructor"),g=y&&e;y&&c!=="method"&&this.raise(n.key.start,"Constructor can't have get/set modifier"),n.kind=y?"constructor":c,this.parseClassMethod(n,r,o,g)}else this.parseClassField(n);return n},he.isClassElementNameStart=function(){return this.type===S.name||this.type===S.privateId||this.type===S.num||this.type===S.string||this.type===S.bracketL||this.type.keyword},he.parseClassElementName=function(e){this.type===S.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},he.parseClassMethod=function(e,t,n,s){var r=e.key;e.kind==="constructor"?(t&&this.raise(r.start,"Constructor can't be a generator"),n&&this.raise(r.start,"Constructor can't be an async method")):e.static&&go(e,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");var o=e.value=this.parseMethod(t,n,s);return e.kind==="get"&&o.params.length!==0&&this.raiseRecoverable(o.start,"getter should have no params"),e.kind==="set"&&o.params.length!==1&&this.raiseRecoverable(o.start,"setter should have exactly one param"),e.kind==="set"&&o.params[0].type==="RestElement"&&this.raiseRecoverable(o.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},he.parseClassField=function(e){return go(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&go(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(S.eq)?(this.enterScope(Xi|ho),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},he.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(zs|ho);this.type!==S.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},he.parseClassId=function(e,t){this.type===S.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,ns,!1)):(t===!0&&this.unexpected(),e.id=null)},he.parseClassSuper=function(e){e.superClass=this.eat(S._extends)?this.parseExprSubscripts(null,!1):null},he.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},he.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var s=this.privateNameStack.length,r=s===0?null:this.privateNameStack[s-1],o=0;o<n.length;++o){var c=n[o];Nr(t,c.name)||(r?r.used.push(c):this.raiseRecoverable(c.start,"Private field '#"+c.name+"' must be declared in an enclosing class"))}};function yk(e,t){var n=t.key.name,s=e[n],r="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(r=(t.static?"s":"i")+t.kind),s==="iget"&&r==="iset"||s==="iset"&&r==="iget"||s==="sget"&&r==="sset"||s==="sset"&&r==="sget"?(e[n]="true",!1):s?!0:(e[n]=r,!1)}function go(e,t){var n=e.computed,s=e.key;return!n&&(s.type==="Identifier"&&s.name===t||s.type==="Literal"&&s.value===t)}he.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==S.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},he.parseExport=function(e,t){if(this.next(),this.eat(S.star))return this.parseExportAllDeclaration(e,t);if(this.eat(S._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==S.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,s=e.specifiers;n<s.length;n+=1){var r=s[n];this.checkUnreserved(r.local),this.checkLocalExport(r.local),r.local.type==="Literal"&&this.raise(r.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},he.parseExportDeclaration=function(e){return this.parseStatement(null)},he.parseExportDefaultDeclaration=function(){var e;if(this.type===S._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Ji|Ey,!1,e)}else if(this.type===S._class){var n=this.startNode();return this.parseClass(n,"nullableID")}else{var s=this.parseMaybeAssign();return this.semicolon(),s}},he.checkExport=function(e,t,n){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),Nr(e,t)&&this.raiseRecoverable(n,"Duplicate export '"+t+"'"),e[t]=!0)},he.checkPatternExport=function(e,t){var n=t.type;if(n==="Identifier")this.checkExport(e,t,t.start);else if(n==="ObjectPattern")for(var s=0,r=t.properties;s<r.length;s+=1){var o=r[s];this.checkPatternExport(e,o)}else if(n==="ArrayPattern")for(var c=0,d=t.elements;c<d.length;c+=1){var p=d[c];p&&this.checkPatternExport(e,p)}else n==="Property"?this.checkPatternExport(e,t.value):n==="AssignmentPattern"?this.checkPatternExport(e,t.left):n==="RestElement"&&this.checkPatternExport(e,t.argument)},he.checkVariableExport=function(e,t){if(e)for(var n=0,s=t;n<s.length;n+=1){var r=s[n];this.checkPatternExport(e,r.id)}},he.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},he.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},he.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(S.braceL);!this.eat(S.braceR);){if(n)n=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;t.push(this.parseExportSpecifier(e))}return t},he.parseImport=function(e){return this.next(),this.type===S.string?(e.specifiers=gk,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===S.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},he.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,ns),this.finishNode(e,"ImportSpecifier")},he.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,ns),this.finishNode(e,"ImportDefaultSpecifier")},he.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,ns),this.finishNode(e,"ImportNamespaceSpecifier")},he.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===S.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(S.comma)))return e;if(this.type===S.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(S.braceL);!this.eat(S.braceR);){if(t)t=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;e.push(this.parseImportSpecifier())}return e},he.parseWithClause=function(){var e=[];if(!this.eat(S._with))return e;this.expect(S.braceL);for(var t={},n=!0;!this.eat(S.braceR);){if(n)n=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;var s=this.parseImportAttribute(),r=s.key.type==="Identifier"?s.key.name:s.key.value;Nr(t,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),t[r]=!0,e.push(s)}return e},he.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===S.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(S.colon),this.type!==S.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},he.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===S.string){var e=this.parseLiteral(this.value);return dk.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},he.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},he.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var dn=nt.prototype;dn.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var s=0,r=e.properties;s<r.length;s+=1){var o=r[s];this.toAssignable(o,t),o.type==="RestElement"&&(o.argument.type==="ArrayPattern"||o.argument.type==="ObjectPattern")&&this.raise(o.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,n);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else n&&this.checkPatternErrors(n,!0);return e},dn.toAssignableList=function(e,t){for(var n=e.length,s=0;s<n;s++){var r=e[s];r&&this.toAssignable(r,t)}if(n){var o=e[n-1];this.options.ecmaVersion===6&&t&&o&&o.type==="RestElement"&&o.argument.type!=="Identifier"&&this.unexpected(o.argument.start)}return e},dn.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},dn.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==S.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},dn.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case S.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(S.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case S.braceL:return this.parseObj(!0)}return this.parseIdent()},dn.parseBindingList=function(e,t,n,s){for(var r=[],o=!0;!this.eat(e);)if(o?o=!1:this.expect(S.comma),t&&this.type===S.comma)r.push(null);else{if(n&&this.afterTrailingComma(e))break;if(this.type===S.ellipsis){var c=this.parseRestBinding();this.parseBindingListItem(c),r.push(c),this.type===S.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else r.push(this.parseAssignableListItem(s))}return r},dn.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},dn.parseBindingListItem=function(e){return e},dn.parseMaybeDefault=function(e,t,n){if(n=n||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(S.eq))return n;var s=this.startNodeAt(e,t);return s.left=n,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")},dn.checkLValSimple=function(e,t,n){t===void 0&&(t=fo);var s=t!==fo;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(s?"Binding ":"Assigning to ")+e.name+" in strict mode"),s&&(t===ns&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),n&&(Nr(n,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),n[e.name]=!0),t!==xy&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":s&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return s&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(s?"Binding":"Assigning to")+" rvalue")}},dn.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=fo),e.type){case"ObjectPattern":for(var s=0,r=e.properties;s<r.length;s+=1){var o=r[s];this.checkLValInnerPattern(o,t,n)}break;case"ArrayPattern":for(var c=0,d=e.elements;c<d.length;c+=1){var p=d[c];p&&this.checkLValInnerPattern(p,t,n)}break;default:this.checkLValSimple(e,t,n)}},dn.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=fo),e.type){case"Property":this.checkLValInnerPattern(e.value,t,n);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,n);break;case"RestElement":this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var hn=function(t,n,s,r,o){this.token=t,this.isExpr=!!n,this.preserveSpace=!!s,this.override=r,this.generator=!!o},Ge={b_stat:new hn("{",!1),b_expr:new hn("{",!0),b_tmpl:new hn("${",!1),p_stat:new hn("(",!1),p_expr:new hn("(",!0),q_tmpl:new hn("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new hn("function",!1),f_expr:new hn("function",!0),f_expr_gen:new hn("function",!0,!1,null,!0),f_gen:new hn("function",!1,!1,null,!0)},Mr=nt.prototype;Mr.initialContext=function(){return[Ge.b_stat]},Mr.curContext=function(){return this.context[this.context.length-1]},Mr.braceIsBlock=function(e){var t=this.curContext();return t===Ge.f_expr||t===Ge.f_stat?!0:e===S.colon&&(t===Ge.b_stat||t===Ge.b_expr)?!t.isExpr:e===S._return||e===S.name&&this.exprAllowed?Bt.test(this.input.slice(this.lastTokEnd,this.start)):e===S._else||e===S.semi||e===S.eof||e===S.parenR||e===S.arrow?!0:e===S.braceL?t===Ge.b_stat:e===S._var||e===S._const||e===S.name?!1:!this.exprAllowed},Mr.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1},Mr.updateContext=function(e){var t,n=this.type;n.keyword&&e===S.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},Mr.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},S.parenR.updateContext=S.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===Ge.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},S.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Ge.b_stat:Ge.b_expr),this.exprAllowed=!0},S.dollarBraceL.updateContext=function(){this.context.push(Ge.b_tmpl),this.exprAllowed=!0},S.parenL.updateContext=function(e){var t=e===S._if||e===S._for||e===S._with||e===S._while;this.context.push(t?Ge.p_stat:Ge.p_expr),this.exprAllowed=!0},S.incDec.updateContext=function(){},S._function.updateContext=S._class.updateContext=function(e){e.beforeExpr&&e!==S._else&&!(e===S.semi&&this.curContext()!==Ge.p_stat)&&!(e===S._return&&Bt.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===S.colon||e===S.braceL)&&this.curContext()===Ge.b_stat)?this.context.push(Ge.f_expr):this.context.push(Ge.f_stat),this.exprAllowed=!1},S.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},S.backQuote.updateContext=function(){this.curContext()===Ge.q_tmpl?this.context.pop():this.context.push(Ge.q_tmpl),this.exprAllowed=!1},S.star.updateContext=function(e){if(e===S._function){var t=this.context.length-1;this.context[t]===Ge.f_expr?this.context[t]=Ge.f_expr_gen:this.context[t]=Ge.f_gen}this.exprAllowed=!0},S.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==S.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var ve=nt.prototype;ve.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var s=e.key,r;switch(s.type){case"Identifier":r=s.name;break;case"Literal":r=String(s.value);break;default:return}var o=e.kind;if(this.options.ecmaVersion>=6){r==="__proto__"&&o==="init"&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),t.proto=!0);return}r="$"+r;var c=t[r];if(c){var d;o==="init"?d=this.strict&&c.init||c.get||c.set:d=c.init||c[o],d&&this.raiseRecoverable(s.start,"Redefinition of property")}else c=t[r]={init:!1,get:!1,set:!1};c[o]=!0}},ve.parseExpression=function(e,t){var n=this.start,s=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===S.comma){var o=this.startNodeAt(n,s);for(o.expressions=[r];this.eat(S.comma);)o.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(o,"SequenceExpression")}return r},ve.parseMaybeAssign=function(e,t,n){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var s=!1,r=-1,o=-1,c=-1;t?(r=t.parenthesizedAssign,o=t.trailingComma,c=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new mo,s=!0);var d=this.start,p=this.startLoc;(this.type===S.parenL||this.type===S.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var y=this.parseMaybeConditional(e,t);if(n&&(y=n.call(this,y,d,p)),this.type.isAssign){var g=this.startNodeAt(d,p);return g.operator=this.value,this.type===S.eq&&(y=this.toAssignable(y,!1,t)),s||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=y.start&&(t.shorthandAssign=-1),this.type===S.eq?this.checkLValPattern(y):this.checkLValSimple(y),g.left=y,this.next(),g.right=this.parseMaybeAssign(e),c>-1&&(t.doubleProto=c),this.finishNode(g,"AssignmentExpression")}else s&&this.checkExpressionErrors(t,!0);return r>-1&&(t.parenthesizedAssign=r),o>-1&&(t.trailingComma=o),y},ve.parseMaybeConditional=function(e,t){var n=this.start,s=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(this.eat(S.question)){var o=this.startNodeAt(n,s);return o.test=r,o.consequent=this.parseMaybeAssign(),this.expect(S.colon),o.alternate=this.parseMaybeAssign(e),this.finishNode(o,"ConditionalExpression")}return r},ve.parseExprOps=function(e,t){var n=this.start,s=this.startLoc,r=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||r.start===n&&r.type==="ArrowFunctionExpression"?r:this.parseExprOp(r,n,s,-1,e)},ve.parseExprOp=function(e,t,n,s,r){var o=this.type.binop;if(o!=null&&(!r||this.type!==S._in)&&o>s){var c=this.type===S.logicalOR||this.type===S.logicalAND,d=this.type===S.coalesce;d&&(o=S.logicalAND.binop);var p=this.value;this.next();var y=this.start,g=this.startLoc,x=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),y,g,o,r),k=this.buildBinary(t,n,e,x,p,c||d);return(c&&this.type===S.coalesce||d&&(this.type===S.logicalOR||this.type===S.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(k,t,n,s,r)}return e},ve.buildBinary=function(e,t,n,s,r,o){s.type==="PrivateIdentifier"&&this.raise(s.start,"Private identifier can only be left side of binary expression");var c=this.startNodeAt(e,t);return c.left=n,c.operator=r,c.right=s,this.finishNode(c,o?"LogicalExpression":"BinaryExpression")},ve.parseMaybeUnary=function(e,t,n,s){var r=this.start,o=this.startLoc,c;if(this.isContextual("await")&&this.canAwait)c=this.parseAwait(s),t=!0;else if(this.type.prefix){var d=this.startNode(),p=this.type===S.incDec;d.operator=this.value,d.prefix=!0,this.next(),d.argument=this.parseMaybeUnary(null,!0,p,s),this.checkExpressionErrors(e,!0),p?this.checkLValSimple(d.argument):this.strict&&d.operator==="delete"&&ky(d.argument)?this.raiseRecoverable(d.start,"Deleting local variable in strict mode"):d.operator==="delete"&&tu(d.argument)?this.raiseRecoverable(d.start,"Private fields can not be deleted"):t=!0,c=this.finishNode(d,p?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===S.privateId)(s||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),c=this.parsePrivateIdent(),this.type!==S._in&&this.unexpected();else{if(c=this.parseExprSubscripts(e,s),this.checkExpressionErrors(e))return c;for(;this.type.postfix&&!this.canInsertSemicolon();){var y=this.startNodeAt(r,o);y.operator=this.value,y.prefix=!1,y.argument=c,this.checkLValSimple(c),this.next(),c=this.finishNode(y,"UpdateExpression")}}if(!n&&this.eat(S.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(r,o,c,this.parseMaybeUnary(null,!1,!1,s),"**",!1);else return c};function ky(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&ky(e.expression)}function tu(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&tu(e.expression)||e.type==="ParenthesizedExpression"&&tu(e.expression)}ve.parseExprSubscripts=function(e,t){var n=this.start,s=this.startLoc,r=this.parseExprAtom(e,t);if(r.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return r;var o=this.parseSubscripts(r,n,s,!1,t);return e&&o.type==="MemberExpression"&&(e.parenthesizedAssign>=o.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=o.start&&(e.parenthesizedBind=-1),e.trailingComma>=o.start&&(e.trailingComma=-1)),o},ve.parseSubscripts=function(e,t,n,s,r){for(var o=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,c=!1;;){var d=this.parseSubscript(e,t,n,s,o,c,r);if(d.optional&&(c=!0),d===e||d.type==="ArrowFunctionExpression"){if(c){var p=this.startNodeAt(t,n);p.expression=d,d=this.finishNode(p,"ChainExpression")}return d}e=d}},ve.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(S.arrow)},ve.parseSubscriptAsyncArrow=function(e,t,n,s){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,s)},ve.parseSubscript=function(e,t,n,s,r,o,c){var d=this.options.ecmaVersion>=11,p=d&&this.eat(S.questionDot);s&&p&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var y=this.eat(S.bracketL);if(y||p&&this.type!==S.parenL&&this.type!==S.backQuote||this.eat(S.dot)){var g=this.startNodeAt(t,n);g.object=e,y?(g.property=this.parseExpression(),this.expect(S.bracketR)):this.type===S.privateId&&e.type!=="Super"?g.property=this.parsePrivateIdent():g.property=this.parseIdent(this.options.allowReserved!=="never"),g.computed=!!y,d&&(g.optional=p),e=this.finishNode(g,"MemberExpression")}else if(!s&&this.eat(S.parenL)){var x=new mo,k=this.yieldPos,C=this.awaitPos,T=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var L=this.parseExprList(S.parenR,this.options.ecmaVersion>=8,!1,x);if(r&&!p&&this.shouldParseAsyncArrow())return this.checkPatternErrors(x,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=k,this.awaitPos=C,this.awaitIdentPos=T,this.parseSubscriptAsyncArrow(t,n,L,c);this.checkExpressionErrors(x,!0),this.yieldPos=k||this.yieldPos,this.awaitPos=C||this.awaitPos,this.awaitIdentPos=T||this.awaitIdentPos;var V=this.startNodeAt(t,n);V.callee=e,V.arguments=L,d&&(V.optional=p),e=this.finishNode(V,"CallExpression")}else if(this.type===S.backQuote){(p||o)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var K=this.startNodeAt(t,n);K.tag=e,K.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(K,"TaggedTemplateExpression")}return e},ve.parseExprAtom=function(e,t,n){this.type===S.slash&&this.readRegexp();var s,r=this.potentialArrowAt===this.start;switch(this.type){case S._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),s=this.startNode(),this.next(),this.type===S.parenL&&!this.allowDirectSuper&&this.raise(s.start,"super() call outside constructor of a subclass"),this.type!==S.dot&&this.type!==S.bracketL&&this.type!==S.parenL&&this.unexpected(),this.finishNode(s,"Super");case S._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case S.name:var o=this.start,c=this.startLoc,d=this.containsEsc,p=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!d&&p.name==="async"&&!this.canInsertSemicolon()&&this.eat(S._function))return this.overrideContext(Ge.f_expr),this.parseFunction(this.startNodeAt(o,c),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(S.arrow))return this.parseArrowExpression(this.startNodeAt(o,c),[p],!1,t);if(this.options.ecmaVersion>=8&&p.name==="async"&&this.type===S.name&&!d&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return p=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(S.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(o,c),[p],!0,t)}return p;case S.regexp:var y=this.value;return s=this.parseLiteral(y.value),s.regex={pattern:y.pattern,flags:y.flags},s;case S.num:case S.string:return this.parseLiteral(this.value);case S._null:case S._true:case S._false:return s=this.startNode(),s.value=this.type===S._null?null:this.type===S._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case S.parenL:var g=this.start,x=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(x)&&(e.parenthesizedAssign=g),e.parenthesizedBind<0&&(e.parenthesizedBind=g)),x;case S.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(S.bracketR,!0,!0,e),this.finishNode(s,"ArrayExpression");case S.braceL:return this.overrideContext(Ge.b_expr),this.parseObj(!1,e);case S._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case S._class:return this.parseClass(this.startNode(),!1);case S._new:return this.parseNew();case S.backQuote:return this.parseTemplate();case S._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},ve.parseExprAtomDefault=function(){this.unexpected()},ve.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===S.parenL&&!e)return this.parseDynamicImport(t);if(this.type===S.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name="import",t.meta=this.finishNode(n,"Identifier"),this.parseImportMeta(t)}else this.unexpected()},ve.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(S.parenR)?e.options=null:(this.expect(S.comma),this.afterTrailingComma(S.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(S.parenR)||(this.expect(S.comma),this.afterTrailingComma(S.parenR)||this.unexpected())));else if(!this.eat(S.parenR)){var t=this.start;this.eat(S.comma)&&this.eat(S.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},ve.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},ve.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},ve.parseParenExpression=function(){this.expect(S.parenL);var e=this.parseExpression();return this.expect(S.parenR),e},ve.shouldParseArrow=function(e){return!this.canInsertSemicolon()},ve.parseParenAndDistinguishExpression=function(e,t){var n=this.start,s=this.startLoc,r,o=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var c=this.start,d=this.startLoc,p=[],y=!0,g=!1,x=new mo,k=this.yieldPos,C=this.awaitPos,T;for(this.yieldPos=0,this.awaitPos=0;this.type!==S.parenR;)if(y?y=!1:this.expect(S.comma),o&&this.afterTrailingComma(S.parenR,!0)){g=!0;break}else if(this.type===S.ellipsis){T=this.start,p.push(this.parseParenItem(this.parseRestBinding())),this.type===S.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else p.push(this.parseMaybeAssign(!1,x,this.parseParenItem));var L=this.lastTokEnd,V=this.lastTokEndLoc;if(this.expect(S.parenR),e&&this.shouldParseArrow(p)&&this.eat(S.arrow))return this.checkPatternErrors(x,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=k,this.awaitPos=C,this.parseParenArrowList(n,s,p,t);(!p.length||g)&&this.unexpected(this.lastTokStart),T&&this.unexpected(T),this.checkExpressionErrors(x,!0),this.yieldPos=k||this.yieldPos,this.awaitPos=C||this.awaitPos,p.length>1?(r=this.startNodeAt(c,d),r.expressions=p,this.finishNodeAt(r,"SequenceExpression",L,V)):r=p[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var K=this.startNodeAt(n,s);return K.expression=r,this.finishNode(K,"ParenthesizedExpression")}else return r},ve.parseParenItem=function(e){return e},ve.parseParenArrowList=function(e,t,n,s){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,s)};var _k=[];ve.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===S.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),n&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var s=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,r,!0,!1),this.eat(S.parenL)?e.arguments=this.parseExprList(S.parenR,this.options.ecmaVersion>=8,!1):e.arguments=_k,this.finishNode(e,"NewExpression")},ve.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===S.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value.replace(/\r\n?/g,`
87
- `),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
88
- `),cooked:this.value},this.next(),n.tail=this.type===S.backQuote,this.finishNode(n,"TemplateElement")},ve.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var s=this.parseTemplateElement({isTagged:t});for(n.quasis=[s];!s.tail;)this.type===S.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(S.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(S.braceR),n.quasis.push(s=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")},ve.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===S.name||this.type===S.num||this.type===S.string||this.type===S.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===S.star)&&!Bt.test(this.input.slice(this.lastTokEnd,this.start))},ve.parseObj=function(e,t){var n=this.startNode(),s=!0,r={};for(n.properties=[],this.next();!this.eat(S.braceR);){if(s)s=!1;else if(this.expect(S.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(S.braceR))break;var o=this.parseProperty(e,t);e||this.checkPropClash(o,r,t),n.properties.push(o)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")},ve.parseProperty=function(e,t){var n=this.startNode(),s,r,o,c;if(this.options.ecmaVersion>=9&&this.eat(S.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===S.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(n,"RestElement")):(n.argument=this.parseMaybeAssign(!1,t),this.type===S.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,"SpreadElement"));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(o=this.start,c=this.startLoc),e||(s=this.eat(S.star)));var d=this.containsEsc;return this.parsePropertyName(n),!e&&!d&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(n)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(S.star),this.parsePropertyName(n)):r=!1,this.parsePropertyValue(n,e,s,r,o,c,t,d),this.finishNode(n,"Property")},ve.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind==="get"?0:1;if(e.value.params.length!==n){var s=e.value.start;e.kind==="get"?this.raiseRecoverable(s,"getter should have no params"):this.raiseRecoverable(s,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},ve.parsePropertyValue=function(e,t,n,s,r,o,c,d){(n||s)&&this.type===S.colon&&this.unexpected(),this.eat(S.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,c),e.kind="init"):this.options.ecmaVersion>=6&&this.type===S.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,s),e.kind="init"):!t&&!d&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==S.comma&&this.type!==S.braceR&&this.type!==S.eq?((n||s)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((n||s)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),t?e.value=this.parseMaybeDefault(r,o,this.copyNode(e.key)):this.type===S.eq&&c?(c.shorthandAssign<0&&(c.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,o,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected()},ve.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(S.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(S.bracketR),e.key;e.computed=!1}return e.key=this.type===S.num||this.type===S.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},ve.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},ve.parseMethod=function(e,t,n){var s=this.startNode(),r=this.yieldPos,o=this.awaitPos,c=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=e),this.options.ecmaVersion>=8&&(s.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Xc(t,s.generator)|ho|(n?vy:0)),this.expect(S.parenL),s.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=o,this.awaitIdentPos=c,this.finishNode(s,"FunctionExpression")},ve.parseArrowExpression=function(e,t,n,s){var r=this.yieldPos,o=this.awaitPos,c=this.awaitIdentPos;return this.enterScope(Xc(n,!1)|Zc),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,s),this.yieldPos=r,this.awaitPos=o,this.awaitIdentPos=c,this.finishNode(e,"ArrowFunctionExpression")},ve.parseFunctionBody=function(e,t,n,s){var r=t&&this.type!==S.braceL,o=this.strict,c=!1;if(r)e.body=this.parseMaybeAssign(s),e.expression=!0,this.checkParams(e,!1);else{var d=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!o||d)&&(c=this.strictDirective(this.end),c&&d&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var p=this.labels;this.labels=[],c&&(this.strict=!0),this.checkParams(e,!o&&!c&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,xy),e.body=this.parseBlock(!1,void 0,c&&!o),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=p}this.exitScope()},ve.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1){var s=n[t];if(s.type!=="Identifier")return!1}return!0},ve.checkParams=function(e,t){for(var n=Object.create(null),s=0,r=e.params;s<r.length;s+=1){var o=r[s];this.checkLValInnerPattern(o,Jc,t?null:n)}},ve.parseExprList=function(e,t,n,s){for(var r=[],o=!0;!this.eat(e);){if(o)o=!1;else if(this.expect(S.comma),t&&this.afterTrailingComma(e))break;var c=void 0;n&&this.type===S.comma?c=null:this.type===S.ellipsis?(c=this.parseSpread(s),s&&this.type===S.comma&&s.trailingComma<0&&(s.trailingComma=this.start)):c=this.parseMaybeAssign(!1,s),r.push(c)}return r},ve.checkUnreserved=function(e){var t=e.start,n=e.end,s=e.name;if(this.inGenerator&&s==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&s==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&po)&&s==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(s==="arguments"||s==="await")&&this.raise(t,"Cannot use "+s+" in class static initialization block"),this.keywords.test(s)&&this.raise(t,"Unexpected keyword '"+s+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf("\\")!==-1)){var r=this.strict?this.reservedWordsStrict:this.reservedWords;r.test(s)&&(!this.inAsync&&s==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+s+"' is reserved"))}},ve.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},ve.parseIdentNode=function(){var e=this.startNode();return this.type===S.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=S.name):this.unexpected(),e},ve.parsePrivateIdent=function(){var e=this.startNode();return this.type===S.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},ve.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===S.semi||this.canInsertSemicolon()||this.type!==S.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(S.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},ve.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var yo=nt.prototype;yo.raise=function(e,t){var n=Kc(this.input,e);t+=" ("+n.line+":"+n.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var s=new SyntaxError(t);throw s.pos=e,s.loc=n,s.raisedAt=this.pos,s},yo.raiseRecoverable=yo.raise,yo.curPosition=function(){if(this.options.locations)return new Br(this.curLine,this.pos-this.lineStart)};var bs=nt.prototype,bk=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]};bs.enterScope=function(e){this.scopeStack.push(new bk(e))},bs.exitScope=function(){this.scopeStack.pop()},bs.treatFunctionsAsVarInScope=function(e){return e.flags&Lr||!this.inModule&&e.flags&Zi},bs.declareName=function(e,t,n){var s=!1;if(t===ns){var r=this.currentScope();s=r.lexical.indexOf(e)>-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&r.flags&Zi&&delete this.undefinedExports[e]}else if(t===Sy){var o=this.currentScope();o.lexical.push(e)}else if(t===wy){var c=this.currentScope();this.treatFunctionsAsVar?s=c.lexical.indexOf(e)>-1:s=c.lexical.indexOf(e)>-1||c.var.indexOf(e)>-1,c.functions.push(e)}else for(var d=this.scopeStack.length-1;d>=0;--d){var p=this.scopeStack[d];if(p.lexical.indexOf(e)>-1&&!(p.flags&by&&p.lexical[0]===e)||!this.treatFunctionsAsVarInScope(p)&&p.functions.indexOf(e)>-1){s=!0;break}if(p.var.push(e),this.inModule&&p.flags&Zi&&delete this.undefinedExports[e],p.flags&po)break}s&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")},bs.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},bs.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},bs.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(po|Xi|zs))return t}},bs.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(po|Xi|zs)&&!(t.flags&Zc))return t}};var Qi=function(t,n,s){this.type="",this.start=n,this.end=0,t.options.locations&&(this.loc=new Yi(t,s)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[n,0])},ea=nt.prototype;ea.startNode=function(){return new Qi(this,this.start,this.startLoc)},ea.startNodeAt=function(e,t){return new Qi(this,e,t)};function Cy(e,t,n,s){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=s),this.options.ranges&&(e.range[1]=n),e}ea.finishNode=function(e,t){return Cy.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},ea.finishNodeAt=function(e,t,n,s){return Cy.call(this,e,t,n,s)},ea.copyNode=function(e){var t=new Qi(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var vk="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",Ay="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Ty=Ay+" Extended_Pictographic",Iy=Ty,Ry=Iy+" EBase EComp EMod EPres ExtPict",Py=Ry,wk=Py,Sk={9:Ay,10:Ty,11:Iy,12:Ry,13:Py,14:wk},xk="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Ek={9:"",10:"",11:"",12:"",13:"",14:xk},Dy="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Oy="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ny=Oy+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",By=Ny+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ly=By+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",My=Ly+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",kk=My+" "+vk,Ck={9:Oy,10:Ny,11:By,12:Ly,13:My,14:kk},Fy={};function Ak(e){var t=Fy[e]={binary:_s(Sk[e]+" "+Dy),binaryOfStrings:_s(Ek[e]),nonBinary:{General_Category:_s(Dy),Script:_s(Ck[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var nu=0,$y=[9,10,11,12,13,14];nu<$y.length;nu+=1){var Tk=$y[nu];Ak(Tk)}var ue=nt.prototype,_o=function(t,n){this.parent=t,this.base=n||this};_o.prototype.separatedFrom=function(t){for(var n=this;n;n=n.parent)for(var s=t;s;s=s.parent)if(n.base===s.base&&n!==s)return!0;return!1},_o.prototype.sibling=function(){return new _o(this.parent,this.base)};var Un=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Fy[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};Un.prototype.reset=function(t,n,s){var r=s.indexOf("v")!==-1,o=s.indexOf("u")!==-1;this.start=t|0,this.source=n+"",this.flags=s,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=o&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=o&&this.parser.options.ecmaVersion>=9)},Un.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},Un.prototype.at=function(t,n){n===void 0&&(n=!1);var s=this.source,r=s.length;if(t>=r)return-1;var o=s.charCodeAt(t);if(!(n||this.switchU)||o<=55295||o>=57344||t+1>=r)return o;var c=s.charCodeAt(t+1);return c>=56320&&c<=57343?(o<<10)+c-56613888:o},Un.prototype.nextIndex=function(t,n){n===void 0&&(n=!1);var s=this.source,r=s.length;if(t>=r)return r;var o=s.charCodeAt(t),c;return!(n||this.switchU)||o<=55295||o>=57344||t+1>=r||(c=s.charCodeAt(t+1))<56320||c>57343?t+1:t+2},Un.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)},Un.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)},Un.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)},Un.prototype.eat=function(t,n){return n===void 0&&(n=!1),this.current(n)===t?(this.advance(n),!0):!1},Un.prototype.eatChars=function(t,n){n===void 0&&(n=!1);for(var s=this.pos,r=0,o=t;r<o.length;r+=1){var c=o[r],d=this.at(s,n);if(d===-1||d!==c)return!1;s=this.nextIndex(s,n)}return this.pos=s,!0},ue.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,s=!1,r=!1,o=0;o<n.length;o++){var c=n.charAt(o);t.indexOf(c)===-1&&this.raise(e.start,"Invalid regular expression flag"),n.indexOf(c,o+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),c==="u"&&(s=!0),c==="v"&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(e.start,"Invalid regular expression flag")};function Ik(e){for(var t in e)return!0;return!1}ue.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Ik(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},ue.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var s=n[t];e.groupNames[s]||e.raise("Invalid named capture referenced")}},ue.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new _o(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},ue.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},ue.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},ue.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},ue.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},ue.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},ue.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var s=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return r!==-1&&r<s&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=n}return!1},ue.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},ue.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},ue.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),s=e.eat(45);if(n||s){for(var r=0;r<n.length;r++){var o=n.charAt(r);n.indexOf(o,r+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(s){var c=this.regexp_eatModifiers(e);!n&&!c&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var d=0;d<c.length;d++){var p=c.charAt(d);(c.indexOf(p,d+1)>-1||n.indexOf(p)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},ue.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},ue.regexp_eatModifiers=function(e){for(var t="",n=0;(n=e.current())!==-1&&Rk(n);)t+=ts(n),e.advance();return t};function Rk(e){return e===105||e===109||e===115}ue.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},ue.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},ue.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Uy(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Uy(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}ue.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!Uy(n);)e.advance();return e.pos!==t},ue.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1},ue.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n)if(t)for(var s=0,r=n;s<r.length;s+=1){var o=r[s];o.separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},ue.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},ue.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=ts(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=ts(e.lastIntValue);return!0}return!1},ue.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,s=e.current(n);return e.advance(n),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(s=e.lastIntValue),Pk(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function Pk(e){return Sn(e,!0)||e===36||e===95}ue.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,s=e.current(n);return e.advance(n),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(s=e.lastIntValue),Dk(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function Dk(e){return es(e,!0)||e===36||e===95||e===8204||e===8205}ue.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},ue.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},ue.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},ue.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},ue.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},ue.regexp_eatZero=function(e){return e.current()===48&&!bo(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1},ue.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1},ue.regexp_eatControlLetter=function(e){var t=e.current();return jy(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function jy(e){return e>=65&&e<=90||e>=97&&e<=122}ue.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,s=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(s&&r>=55296&&r<=56319){var o=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var c=e.lastIntValue;if(c>=56320&&c<=57343)return e.lastIntValue=(r-55296)*1024+(c-56320)+65536,!0}e.pos=o,e.lastIntValue=r}return!0}if(s&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Ok(e.lastIntValue))return!0;s&&e.raise("Invalid unicode escape"),e.pos=n}return!1};function Ok(e){return e>=0&&e<=1114111}ue.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1},ue.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var Vy=0,ss=1,pn=2;ue.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Nk(t))return e.lastIntValue=-1,e.advance(),ss;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var s;if(e.eat(123)&&(s=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&s===pn&&e.raise("Invalid property name"),s;e.raise("Invalid property name")}return Vy};function Nk(e){return e===100||e===68||e===115||e===83||e===119||e===87}ue.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,s),ss}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r)}return Vy},ue.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){Nr(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value")},ue.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return ss;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return pn;e.raise("Invalid property name")},ue.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Hy(t=e.current());)e.lastStringValue+=ts(t),e.advance();return e.lastStringValue!==""};function Hy(e){return jy(e)||e===95}ue.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Bk(t=e.current());)e.lastStringValue+=ts(t),e.advance();return e.lastStringValue!==""};function Bk(e){return Hy(e)||bo(e)}ue.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},ue.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&n===pn&&e.raise("Negated character class may contain strings"),!0}return!1},ue.regexp_classContents=function(e){return e.current()===93?ss:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),ss)},ue.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise("Invalid character class"),t!==-1&&n!==-1&&t>n&&e.raise("Range out of order in character class")}}},ue.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||qy(n))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var s=e.current();return s!==93?(e.lastIntValue=s,e.advance(),!0):!1},ue.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},ue.regexp_classSetExpression=function(e){var t=ss,n;if(!this.regexp_eatClassSetRange(e))if(n=this.regexp_eatClassSetOperand(e)){n===pn&&(t=pn);for(var s=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){n!==pn&&(t=ss);continue}e.raise("Invalid character in character class")}if(s!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(s!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===pn&&(t=pn)}},ue.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var s=e.lastIntValue;return n!==-1&&s!==-1&&n>s&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},ue.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?ss:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},ue.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),s=this.regexp_classContents(e);if(e.eat(93))return n&&s===pn&&e.raise("Negated character class may contain strings"),s;e.pos=t}if(e.eat(92)){var r=this.regexp_eatCharacterClassEscape(e);if(r)return r;e.pos=t}return null},ue.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise("Invalid escape");e.pos=t}return null},ue.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===pn&&(t=pn);return t},ue.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?ss:pn},ue.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&Lk(n)||Mk(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function Lk(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Mk(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}ue.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Fk(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Fk(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}ue.regexp_eatClassControlLetter=function(e){var t=e.current();return bo(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},ue.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},ue.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;bo(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function bo(e){return e>=48&&e<=57}ue.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Wy(n=e.current());)e.lastIntValue=16*e.lastIntValue+zy(n),e.advance();return e.pos!==t};function Wy(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function zy(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}ue.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+n*8+e.lastIntValue:e.lastIntValue=t*8+n}else e.lastIntValue=t;return!0}return!1},ue.regexp_eatOctalDigit=function(e){var t=e.current();return qy(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function qy(e){return e>=48&&e<=55}ue.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var s=0;s<t;++s){var r=e.current();if(!Wy(r))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+zy(r),e.advance()}return!0};var vo=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Yi(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},Oe=nt.prototype;Oe.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new vo(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Oe.getToken=function(){return this.next(),new vo(this)},typeof Symbol<"u"&&(Oe[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===S.eof,value:t}}}}),Oe.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(S.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},Oe.readToken=function(e){return Sn(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Oe.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},Oe.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(n===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(var s=void 0,r=t;(s=py(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=s;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Oe.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Ws(s);)s=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Oe.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&Gc.test(String.fromCharCode(e)))++this.pos;else break e}}},Oe.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Oe.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(S.ellipsis)):(++this.pos,this.finishToken(S.dot))},Oe.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(S.assign,2):this.finishOp(S.slash,1)},Oe.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,s=e===42?S.star:S.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,s=S.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(S.assign,n+1):this.finishOp(s,n)},Oe.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var n=this.input.charCodeAt(this.pos+2);if(n===61)return this.finishOp(S.assign,3)}return this.finishOp(e===124?S.logicalOR:S.logicalAND,2)}return t===61?this.finishOp(S.assign,2):this.finishOp(e===124?S.bitwiseOR:S.bitwiseAND,1)},Oe.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(S.assign,2):this.finishOp(S.bitwiseXOR,1)},Oe.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Bt.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(S.incDec,2):t===61?this.finishOp(S.assign,2):this.finishOp(S.plusMin,1)},Oe.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(S.assign,n+1):this.finishOp(S.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(S.relational,n))},Oe.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(S.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(S.arrow)):this.finishOp(e===61?S.eq:S.prefix,1)},Oe.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(S.questionDot,2)}if(t===63){if(e>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61)return this.finishOp(S.assign,3)}return this.finishOp(S.coalesce,2)}}return this.finishOp(S.question,1)},Oe.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),Sn(t,!0)||t===92))return this.finishToken(S.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+ts(t)+"'")},Oe.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(S.parenL);case 41:return++this.pos,this.finishToken(S.parenR);case 59:return++this.pos,this.finishToken(S.semi);case 44:return++this.pos,this.finishToken(S.comma);case 91:return++this.pos,this.finishToken(S.bracketL);case 93:return++this.pos,this.finishToken(S.bracketR);case 123:return++this.pos,this.finishToken(S.braceL);case 125:return++this.pos,this.finishToken(S.braceR);case 58:return++this.pos,this.finishToken(S.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(S.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(S.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+ts(e)+"'")},Oe.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Oe.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(Bt.test(s)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if(s==="[")t=!0;else if(s==="]"&&t)t=!1;else if(s==="/"&&!t)break;e=s==="\\"}++this.pos}var r=this.input.slice(n,this.pos);++this.pos;var o=this.pos,c=this.readWord1();this.containsEsc&&this.unexpected(o);var d=this.regexpState||(this.regexpState=new Un(this));d.reset(n,r,c),this.validateRegExpFlags(d),this.validateRegExpPattern(d);var p=null;try{p=new RegExp(r,c)}catch{}return this.finishToken(S.regexp,{pattern:r,flags:c,value:p})},Oe.readInt=function(e,t,n){for(var s=this.options.ecmaVersion>=12&&t===void 0,r=n&&this.input.charCodeAt(this.pos)===48,o=this.pos,c=0,d=0,p=0,y=t??1/0;p<y;++p,++this.pos){var g=this.input.charCodeAt(this.pos),x=void 0;if(s&&g===95){r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),d===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),p===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),d=g;continue}if(g>=97?x=g-97+10:g>=65?x=g-65+10:g>=48&&g<=57?x=g-48:x=1/0,x>=e)break;d=g,c=c*e+x}return s&&d===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===o||t!=null&&this.pos-o!==t?null:c};function $k(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Gy(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}Oe.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=Gy(this.input.slice(t,this.pos)),++this.pos):Sn(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,n)},Oe.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&s===110){var r=Gy(this.input.slice(t,this.pos));return++this.pos,Sn(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,r)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),s===46&&!n&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!n&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),Sn(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var o=$k(this.input.slice(t,this.pos),n);return this.finishToken(S.num,o)},Oe.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,"Code point out of bounds")}else t=this.readHexChar(4);return t},Oe.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===e)break;s===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Ws(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(S.string,t)};var Ky={};Oe.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Ky)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Oe.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ky;this.raise(e,t)},Oe.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===S.template||this.type===S.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(S.dollarBraceL)):(++this.pos,this.finishToken(S.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(S.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Ws(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
89
- `;break;default:e+=String.fromCharCode(n);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Oe.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(S.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
78
+ `;a.write(I.from(h)),a.on("data",f=>{var m,v,k;const P=f instanceof Uint8Array?f:new Uint8Array(f),N=new Uint8Array(i._tcpInboundBuf.length+P.length);for(N.set(i._tcpInboundBuf,0),N.set(P,i._tcpInboundBuf.length),i._tcpInboundBuf=N;i._tcpInboundBuf.length>=2;){const O=ys(i._tcpInboundBuf);if(!O)break;switch(i._tcpInboundBuf=i._tcpInboundBuf.slice(O.consumed),O.op){case 1:{const R=new TextDecoder().decode(O.data),S=new jr("message",{data:R});i.emit("message",S),(m=i.onmessage)==null||m.call(i,S);break}case 2:{const R=new jr("message",{data:O.data.buffer});i.emit("message",R),(v=i.onmessage)==null||v.call(i,R);break}case 8:{const R=O.data.length>=2?O.data[0]<<8|O.data[1]:1e3;i.readyState=Sn;const S=new er("close",{code:R,reason:"",wasClean:!0});i.emit("close",S),(k=i.onclose)==null||k.call(i,S),i._tcpSocket=null;break}case 9:{const R=Vn(10,O.data,!1);a.write(I.from(R));break}case 10:{i.emit("pong",O.data);break}}}}),a.on("close",()=>{var f;if(i.readyState!==Sn){i.readyState=Sn;const m=new er("close",{code:1006,reason:"Connection lost",wasClean:!1});i.emit("close",m),(f=i.onclose)==null||f.call(i,m)}i._tcpSocket=null})}const l=this;setTimeout(()=>{s(i,n),l.emit("connection",i,n)},0)},Nt.prototype.close=function(n){for(const t of this.clients)t.close(1001,"Server closing");this.clients.clear(),xh.delete(this._route),this._channelCb&&Ln&&(Ln.removeEventListener("message",this._channelCb),this._channelCb=null),this.emit("close"),n&&setTimeout(n,0)},Nt.prototype.address=function(){return{port:this.options.port||0,family:"IPv4",address:this.options.host||"0.0.0.0"}},Object.freeze(Object.defineProperty({__proto__:null,CLOSED:Sn,CLOSING:js,CONNECTING:Us,OPEN:it,Server:Nt,WebSocket:qe,WebSocketServer:Nt,createWebSocketStream:()=>{throw new Error("createWebSocketStream is not available in the browser")},default:qe},Symbol.toStringTag,{value:"Module"}));const kh={kFSEventStreamEventFlagNone:0,kFSEventStreamEventFlagMustScanSubDirs:1,kFSEventStreamEventFlagUserDropped:2,kFSEventStreamEventFlagKernelDropped:4,kFSEventStreamEventFlagEventIdsWrapped:8,kFSEventStreamEventFlagHistoryDone:16,kFSEventStreamEventFlagRootChanged:32,kFSEventStreamEventFlagMount:64,kFSEventStreamEventFlagUnmount:128,kFSEventStreamEventFlagItemCreated:256,kFSEventStreamEventFlagItemRemoved:512,kFSEventStreamEventFlagItemInodeMetaMod:1024,kFSEventStreamEventFlagItemRenamed:2048,kFSEventStreamEventFlagItemModified:4096,kFSEventStreamEventFlagItemFinderInfoMod:8192,kFSEventStreamEventFlagItemChangeOwner:16384,kFSEventStreamEventFlagItemXattrMod:32768,kFSEventStreamEventFlagItemIsFile:65536,kFSEventStreamEventFlagItemIsDir:131072,kFSEventStreamEventFlagItemIsSymlink:262144};function Ch(e,n){return()=>Promise.resolve()}function Ah(e,n){return{event:"unknown",path:e,type:"file",changes:{inode:!1,finder:!1,access:!1,xattrs:!1},flags:n}}Object.freeze(Object.defineProperty({__proto__:null,constants:kh,default:{watch:Ch,getInfo:Ah,constants:kh},getInfo:Ah,watch:Ch},Symbol.toStringTag,{value:"Module"}));function gv(e){bh(e)}const xn=function(n,t={}){this&&(this.rootDir=n,this.cfg=t,this.results=[],this.scanned=!1,this.handlerMap=new Map)};xn.prototype[Symbol.asyncIterator]=async function*(){this.runScan();for(const e of this.results)yield e},xn.prototype.toArray=async function(){return this.runScan(),[...this.results]},xn.prototype.on=function(n,t){return n==="data"?setTimeout(()=>{this.runScan();for(const r of this.results)t(r);this.fireEvent("end")},0):(this.handlerMap.has(n)||this.handlerMap.set(n,[]),this.handlerMap.get(n).push(t)),this},xn.prototype.once=function(n,t){const r=this,s=(...i)=>{t(...i),r.off(n,s)};return this.on(n,s)},xn.prototype.off=function(n,t){const r=this.handlerMap.get(n);if(r){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}return this},xn.prototype.fireEvent=function(n,...t){const r=this.handlerMap.get(n);if(r)for(const s of r)s(...t)},xn.prototype.runScan=function(){this.scanned||(this.scanned=!0,this.crawl(this.rootDir,0,""))},xn.prototype.crawl=function(n,t,r){const s=vh();if(!s||this.cfg.depth!==void 0&&t>this.cfg.depth)return;let i;try{i=s.readdirSync(n)}catch{return}for(const a of i){const o=n==="/"?"/"+a:n+"/"+a,l=r?r+"/"+a:a;let u;try{u=s.statSync(o)}catch{continue}const c=u.isDirectory(),p={path:l,fullPath:o,basename:a,stats:this.cfg.alwaysStat?u:void 0,dirent:{isFile:()=>!c,isDirectory:()=>c,name:a}},h=this.cfg.type||"files";if(c){if(!this.applyFilter(p,this.cfg.directoryFilter))continue;(h==="directories"||h==="files_directories"||h==="all")&&this.results.push(p),this.crawl(o,t+1,l)}else(h==="files"||h==="files_directories"||h==="all")&&this.applyFilter(p,this.cfg.fileFilter)&&this.results.push(p)}},xn.prototype.applyFilter=function(n,t){if(!t)return!0;if(typeof t=="function")return t(n);const r=Array.isArray(t)?t:[t];for(const s of r)if(s.startsWith("!")){if(this.globMatch(n.basename,s.slice(1)))return!1}else if(this.globMatch(n.basename,s))return!0;return r.length===0||r.every(s=>s.startsWith("!"))},xn.prototype.globMatch=function(n,t){return t==="*"?!0:t.startsWith("*.")?n.endsWith(t.slice(1)):t.endsWith("*")?n.startsWith(t.slice(0,-1)):n===t};function Th(e,n){return new xn(e,n)}async function _v(e,n){return new xn(e,n).toArray()}Object.freeze(Object.defineProperty({__proto__:null,DirectoryScanner:xn,default:Th,readdirp:Th,readdirpPromise:_v,setVolume:gv},Symbol.toStringTag,{value:"Module"}));const Vi=["assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","quic","readline","readline/promises","repl","sea","sqlite","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","test","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib"];function Ih(e){const n=e.startsWith("node:")?e.slice(5):e;if(Vi.includes(n))return!0;const t=n.indexOf("/");return t!==-1?Vi.includes(n.slice(0,t)):!1}function Rh(e){return function(t){throw new Error(`Cannot resolve module '${t}' from '${e}'`)}}const Ph={},Dh={".js":()=>{},".json":()=>{},".node":()=>{}},Oh={};function Nh(e,n,t,r){return e}function Bh(e){const n=e.split("/").filter(Boolean),t=[];for(let r=n.length;r>0;r--){const s="/"+n.slice(0,r).join("/");n[r-1]!=="node_modules"&&t.push(s+"/node_modules")}return t.push("/node_modules"),t}function Lh(e,n,t){throw new Error(`Cannot load module '${e}'`)}function Fh(e,n,t){return e}function Mh(e){return"(function (exports, require, module, __filename, __dirname) { "+e+`
79
+ });`}const $h=["(function (exports, require, module, __filename, __dirname) { ",`
80
+ });`];function Uh(){}function Ae(e,n){this.id=e||"",this.filename=e||"",this.loaded=!1,this.parent=n||null,this.children=[],this.exports={},this.paths=[]}Ae.prototype.require=function(e){throw new Error(`Cannot resolve module '${e}' from '${this.filename}'`)},Ae.prototype.load=function(e){this.loaded=!0},Ae.prototype._compile=function(e,n){},Ae.createRequire=Rh,Ae.builtinModules=Vi,Ae.isBuiltin=Ih,Ae._cache=Ph,Ae._extensions=Dh,Ae._pathCache=Oh,Ae._resolveFilename=Nh,Ae._nodeModulePaths=Bh,Ae._load=Lh,Ae._findPath=Fh,Ae.syncBuiltinESMExports=Uh,Ae.wrap=Mh,Ae.wrapper=$h,Ae.Module=Ae,Ae.runMain=function(){},Ae._preloadModules=function(e){},Ae._initPaths=function(){},Ae.globalPaths=["/node_modules"],Object.freeze(Object.defineProperty({__proto__:null,Module:Ae,_cache:Ph,_extensions:Dh,_findPath:Fh,_load:Lh,_nodeModulePaths:Bh,_pathCache:Oh,_resolveFilename:Nh,builtinModules:Vi,createRequire:Rh,default:Ae,isBuiltin:Ih,syncBuiltinESMExports:Uh,wrap:Mh,wrapper:$h},Symbol.toStringTag,{value:"Module"}));const jh=globalThis.performance??{now:()=>Date.now(),timeOrigin:Date.now(),mark:()=>{},measure:()=>{},getEntries:()=>[],getEntriesByName:()=>[],getEntriesByType:()=>[],clearMarks:()=>{},clearMeasures:()=>{},clearResourceTimings:()=>{}},Hr=function(n){this&&(this._fn=n,this._types=[])};Hr.supportedEntryTypes=["mark","measure","resource","navigation"],Hr.prototype.observe=function(n){this._types=n.entryTypes??(n.type?[n.type]:[])},Hr.prototype.disconnect=function(){this._types=[]},Hr.prototype.takeRecords=function(){return[]};const Hs=function(){this&&(this.min=0,this.max=0,this.mean=0,this.stddev=0,this.percentiles=new Map,this.exceeds=0)};Hs.prototype.reset=function(){this.min=0,this.max=0,this.mean=0,this.stddev=0,this.percentiles.clear(),this.exceeds=0},Hs.prototype.percentile=function(n){return this.percentiles.get(n)??0};function Hh(){return new Hs}function Wh(e){return new Hs}Object.freeze(Object.defineProperty({__proto__:null,PerformanceObserver:Hr,TimingHistogram:Hs,createHistogram:Hh,default:{performance:jh,PerformanceObserver:Hr,createHistogram:Hh,monitorEventLoopDelay:Wh},monitorEventLoopDelay:Wh,performance:jh},Symbol.toStringTag,{value:"Module"}));let Vh=!0,qh=null,zh=null,Gh=0,il=null;function Kh(e){il=e}let yv=1;const at=function(){this&&M.call(this)};Object.setPrototypeOf(at.prototype,M.prototype),at.prototype.postMessage=function(n,t){},at.prototype.start=function(){},at.prototype.close=function(){},at.prototype.ref=function(){},at.prototype.unref=function(){};const Yh=function(){if(!this)return;this.port1=new at,this.port2=new at;const n=this.port1,t=this.port2;n.postMessage=r=>{queueMicrotask(()=>t.emit("message",r))},t.postMessage=r=>{queueMicrotask(()=>n.emit("message",r))}},Bt=function(n,t){var r,s;if(!this)return;M.call(this),this.threadId=yv++,this.resourceLimits={},this._handle=null,this._terminated=!1,this._isReffed=!1;const i=typeof n=="string"?n:n.href,a=this;if(!il){queueMicrotask(()=>{a.emit("error",new Error("[Nodepod] worker_threads.Worker requires worker mode. Ensure the process is running in a worker context."))});return}const o=(t==null?void 0:t.workerData)??null,l=!!(t!=null&&t.eval),u=t!=null&&t.env&&typeof t.env!="symbol"?t.env:{},c=il(i,{workerData:o,threadId:this.threadId,isEval:l,cwd:((s=(r=globalThis.process)==null?void 0:r.cwd)==null?void 0:s.call(r))??"/",env:u,onMessage:p=>{a.emit("message",p)},onError:p=>{a.emit("error",p)},onExit:p=>{a._isReffed&&(a._isReffed=!1,Yn()),a._terminated=!0,a.emit("exit",p)},onStdout:p=>{var h,f;const m=(f=(h=globalThis.process)==null?void 0:h.stdout)==null?void 0:f.write;typeof m=="function"&&m.call(globalThis.process.stdout,p)},onStderr:p=>{var h,f;const m=(f=(h=globalThis.process)==null?void 0:h.stderr)==null?void 0:f.write;typeof m=="function"&&m.call(globalThis.process.stderr,p)}});this._handle=c,this._isReffed=!0,Tt(),queueMicrotask(()=>{a._terminated||a.emit("online")})};Object.setPrototypeOf(Bt.prototype,M.prototype),Bt.prototype.postMessage=function(n,t){this._handle&&!this._terminated&&this._handle.postMessage(n)},Bt.prototype.terminate=function(){return this._handle&&!this._terminated&&(this._isReffed&&(this._isReffed=!1,Yn()),this._terminated=!0,this._handle.terminate()),Promise.resolve(0)},Bt.prototype.ref=function(){return!this._isReffed&&!this._terminated&&(this._isReffed=!0,Tt()),this},Bt.prototype.unref=function(){return this._isReffed&&(this._isReffed=!1,Yn()),this},Bt.prototype.getHeapSnapshot=function(){return Promise.resolve({})};const tr=function(n){this&&(M.call(this),this.name=n)};Object.setPrototypeOf(tr.prototype,M.prototype),tr.prototype.postMessage=function(n){},tr.prototype.close=function(){},tr.prototype.ref=function(){},tr.prototype.unref=function(){};function Zh(e,n){return e}function Xh(e){}const Jh=Symbol.for("nodejs.worker_threads.SHARE_ENV");function Qh(e){}function ef(e){}function nf(e,n){}Object.freeze(Object.defineProperty({__proto__:null,BroadcastChannel:tr,MessageChannel:Yh,MessagePort:at,SHARE_ENV:Jh,Worker:Bt,default:{isMainThread:Vh,parentPort:qh,workerData:zh,threadId:Gh,Worker:Bt,MessageChannel:Yh,MessagePort:at,BroadcastChannel:tr,moveMessagePortToContext:Zh,receiveMessageOnPort:Xh,SHARE_ENV:Jh,markAsUntransferable:Qh,getEnvironmentData:ef,setEnvironmentData:nf,setWorkerThreadForkCallback:Kh},getEnvironmentData:ef,isMainThread:Vh,markAsUntransferable:Qh,moveMessagePortToContext:Zh,parentPort:qh,receiveMessageOnPort:Xh,setEnvironmentData:nf,setWorkerThreadForkCallback:Kh,threadId:Gh,workerData:zh},Symbol.toStringTag,{value:"Module"}));var bv=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],tf=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],vv="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",rf="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",al={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ol="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",wv={5:ol,"5module":ol+" export import",6:ol+" const class extends export import super"},Sv=/^in(stanceof)?$/,xv=new RegExp("["+rf+"]"),Ev=new RegExp("["+rf+vv+"]");function ll(e,n){for(var t=65536,r=0;r<n.length;r+=2){if(t+=n[r],t>e)return!1;if(t+=n[r+1],t>=e)return!0}return!1}function qn(e,n){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&xv.test(String.fromCharCode(e)):n===!1?!1:ll(e,tf)}function vt(e,n){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Ev.test(String.fromCharCode(e)):n===!1?!1:ll(e,tf)||ll(e,bv)}var he=function(n,t){t===void 0&&(t={}),this.label=n,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function Fn(e,n){return new he(e,{beforeExpr:!0,binop:n})}var Mn={beforeExpr:!0},gn={startsExpr:!0},qi={};function pe(e,n){return n===void 0&&(n={}),n.keyword=e,qi[e]=new he(e,n)}var d={num:new he("num",gn),regexp:new he("regexp",gn),string:new he("string",gn),name:new he("name",gn),privateId:new he("privateId",gn),eof:new he("eof"),bracketL:new he("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new he("]"),braceL:new he("{",{beforeExpr:!0,startsExpr:!0}),braceR:new he("}"),parenL:new he("(",{beforeExpr:!0,startsExpr:!0}),parenR:new he(")"),comma:new he(",",Mn),semi:new he(";",Mn),colon:new he(":",Mn),dot:new he("."),question:new he("?",Mn),questionDot:new he("?."),arrow:new he("=>",Mn),template:new he("template"),invalidTemplate:new he("invalidTemplate"),ellipsis:new he("...",Mn),backQuote:new he("`",gn),dollarBraceL:new he("${",{beforeExpr:!0,startsExpr:!0}),eq:new he("=",{beforeExpr:!0,isAssign:!0}),assign:new he("_=",{beforeExpr:!0,isAssign:!0}),incDec:new he("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new he("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Fn("||",1),logicalAND:Fn("&&",2),bitwiseOR:Fn("|",3),bitwiseXOR:Fn("^",4),bitwiseAND:Fn("&",5),equality:Fn("==/!=/===/!==",6),relational:Fn("</>/<=/>=",7),bitShift:Fn("<</>>/>>>",8),plusMin:new he("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Fn("%",10),star:Fn("*",10),slash:Fn("/",10),starstar:new he("**",{beforeExpr:!0}),coalesce:Fn("??",1),_break:pe("break"),_case:pe("case",Mn),_catch:pe("catch"),_continue:pe("continue"),_debugger:pe("debugger"),_default:pe("default",Mn),_do:pe("do",{isLoop:!0,beforeExpr:!0}),_else:pe("else",Mn),_finally:pe("finally"),_for:pe("for",{isLoop:!0}),_function:pe("function",gn),_if:pe("if"),_return:pe("return",Mn),_switch:pe("switch"),_throw:pe("throw",Mn),_try:pe("try"),_var:pe("var"),_const:pe("const"),_while:pe("while",{isLoop:!0}),_with:pe("with"),_new:pe("new",{beforeExpr:!0,startsExpr:!0}),_this:pe("this",gn),_super:pe("super",gn),_class:pe("class",gn),_extends:pe("extends",Mn),_export:pe("export"),_import:pe("import",gn),_null:pe("null",gn),_true:pe("true",gn),_false:pe("false",gn),_in:pe("in",{beforeExpr:!0,binop:7}),_instanceof:pe("instanceof",{beforeExpr:!0,binop:7}),_typeof:pe("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:pe("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:pe("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},un=/\r\n?|\n|\u2028|\u2029/,sf=new RegExp(un.source,"g");function rr(e){return e===10||e===13||e===8232||e===8233}function af(e,n,t){t===void 0&&(t=e.length);for(var r=n;r<t;r++){var s=e.charCodeAt(r);if(rr(s))return r<t-1&&s===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var cl=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,nn=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,of=Object.prototype,kv=of.hasOwnProperty,Cv=of.toString,Wr=Object.hasOwn||function(e,n){return kv.call(e,n)},lf=Array.isArray||function(e){return Cv.call(e)==="[object Array]"},cf=Object.create(null);function Lt(e){return cf[e]||(cf[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function wt(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Av=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Vr=function(n,t){this.line=n,this.column=t};Vr.prototype.offset=function(n){return new Vr(this.line,this.column+n)};var Ws=function(n,t,r){this.start=t,this.end=r,n.sourceFile!==null&&(this.source=n.sourceFile)};function ul(e,n){for(var t=1,r=0;;){var s=af(e,r,n);if(s<0)return new Vr(t,n-r);++t,r=s}}var zi={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},uf=!1;function Tv(e){var n={};for(var t in zi)n[t]=e&&Wr(e,t)?e[t]:zi[t];if(n.ecmaVersion==="latest"?n.ecmaVersion=1e8:n.ecmaVersion==null?(!uf&&typeof console=="object"&&console.warn&&(uf=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
81
+ Defaulting to 2020, but this will stop working in the future.`)),n.ecmaVersion=11):n.ecmaVersion>=2015&&(n.ecmaVersion-=2009),n.allowReserved==null&&(n.allowReserved=n.ecmaVersion<5),(!e||e.allowHashBang==null)&&(n.allowHashBang=n.ecmaVersion>=14),lf(n.onToken)){var r=n.onToken;n.onToken=function(s){return r.push(s)}}return lf(n.onComment)&&(n.onComment=Iv(n,n.onComment)),n}function Iv(e,n){return function(t,r,s,i,a,o){var l={type:t?"Block":"Line",value:r,start:s,end:i};e.locations&&(l.loc=new Ws(this,a,o)),e.ranges&&(l.range=[s,i]),n.push(l)}}var Vs=1,qr=2,dl=4,df=8,pl=16,pf=32,Gi=64,hf=128,sr=256,qs=512,Ki=Vs|qr|sr;function hl(e,n){return qr|(e?dl:0)|(n?df:0)}var Yi=0,fl=1,St=2,ff=3,mf=4,gf=5,Re=function(n,t,r){this.options=n=Tv(n),this.sourceFile=n.sourceFile,this.keywords=Lt(wv[n.ecmaVersion>=6?6:n.sourceType==="module"?"5module":5]);var s="";n.allowReserved!==!0&&(s=al[n.ecmaVersion>=6?6:n.ecmaVersion===5?5:3],n.sourceType==="module"&&(s+=" await")),this.reservedWords=Lt(s);var i=(s?s+" ":"")+al.strict;this.reservedWordsStrict=Lt(i),this.reservedWordsStrictBind=Lt(i+" "+al.strictBind),this.input=String(t),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
82
+ `,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(un).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=d.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=n.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&n.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Vs),this.regexpState=null,this.privateNameStack=[]},ot={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};Re.prototype.parse=function(){var n=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(n)},ot.inFunction.get=function(){return(this.currentVarScope().flags&qr)>0},ot.inGenerator.get=function(){return(this.currentVarScope().flags&df)>0},ot.inAsync.get=function(){return(this.currentVarScope().flags&dl)>0},ot.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var n=this.scopeStack[e],t=n.flags;if(t&(sr|qs))return!1;if(t&qr)return(t&dl)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},ot.allowSuper.get=function(){var e=this.currentThisScope(),n=e.flags;return(n&Gi)>0||this.options.allowSuperOutsideMethod},ot.allowDirectSuper.get=function(){return(this.currentThisScope().flags&hf)>0},ot.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},ot.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var n=this.scopeStack[e],t=n.flags;if(t&(sr|qs)||t&qr&&!(t&pl))return!0}return!1},ot.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&sr)>0},Re.extend=function(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];for(var r=this,s=0;s<n.length;s++)r=n[s](r);return r},Re.parse=function(n,t){return new this(t,n).parse()},Re.parseExpressionAt=function(n,t,r){var s=new this(r,n,t);return s.nextToken(),s.parseExpression()},Re.tokenizer=function(n,t){return new this(t,n)},Object.defineProperties(Re.prototype,ot);var dn=Re.prototype,Rv=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;dn.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){nn.lastIndex=e,e+=nn.exec(this.input)[0].length;var n=Rv.exec(this.input.slice(e));if(!n)return!1;if((n[1]||n[2])==="use strict"){nn.lastIndex=e+n[0].length;var t=nn.exec(this.input),r=t.index+t[0].length,s=this.input.charAt(r);return s===";"||s==="}"||un.test(t[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}e+=n[0].length,nn.lastIndex=e,e+=nn.exec(this.input)[0].length,this.input[e]===";"&&e++}},dn.eat=function(e){return this.type===e?(this.next(),!0):!1},dn.isContextual=function(e){return this.type===d.name&&this.value===e&&!this.containsEsc},dn.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},dn.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},dn.canInsertSemicolon=function(){return this.type===d.eof||this.type===d.braceR||un.test(this.input.slice(this.lastTokEnd,this.start))},dn.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},dn.semicolon=function(){!this.eat(d.semi)&&!this.insertSemicolon()&&this.unexpected()},dn.afterTrailingComma=function(e,n){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),n||this.next(),!0},dn.expect=function(e){this.eat(e)||this.unexpected()},dn.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Zi=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};dn.checkPatternErrors=function(e,n){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var t=n?e.parenthesizedAssign:e.parenthesizedBind;t>-1&&this.raiseRecoverable(t,n?"Assigning to rvalue":"Parenthesized pattern")}},dn.checkExpressionErrors=function(e,n){if(!e)return!1;var t=e.shorthandAssign,r=e.doubleProto;if(!n)return t>=0||r>=0;t>=0&&this.raise(t,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")},dn.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},dn.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var G=Re.prototype;G.parseTopLevel=function(e){var n=Object.create(null);for(e.body||(e.body=[]);this.type!==d.eof;){var t=this.parseStatement(null,!0,n);e.body.push(t)}if(this.inModule)for(var r=0,s=Object.keys(this.undefinedExports);r<s.length;r+=1){var i=s[r];this.raiseRecoverable(this.undefinedExports[i].start,"Export '"+i+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var ml={kind:"loop"},Pv={kind:"switch"};G.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;nn.lastIndex=this.pos;var n=nn.exec(this.input),t=this.pos+n[0].length,r=this.input.charCodeAt(t);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(qn(r,!0)){for(var s=t+1;vt(r=this.input.charCodeAt(s),!0);)++s;if(r===92||r>55295&&r<56320)return!0;var i=this.input.slice(t,s);if(!Sv.test(i))return!0}return!1},G.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;nn.lastIndex=this.pos;var e=nn.exec(this.input),n=this.pos+e[0].length,t;return!un.test(this.input.slice(this.pos,n))&&this.input.slice(n,n+8)==="function"&&(n+8===this.input.length||!(vt(t=this.input.charCodeAt(n+8))||t>55295&&t<56320))},G.isUsingKeyword=function(e,n){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;nn.lastIndex=this.pos;var t=nn.exec(this.input),r=this.pos+t[0].length;if(un.test(this.input.slice(this.pos,r)))return!1;if(e){var s=r+5,i;if(this.input.slice(r,s)!=="using"||s===this.input.length||vt(i=this.input.charCodeAt(s))||i>55295&&i<56320)return!1;nn.lastIndex=s;var a=nn.exec(this.input);if(a&&un.test(this.input.slice(s,s+a[0].length)))return!1}if(n){var o=r+2,l;if(this.input.slice(r,o)==="of"&&(o===this.input.length||!vt(l=this.input.charCodeAt(o))&&!(l>55295&&l<56320)))return!1}var u=this.input.charCodeAt(r);return qn(u,!0)||u===92},G.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},G.isUsing=function(e){return this.isUsingKeyword(!1,e)},G.parseStatement=function(e,n,t){var r=this.type,s=this.startNode(),i;switch(this.isLet(e)&&(r=d._var,i="let"),r){case d._break:case d._continue:return this.parseBreakContinueStatement(s,r.keyword);case d._debugger:return this.parseDebuggerStatement(s);case d._do:return this.parseDoStatement(s);case d._for:return this.parseForStatement(s);case d._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case d._class:return e&&this.unexpected(),this.parseClass(s,!0);case d._if:return this.parseIfStatement(s);case d._return:return this.parseReturnStatement(s);case d._switch:return this.parseSwitchStatement(s);case d._throw:return this.parseThrowStatement(s);case d._try:return this.parseTryStatement(s);case d._const:case d._var:return i=i||this.value,e&&i!=="var"&&this.unexpected(),this.parseVarStatement(s,i);case d._while:return this.parseWhileStatement(s);case d._with:return this.parseWithStatement(s);case d.braceL:return this.parseBlock(!0,s);case d.semi:return this.parseEmptyStatement(s);case d._export:case d._import:if(this.options.ecmaVersion>10&&r===d._import){nn.lastIndex=this.pos;var a=nn.exec(this.input),o=this.pos+a[0].length,l=this.input.charCodeAt(o);if(l===40||l===46)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(n||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===d._import?this.parseImport(s):this.parseExport(s,t);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var u=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(u)return n&&this.options.sourceType==="script"&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),u==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(s,!1,u),this.semicolon(),this.finishNode(s,"VariableDeclaration");var c=this.value,p=this.parseExpression();return r===d.name&&p.type==="Identifier"&&this.eat(d.colon)?this.parseLabeledStatement(s,c,p,e):this.parseExpressionStatement(s,p)}},G.parseBreakContinueStatement=function(e,n){var t=n==="break";this.next(),this.eat(d.semi)||this.insertSemicolon()?e.label=null:this.type!==d.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var s=this.labels[r];if((e.label==null||s.name===e.label.name)&&(s.kind!=null&&(t||s.kind==="loop")||e.label&&t))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+n),this.finishNode(e,t?"BreakStatement":"ContinueStatement")},G.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},G.parseDoStatement=function(e){return this.next(),this.labels.push(ml),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(d._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(d.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},G.parseForStatement=function(e){this.next();var n=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ml),this.enterScope(0),this.expect(d.parenL),this.type===d.semi)return n>-1&&this.unexpected(n),this.parseFor(e,null);var t=this.isLet();if(this.type===d._var||this.type===d._const||t){var r=this.startNode(),s=t?"let":this.value;return this.next(),this.parseVar(r,!0,s),this.finishNode(r,"VariableDeclaration"),this.parseForAfterInit(e,r,n)}var i=this.isContextual("let"),a=!1,o=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(o){var l=this.startNode();return this.next(),o==="await using"&&this.next(),this.parseVar(l,!0,o),this.finishNode(l,"VariableDeclaration"),this.parseForAfterInit(e,l,n)}var u=this.containsEsc,c=new Zi,p=this.start,h=n>-1?this.parseExprSubscripts(c,"await"):this.parseExpression(!0,c);return this.type===d._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(n>-1?(this.type===d._in&&this.unexpected(n),e.await=!0):a&&this.options.ecmaVersion>=8&&(h.start===p&&!u&&h.type==="Identifier"&&h.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),i&&a&&this.raise(h.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(h,!1,c),this.checkLValPattern(h),this.parseForIn(e,h)):(this.checkExpressionErrors(c,!0),n>-1&&this.unexpected(n),this.parseFor(e,h))},G.parseForAfterInit=function(e,n,t){return(this.type===d._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&n.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===d._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,n)):(t>-1&&this.unexpected(t),this.parseFor(e,n))},G.parseFunctionStatement=function(e,n,t){return this.next(),this.parseFunction(e,zs|(t?0:gl),!1,n)},G.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(d._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},G.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(d.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},G.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(d.braceL),this.labels.push(Pv),this.enterScope(0);for(var n,t=!1;this.type!==d.braceR;)if(this.type===d._case||this.type===d._default){var r=this.type===d._case;n&&this.finishNode(n,"SwitchCase"),e.cases.push(n=this.startNode()),n.consequent=[],this.next(),r?n.test=this.parseExpression():(t&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),t=!0,n.test=null),this.expect(d.colon)}else n||this.unexpected(),n.consequent.push(this.parseStatement(null));return this.exitScope(),n&&this.finishNode(n,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},G.parseThrowStatement=function(e){return this.next(),un.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Dv=[];G.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),n=e.type==="Identifier";return this.enterScope(n?pf:0),this.checkLValPattern(e,n?mf:St),this.expect(d.parenR),e},G.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===d._catch){var n=this.startNode();this.next(),this.eat(d.parenL)?n.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),n.param=null,this.enterScope(0)),n.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(n,"CatchClause")}return e.finalizer=this.eat(d._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},G.parseVarStatement=function(e,n,t){return this.next(),this.parseVar(e,!1,n,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},G.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(ml),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},G.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},G.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},G.parseLabeledStatement=function(e,n,t,r){for(var s=0,i=this.labels;s<i.length;s+=1){var a=i[s];a.name===n&&this.raise(t.start,"Label '"+n+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===d._switch?"switch":null,l=this.labels.length-1;l>=0;l--){var u=this.labels[l];if(u.statementStart===e.start)u.statementStart=this.start,u.kind=o;else break}return this.labels.push({name:n,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=t,this.finishNode(e,"LabeledStatement")},G.parseExpressionStatement=function(e,n){return e.expression=n,this.semicolon(),this.finishNode(e,"ExpressionStatement")},G.parseBlock=function(e,n,t){for(e===void 0&&(e=!0),n===void 0&&(n=this.startNode()),n.body=[],this.expect(d.braceL),e&&this.enterScope(0);this.type!==d.braceR;){var r=this.parseStatement(null);n.body.push(r)}return t&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(n,"BlockStatement")},G.parseFor=function(e,n){return e.init=n,this.expect(d.semi),e.test=this.type===d.semi?null:this.parseExpression(),this.expect(d.semi),e.update=this.type===d.parenR?null:this.parseExpression(),this.expect(d.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},G.parseForIn=function(e,n){var t=this.type===d._in;return this.next(),n.type==="VariableDeclaration"&&n.declarations[0].init!=null&&(!t||this.options.ecmaVersion<8||this.strict||n.kind!=="var"||n.declarations[0].id.type!=="Identifier")&&this.raise(n.start,(t?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=n,e.right=t?this.parseExpression():this.parseMaybeAssign(),this.expect(d.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,t?"ForInStatement":"ForOfStatement")},G.parseVar=function(e,n,t,r){for(e.declarations=[],e.kind=t;;){var s=this.startNode();if(this.parseVarId(s,t),this.eat(d.eq)?s.init=this.parseMaybeAssign(n):!r&&t==="const"&&!(this.type===d._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!r&&(t==="using"||t==="await using")&&this.options.ecmaVersion>=17&&this.type!==d._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+t+" declaration"):!r&&s.id.type!=="Identifier"&&!(n&&(this.type===d._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):s.init=null,e.declarations.push(this.finishNode(s,"VariableDeclarator")),!this.eat(d.comma))break}return e},G.parseVarId=function(e,n){e.id=n==="using"||n==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,n==="var"?fl:St,!1)};var zs=1,gl=2,_f=4;G.parseFunction=function(e,n,t,r,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===d.star&&n&gl&&this.unexpected(),e.generator=this.eat(d.star)),this.options.ecmaVersion>=8&&(e.async=!!r),n&zs&&(e.id=n&_f&&this.type!==d.name?null:this.parseIdent(),e.id&&!(n&gl)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?fl:St:ff));var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(hl(e.async,e.generator)),n&zs||(e.id=this.type===d.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,t,!1,s),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,n&zs?"FunctionDeclaration":"FunctionExpression")},G.parseFunctionParams=function(e){this.expect(d.parenL),e.params=this.parseBindingList(d.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},G.parseClass=function(e,n){this.next();var t=this.strict;this.strict=!0,this.parseClassId(e,n),this.parseClassSuper(e);var r=this.enterClassBody(),s=this.startNode(),i=!1;for(s.body=[],this.expect(d.braceL);this.type!==d.braceR;){var a=this.parseClassElement(e.superClass!==null);a&&(s.body.push(a),a.type==="MethodDefinition"&&a.kind==="constructor"?(i&&this.raiseRecoverable(a.start,"Duplicate constructor in the same class"),i=!0):a.key&&a.key.type==="PrivateIdentifier"&&Ov(r,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=t,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,n?"ClassDeclaration":"ClassExpression")},G.parseClassElement=function(e){if(this.eat(d.semi))return null;var n=this.options.ecmaVersion,t=this.startNode(),r="",s=!1,i=!1,a="method",o=!1;if(this.eatContextual("static")){if(n>=13&&this.eat(d.braceL))return this.parseClassStaticBlock(t),t;this.isClassElementNameStart()||this.type===d.star?o=!0:r="static"}if(t.static=o,!r&&n>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===d.star)&&!this.canInsertSemicolon()?i=!0:r="async"),!r&&(n>=9||!i)&&this.eat(d.star)&&(s=!0),!r&&!i&&!s){var l=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=l:r=l)}if(r?(t.computed=!1,t.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),t.key.name=r,this.finishNode(t.key,"Identifier")):this.parseClassElementName(t),n<13||this.type===d.parenL||a!=="method"||s||i){var u=!t.static&&Xi(t,"constructor"),c=u&&e;u&&a!=="method"&&this.raise(t.key.start,"Constructor can't have get/set modifier"),t.kind=u?"constructor":a,this.parseClassMethod(t,s,i,c)}else this.parseClassField(t);return t},G.isClassElementNameStart=function(){return this.type===d.name||this.type===d.privateId||this.type===d.num||this.type===d.string||this.type===d.bracketL||this.type.keyword},G.parseClassElementName=function(e){this.type===d.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},G.parseClassMethod=function(e,n,t,r){var s=e.key;e.kind==="constructor"?(n&&this.raise(s.start,"Constructor can't be a generator"),t&&this.raise(s.start,"Constructor can't be an async method")):e.static&&Xi(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var i=e.value=this.parseMethod(n,t,r);return e.kind==="get"&&i.params.length!==0&&this.raiseRecoverable(i.start,"getter should have no params"),e.kind==="set"&&i.params.length!==1&&this.raiseRecoverable(i.start,"setter should have exactly one param"),e.kind==="set"&&i.params[0].type==="RestElement"&&this.raiseRecoverable(i.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},G.parseClassField=function(e){return Xi(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Xi(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(d.eq)?(this.enterScope(qs|Gi),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},G.parseClassStaticBlock=function(e){e.body=[];var n=this.labels;for(this.labels=[],this.enterScope(sr|Gi);this.type!==d.braceR;){var t=this.parseStatement(null);e.body.push(t)}return this.next(),this.exitScope(),this.labels=n,this.finishNode(e,"StaticBlock")},G.parseClassId=function(e,n){this.type===d.name?(e.id=this.parseIdent(),n&&this.checkLValSimple(e.id,St,!1)):(n===!0&&this.unexpected(),e.id=null)},G.parseClassSuper=function(e){e.superClass=this.eat(d._extends)?this.parseExprSubscripts(null,!1):null},G.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},G.exitClassBody=function(){var e=this.privateNameStack.pop(),n=e.declared,t=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,s=r===0?null:this.privateNameStack[r-1],i=0;i<t.length;++i){var a=t[i];Wr(n,a.name)||(s?s.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}};function Ov(e,n){var t=n.key.name,r=e[t],s="true";return n.type==="MethodDefinition"&&(n.kind==="get"||n.kind==="set")&&(s=(n.static?"s":"i")+n.kind),r==="iget"&&s==="iset"||r==="iset"&&s==="iget"||r==="sget"&&s==="sset"||r==="sset"&&s==="sget"?(e[t]="true",!1):r?!0:(e[t]=s,!1)}function Xi(e,n){var t=e.computed,r=e.key;return!t&&(r.type==="Identifier"&&r.name===n||r.type==="Literal"&&r.value===n)}G.parseExportAllDeclaration=function(e,n){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(n,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==d.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},G.parseExport=function(e,n){if(this.next(),this.eat(d.star))return this.parseExportAllDeclaration(e,n);if(this.eat(d._default))return this.checkExport(n,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(n,e.declaration.declarations):this.checkExport(n,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(n),this.eatContextual("from"))this.type!==d.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var t=0,r=e.specifiers;t<r.length;t+=1){var s=r[t];this.checkUnreserved(s.local),this.checkLocalExport(s.local),s.local.type==="Literal"&&this.raise(s.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},G.parseExportDeclaration=function(e){return this.parseStatement(null)},G.parseExportDefaultDeclaration=function(){var e;if(this.type===d._function||(e=this.isAsyncFunction())){var n=this.startNode();return this.next(),e&&this.next(),this.parseFunction(n,zs|_f,!1,e)}else if(this.type===d._class){var t=this.startNode();return this.parseClass(t,"nullableID")}else{var r=this.parseMaybeAssign();return this.semicolon(),r}},G.checkExport=function(e,n,t){e&&(typeof n!="string"&&(n=n.type==="Identifier"?n.name:n.value),Wr(e,n)&&this.raiseRecoverable(t,"Duplicate export '"+n+"'"),e[n]=!0)},G.checkPatternExport=function(e,n){var t=n.type;if(t==="Identifier")this.checkExport(e,n,n.start);else if(t==="ObjectPattern")for(var r=0,s=n.properties;r<s.length;r+=1){var i=s[r];this.checkPatternExport(e,i)}else if(t==="ArrayPattern")for(var a=0,o=n.elements;a<o.length;a+=1){var l=o[a];l&&this.checkPatternExport(e,l)}else t==="Property"?this.checkPatternExport(e,n.value):t==="AssignmentPattern"?this.checkPatternExport(e,n.left):t==="RestElement"&&this.checkPatternExport(e,n.argument)},G.checkVariableExport=function(e,n){if(e)for(var t=0,r=n;t<r.length;t+=1){var s=r[t];this.checkPatternExport(e,s.id)}},G.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},G.parseExportSpecifier=function(e){var n=this.startNode();return n.local=this.parseModuleExportName(),n.exported=this.eatContextual("as")?this.parseModuleExportName():n.local,this.checkExport(e,n.exported,n.exported.start),this.finishNode(n,"ExportSpecifier")},G.parseExportSpecifiers=function(e){var n=[],t=!0;for(this.expect(d.braceL);!this.eat(d.braceR);){if(t)t=!1;else if(this.expect(d.comma),this.afterTrailingComma(d.braceR))break;n.push(this.parseExportSpecifier(e))}return n},G.parseImport=function(e){return this.next(),this.type===d.string?(e.specifiers=Dv,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===d.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},G.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,St),this.finishNode(e,"ImportSpecifier")},G.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,St),this.finishNode(e,"ImportDefaultSpecifier")},G.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,St),this.finishNode(e,"ImportNamespaceSpecifier")},G.parseImportSpecifiers=function(){var e=[],n=!0;if(this.type===d.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(d.comma)))return e;if(this.type===d.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(d.braceL);!this.eat(d.braceR);){if(n)n=!1;else if(this.expect(d.comma),this.afterTrailingComma(d.braceR))break;e.push(this.parseImportSpecifier())}return e},G.parseWithClause=function(){var e=[];if(!this.eat(d._with))return e;this.expect(d.braceL);for(var n={},t=!0;!this.eat(d.braceR);){if(t)t=!1;else if(this.expect(d.comma),this.afterTrailingComma(d.braceR))break;var r=this.parseImportAttribute(),s=r.key.type==="Identifier"?r.key.name:r.key.value;Wr(n,s)&&this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+s+"'"),n[s]=!0,e.push(r)}return e},G.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===d.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(d.colon),this.type!==d.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},G.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===d.string){var e=this.parseLiteral(this.value);return Av.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},G.adaptDirectivePrologue=function(e){for(var n=0;n<e.length&&this.isDirectiveCandidate(e[n]);++n)e[n].directive=e[n].expression.raw.slice(1,-1)},G.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var $n=Re.prototype;$n.toAssignable=function(e,n,t){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",t&&this.checkPatternErrors(t,!0);for(var r=0,s=e.properties;r<s.length;r+=1){var i=s[r];this.toAssignable(i,n),i.type==="RestElement"&&(i.argument.type==="ArrayPattern"||i.argument.type==="ObjectPattern")&&this.raise(i.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,n);break;case"ArrayExpression":e.type="ArrayPattern",t&&this.checkPatternErrors(t,!0),this.toAssignableList(e.elements,n);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,n),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,n);break;case"ParenthesizedExpression":this.toAssignable(e.expression,n,t);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!n)break;default:this.raise(e.start,"Assigning to rvalue")}else t&&this.checkPatternErrors(t,!0);return e},$n.toAssignableList=function(e,n){for(var t=e.length,r=0;r<t;r++){var s=e[r];s&&this.toAssignable(s,n)}if(t){var i=e[t-1];this.options.ecmaVersion===6&&n&&i&&i.type==="RestElement"&&i.argument.type!=="Identifier"&&this.unexpected(i.argument.start)}return e},$n.parseSpread=function(e){var n=this.startNode();return this.next(),n.argument=this.parseMaybeAssign(!1,e),this.finishNode(n,"SpreadElement")},$n.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==d.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},$n.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case d.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(d.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case d.braceL:return this.parseObj(!0)}return this.parseIdent()},$n.parseBindingList=function(e,n,t,r){for(var s=[],i=!0;!this.eat(e);)if(i?i=!1:this.expect(d.comma),n&&this.type===d.comma)s.push(null);else{if(t&&this.afterTrailingComma(e))break;if(this.type===d.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),s.push(a),this.type===d.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else s.push(this.parseAssignableListItem(r))}return s},$n.parseAssignableListItem=function(e){var n=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(n),n},$n.parseBindingListItem=function(e){return e},$n.parseMaybeDefault=function(e,n,t){if(t=t||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(d.eq))return t;var r=this.startNodeAt(e,n);return r.left=t,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")},$n.checkLValSimple=function(e,n,t){n===void 0&&(n=Yi);var r=n!==Yi;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(n===St&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),t&&(Wr(t,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),t[e.name]=!0),n!==gf&&this.declareName(e.name,n,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,n,t);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}},$n.checkLValPattern=function(e,n,t){switch(n===void 0&&(n=Yi),e.type){case"ObjectPattern":for(var r=0,s=e.properties;r<s.length;r+=1){var i=s[r];this.checkLValInnerPattern(i,n,t)}break;case"ArrayPattern":for(var a=0,o=e.elements;a<o.length;a+=1){var l=o[a];l&&this.checkLValInnerPattern(l,n,t)}break;default:this.checkLValSimple(e,n,t)}},$n.checkLValInnerPattern=function(e,n,t){switch(n===void 0&&(n=Yi),e.type){case"Property":this.checkLValInnerPattern(e.value,n,t);break;case"AssignmentPattern":this.checkLValPattern(e.left,n,t);break;case"RestElement":this.checkLValPattern(e.argument,n,t);break;default:this.checkLValPattern(e,n,t)}};var Un=function(n,t,r,s,i){this.token=n,this.isExpr=!!t,this.preserveSpace=!!r,this.override=s,this.generator=!!i},Se={b_stat:new Un("{",!1),b_expr:new Un("{",!0),b_tmpl:new Un("${",!1),p_stat:new Un("(",!1),p_expr:new Un("(",!0),q_tmpl:new Un("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Un("function",!1),f_expr:new Un("function",!0),f_expr_gen:new Un("function",!0,!1,null,!0),f_gen:new Un("function",!1,!1,null,!0)},zr=Re.prototype;zr.initialContext=function(){return[Se.b_stat]},zr.curContext=function(){return this.context[this.context.length-1]},zr.braceIsBlock=function(e){var n=this.curContext();return n===Se.f_expr||n===Se.f_stat?!0:e===d.colon&&(n===Se.b_stat||n===Se.b_expr)?!n.isExpr:e===d._return||e===d.name&&this.exprAllowed?un.test(this.input.slice(this.lastTokEnd,this.start)):e===d._else||e===d.semi||e===d.eof||e===d.parenR||e===d.arrow?!0:e===d.braceL?n===Se.b_stat:e===d._var||e===d._const||e===d.name?!1:!this.exprAllowed},zr.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var n=this.context[e];if(n.token==="function")return n.generator}return!1},zr.updateContext=function(e){var n,t=this.type;t.keyword&&e===d.dot?this.exprAllowed=!1:(n=t.updateContext)?n.call(this,e):this.exprAllowed=t.beforeExpr},zr.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},d.parenR.updateContext=d.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===Se.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},d.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Se.b_stat:Se.b_expr),this.exprAllowed=!0},d.dollarBraceL.updateContext=function(){this.context.push(Se.b_tmpl),this.exprAllowed=!0},d.parenL.updateContext=function(e){var n=e===d._if||e===d._for||e===d._with||e===d._while;this.context.push(n?Se.p_stat:Se.p_expr),this.exprAllowed=!0},d.incDec.updateContext=function(){},d._function.updateContext=d._class.updateContext=function(e){e.beforeExpr&&e!==d._else&&!(e===d.semi&&this.curContext()!==Se.p_stat)&&!(e===d._return&&un.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===d.colon||e===d.braceL)&&this.curContext()===Se.b_stat)?this.context.push(Se.f_expr):this.context.push(Se.f_stat),this.exprAllowed=!1},d.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},d.backQuote.updateContext=function(){this.curContext()===Se.q_tmpl?this.context.pop():this.context.push(Se.q_tmpl),this.exprAllowed=!1},d.star.updateContext=function(e){if(e===d._function){var n=this.context.length-1;this.context[n]===Se.f_expr?this.context[n]=Se.f_expr_gen:this.context[n]=Se.f_gen}this.exprAllowed=!0},d.name.updateContext=function(e){var n=!1;this.options.ecmaVersion>=6&&e!==d.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(n=!0),this.exprAllowed=n};var ee=Re.prototype;ee.checkPropClash=function(e,n,t){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,s;switch(r.type){case"Identifier":s=r.name;break;case"Literal":s=String(r.value);break;default:return}var i=e.kind;if(this.options.ecmaVersion>=6){s==="__proto__"&&i==="init"&&(n.proto&&(t?t.doubleProto<0&&(t.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),n.proto=!0);return}s="$"+s;var a=n[s];if(a){var o;i==="init"?o=this.strict&&a.init||a.get||a.set:o=a.init||a[i],o&&this.raiseRecoverable(r.start,"Redefinition of property")}else a=n[s]={init:!1,get:!1,set:!1};a[i]=!0}},ee.parseExpression=function(e,n){var t=this.start,r=this.startLoc,s=this.parseMaybeAssign(e,n);if(this.type===d.comma){var i=this.startNodeAt(t,r);for(i.expressions=[s];this.eat(d.comma);)i.expressions.push(this.parseMaybeAssign(e,n));return this.finishNode(i,"SequenceExpression")}return s},ee.parseMaybeAssign=function(e,n,t){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,s=-1,i=-1,a=-1;n?(s=n.parenthesizedAssign,i=n.trailingComma,a=n.doubleProto,n.parenthesizedAssign=n.trailingComma=-1):(n=new Zi,r=!0);var o=this.start,l=this.startLoc;(this.type===d.parenL||this.type===d.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var u=this.parseMaybeConditional(e,n);if(t&&(u=t.call(this,u,o,l)),this.type.isAssign){var c=this.startNodeAt(o,l);return c.operator=this.value,this.type===d.eq&&(u=this.toAssignable(u,!1,n)),r||(n.parenthesizedAssign=n.trailingComma=n.doubleProto=-1),n.shorthandAssign>=u.start&&(n.shorthandAssign=-1),this.type===d.eq?this.checkLValPattern(u):this.checkLValSimple(u),c.left=u,this.next(),c.right=this.parseMaybeAssign(e),a>-1&&(n.doubleProto=a),this.finishNode(c,"AssignmentExpression")}else r&&this.checkExpressionErrors(n,!0);return s>-1&&(n.parenthesizedAssign=s),i>-1&&(n.trailingComma=i),u},ee.parseMaybeConditional=function(e,n){var t=this.start,r=this.startLoc,s=this.parseExprOps(e,n);if(this.checkExpressionErrors(n))return s;if(this.eat(d.question)){var i=this.startNodeAt(t,r);return i.test=s,i.consequent=this.parseMaybeAssign(),this.expect(d.colon),i.alternate=this.parseMaybeAssign(e),this.finishNode(i,"ConditionalExpression")}return s},ee.parseExprOps=function(e,n){var t=this.start,r=this.startLoc,s=this.parseMaybeUnary(n,!1,!1,e);return this.checkExpressionErrors(n)||s.start===t&&s.type==="ArrowFunctionExpression"?s:this.parseExprOp(s,t,r,-1,e)},ee.parseExprOp=function(e,n,t,r,s){var i=this.type.binop;if(i!=null&&(!s||this.type!==d._in)&&i>r){var a=this.type===d.logicalOR||this.type===d.logicalAND,o=this.type===d.coalesce;o&&(i=d.logicalAND.binop);var l=this.value;this.next();var u=this.start,c=this.startLoc,p=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,s),u,c,i,s),h=this.buildBinary(n,t,e,p,l,a||o);return(a&&this.type===d.coalesce||o&&(this.type===d.logicalOR||this.type===d.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(h,n,t,r,s)}return e},ee.buildBinary=function(e,n,t,r,s,i){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,n);return a.left=t,a.operator=s,a.right=r,this.finishNode(a,i?"LogicalExpression":"BinaryExpression")},ee.parseMaybeUnary=function(e,n,t,r){var s=this.start,i=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(r),n=!0;else if(this.type.prefix){var o=this.startNode(),l=this.type===d.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,l,r),this.checkExpressionErrors(e,!0),l?this.checkLValSimple(o.argument):this.strict&&o.operator==="delete"&&yf(o.argument)?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):o.operator==="delete"&&_l(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):n=!0,a=this.finishNode(o,l?"UpdateExpression":"UnaryExpression")}else if(!n&&this.type===d.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==d._in&&this.unexpected();else{if(a=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var u=this.startNodeAt(s,i);u.operator=this.value,u.prefix=!1,u.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(u,"UpdateExpression")}}if(!t&&this.eat(d.starstar))if(n)this.unexpected(this.lastTokStart);else return this.buildBinary(s,i,a,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return a};function yf(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&yf(e.expression)}function _l(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&_l(e.expression)||e.type==="ParenthesizedExpression"&&_l(e.expression)}ee.parseExprSubscripts=function(e,n){var t=this.start,r=this.startLoc,s=this.parseExprAtom(e,n);if(s.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return s;var i=this.parseSubscripts(s,t,r,!1,n);return e&&i.type==="MemberExpression"&&(e.parenthesizedAssign>=i.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=i.start&&(e.parenthesizedBind=-1),e.trailingComma>=i.start&&(e.trailingComma=-1)),i},ee.parseSubscripts=function(e,n,t,r,s){for(var i=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var o=this.parseSubscript(e,n,t,r,i,a,s);if(o.optional&&(a=!0),o===e||o.type==="ArrowFunctionExpression"){if(a){var l=this.startNodeAt(n,t);l.expression=o,o=this.finishNode(l,"ChainExpression")}return o}e=o}},ee.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(d.arrow)},ee.parseSubscriptAsyncArrow=function(e,n,t,r){return this.parseArrowExpression(this.startNodeAt(e,n),t,!0,r)},ee.parseSubscript=function(e,n,t,r,s,i,a){var o=this.options.ecmaVersion>=11,l=o&&this.eat(d.questionDot);r&&l&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var u=this.eat(d.bracketL);if(u||l&&this.type!==d.parenL&&this.type!==d.backQuote||this.eat(d.dot)){var c=this.startNodeAt(n,t);c.object=e,u?(c.property=this.parseExpression(),this.expect(d.bracketR)):this.type===d.privateId&&e.type!=="Super"?c.property=this.parsePrivateIdent():c.property=this.parseIdent(this.options.allowReserved!=="never"),c.computed=!!u,o&&(c.optional=l),e=this.finishNode(c,"MemberExpression")}else if(!r&&this.eat(d.parenL)){var p=new Zi,h=this.yieldPos,f=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var v=this.parseExprList(d.parenR,this.options.ecmaVersion>=8,!1,p);if(s&&!l&&this.shouldParseAsyncArrow())return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=h,this.awaitPos=f,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(n,t,v,a);this.checkExpressionErrors(p,!0),this.yieldPos=h||this.yieldPos,this.awaitPos=f||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var k=this.startNodeAt(n,t);k.callee=e,k.arguments=v,o&&(k.optional=l),e=this.finishNode(k,"CallExpression")}else if(this.type===d.backQuote){(l||i)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var P=this.startNodeAt(n,t);P.tag=e,P.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(P,"TaggedTemplateExpression")}return e},ee.parseExprAtom=function(e,n,t){this.type===d.slash&&this.readRegexp();var r,s=this.potentialArrowAt===this.start;switch(this.type){case d._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type===d.parenL&&!this.allowDirectSuper&&this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==d.dot&&this.type!==d.bracketL&&this.type!==d.parenL&&this.unexpected(),this.finishNode(r,"Super");case d._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case d.name:var i=this.start,a=this.startLoc,o=this.containsEsc,l=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&l.name==="async"&&!this.canInsertSemicolon()&&this.eat(d._function))return this.overrideContext(Se.f_expr),this.parseFunction(this.startNodeAt(i,a),0,!1,!0,n);if(s&&!this.canInsertSemicolon()){if(this.eat(d.arrow))return this.parseArrowExpression(this.startNodeAt(i,a),[l],!1,n);if(this.options.ecmaVersion>=8&&l.name==="async"&&this.type===d.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return l=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(d.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,a),[l],!0,n)}return l;case d.regexp:var u=this.value;return r=this.parseLiteral(u.value),r.regex={pattern:u.pattern,flags:u.flags},r;case d.num:case d.string:return this.parseLiteral(this.value);case d._null:case d._true:case d._false:return r=this.startNode(),r.value=this.type===d._null?null:this.type===d._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case d.parenL:var c=this.start,p=this.parseParenAndDistinguishExpression(s,n);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),p;case d.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(d.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case d.braceL:return this.overrideContext(Se.b_expr),this.parseObj(!1,e);case d._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case d._class:return this.parseClass(this.startNode(),!1);case d._new:return this.parseNew();case d.backQuote:return this.parseTemplate();case d._import:return this.options.ecmaVersion>=11?this.parseExprImport(t):this.unexpected();default:return this.parseExprAtomDefault()}},ee.parseExprAtomDefault=function(){this.unexpected()},ee.parseExprImport=function(e){var n=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===d.parenL&&!e)return this.parseDynamicImport(n);if(this.type===d.dot){var t=this.startNodeAt(n.start,n.loc&&n.loc.start);return t.name="import",n.meta=this.finishNode(t,"Identifier"),this.parseImportMeta(n)}else this.unexpected()},ee.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(d.parenR)?e.options=null:(this.expect(d.comma),this.afterTrailingComma(d.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(d.parenR)||(this.expect(d.comma),this.afterTrailingComma(d.parenR)||this.unexpected())));else if(!this.eat(d.parenR)){var n=this.start;this.eat(d.comma)&&this.eat(d.parenR)?this.raiseRecoverable(n,"Trailing comma is not allowed in import()"):this.unexpected(n)}return this.finishNode(e,"ImportExpression")},ee.parseImportMeta=function(e){this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),n&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},ee.parseLiteral=function(e){var n=this.startNode();return n.value=e,n.raw=this.input.slice(this.start,this.end),n.raw.charCodeAt(n.raw.length-1)===110&&(n.bigint=n.value!=null?n.value.toString():n.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(n,"Literal")},ee.parseParenExpression=function(){this.expect(d.parenL);var e=this.parseExpression();return this.expect(d.parenR),e},ee.shouldParseArrow=function(e){return!this.canInsertSemicolon()},ee.parseParenAndDistinguishExpression=function(e,n){var t=this.start,r=this.startLoc,s,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,o=this.startLoc,l=[],u=!0,c=!1,p=new Zi,h=this.yieldPos,f=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==d.parenR;)if(u?u=!1:this.expect(d.comma),i&&this.afterTrailingComma(d.parenR,!0)){c=!0;break}else if(this.type===d.ellipsis){m=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===d.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else l.push(this.parseMaybeAssign(!1,p,this.parseParenItem));var v=this.lastTokEnd,k=this.lastTokEndLoc;if(this.expect(d.parenR),e&&this.shouldParseArrow(l)&&this.eat(d.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=h,this.awaitPos=f,this.parseParenArrowList(t,r,l,n);(!l.length||c)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(p,!0),this.yieldPos=h||this.yieldPos,this.awaitPos=f||this.awaitPos,l.length>1?(s=this.startNodeAt(a,o),s.expressions=l,this.finishNodeAt(s,"SequenceExpression",v,k)):s=l[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var P=this.startNodeAt(t,r);return P.expression=s,this.finishNode(P,"ParenthesizedExpression")}else return s},ee.parseParenItem=function(e){return e},ee.parseParenArrowList=function(e,n,t,r){return this.parseArrowExpression(this.startNodeAt(e,n),t,!1,r)};var Nv=[];ee.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===d.dot){var n=this.startNodeAt(e.start,e.loc&&e.loc.start);n.name="new",e.meta=this.finishNode(n,"Identifier"),this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),t&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,s=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,s,!0,!1),this.eat(d.parenL)?e.arguments=this.parseExprList(d.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Nv,this.finishNode(e,"NewExpression")},ee.parseTemplateElement=function(e){var n=e.isTagged,t=this.startNode();return this.type===d.invalidTemplate?(n||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),t.value={raw:this.value.replace(/\r\n?/g,`
83
+ `),cooked:null}):t.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
84
+ `),cooked:this.value},this.next(),t.tail=this.type===d.backQuote,this.finishNode(t,"TemplateElement")},ee.parseTemplate=function(e){e===void 0&&(e={});var n=e.isTagged;n===void 0&&(n=!1);var t=this.startNode();this.next(),t.expressions=[];var r=this.parseTemplateElement({isTagged:n});for(t.quasis=[r];!r.tail;)this.type===d.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(d.dollarBraceL),t.expressions.push(this.parseExpression()),this.expect(d.braceR),t.quasis.push(r=this.parseTemplateElement({isTagged:n}));return this.next(),this.finishNode(t,"TemplateLiteral")},ee.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===d.name||this.type===d.num||this.type===d.string||this.type===d.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===d.star)&&!un.test(this.input.slice(this.lastTokEnd,this.start))},ee.parseObj=function(e,n){var t=this.startNode(),r=!0,s={};for(t.properties=[],this.next();!this.eat(d.braceR);){if(r)r=!1;else if(this.expect(d.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(d.braceR))break;var i=this.parseProperty(e,n);e||this.checkPropClash(i,s,n),t.properties.push(i)}return this.finishNode(t,e?"ObjectPattern":"ObjectExpression")},ee.parseProperty=function(e,n){var t=this.startNode(),r,s,i,a;if(this.options.ecmaVersion>=9&&this.eat(d.ellipsis))return e?(t.argument=this.parseIdent(!1),this.type===d.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(t,"RestElement")):(t.argument=this.parseMaybeAssign(!1,n),this.type===d.comma&&n&&n.trailingComma<0&&(n.trailingComma=this.start),this.finishNode(t,"SpreadElement"));this.options.ecmaVersion>=6&&(t.method=!1,t.shorthand=!1,(e||n)&&(i=this.start,a=this.startLoc),e||(r=this.eat(d.star)));var o=this.containsEsc;return this.parsePropertyName(t),!e&&!o&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(t)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(d.star),this.parsePropertyName(t)):s=!1,this.parsePropertyValue(t,e,r,s,i,a,n,o),this.finishNode(t,"Property")},ee.parseGetterSetter=function(e){var n=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=n;var t=e.kind==="get"?0:1;if(e.value.params.length!==t){var r=e.value.start;e.kind==="get"?this.raiseRecoverable(r,"getter should have no params"):this.raiseRecoverable(r,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},ee.parsePropertyValue=function(e,n,t,r,s,i,a,o){(t||r)&&this.type===d.colon&&this.unexpected(),this.eat(d.colon)?(e.value=n?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init"):this.options.ecmaVersion>=6&&this.type===d.parenL?(n&&this.unexpected(),e.method=!0,e.value=this.parseMethod(t,r),e.kind="init"):!n&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==d.comma&&this.type!==d.braceR&&this.type!==d.eq?((t||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((t||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=s),n?e.value=this.parseMaybeDefault(s,i,this.copyNode(e.key)):this.type===d.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(s,i,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected()},ee.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(d.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(d.bracketR),e.key;e.computed=!1}return e.key=this.type===d.num||this.type===d.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},ee.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},ee.parseMethod=function(e,n,t){var r=this.startNode(),s=this.yieldPos,i=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(hl(n,r.generator)|Gi|(t?hf:0)),this.expect(d.parenL),r.params=this.parseBindingList(d.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=s,this.awaitPos=i,this.awaitIdentPos=a,this.finishNode(r,"FunctionExpression")},ee.parseArrowExpression=function(e,n,t,r){var s=this.yieldPos,i=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(hl(t,!1)|pl),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(n,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=s,this.awaitPos=i,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")},ee.parseFunctionBody=function(e,n,t,r){var s=n&&this.type!==d.braceL,i=this.strict,a=!1;if(s)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!i||o)&&(a=this.strictDirective(this.end),a&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var l=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!i&&!a&&!n&&!t&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,gf),e.body=this.parseBlock(!1,void 0,a&&!i),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()},ee.isSimpleParamList=function(e){for(var n=0,t=e;n<t.length;n+=1){var r=t[n];if(r.type!=="Identifier")return!1}return!0},ee.checkParams=function(e,n){for(var t=Object.create(null),r=0,s=e.params;r<s.length;r+=1){var i=s[r];this.checkLValInnerPattern(i,fl,n?null:t)}},ee.parseExprList=function(e,n,t,r){for(var s=[],i=!0;!this.eat(e);){if(i)i=!1;else if(this.expect(d.comma),n&&this.afterTrailingComma(e))break;var a=void 0;t&&this.type===d.comma?a=null:this.type===d.ellipsis?(a=this.parseSpread(r),r&&this.type===d.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):a=this.parseMaybeAssign(!1,r),s.push(a)}return s},ee.checkUnreserved=function(e){var n=e.start,t=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(n,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(n,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&Ki)&&r==="arguments"&&this.raiseRecoverable(n,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(n,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(n,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(n,t).indexOf("\\")!==-1)){var s=this.strict?this.reservedWordsStrict:this.reservedWords;s.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(n,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(n,"The keyword '"+r+"' is reserved"))}},ee.parseIdent=function(e){var n=this.parseIdentNode();return this.next(!!e),this.finishNode(n,"Identifier"),e||(this.checkUnreserved(n),n.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=n.start)),n},ee.parseIdentNode=function(){var e=this.startNode();return this.type===d.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=d.name):this.unexpected(),e},ee.parsePrivateIdent=function(){var e=this.startNode();return this.type===d.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},ee.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var n=this.startNode();return this.next(),this.type===d.semi||this.canInsertSemicolon()||this.type!==d.star&&!this.type.startsExpr?(n.delegate=!1,n.argument=null):(n.delegate=this.eat(d.star),n.argument=this.parseMaybeAssign(e)),this.finishNode(n,"YieldExpression")},ee.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var n=this.startNode();return this.next(),n.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(n,"AwaitExpression")};var Ji=Re.prototype;Ji.raise=function(e,n){var t=ul(this.input,e);n+=" ("+t.line+":"+t.column+")",this.sourceFile&&(n+=" in "+this.sourceFile);var r=new SyntaxError(n);throw r.pos=e,r.loc=t,r.raisedAt=this.pos,r},Ji.raiseRecoverable=Ji.raise,Ji.curPosition=function(){if(this.options.locations)return new Vr(this.curLine,this.pos-this.lineStart)};var Ft=Re.prototype,Bv=function(n){this.flags=n,this.var=[],this.lexical=[],this.functions=[]};Ft.enterScope=function(e){this.scopeStack.push(new Bv(e))},Ft.exitScope=function(){this.scopeStack.pop()},Ft.treatFunctionsAsVarInScope=function(e){return e.flags&qr||!this.inModule&&e.flags&Vs},Ft.declareName=function(e,n,t){var r=!1;if(n===St){var s=this.currentScope();r=s.lexical.indexOf(e)>-1||s.functions.indexOf(e)>-1||s.var.indexOf(e)>-1,s.lexical.push(e),this.inModule&&s.flags&Vs&&delete this.undefinedExports[e]}else if(n===mf){var i=this.currentScope();i.lexical.push(e)}else if(n===ff){var a=this.currentScope();this.treatFunctionsAsVar?r=a.lexical.indexOf(e)>-1:r=a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var l=this.scopeStack[o];if(l.lexical.indexOf(e)>-1&&!(l.flags&pf&&l.lexical[0]===e)||!this.treatFunctionsAsVarInScope(l)&&l.functions.indexOf(e)>-1){r=!0;break}if(l.var.push(e),this.inModule&&l.flags&Vs&&delete this.undefinedExports[e],l.flags&Ki)break}r&&this.raiseRecoverable(t,"Identifier '"+e+"' has already been declared")},Ft.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},Ft.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Ft.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var n=this.scopeStack[e];if(n.flags&(Ki|qs|sr))return n}},Ft.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var n=this.scopeStack[e];if(n.flags&(Ki|qs|sr)&&!(n.flags&pl))return n}};var Gs=function(n,t,r){this.type="",this.start=t,this.end=0,n.options.locations&&(this.loc=new Ws(n,r)),n.options.directSourceFile&&(this.sourceFile=n.options.directSourceFile),n.options.ranges&&(this.range=[t,0])},Ks=Re.prototype;Ks.startNode=function(){return new Gs(this,this.start,this.startLoc)},Ks.startNodeAt=function(e,n){return new Gs(this,e,n)};function bf(e,n,t,r){return e.type=n,e.end=t,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=t),e}Ks.finishNode=function(e,n){return bf.call(this,e,n,this.lastTokEnd,this.lastTokEndLoc)},Ks.finishNodeAt=function(e,n,t,r){return bf.call(this,e,n,t,r)},Ks.copyNode=function(e){var n=new Gs(this,e.start,this.startLoc);for(var t in e)n[t]=e[t];return n};var Lv="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",vf="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",wf=vf+" Extended_Pictographic",Sf=wf,xf=Sf+" EBase EComp EMod EPres ExtPict",Ef=xf,Fv=Ef,Mv={9:vf,10:wf,11:Sf,12:xf,13:Ef,14:Fv},$v="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Uv={9:"",10:"",11:"",12:"",13:"",14:$v},kf="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Cf="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Af=Cf+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Tf=Af+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",If=Tf+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Rf=If+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",jv=Rf+" "+Lv,Hv={9:Cf,10:Af,11:Tf,12:If,13:Rf,14:jv},Pf={};function Wv(e){var n=Pf[e]={binary:Lt(Mv[e]+" "+kf),binaryOfStrings:Lt(Uv[e]),nonBinary:{General_Category:Lt(kf),Script:Lt(Hv[e])}};n.nonBinary.Script_Extensions=n.nonBinary.Script,n.nonBinary.gc=n.nonBinary.General_Category,n.nonBinary.sc=n.nonBinary.Script,n.nonBinary.scx=n.nonBinary.Script_Extensions}for(var yl=0,Df=[9,10,11,12,13,14];yl<Df.length;yl+=1){var Vv=Df[yl];Wv(Vv)}var z=Re.prototype,Qi=function(n,t){this.parent=n,this.base=t||this};Qi.prototype.separatedFrom=function(n){for(var t=this;t;t=t.parent)for(var r=n;r;r=r.parent)if(t.base===r.base&&t!==r)return!0;return!1},Qi.prototype.sibling=function(){return new Qi(this.parent,this.base)};var lt=function(n){this.parser=n,this.validFlags="gim"+(n.options.ecmaVersion>=6?"uy":"")+(n.options.ecmaVersion>=9?"s":"")+(n.options.ecmaVersion>=13?"d":"")+(n.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Pf[n.options.ecmaVersion>=14?14:n.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};lt.prototype.reset=function(n,t,r){var s=r.indexOf("v")!==-1,i=r.indexOf("u")!==-1;this.start=n|0,this.source=t+"",this.flags=r,s&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},lt.prototype.raise=function(n){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+n)},lt.prototype.at=function(n,t){t===void 0&&(t=!1);var r=this.source,s=r.length;if(n>=s)return-1;var i=r.charCodeAt(n);if(!(t||this.switchU)||i<=55295||i>=57344||n+1>=s)return i;var a=r.charCodeAt(n+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},lt.prototype.nextIndex=function(n,t){t===void 0&&(t=!1);var r=this.source,s=r.length;if(n>=s)return s;var i=r.charCodeAt(n),a;return!(t||this.switchU)||i<=55295||i>=57344||n+1>=s||(a=r.charCodeAt(n+1))<56320||a>57343?n+1:n+2},lt.prototype.current=function(n){return n===void 0&&(n=!1),this.at(this.pos,n)},lt.prototype.lookahead=function(n){return n===void 0&&(n=!1),this.at(this.nextIndex(this.pos,n),n)},lt.prototype.advance=function(n){n===void 0&&(n=!1),this.pos=this.nextIndex(this.pos,n)},lt.prototype.eat=function(n,t){return t===void 0&&(t=!1),this.current(t)===n?(this.advance(t),!0):!1},lt.prototype.eatChars=function(n,t){t===void 0&&(t=!1);for(var r=this.pos,s=0,i=n;s<i.length;s+=1){var a=i[s],o=this.at(r,t);if(o===-1||o!==a)return!1;r=this.nextIndex(r,t)}return this.pos=r,!0},z.validateRegExpFlags=function(e){for(var n=e.validFlags,t=e.flags,r=!1,s=!1,i=0;i<t.length;i++){var a=t.charAt(i);n.indexOf(a)===-1&&this.raise(e.start,"Invalid regular expression flag"),t.indexOf(a,i+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),a==="u"&&(r=!0),a==="v"&&(s=!0)}this.options.ecmaVersion>=15&&r&&s&&this.raise(e.start,"Invalid regular expression flag")};function qv(e){for(var n in e)return!0;return!1}z.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&qv(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},z.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var n=0,t=e.backReferenceNames;n<t.length;n+=1){var r=t[n];e.groupNames[r]||e.raise("Invalid named capture referenced")}},z.regexp_disjunction=function(e){var n=this.options.ecmaVersion>=16;for(n&&(e.branchID=new Qi(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)n&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);n&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},z.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},z.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},z.regexp_eatAssertion=function(e){var n=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=n}if(e.eat(40)&&e.eat(63)){var t=!1;if(this.options.ecmaVersion>=9&&(t=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!t,!0}return e.pos=n,!1},z.regexp_eatQuantifier=function(e,n){return n===void 0&&(n=!1),this.regexp_eatQuantifierPrefix(e,n)?(e.eat(63),!0):!1},z.regexp_eatQuantifierPrefix=function(e,n){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,n)},z.regexp_eatBracedQuantifier=function(e,n){var t=e.pos;if(e.eat(123)){var r=0,s=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue),e.eat(125)))return s!==-1&&s<r&&!n&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!n&&e.raise("Incomplete quantifier"),e.pos=t}return!1},z.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},z.regexp_eatReverseSolidusAtomEscape=function(e){var n=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=n}return!1},z.regexp_eatUncapturingGroup=function(e){var n=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var t=this.regexp_eatModifiers(e),r=e.eat(45);if(t||r){for(var s=0;s<t.length;s++){var i=t.charAt(s);t.indexOf(i,s+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(r){var a=this.regexp_eatModifiers(e);!t&&!a&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var o=0;o<a.length;o++){var l=a.charAt(o);(a.indexOf(l,o+1)>-1||t.indexOf(l)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=n}return!1},z.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},z.regexp_eatModifiers=function(e){for(var n="",t=0;(t=e.current())!==-1&&zv(t);)n+=wt(t),e.advance();return n};function zv(e){return e===105||e===109||e===115}z.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},z.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},z.regexp_eatSyntaxCharacter=function(e){var n=e.current();return Of(n)?(e.lastIntValue=n,e.advance(),!0):!1};function Of(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}z.regexp_eatPatternCharacters=function(e){for(var n=e.pos,t=0;(t=e.current())!==-1&&!Of(t);)e.advance();return e.pos!==n},z.regexp_eatExtendedPatternCharacter=function(e){var n=e.current();return n!==-1&&n!==36&&!(n>=40&&n<=43)&&n!==46&&n!==63&&n!==91&&n!==94&&n!==124?(e.advance(),!0):!1},z.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var n=this.options.ecmaVersion>=16,t=e.groupNames[e.lastStringValue];if(t)if(n)for(var r=0,s=t;r<s.length;r+=1){var i=s[r];i.separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");n?(t||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},z.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},z.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=wt(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=wt(e.lastIntValue);return!0}return!1},z.regexp_eatRegExpIdentifierStart=function(e){var n=e.pos,t=this.options.ecmaVersion>=11,r=e.current(t);return e.advance(t),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(r=e.lastIntValue),Gv(r)?(e.lastIntValue=r,!0):(e.pos=n,!1)};function Gv(e){return qn(e,!0)||e===36||e===95}z.regexp_eatRegExpIdentifierPart=function(e){var n=e.pos,t=this.options.ecmaVersion>=11,r=e.current(t);return e.advance(t),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(r=e.lastIntValue),Kv(r)?(e.lastIntValue=r,!0):(e.pos=n,!1)};function Kv(e){return vt(e,!0)||e===36||e===95||e===8204||e===8205}z.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},z.regexp_eatBackReference=function(e){var n=e.pos;if(this.regexp_eatDecimalEscape(e)){var t=e.lastIntValue;if(e.switchU)return t>e.maxBackReference&&(e.maxBackReference=t),!0;if(t<=e.numCapturingParens)return!0;e.pos=n}return!1},z.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},z.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},z.regexp_eatCControlLetter=function(e){var n=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=n}return!1},z.regexp_eatZero=function(e){return e.current()===48&&!ea(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1},z.regexp_eatControlEscape=function(e){var n=e.current();return n===116?(e.lastIntValue=9,e.advance(),!0):n===110?(e.lastIntValue=10,e.advance(),!0):n===118?(e.lastIntValue=11,e.advance(),!0):n===102?(e.lastIntValue=12,e.advance(),!0):n===114?(e.lastIntValue=13,e.advance(),!0):!1},z.regexp_eatControlLetter=function(e){var n=e.current();return Nf(n)?(e.lastIntValue=n%32,e.advance(),!0):!1};function Nf(e){return e>=65&&e<=90||e>=97&&e<=122}z.regexp_eatRegExpUnicodeEscapeSequence=function(e,n){n===void 0&&(n=!1);var t=e.pos,r=n||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(r&&s>=55296&&s<=56319){var i=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=(s-55296)*1024+(a-56320)+65536,!0}e.pos=i,e.lastIntValue=s}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Yv(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=t}return!1};function Yv(e){return e>=0&&e<=1114111}z.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var n=e.current();return n!==99&&(!e.switchN||n!==107)?(e.lastIntValue=n,e.advance(),!0):!1},z.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var n=e.current();if(n>=49&&n<=57){do e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();while((n=e.current())>=48&&n<=57);return!0}return!1};var Bf=0,xt=1,jn=2;z.regexp_eatCharacterClassEscape=function(e){var n=e.current();if(Zv(n))return e.lastIntValue=-1,e.advance(),xt;var t=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((t=n===80)||n===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return t&&r===jn&&e.raise("Invalid property name"),r;e.raise("Invalid property name")}return Bf};function Zv(e){return e===100||e===68||e===115||e===83||e===119||e===87}z.regexp_eatUnicodePropertyValueExpression=function(e){var n=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var t=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,t,r),xt}}if(e.pos=n,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,s)}return Bf},z.regexp_validateUnicodePropertyNameAndValue=function(e,n,t){Wr(e.unicodeProperties.nonBinary,n)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[n].test(t)||e.raise("Invalid property value")},z.regexp_validateUnicodePropertyNameOrValue=function(e,n){if(e.unicodeProperties.binary.test(n))return xt;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(n))return jn;e.raise("Invalid property name")},z.regexp_eatUnicodePropertyName=function(e){var n=0;for(e.lastStringValue="";Lf(n=e.current());)e.lastStringValue+=wt(n),e.advance();return e.lastStringValue!==""};function Lf(e){return Nf(e)||e===95}z.regexp_eatUnicodePropertyValue=function(e){var n=0;for(e.lastStringValue="";Xv(n=e.current());)e.lastStringValue+=wt(n),e.advance();return e.lastStringValue!==""};function Xv(e){return Lf(e)||ea(e)}z.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},z.regexp_eatCharacterClass=function(e){if(e.eat(91)){var n=e.eat(94),t=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),n&&t===jn&&e.raise("Negated character class may contain strings"),!0}return!1},z.regexp_classContents=function(e){return e.current()===93?xt:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),xt)},z.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var t=e.lastIntValue;e.switchU&&(n===-1||t===-1)&&e.raise("Invalid character class"),n!==-1&&t!==-1&&n>t&&e.raise("Range out of order in character class")}}},z.regexp_eatClassAtom=function(e){var n=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var t=e.current();(t===99||$f(t))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=n}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),!0):!1},z.regexp_eatClassEscape=function(e){var n=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=n}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},z.regexp_classSetExpression=function(e){var n=xt,t;if(!this.regexp_eatClassSetRange(e))if(t=this.regexp_eatClassSetOperand(e)){t===jn&&(n=jn);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(t=this.regexp_eatClassSetOperand(e))){t!==jn&&(n=xt);continue}e.raise("Invalid character in character class")}if(r!==e.pos)return n;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(r!==e.pos)return n}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(t=this.regexp_eatClassSetOperand(e),!t)return n;t===jn&&(n=jn)}},z.regexp_eatClassSetRange=function(e){var n=e.pos;if(this.regexp_eatClassSetCharacter(e)){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return t!==-1&&r!==-1&&t>r&&e.raise("Range out of order in character class"),!0}e.pos=n}return!1},z.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?xt:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},z.regexp_eatNestedClass=function(e){var n=e.pos;if(e.eat(91)){var t=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return t&&r===jn&&e.raise("Negated character class may contain strings"),r;e.pos=n}if(e.eat(92)){var s=this.regexp_eatCharacterClassEscape(e);if(s)return s;e.pos=n}return null},z.regexp_eatClassStringDisjunction=function(e){var n=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var t=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return t}else e.raise("Invalid escape");e.pos=n}return null},z.regexp_classStringDisjunctionContents=function(e){for(var n=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===jn&&(n=jn);return n},z.regexp_classString=function(e){for(var n=0;this.regexp_eatClassSetCharacter(e);)n++;return n===1?xt:jn},z.regexp_eatClassSetCharacter=function(e){var n=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=n,!1);var t=e.current();return t<0||t===e.lookahead()&&Jv(t)||Qv(t)?!1:(e.advance(),e.lastIntValue=t,!0)};function Jv(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Qv(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}z.regexp_eatClassSetReservedPunctuator=function(e){var n=e.current();return e0(n)?(e.lastIntValue=n,e.advance(),!0):!1};function e0(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}z.regexp_eatClassControlLetter=function(e){var n=e.current();return ea(n)||n===95?(e.lastIntValue=n%32,e.advance(),!0):!1},z.regexp_eatHexEscapeSequence=function(e){var n=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=n}return!1},z.regexp_eatDecimalDigits=function(e){var n=e.pos,t=0;for(e.lastIntValue=0;ea(t=e.current());)e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();return e.pos!==n};function ea(e){return e>=48&&e<=57}z.regexp_eatHexDigits=function(e){var n=e.pos,t=0;for(e.lastIntValue=0;Ff(t=e.current());)e.lastIntValue=16*e.lastIntValue+Mf(t),e.advance();return e.pos!==n};function Ff(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Mf(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}z.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;n<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=n*64+t*8+e.lastIntValue:e.lastIntValue=n*8+t}else e.lastIntValue=n;return!0}return!1},z.regexp_eatOctalDigit=function(e){var n=e.current();return $f(n)?(e.lastIntValue=n-48,e.advance(),!0):(e.lastIntValue=0,!1)};function $f(e){return e>=48&&e<=55}z.regexp_eatFixedHexDigits=function(e,n){var t=e.pos;e.lastIntValue=0;for(var r=0;r<n;++r){var s=e.current();if(!Ff(s))return e.pos=t,!1;e.lastIntValue=16*e.lastIntValue+Mf(s),e.advance()}return!0};var na=function(n){this.type=n.type,this.value=n.value,this.start=n.start,this.end=n.end,n.options.locations&&(this.loc=new Ws(n,n.startLoc,n.endLoc)),n.options.ranges&&(this.range=[n.start,n.end])},oe=Re.prototype;oe.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new na(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},oe.getToken=function(){return this.next(),new na(this)},typeof Symbol<"u"&&(oe[Symbol.iterator]=function(){var e=this;return{next:function(){var n=e.getToken();return{done:n.type===d.eof,value:n}}}}),oe.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(d.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},oe.readToken=function(e){return qn(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},oe.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var n=this.input.charCodeAt(this.pos+1);return n<=56319||n>=57344?e:(e<<10)+n-56613888},oe.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),n=this.pos,t=this.input.indexOf("*/",this.pos+=2);if(t===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=t+2,this.options.locations)for(var r=void 0,s=n;(r=af(this.input,s,this.pos))>-1;)++this.curLine,s=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(n+2,t),n,this.pos,e,this.curPosition())},oe.skipLineComment=function(e){for(var n=this.pos,t=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!rr(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(n+e,this.pos),n,this.pos,t,this.curPosition())},oe.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&cl.test(String.fromCharCode(e)))++this.pos;else break e}}},oe.finishToken=function(e,n){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var t=this.type;this.type=e,this.value=n,this.updateContext(t)},oe.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var n=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&n===46?(this.pos+=3,this.finishToken(d.ellipsis)):(++this.pos,this.finishToken(d.dot))},oe.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(d.assign,2):this.finishOp(d.slash,1)},oe.readToken_mult_modulo_exp=function(e){var n=this.input.charCodeAt(this.pos+1),t=1,r=e===42?d.star:d.modulo;return this.options.ecmaVersion>=7&&e===42&&n===42&&(++t,r=d.starstar,n=this.input.charCodeAt(this.pos+2)),n===61?this.finishOp(d.assign,t+1):this.finishOp(r,t)},oe.readToken_pipe_amp=function(e){var n=this.input.charCodeAt(this.pos+1);if(n===e){if(this.options.ecmaVersion>=12){var t=this.input.charCodeAt(this.pos+2);if(t===61)return this.finishOp(d.assign,3)}return this.finishOp(e===124?d.logicalOR:d.logicalAND,2)}return n===61?this.finishOp(d.assign,2):this.finishOp(e===124?d.bitwiseOR:d.bitwiseAND,1)},oe.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(d.assign,2):this.finishOp(d.bitwiseXOR,1)},oe.readToken_plus_min=function(e){var n=this.input.charCodeAt(this.pos+1);return n===e?n===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||un.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(d.incDec,2):n===61?this.finishOp(d.assign,2):this.finishOp(d.plusMin,1)},oe.readToken_lt_gt=function(e){var n=this.input.charCodeAt(this.pos+1),t=1;return n===e?(t=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+t)===61?this.finishOp(d.assign,t+1):this.finishOp(d.bitShift,t)):n===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(n===61&&(t=2),this.finishOp(d.relational,t))},oe.readToken_eq_excl=function(e){var n=this.input.charCodeAt(this.pos+1);return n===61?this.finishOp(d.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&n===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(d.arrow)):this.finishOp(e===61?d.eq:d.prefix,1)},oe.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var n=this.input.charCodeAt(this.pos+1);if(n===46){var t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(d.questionDot,2)}if(n===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(d.assign,3)}return this.finishOp(d.coalesce,2)}}return this.finishOp(d.question,1)},oe.readToken_numberSign=function(){var e=this.options.ecmaVersion,n=35;if(e>=13&&(++this.pos,n=this.fullCharCodeAtPos(),qn(n,!0)||n===92))return this.finishToken(d.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+wt(n)+"'")},oe.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(d.parenL);case 41:return++this.pos,this.finishToken(d.parenR);case 59:return++this.pos,this.finishToken(d.semi);case 44:return++this.pos,this.finishToken(d.comma);case 91:return++this.pos,this.finishToken(d.bracketL);case 93:return++this.pos,this.finishToken(d.bracketR);case 123:return++this.pos,this.finishToken(d.braceL);case 125:return++this.pos,this.finishToken(d.braceR);case 58:return++this.pos,this.finishToken(d.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(d.backQuote);case 48:var n=this.input.charCodeAt(this.pos+1);if(n===120||n===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(n===111||n===79)return this.readRadixNumber(8);if(n===98||n===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(d.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+wt(e)+"'")},oe.finishOp=function(e,n){var t=this.input.slice(this.pos,this.pos+n);return this.pos+=n,this.finishToken(e,t)},oe.readRegexp=function(){for(var e,n,t=this.pos;;){this.pos>=this.input.length&&this.raise(t,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(un.test(r)&&this.raise(t,"Unterminated regular expression"),e)e=!1;else{if(r==="[")n=!0;else if(r==="]"&&n)n=!1;else if(r==="/"&&!n)break;e=r==="\\"}++this.pos}var s=this.input.slice(t,this.pos);++this.pos;var i=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(i);var o=this.regexpState||(this.regexpState=new lt(this));o.reset(t,s,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var l=null;try{l=new RegExp(s,a)}catch{}return this.finishToken(d.regexp,{pattern:s,flags:a,value:l})},oe.readInt=function(e,n,t){for(var r=this.options.ecmaVersion>=12&&n===void 0,s=t&&this.input.charCodeAt(this.pos)===48,i=this.pos,a=0,o=0,l=0,u=n??1/0;l<u;++l,++this.pos){var c=this.input.charCodeAt(this.pos),p=void 0;if(r&&c===95){s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),l===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=c;continue}if(c>=97?p=c-97+10:c>=65?p=c-65+10:c>=48&&c<=57?p=c-48:p=1/0,p>=e)break;o=c,a=a*e+p}return r&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===i||n!=null&&this.pos-i!==n?null:a};function n0(e,n){return n?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Uf(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}oe.readRadixNumber=function(e){var n=this.pos;this.pos+=2;var t=this.readInt(e);return t==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(t=Uf(this.input.slice(n,this.pos)),++this.pos):qn(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(d.num,t)},oe.readNumber=function(e){var n=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(n,"Invalid number");var t=this.pos-n>=2&&this.input.charCodeAt(n)===48;t&&this.strict&&this.raise(n,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!t&&!e&&this.options.ecmaVersion>=11&&r===110){var s=Uf(this.input.slice(n,this.pos));return++this.pos,qn(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(d.num,s)}t&&/[89]/.test(this.input.slice(n,this.pos))&&(t=!1),r===46&&!t&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!t&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(n,"Invalid number")),qn(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var i=n0(this.input.slice(n,this.pos),t);return this.finishToken(d.num,i)},oe.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),n;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;n=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,n>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else n=this.readHexChar(4);return n},oe.readString=function(e){for(var n="",t=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(n+=this.input.slice(t,this.pos),n+=this.readEscapedChar(!1),t=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(rr(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return n+=this.input.slice(t,this.pos++),this.finishToken(d.string,n)};var jf={};oe.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===jf)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},oe.invalidStringToken=function(e,n){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw jf;this.raise(e,n)},oe.readTmplToken=function(){for(var e="",n=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var t=this.input.charCodeAt(this.pos);if(t===96||t===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===d.template||this.type===d.invalidTemplate)?t===36?(this.pos+=2,this.finishToken(d.dollarBraceL)):(++this.pos,this.finishToken(d.backQuote)):(e+=this.input.slice(n,this.pos),this.finishToken(d.template,e));if(t===92)e+=this.input.slice(n,this.pos),e+=this.readEscapedChar(!0),n=this.pos;else if(rr(t)){switch(e+=this.input.slice(n,this.pos),++this.pos,t){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
85
+ `;break;default:e+=String.fromCharCode(t);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),n=this.pos}else++this.pos}},oe.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(d.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
90
86
  `&&++this.pos;case`
91
- `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},Oe.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
92
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ts(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(s,8);return r>255&&(s=s.slice(0,-1),r=parseInt(s,8)),this.pos+=s.length-1,t=this.input.charCodeAt(this.pos),(s!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-s.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return Ws(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},Oe.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,"Bad character escape sequence"),n},Oe.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,s=this.options.ecmaVersion>=6;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(es(r,s))this.pos+=r<=65535?1:2;else if(r===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var o=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var c=this.readCodePoint();(t?Sn:es)(c,s)||this.invalidStringToken(o,"Invalid Unicode escape"),e+=ts(c),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Oe.readWord=function(){var e=this.readWord1(),t=S.name;return this.keywords.test(e)&&(t=co[e]),this.finishToken(t,e)};var Yy="8.15.0";nt.acorn={Parser:nt,version:Yy,defaultOptions:uo,Position:Br,SourceLocation:Yi,getLineInfo:Kc,Node:Qi,TokenType:$e,tokTypes:S,keywordTypes:co,TokContext:hn,tokContexts:Ge,isIdentifierChar:es,isIdentifierStart:Sn,Token:vo,isNewLine:Ws,lineBreak:Bt,lineBreakG:hy,nonASCIIwhitespace:Gc};function wo(e,t){return nt.parse(e,t)}function Uk(e,t,n){return nt.parseExpressionAt(e,t,n)}function jk(e,t){return nt.tokenizer(e,t)}const Vk=Object.freeze(Object.defineProperty({__proto__:null,Node:Qi,Parser:nt,Position:Br,SourceLocation:Yi,TokContext:hn,Token:vo,TokenType:$e,defaultOptions:uo,getLineInfo:Kc,isIdentifierChar:es,isIdentifierStart:Sn,isNewLine:Ws,keywordTypes:co,lineBreak:Bt,lineBreakG:hy,nonASCIIwhitespace:Gc,parse:wo,parseExpressionAt:Uk,tokContexts:Ge,tokTypes:S,tokenizer:jk,version:Yy},Symbol.toStringTag,{value:"Module"})),Zy=/\bawait\b/,Hk=/\basync\b/,Xy=new RegExp("(?<![.\\w])await\\s+(?=[\\w$(\"'\\[`!~+\\-/])","g"),Wk=new RegExp("(?<![.\\w])async\\s+(?=function[\\s*(])","g"),zk=new RegExp("(?<![.\\w])async\\s+(?=\\()","g"),qk=new RegExp("(?<![.\\w])async\\s+(?=\\w+\\s*=>)","g");function Gk(e,t="topLevelOnly"){const n=t==="full";if(!n&&!Zy.test(e)||n&&!Zy.test(e)&&!Hk.test(e))return e;try{let s=function(p){if(!p||typeof p!="object")return;if(Array.isArray(p)){for(const g of p)s(g);return}if(typeof p.type!="string")return;const y=(p.type==="FunctionDeclaration"||p.type==="FunctionExpression"||p.type==="ArrowFunctionExpression")&&p.async;if(y&&c++,n&&y&&!p.generator)if(e.slice(p.start,p.start+5)==="async"){let g=p.start+5;for(;g<e.length&&(e[g]===" "||e[g]===" ");)g++;o.push([p.start,g,""])}else{const g=Math.max(0,p.start-30),k=e.slice(g,p.start).lastIndexOf("async");if(k>=0){const C=g+k;let T=C+5;for(;T<e.length&&(e[T]===" "||e[T]===" ");)T++;o.push([C,T,""])}}if(p.type==="AwaitExpression"&&(n||c===0)){let g=p.start+5;for(;g<p.argument.start&&(e[g]===" "||e[g]===" "||e[g]===`
93
- `||e[g]==="\r");)g++;o.push([p.start,g,"__syncAwait("]),o.push([p.end,p.end,")"])}if(p.type==="ForOfStatement"&&p.await&&(n||c===0)){const g=p.start+3,k=e.slice(g,p.left.start).indexOf("await");if(k>=0){const C=g+k;let T=C+5;for(;T<e.length&&e[T]===" ";)T++;o.push([C,T,""])}}for(const g in p){if(g==="type"||g==="start"||g==="end")continue;const x=p[g];x&&typeof x=="object"&&s(x)}y&&c--},r;try{r=wo(e,{ecmaVersion:"latest",sourceType:"script",allowAwaitOutsideFunction:!0})}catch{r=wo(e,{ecmaVersion:"latest",sourceType:"module"})}const o=[];let c=0;if(s(r),o.length===0)return e;let d=e;o.sort((p,y)=>y[0]-p[0]||y[1]-p[1]);for(const[p,y,g]of o)d=d.slice(0,p)+g+d.slice(y);return d}catch{if(n){let s=e.replace(Xy,"");return s=s.replace(Wk,""),s=s.replace(zk,""),s=s.replace(qk,""),s}return e.replace(Xy,"")}}const Kk=new Set(["assert","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","http2","https","inspector","module","net","os","path","perf_hooks","process","punycode","querystring","readline","stream","string_decoder","sys","timers","tls","tty","url","util","v8","vm","worker_threads","zlib"]);let Xt=null,ta=null,Jy=uc,vs=null;function Qy(e){vs=e}function e_(e){Jy=e}async function na(e){if(!Xt){if(typeof window<"u"&&window.__esbuild){Xt=window.__esbuild;return}if(typeof window<"u"&&window.__esbuildInitPromise&&(await window.__esbuildInitPromise,window.__esbuild)){Xt=window.__esbuild;return}return ta||(ta=(async()=>{try{const t=await Ga(px);await t.initialize({wasmURL:(e==null?void 0:e.wasmURL)||Jy}),Xt=t}catch(t){throw ta=null,new Error(`esbuild: initialization failed -- ${t}`)}})(),ta)}}async function t_(e,t){ls();try{if(Xt||await na(),!Xt)throw new Error("esbuild: engine not ready");return await Xt.transform(e,t)}finally{An()}}async function su(e){if(Xt||await na(),!Xt)throw new Error("esbuild: engine not ready");ls();try{const t=iC(e.external,e.platform,e.conditions),n=[...e.plugins||[]];t&&n.push(t);let s=e.entryPoints;if(s&&vs){const d=e.absWorkingDir||So();s=s.map(p=>nC(p,d))}const r=e.absWorkingDir||So(),o=e.write!==!1,c=await Xt.build({...e,entryPoints:s,plugins:n,write:!1,absWorkingDir:r});if(rC(c),o&&c.outputFiles&&vs)for(const d of c.outputFiles){const p=d.path.startsWith("/")?d.path:r+"/"+d.path,y=p.substring(0,p.lastIndexOf("/"));y&&!vs.existsSync(y)&&vs.mkdirSync(y,{recursive:!0}),vs.writeFileSync(p,d.text)}return c}finally{An()}}function n_(e,t){if(!Xt)throw new Error("esbuild: engine not ready");return Xt.formatMessages(e,t)}const s_="0.21.5";async function r_(e){ls();try{Xt||await na()}finally{An()}let t=!1;return{async rebuild(){if(t)throw new Error("Build context already disposed");return su(e)},async watch(s){},async serve(s){return{host:"localhost",port:0}},async cancel(){},async dispose(){t=!0}}}function i_(){}async function a_(e,t){const n=typeof e=="string"?JSON.parse(e):e,s=(n==null?void 0:n.outputs)??{},r=[];for(const[o,c]of Object.entries(s)){const d=(c==null?void 0:c.bytes)??0;r.push(` ${o} ${(d/1024).toFixed(1)}kb`)}return r.join(`
94
- `)}function o_(e,t){const n=typeof e=="string"?JSON.parse(e):e,s=(n==null?void 0:n.outputs)??{},r=[];for(const[o,c]of Object.entries(s)){const d=(c==null?void 0:c.bytes)??0;r.push(` ${o} ${(d/1024).toFixed(1)}kb`)}return r.join(`
95
- `)}function l_(e,t){return{code:e,map:"",warnings:[]}}function c_(e){return{errors:[],warnings:[],outputFiles:[]}}const Yk={initialize:na,transform:t_,transformSync:l_,build:su,buildSync:c_,context:r_,stop:i_,formatMessages:n_,analyzeMetafile:a_,analyzeMetafileSync:o_,version:s_,setVolume:Qy,setWasmUrl:e_},Zk=["node","browser","require","module","import","default"],Xk=["browser","module","import","node","require","default"];function Fr(e,t,n){if(typeof e=="string")return e;if(typeof e=="object"&&e!==null){if(n)for(const r of n){const o=e[r];if(o!==void 0){const c=Fr(o,t,n);if(c)return c}}const s=t==="browser"?Xk:Zk;for(const r of s){const o=e[r];if(o!==void 0){const c=Fr(o,t,n);if(c)return c}}}}function Jk(e,t,n,s,r,o){const c=t.split("/"),d=c[0].startsWith("@"),p=d?c.slice(0,2).join("/"):c[0],y=d?c.slice(2).join("/"):c.slice(1).join("/"),g=[];if(s){let C=s;for(;C!=="/"&&C;){g.push(C+"/node_modules/"+p);const T=C.substring(0,C.lastIndexOf("/"))||"/";if(T===C)break;C=T}}g.push("/node_modules/"+p),g.push("/project/node_modules/"+p);let x=null;for(const C of g)if(e.existsSync(C)){x=C;break}if(!x)return null;const k=x+"/package.json";if(!e.existsSync(k))return null;try{const C=e.readFileSync(k,"utf8"),T=JSON.parse(C);let L=null;if(y?L=Qk(e,T,x,y,n,r,o):L=eC(e,T,x,n,r,o),L)return{resolvedPath:L,fromVolume:!0}}catch{}return null}function Qk(e,t,n,s,r,o,c){if(t.exports&&typeof t.exports=="object"){const d="./"+s,p=t.exports[d];if(p){const y=Fr(p,o,c);if(y){const g=n+"/"+y.replace(/^\.\//,""),x=jn(e,g,["",".js",".ts",".mjs"]);if(x)return x}}}return jn(e,n+"/"+s,r)}function eC(e,t,n,s,r,o){if(t.exports){const d=typeof t.exports=="object"&&!Array.isArray(t.exports)&&t.exports["."]||t.exports,p=Fr(d,r,o);if(p){const y=n+"/"+p.replace(/^\.\//,""),g=jn(e,y,["",".js",".ts",".mjs"]);if(g)return g}}const c=t.module||t.main||"index.js";return jn(e,n+"/"+c.replace(/^\.\//,""),s)}function tC(e,t,n,s,r,o){let c=s;for(;c&&c!=="/";){const d=c+"/package.json";if(e.existsSync(d))try{const y=JSON.parse(e.readFileSync(d,"utf8"));if(y.imports){const g=y.imports[t];if(g!==void 0){const x=Fr(g,r,o);if(x){const k=c+"/"+x.replace(/^\.\//,""),C=jn(e,k,["",...n]);if(C)return C}}for(const x of Object.keys(y.imports)){const k=x.indexOf("*");if(k===-1)continue;const C=x.slice(0,k),T=x.slice(k+1);if(t.startsWith(C)&&t.endsWith(T)&&t.length>=C.length+T.length){const L=T.length?t.slice(C.length,-T.length):t.slice(C.length),V=Fr(y.imports[x],r,o);if(V){const K=V.replace(/\*/g,L),J=c+"/"+K.replace(/^\.\//,""),X=jn(e,J,["",...n]);if(X)return X}}}}}catch{}const p=c.substring(0,c.lastIndexOf("/"))||"/";if(p===c)break;c=p}return null}function jn(e,t,n){for(const s of n){const r=t+s;if(e.existsSync(r))try{if(!e.statSync(r).isDirectory())return r}catch{return r}}return null}function So(){return typeof globalThis<"u"&&globalThis.process&&typeof globalThis.process.cwd=="function"?globalThis.process.cwd():"/"}function nC(e,t){if(e.includes("vfs:")&&(e=e.substring(e.indexOf("vfs:")+4)),e.startsWith("/"))return e;if(e.startsWith("./"))return(t.endsWith("/")?t.slice(0,-1):t)+"/"+e.slice(2);if(e.startsWith("../")){const n=(t.endsWith("/")?t.slice(0,-1):t).split("/").filter(Boolean);return n.pop(),"/"+n.join("/")+"/"+e.slice(3)}return e}function sC(e){const t=e.split("/").filter(Boolean),n=[];for(const s of t)s===".."?n.pop():s!=="."&&n.push(s);return"/"+n.join("/")}function rC(e){if(e.outputFiles)for(const t of e.outputFiles)t.path.includes("vfs:")&&(t.path=t.path.replace(/vfs:/g,""));if(e.metafile){const t=e.metafile;for(const n of["inputs","outputs"]){const s=t[n];if(s)for(const r of Object.keys(s))r.includes("vfs:")&&(s[r.replace(/vfs:/g,"")]=s[r],delete s[r])}}}function iC(e,t,n){if(!vs)return null;const s=vs;return{name:"volume-loader",setup(r){const o=r,c=["",...P],d=new Map;function p(y){return{path:y,pluginData:{fromVolume:!0}}}o.onResolve({filter:/.*/},y=>{const{path:g,importer:x}=y;if(g.endsWith(".node"))return{external:!0};if(!g.startsWith(".")&&!g.startsWith("/")&&!g.startsWith("#")){const L=g.split("/"),K=L[0].startsWith("@")?L.slice(0,2).join("/"):L[0],J=d.get(K);if(J===!0)return{external:!0};if(J===void 0){const X=[];if(x){let $=x.substring(0,x.lastIndexOf("/"));for(;$&&$!=="/";)X.push($+"/node_modules/"+K),$=$.substring(0,$.lastIndexOf("/"))||"/"}X.push("/node_modules/"+K),X.push("/project/node_modules/"+K);let G=!1;for(const $ of X)if(s.existsSync($)){try{const te=JSON.parse(s.readFileSync($+"/package.json","utf8"));(te.napi||te.binary||te.gypfile)&&(G=!0)}catch{}break}if(d.set(K,G),G)return{external:!0}}}if(g.startsWith("node_modules/")){const L="/"+g,V=jn(s,L,c);return V?p(V):{external:!0}}if(g.startsWith("/")){const L=jn(s,g,c);return L?p(L):{external:!0}}if(g.startsWith(".")){let L=g;x&&(L=x.substring(0,x.lastIndexOf("/"))+"/"+g);const V=sC(L),K=jn(s,V,c);if(K)return p(K);for(const J of[".ts",".tsx",".js",".jsx"]){const X=jn(s,V+"/index"+J,[""]);if(X)return p(X)}}if(g.startsWith("#")){const L=x?x.substring(0,x.lastIndexOf("/")):So(),V=tC(s,g,c,L,t,n);return V?p(V):{external:!0}}if(e&&e.some(L=>g===L||g.startsWith(L+"/")))return{external:!0};const k=x?x.substring(0,x.lastIndexOf("/")):So(),C=Jk(s,g,c,k,t,n);if(C)return{path:C.resolvedPath,pluginData:{fromVolume:!0}};const T=g.replace(/^node:/,"");if(Kk.has(T))return{external:!0};if(y.kind!=="entry-point")return{external:!0}}),o.onLoad({filter:/.*/,namespace:"builtin-stub"},()=>({contents:"module.exports = {};",loader:"js"})),o.onLoad({filter:/.*/},y=>{var g,x;if(y.namespace&&y.namespace!=="file"&&y.namespace!=="")return null;if(!((g=y.pluginData)==null?void 0:g.fromVolume)){let C=y.path;if(C.startsWith("/")||(C="/"+C),!s.existsSync(C))return null;y={...y,path:C,pluginData:{fromVolume:!0,actualPath:C}}}try{const C=((x=y.pluginData)==null?void 0:x.actualPath)||y.path;let T;if(s.existsSync(C))T=s.readFileSync(C,"utf8");else throw new Error(`Not found: ${C}`);if(C.includes("node_modules")&&/require\(.+\.node['"`)]/m.test(T.slice(0,4096)))return{contents:"module.exports = {};",loader:"js"};/\bawait\b/.test(T)&&!y.path.endsWith(".mjs")&&(T=Gk(T,"topLevelOnly"));const L=C.lastIndexOf("."),V=L>=0?C.substring(L):"";let J=j[V];return J?{contents:T,loader:J}:null}catch(C){return y.path.endsWith(".map")?{contents:'{"version":3,"sources":[],"mappings":""}',loader:"json"}:{errors:[{text:`volume-loader: ${y.path} -- ${C}`}]}}})}}}U0=Object.freeze(Object.defineProperty({__proto__:null,analyzeMetafile:a_,analyzeMetafileSync:o_,build:su,buildSync:c_,context:r_,default:Yk,formatMessages:n_,initialize:na,setVolume:Qy,setWasmUrl:e_,stop:i_,transform:t_,transformSync:l_,version:s_},Symbol.toStringTag,{value:"Module"}));function aC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function oC(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}),n}var u_={exports:{}},lC={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};const d_=oC(Vk);(function(e){const t=lC,n=/^[\da-fA-F]+$/,s=/^\d+$/,r=new WeakMap;function o(p){p=p.Parser.acorn||p;let y=r.get(p);if(!y){const g=p.tokTypes,x=p.TokContext,k=p.TokenType,C=new x("<tag",!1),T=new x("</tag",!1),L=new x("<tag>...</tag>",!0,!0),V={tc_oTag:C,tc_cTag:T,tc_expr:L},K={jsxName:new k("jsxName"),jsxText:new k("jsxText",{beforeExpr:!0}),jsxTagStart:new k("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new k("jsxTagEnd")};K.jsxTagStart.updateContext=function(){this.context.push(L),this.context.push(C),this.exprAllowed=!1},K.jsxTagEnd.updateContext=function(J){let X=this.context.pop();X===C&&J===g.slash||X===T?(this.context.pop(),this.exprAllowed=this.curContext()===L):this.exprAllowed=!0},y={tokContexts:V,tokTypes:K},r.set(p,y)}return y}function c(p){if(!p)return p;if(p.type==="JSXIdentifier")return p.name;if(p.type==="JSXNamespacedName")return p.namespace.name+":"+p.name.name;if(p.type==="JSXMemberExpression")return c(p.object)+"."+c(p.property)}e.exports=function(p){return p=p||{},function(y){return d({allowNamespaces:p.allowNamespaces!==!1,allowNamespacedObjects:!!p.allowNamespacedObjects},y)}},Object.defineProperty(e.exports,"tokTypes",{get:function(){return o(d_).tokTypes},configurable:!0,enumerable:!0});function d(p,y){const g=y.acorn||d_,x=o(g),k=g.tokTypes,C=x.tokTypes,T=g.tokContexts,L=x.tokContexts.tc_oTag,V=x.tokContexts.tc_cTag,K=x.tokContexts.tc_expr,J=g.isNewLine,X=g.isIdentifierStart,G=g.isIdentifierChar;return class extends y{static get acornJsx(){return x}jsx_readToken(){let $="",te=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let I=this.input.charCodeAt(this.pos);switch(I){case 60:case 123:return this.pos===this.start?I===60&&this.exprAllowed?(++this.pos,this.finishToken(C.jsxTagStart)):this.getTokenFromCode(I):($+=this.input.slice(te,this.pos),this.finishToken(C.jsxText,$));case 38:$+=this.input.slice(te,this.pos),$+=this.jsx_readEntity(),te=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(I===62?"&gt;":"&rbrace;")+'` or `{"'+this.input[this.pos]+'"}`?');default:J(I)?($+=this.input.slice(te,this.pos),$+=this.jsx_readNewLine(!0),te=this.pos):++this.pos}}}jsx_readNewLine($){let te=this.input.charCodeAt(this.pos),I;return++this.pos,te===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,I=$?`
87
+ `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},oe.readEscapedChar=function(e){var n=this.input.charCodeAt(++this.pos);switch(++this.pos,n){case 110:return`
88
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return wt(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var t=this.pos-1;this.invalidStringToken(t,"Invalid escape sequence in template string")}default:if(n>=48&&n<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(r,8);return s>255&&(r=r.slice(0,-1),s=parseInt(r,8)),this.pos+=r.length-1,n=this.input.charCodeAt(this.pos),(r!=="0"||n===56||n===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return rr(n)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(n)}},oe.readHexChar=function(e){var n=this.pos,t=this.readInt(16,e);return t===null&&this.invalidStringToken(n,"Bad character escape sequence"),t},oe.readWord1=function(){this.containsEsc=!1;for(var e="",n=!0,t=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(vt(s,r))this.pos+=s<=65535?1:2;else if(s===92){this.containsEsc=!0,e+=this.input.slice(t,this.pos);var i=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(n?qn:vt)(a,r)||this.invalidStringToken(i,"Invalid Unicode escape"),e+=wt(a),t=this.pos}else break;n=!1}return e+this.input.slice(t,this.pos)},oe.readWord=function(){var e=this.readWord1(),n=d.name;return this.keywords.test(e)&&(n=qi[e]),this.finishToken(n,e)};var Hf="8.15.0";Re.acorn={Parser:Re,version:Hf,defaultOptions:zi,Position:Vr,SourceLocation:Ws,getLineInfo:ul,Node:Gs,TokenType:he,tokTypes:d,keywordTypes:qi,TokContext:Un,tokContexts:Se,isIdentifierChar:vt,isIdentifierStart:qn,Token:na,isNewLine:rr,lineBreak:un,lineBreakG:sf,nonASCIIwhitespace:cl};function ta(e,n){return Re.parse(e,n)}function t0(e,n,t){return Re.parseExpressionAt(e,n,t)}function r0(e,n){return Re.tokenizer(e,n)}const s0=Object.freeze(Object.defineProperty({__proto__:null,Node:Gs,Parser:Re,Position:Vr,SourceLocation:Ws,TokContext:Un,Token:na,TokenType:he,defaultOptions:zi,getLineInfo:ul,isIdentifierChar:vt,isIdentifierStart:qn,isNewLine:rr,keywordTypes:qi,lineBreak:un,lineBreakG:sf,nonASCIIwhitespace:cl,parse:ta,parseExpressionAt:t0,tokContexts:Se,tokTypes:d,tokenizer:r0,version:Hf},Symbol.toStringTag,{value:"Module"})),Wf=/\bawait\b/,i0=/\basync\b/,Vf=new RegExp("(?<![.\\w])await\\s+(?=[\\w$(\"'\\[`!~+\\-/])","g"),a0=new RegExp("(?<![.\\w])async\\s+(?=function[\\s*(])","g"),o0=new RegExp("(?<![.\\w])async\\s+(?=\\()","g"),l0=new RegExp("(?<![.\\w])async\\s+(?=\\w+\\s*=>)","g");function c0(e,n="topLevelOnly"){const t=n==="full";if(!t&&!Wf.test(e)||t&&!Wf.test(e)&&!i0.test(e))return e;try{let r=function(l){if(!l||typeof l!="object")return;if(Array.isArray(l)){for(const c of l)r(c);return}if(typeof l.type!="string")return;const u=(l.type==="FunctionDeclaration"||l.type==="FunctionExpression"||l.type==="ArrowFunctionExpression")&&l.async;if(u&&a++,t&&u&&!l.generator)if(e.slice(l.start,l.start+5)==="async"){let c=l.start+5;for(;c<e.length&&(e[c]===" "||e[c]===" ");)c++;i.push([l.start,c,""])}else{const c=Math.max(0,l.start-30),h=e.slice(c,l.start).lastIndexOf("async");if(h>=0){const f=c+h;let m=f+5;for(;m<e.length&&(e[m]===" "||e[m]===" ");)m++;i.push([f,m,""])}}if(l.type==="AwaitExpression"&&(t||a===0)){let c=l.start+5;for(;c<l.argument.start&&(e[c]===" "||e[c]===" "||e[c]===`
89
+ `||e[c]==="\r");)c++;i.push([l.start,c,"__syncAwait("]),i.push([l.end,l.end,")"])}if(l.type==="ForOfStatement"&&l.await&&(t||a===0)){const c=l.start+3,h=e.slice(c,l.left.start).indexOf("await");if(h>=0){const f=c+h;let m=f+5;for(;m<e.length&&e[m]===" ";)m++;i.push([f,m,""])}}for(const c in l){if(c==="type"||c==="start"||c==="end")continue;const p=l[c];p&&typeof p=="object"&&r(p)}u&&a--},s;try{s=ta(e,{ecmaVersion:"latest",sourceType:"script",allowAwaitOutsideFunction:!0})}catch{s=ta(e,{ecmaVersion:"latest",sourceType:"module"})}const i=[];let a=0;if(r(s),i.length===0)return e;let o=e;i.sort((l,u)=>u[0]-l[0]||u[1]-l[1]);for(const[l,u,c]of i)o=o.slice(0,l)+c+o.slice(u);return o}catch{if(t){let r=e.replace(Vf,"");return r=r.replace(a0,""),r=r.replace(o0,""),r=r.replace(l0,""),r}return e.replace(Vf,"")}}const u0=new Set(["assert","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","http2","https","inspector","module","net","os","path","perf_hooks","process","punycode","querystring","readline","stream","string_decoder","sys","timers","tls","tty","url","util","v8","vm","worker_threads","zlib"]);let En=null,Ys=null,qf=Co,Mt=null;function zf(e){Mt=e}function Gf(e){qf=e}async function Zs(e){if(!En){if(typeof window<"u"&&window.__esbuild){En=window.__esbuild;return}if(typeof window<"u"&&window.__esbuildInitPromise&&(await window.__esbuildInitPromise,window.__esbuild)){En=window.__esbuild;return}return Ys||(Ys=(async()=>{try{const n=await Ii(Iy);await n.initialize({wasmURL:(e==null?void 0:e.wasmURL)||qf}),En=n}catch(n){throw Ys=null,new Error(`esbuild: initialization failed -- ${n}`)}})(),Ys)}}async function Kf(e,n){Tt();try{if(En||await Zs(),!En)throw new Error("esbuild: engine not ready");return await En.transform(e,n)}finally{Yn()}}async function bl(e){if(En||await Zs(),!En)throw new Error("esbuild: engine not ready");Tt();try{const n=w0(e.external,e.platform,e.conditions),t=[...e.plugins||[]];n&&t.push(n);let r=e.entryPoints;if(r&&Mt){const o=e.absWorkingDir||ra();r=r.map(l=>y0(l,o))}const s=e.absWorkingDir||ra(),i=e.write!==!1,a=await En.build({...e,entryPoints:r,plugins:t,write:!1,absWorkingDir:s});if(v0(a),i&&a.outputFiles&&Mt)for(const o of a.outputFiles){const l=o.path.startsWith("/")?o.path:s+"/"+o.path,u=l.substring(0,l.lastIndexOf("/"));u&&!Mt.existsSync(u)&&Mt.mkdirSync(u,{recursive:!0}),Mt.writeFileSync(l,o.text)}return a}finally{Yn()}}function Yf(e,n){if(!En)throw new Error("esbuild: engine not ready");return En.formatMessages(e,n)}const Zf="0.21.5";async function Xf(e){Tt();try{En||await Zs()}finally{Yn()}let n=!1;return{async rebuild(){if(n)throw new Error("Build context already disposed");return bl(e)},async watch(r){},async serve(r){return{host:"localhost",port:0}},async cancel(){},async dispose(){n=!0}}}function Jf(){}async function Qf(e,n){const t=typeof e=="string"?JSON.parse(e):e,r=(t==null?void 0:t.outputs)??{},s=[];for(const[i,a]of Object.entries(r)){const o=(a==null?void 0:a.bytes)??0;s.push(` ${i} ${(o/1024).toFixed(1)}kb`)}return s.join(`
90
+ `)}function em(e,n){const t=typeof e=="string"?JSON.parse(e):e,r=(t==null?void 0:t.outputs)??{},s=[];for(const[i,a]of Object.entries(r)){const o=(a==null?void 0:a.bytes)??0;s.push(` ${i} ${(o/1024).toFixed(1)}kb`)}return s.join(`
91
+ `)}function nm(e,n){return{code:e,map:"",warnings:[]}}function tm(e){return{errors:[],warnings:[],outputFiles:[]}}const d0={initialize:Zs,transform:Kf,transformSync:nm,build:bl,buildSync:tm,context:Xf,stop:Jf,formatMessages:Yf,analyzeMetafile:Qf,analyzeMetafileSync:em,version:Zf,setVolume:zf,setWasmUrl:Gf},p0=["node","browser","require","module","import","default"],h0=["browser","module","import","node","require","default"];function Gr(e,n,t){if(typeof e=="string")return e;if(typeof e=="object"&&e!==null){if(t)for(const s of t){const i=e[s];if(i!==void 0){const a=Gr(i,n,t);if(a)return a}}const r=n==="browser"?h0:p0;for(const s of r){const i=e[s];if(i!==void 0){const a=Gr(i,n,t);if(a)return a}}}}function f0(e,n,t,r,s,i){const a=n.split("/"),o=a[0].startsWith("@"),l=o?a.slice(0,2).join("/"):a[0],u=o?a.slice(2).join("/"):a.slice(1).join("/"),c=[];if(r){let f=r;for(;f!=="/"&&f;){c.push(f+"/node_modules/"+l);const m=f.substring(0,f.lastIndexOf("/"))||"/";if(m===f)break;f=m}}c.push("/node_modules/"+l),c.push("/project/node_modules/"+l);let p=null;for(const f of c)if(e.existsSync(f)){p=f;break}if(!p)return null;const h=p+"/package.json";if(!e.existsSync(h))return null;try{const f=e.readFileSync(h,"utf8"),m=JSON.parse(f);let v=null;if(u?v=m0(e,m,p,u,t,s,i):v=g0(e,m,p,t,s,i),v)return{resolvedPath:v,fromVolume:!0}}catch{}return null}function m0(e,n,t,r,s,i,a){if(n.exports&&typeof n.exports=="object"){const o="./"+r,l=n.exports[o];if(l){const u=Gr(l,i,a);if(u){const c=t+"/"+u.replace(/^\.\//,""),p=ct(e,c,["",".js",".ts",".mjs"]);if(p)return p}}}return ct(e,t+"/"+r,s)}function g0(e,n,t,r,s,i){if(n.exports){const o=typeof n.exports=="object"&&!Array.isArray(n.exports)&&n.exports["."]||n.exports,l=Gr(o,s,i);if(l){const u=t+"/"+l.replace(/^\.\//,""),c=ct(e,u,["",".js",".ts",".mjs"]);if(c)return c}}const a=n.module||n.main||"index.js";return ct(e,t+"/"+a.replace(/^\.\//,""),r)}function _0(e,n,t,r,s,i){let a=r;for(;a&&a!=="/";){const o=a+"/package.json";if(e.existsSync(o))try{const u=JSON.parse(e.readFileSync(o,"utf8"));if(u.imports){const c=u.imports[n];if(c!==void 0){const p=Gr(c,s,i);if(p){const h=a+"/"+p.replace(/^\.\//,""),f=ct(e,h,["",...t]);if(f)return f}}for(const p of Object.keys(u.imports)){const h=p.indexOf("*");if(h===-1)continue;const f=p.slice(0,h),m=p.slice(h+1);if(n.startsWith(f)&&n.endsWith(m)&&n.length>=f.length+m.length){const v=m.length?n.slice(f.length,-m.length):n.slice(f.length),k=Gr(u.imports[p],s,i);if(k){const P=k.replace(/\*/g,v),N=a+"/"+P.replace(/^\.\//,""),O=ct(e,N,["",...t]);if(O)return O}}}}}catch{}const l=a.substring(0,a.lastIndexOf("/"))||"/";if(l===a)break;a=l}return null}function ct(e,n,t){for(const r of t){const s=n+r;if(e.existsSync(s))try{if(!e.statSync(s).isDirectory())return s}catch{return s}}return null}function ra(){return typeof globalThis<"u"&&globalThis.process&&typeof globalThis.process.cwd=="function"?globalThis.process.cwd():"/"}function y0(e,n){if(e.includes("vfs:")&&(e=e.substring(e.indexOf("vfs:")+4)),e.startsWith("/"))return e;if(e.startsWith("./"))return(n.endsWith("/")?n.slice(0,-1):n)+"/"+e.slice(2);if(e.startsWith("../")){const t=(n.endsWith("/")?n.slice(0,-1):n).split("/").filter(Boolean);return t.pop(),"/"+t.join("/")+"/"+e.slice(3)}return e}function b0(e){const n=e.split("/").filter(Boolean),t=[];for(const r of n)r===".."?t.pop():r!=="."&&t.push(r);return"/"+t.join("/")}function v0(e){if(e.outputFiles)for(const n of e.outputFiles)n.path.includes("vfs:")&&(n.path=n.path.replace(/vfs:/g,""));if(e.metafile){const n=e.metafile;for(const t of["inputs","outputs"]){const r=n[t];if(r)for(const s of Object.keys(r))s.includes("vfs:")&&(r[s.replace(/vfs:/g,"")]=r[s],delete r[s])}}}function w0(e,n,t){if(!Mt)return null;const r=Mt;return{name:"volume-loader",setup(s){const i=s,a=["",...sn],o=new Map;function l(u){return{path:u,pluginData:{fromVolume:!0}}}i.onResolve({filter:/.*/},u=>{const{path:c,importer:p}=u;if(c.endsWith(".node"))return{external:!0};if(!c.startsWith(".")&&!c.startsWith("/")&&!c.startsWith("#")){const v=c.split("/"),P=v[0].startsWith("@")?v.slice(0,2).join("/"):v[0],N=o.get(P);if(N===!0)return{external:!0};if(N===void 0){const O=[];if(p){let S=p.substring(0,p.lastIndexOf("/"));for(;S&&S!=="/";)O.push(S+"/node_modules/"+P),S=S.substring(0,S.lastIndexOf("/"))||"/"}O.push("/node_modules/"+P),O.push("/project/node_modules/"+P);let R=!1;for(const S of O)if(r.existsSync(S)){try{const F=JSON.parse(r.readFileSync(S+"/package.json","utf8"));(F.napi||F.binary||F.gypfile)&&(R=!0)}catch{}break}if(o.set(P,R),R)return{external:!0}}}if(c.startsWith("node_modules/")){const v="/"+c,k=ct(r,v,a);return k?l(k):{external:!0}}if(c.startsWith("/")){const v=ct(r,c,a);return v?l(v):{external:!0}}if(c.startsWith(".")){let v=c;p&&(v=p.substring(0,p.lastIndexOf("/"))+"/"+c);const k=b0(v),P=ct(r,k,a);if(P)return l(P);for(const N of[".ts",".tsx",".js",".jsx"]){const O=ct(r,k+"/index"+N,[""]);if(O)return l(O)}}if(c.startsWith("#")){const v=p?p.substring(0,p.lastIndexOf("/")):ra(),k=_0(r,c,a,v,n,t);return k?l(k):{external:!0}}if(e&&e.some(v=>c===v||c.startsWith(v+"/")))return{external:!0};const h=p?p.substring(0,p.lastIndexOf("/")):ra(),f=f0(r,c,a,h,n,t);if(f)return{path:f.resolvedPath,pluginData:{fromVolume:!0}};const m=c.replace(/^node:/,"");if(u0.has(m))return{external:!0};if(u.kind!=="entry-point")return{external:!0}}),i.onLoad({filter:/.*/,namespace:"builtin-stub"},()=>({contents:"module.exports = {};",loader:"js"})),i.onLoad({filter:/.*/},u=>{var c,p;if(u.namespace&&u.namespace!=="file"&&u.namespace!=="")return null;if(!((c=u.pluginData)==null?void 0:c.fromVolume)){let f=u.path;if(f.startsWith("/")||(f="/"+f),!r.existsSync(f))return null;u={...u,path:f,pluginData:{fromVolume:!0,actualPath:f}}}try{const f=((p=u.pluginData)==null?void 0:p.actualPath)||u.path;let m;if(r.existsSync(f))m=r.readFileSync(f,"utf8");else throw new Error(`Not found: ${f}`);if(f.includes("node_modules")&&/require\(.+\.node['"`)]/m.test(m.slice(0,4096)))return{contents:"module.exports = {};",loader:"js"};/\bawait\b/.test(m)&&!u.path.endsWith(".mjs")&&(m=c0(m,"topLevelOnly"));const v=f.lastIndexOf("."),k=v>=0?f.substring(v):"";let N=An[k];return N?{contents:m,loader:N}:null}catch(f){return u.path.endsWith(".map")?{contents:'{"version":3,"sources":[],"mappings":""}',loader:"json"}:{errors:[{text:`volume-loader: ${u.path} -- ${f}`}]}}})}}}Z_=Object.freeze(Object.defineProperty({__proto__:null,analyzeMetafile:Qf,analyzeMetafileSync:em,build:bl,buildSync:tm,context:Xf,default:d0,formatMessages:Yf,initialize:Zs,setVolume:zf,setWasmUrl:Gf,stop:Jf,transform:Kf,transformSync:nm,version:Zf},Symbol.toStringTag,{value:"Module"}));function S0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function x0(e){if(e.__esModule)return e;var n=e.default;if(typeof n=="function"){var t=function r(){return this instanceof r?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};t.prototype=n.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),t}var rm={exports:{}},E0={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};const sm=x0(s0);(function(e){const n=E0,t=/^[\da-fA-F]+$/,r=/^\d+$/,s=new WeakMap;function i(l){l=l.Parser.acorn||l;let u=s.get(l);if(!u){const c=l.tokTypes,p=l.TokContext,h=l.TokenType,f=new p("<tag",!1),m=new p("</tag",!1),v=new p("<tag>...</tag>",!0,!0),k={tc_oTag:f,tc_cTag:m,tc_expr:v},P={jsxName:new h("jsxName"),jsxText:new h("jsxText",{beforeExpr:!0}),jsxTagStart:new h("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new h("jsxTagEnd")};P.jsxTagStart.updateContext=function(){this.context.push(v),this.context.push(f),this.exprAllowed=!1},P.jsxTagEnd.updateContext=function(N){let O=this.context.pop();O===f&&N===c.slash||O===m?(this.context.pop(),this.exprAllowed=this.curContext()===v):this.exprAllowed=!0},u={tokContexts:k,tokTypes:P},s.set(l,u)}return u}function a(l){if(!l)return l;if(l.type==="JSXIdentifier")return l.name;if(l.type==="JSXNamespacedName")return l.namespace.name+":"+l.name.name;if(l.type==="JSXMemberExpression")return a(l.object)+"."+a(l.property)}e.exports=function(l){return l=l||{},function(u){return o({allowNamespaces:l.allowNamespaces!==!1,allowNamespacedObjects:!!l.allowNamespacedObjects},u)}},Object.defineProperty(e.exports,"tokTypes",{get:function(){return i(sm).tokTypes},configurable:!0,enumerable:!0});function o(l,u){const c=u.acorn||sm,p=i(c),h=c.tokTypes,f=p.tokTypes,m=c.tokContexts,v=p.tokContexts.tc_oTag,k=p.tokContexts.tc_cTag,P=p.tokContexts.tc_expr,N=c.isNewLine,O=c.isIdentifierStart,R=c.isIdentifierChar;return class extends u{static get acornJsx(){return p}jsx_readToken(){let S="",F=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let g=this.input.charCodeAt(this.pos);switch(g){case 60:case 123:return this.pos===this.start?g===60&&this.exprAllowed?(++this.pos,this.finishToken(f.jsxTagStart)):this.getTokenFromCode(g):(S+=this.input.slice(F,this.pos),this.finishToken(f.jsxText,S));case 38:S+=this.input.slice(F,this.pos),S+=this.jsx_readEntity(),F=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(g===62?"&gt;":"&rbrace;")+'` or `{"'+this.input[this.pos]+'"}`?');default:N(g)?(S+=this.input.slice(F,this.pos),S+=this.jsx_readNewLine(!0),F=this.pos):++this.pos}}}jsx_readNewLine(S){let F=this.input.charCodeAt(this.pos),g;return++this.pos,F===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,g=S?`
96
92
  `:`\r
97
- `):I=String.fromCharCode(te),this.options.locations&&(++this.curLine,this.lineStart=this.pos),I}jsx_readString($){let te="",I=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let D=this.input.charCodeAt(this.pos);if(D===$)break;D===38?(te+=this.input.slice(I,this.pos),te+=this.jsx_readEntity(),I=this.pos):J(D)?(te+=this.input.slice(I,this.pos),te+=this.jsx_readNewLine(!1),I=this.pos):++this.pos}return te+=this.input.slice(I,this.pos++),this.finishToken(k.string,te)}jsx_readEntity(){let $="",te=0,I,D=this.input[this.pos];D!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let F=++this.pos;for(;this.pos<this.input.length&&te++<10;){if(D=this.input[this.pos++],D===";"){$[0]==="#"?$[1]==="x"?($=$.substr(2),n.test($)&&(I=String.fromCharCode(parseInt($,16)))):($=$.substr(1),s.test($)&&(I=String.fromCharCode(parseInt($,10)))):I=t[$];break}$+=D}return I||(this.pos=F,"&")}jsx_readWord(){let $,te=this.pos;do $=this.input.charCodeAt(++this.pos);while(G($)||$===45);return this.finishToken(C.jsxName,this.input.slice(te,this.pos))}jsx_parseIdentifier(){let $=this.startNode();return this.type===C.jsxName?$.name=this.value:this.type.keyword?$.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode($,"JSXIdentifier")}jsx_parseNamespacedName(){let $=this.start,te=this.startLoc,I=this.jsx_parseIdentifier();if(!p.allowNamespaces||!this.eat(k.colon))return I;var D=this.startNodeAt($,te);return D.namespace=I,D.name=this.jsx_parseIdentifier(),this.finishNode(D,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===C.jsxTagEnd)return"";let $=this.start,te=this.startLoc,I=this.jsx_parseNamespacedName();for(this.type===k.dot&&I.type==="JSXNamespacedName"&&!p.allowNamespacedObjects&&this.unexpected();this.eat(k.dot);){let D=this.startNodeAt($,te);D.object=I,D.property=this.jsx_parseIdentifier(),I=this.finishNode(D,"JSXMemberExpression")}return I}jsx_parseAttributeValue(){switch(this.type){case k.braceL:let $=this.jsx_parseExpressionContainer();return $.expression.type==="JSXEmptyExpression"&&this.raise($.start,"JSX attributes must only be assigned a non-empty expression"),$;case C.jsxTagStart:case k.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let $=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt($,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let $=this.startNode();return this.next(),$.expression=this.type===k.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(k.braceR),this.finishNode($,"JSXExpressionContainer")}jsx_parseAttribute(){let $=this.startNode();return this.eat(k.braceL)?(this.expect(k.ellipsis),$.argument=this.parseMaybeAssign(),this.expect(k.braceR),this.finishNode($,"JSXSpreadAttribute")):($.name=this.jsx_parseNamespacedName(),$.value=this.eat(k.eq)?this.jsx_parseAttributeValue():null,this.finishNode($,"JSXAttribute"))}jsx_parseOpeningElementAt($,te){let I=this.startNodeAt($,te);I.attributes=[];let D=this.jsx_parseElementName();for(D&&(I.name=D);this.type!==k.slash&&this.type!==C.jsxTagEnd;)I.attributes.push(this.jsx_parseAttribute());return I.selfClosing=this.eat(k.slash),this.expect(C.jsxTagEnd),this.finishNode(I,D?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt($,te){let I=this.startNodeAt($,te),D=this.jsx_parseElementName();return D&&(I.name=D),this.expect(C.jsxTagEnd),this.finishNode(I,D?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt($,te){let I=this.startNodeAt($,te),D=[],F=this.jsx_parseOpeningElementAt($,te),U=null;if(!F.selfClosing){e:for(;;)switch(this.type){case C.jsxTagStart:if($=this.start,te=this.startLoc,this.next(),this.eat(k.slash)){U=this.jsx_parseClosingElementAt($,te);break e}D.push(this.jsx_parseElementAt($,te));break;case C.jsxText:D.push(this.parseExprAtom());break;case k.braceL:D.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}c(U.name)!==c(F.name)&&this.raise(U.start,"Expected corresponding JSX closing tag for <"+c(F.name)+">")}let N=F.name?"Element":"Fragment";return I["opening"+N]=F,I["closing"+N]=U,I.children=D,this.type===k.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(I,"JSX"+N)}jsx_parseText(){let $=this.parseLiteral(this.value);return $.type="JSXText",$}jsx_parseElement(){let $=this.start,te=this.startLoc;return this.next(),this.jsx_parseElementAt($,te)}parseExprAtom($){return this.type===C.jsxText?this.jsx_parseText():this.type===C.jsxTagStart?this.jsx_parseElement():super.parseExprAtom($)}readToken($){let te=this.curContext();if(te===K)return this.jsx_readToken();if(te===L||te===V){if(X($))return this.jsx_readWord();if($==62)return++this.pos,this.finishToken(C.jsxTagEnd);if(($===34||$===39)&&te==L)return this.jsx_readString($)}return $===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(C.jsxTagStart)):super.readToken($)}updateContext($){if(this.type==k.braceL){var te=this.curContext();te==L?this.context.push(T.b_expr):te==K?this.context.push(T.b_tmpl):super.updateContext($),this.exprAllowed=!0}else if(this.type===k.slash&&$===C.jsxTagStart)this.context.length-=2,this.context.push(V),this.exprAllowed=!1;else return super.updateContext($)}}}})(u_);var cC=u_.exports;const uC=aC(cC),h_=nt.extend(uC());let ru=null,sa=null;async function xo(){return ru||sa||(sa=(async()=>{try{const e=await Ga(fx);return ru=e,e}catch(e){throw sa=null,new Error(`rollup: failed to load @rollup/browser from CDN -- ${e}`)}})(),sa)}const p_=df;async function f_(e){return(await xo()).rollup(e)}async function m_(e){return(await xo()).watch(e)}function g_(e){return e}function iu(e,t){const n={ecmaVersion:"latest",sourceType:"module",allowReturnOutsideFunction:(t==null?void 0:t.allowReturnOutsideFunction)??!1,locations:!0};if(t!=null&&t.jsx)return h_.parse(e,n);try{return wo(e,n)}catch{return h_.parse(e,n)}}async function y_(e,t){return iu(e,{allowReturnOutsideFunction:t==null?void 0:t.allowReturnOutsideFunction,jsx:t==null?void 0:t.jsx})}function dC(){return""}Object.freeze(Object.defineProperty({__proto__:null,VERSION:p_,default:{VERSION:p_,rollup:f_,watch:m_,defineConfig:g_,parseAst:iu,parseAstAsync:y_,loadRollup:xo},defineConfig:g_,getPackageBase:dC,loadRollup:xo,parseAst:iu,parseAstAsync:y_,rollup:f_,watch:m_},Symbol.toStringTag,{value:"Module"}));function __(){return{total_heap_size:0,total_heap_size_executable:0,total_physical_size:0,total_available_size:0,used_heap_size:0,heap_size_limit:0,malloced_memory:0,peak_malloced_memory:0,does_zap_garbage:0,number_of_native_contexts:0,number_of_detached_contexts:0}}function b_(){return[]}function v_(){return{code_and_metadata_size:0,bytecode_and_metadata_size:0,external_script_source_size:0}}function w_(){return null}function S_(){return""}function x_(e){}function E_(){}function k_(){}function C_(){return 0}function A_(e){return new TextEncoder().encode(JSON.stringify(e))}function T_(e){return JSON.parse(new TextDecoder().decode(e))}const qs=function(){};qs.prototype.writeHeader=function(){},qs.prototype.writeValue=function(t){},qs.prototype.releaseBuffer=function(){return new Uint8Array(0)};const $r=function(t){};$r.prototype.readHeader=function(){return!0},$r.prototype.readValue=function(){return null};const au=function(){this&&qs.call(this)};Object.setPrototypeOf(au.prototype,qs.prototype);const ou=function(t){this&&$r.call(this,t)};Object.setPrototypeOf(ou.prototype,$r.prototype);function I_(){return{onInit:()=>{},onSettled:()=>{},onBefore:()=>{},onAfter:()=>{},createHook:()=>({enable:()=>{},disable:()=>{}})}}Object.freeze(Object.defineProperty({__proto__:null,DefaultDeserializer:ou,DefaultSerializer:au,Deserializer:$r,Serializer:qs,cachedDataVersionTag:C_,default:{getHeapStatistics:__,getHeapSpaceStatistics:b_,getHeapCodeStatistics:v_,getHeapSnapshot:w_,writeHeapSnapshot:S_,setFlagsFromString:x_,takeCoverage:E_,stopCoverage:k_,cachedDataVersionTag:C_,serialize:A_,deserialize:T_,Serializer:qs,Deserializer:$r,DefaultSerializer:au,DefaultDeserializer:ou,promiseHooks:I_},deserialize:T_,getHeapCodeStatistics:v_,getHeapSnapshot:w_,getHeapSpaceStatistics:b_,getHeapStatistics:__,promiseHooks:I_,serialize:A_,setFlagsFromString:x_,stopCoverage:k_,takeCoverage:E_,writeHeapSnapshot:S_},Symbol.toStringTag,{value:"Module"}));let Ur=0;function hC(){return Ur}function pC(e){Ur=e}z0=function(){Ur=0};const R_=Symbol("keypressDecoder");function fC(e,t,n){if(n.length>0){n.push(t);const o=n.join("");if(o.length>=3&&o[1]==="["){const c=o[o.length-1];if(/[A-Za-z~]/.test(c)){let d="",p=!1;return c==="A"?d="up":c==="B"?d="down":c==="C"?d="right":c==="D"?d="left":c==="H"?d="home":c==="F"?d="end":o==="\x1B[3~"?d="delete":o==="\x1B[2~"?d="insert":o==="\x1B[5~"?d="pageup":o==="\x1B[6~"?d="pagedown":o==="\x1B[1;5C"?(d="right",p=!0):o==="\x1B[1;5D"?(d="left",p=!0):d=c,e.emit("keypress",o,{sequence:o,name:d,ctrl:p,meta:!1,shift:!1}),[]}return o.length>8?(e.emit("keypress",o,{sequence:o,name:"unknown",ctrl:!1,meta:!1,shift:!1}),[]):n}if(o.length>=3&&o[1]==="O"){const c=o[o.length-1];let d="";return c==="A"?d="up":c==="B"?d="down":c==="C"?d="right":c==="D"?d="left":c==="H"?d="home":c==="F"?d="end":d=c,e.emit("keypress",o,{sequence:o,name:d,ctrl:!1,meta:!1,shift:!1}),[]}if(o.length>=2&&o[1]!=="["&&o[1]!=="O"){const c=o[1];let d=c;return c.charCodeAt(0)>=32&&(d=c.toLowerCase()),e.emit("keypress",o,{sequence:o,name:d,ctrl:!1,meta:!0,shift:!1}),[]}return n}if(t==="\x1B")return[t];let s=t,r=!1;return t==="\r"||t===`
98
- `?s="return":t===""||t==="\b"?s="backspace":t===" "?s="tab":t===" "?s="space":t.charCodeAt(0)<32&&(r=!0,s=String.fromCharCode(t.charCodeAt(0)+96)),e.emit("keypress",t,{sequence:t,name:s,ctrl:r,meta:!1,shift:!1}),[]}function lu(e,t){if(!e||typeof e.on!="function"||e[R_])return;e[R_]=!0;let n=[],s=null;e.on("data",r=>{if(e.listenerCount("keypress")<=0)return;const o=typeof r=="string"?r:String(r);for(const c of o)s&&(clearTimeout(s),s=null),n=fC(e,c,n),n.length>0&&(s=setTimeout(()=>{if(n.length>0){const d=n.join("");e.emit("keypress",d,{sequence:d,name:"escape",ctrl:!1,meta:!1,shift:!1}),n=[]}},50))})}function ra(e,t){let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n--;for(;n>=0&&!/\s/.test(e[n]);)n--;return n+1}function ia(e,t){let n=t;for(;n<e.length&&!/\s/.test(e[n]);)n++;for(;n<e.length&&/\s/.test(e[n]);)n++;return n}const lt=function(t){if(this){if(ne.call(this),this._promptStr=(t==null?void 0:t.prompt)??"> ",this.input=t==null?void 0:t.input,this.output=t==null?void 0:t.output,this.closed=!1,this._lineBuffer="",this._pendingQuestions=[],this.terminal=(t==null?void 0:t.terminal)??!1,this.line="",this.cursor=0,this._historySize=(t==null?void 0:t.historySize)??30,this._removeHistoryDuplicates=(t==null?void 0:t.removeHistoryDuplicates)??!1,this.history=Array.isArray(t==null?void 0:t.history)?t.history.slice(0,this._historySize):[],this._historyIndex=-1,this._savedLine="",this._killRing=[],t!=null&&t.signal){const n=t.signal;if(n.aborted)queueMicrotask(()=>this.close());else{const s=()=>this.close();n.addEventListener("abort",s,{once:!0})}}if(this.input&&typeof this.input.on=="function"){Ur++,ls();const n=this.input,s=this;this.terminal?(typeof this.input.setRawMode=="function"&&this.input.setRawMode(!0),lu(this.input),n.on("keypress",(r,o)=>{s.closed||s._onKeypress(r,o)})):n.on("data",r=>{if(s.closed)return;const o=typeof r=="string"?r:String(r);s._onData(o)}),n.on("end",()=>{s.closed||s.close()})}}};Object.setPrototypeOf(lt.prototype,ne.prototype),lt.prototype._refreshLine=function(){this.output&&typeof this.output.write=="function"&&this.output.write(this.line)},lt.prototype._addToHistory=function(t){if(!(this._historySize===0||!t)){if(this._removeHistoryDuplicates){const n=this.history.indexOf(t);n!==-1&&this.history.splice(n,1)}this.history.unshift(t),this.history.length>this._historySize&&(this.history.length=this._historySize),this._historyIndex=-1,this.emit("history",this.history)}},lt.prototype._onKeypress=function(t,n){if(n){if(n.ctrl&&n.name==="c"){this.listenerCount("SIGINT")>0?this.emit("SIGINT"):this.close();return}if(n.ctrl&&n.name==="z"){this.listenerCount("SIGTSTP")>0&&this.emit("SIGTSTP");return}if(n.name==="return"){const s=this._lineBuffer;if(this._lineBuffer="",this.line=s,this._addToHistory(s),this._pendingQuestions.length>0){const r=this._pendingQuestions.shift();r.signal&&r.abortListener&&r.signal.removeEventListener("abort",r.abortListener),r.handler(s)}this.emit("line",s),this.line="",this.cursor=0;return}if(n.name==="backspace"){this.cursor>0&&(this._lineBuffer[this.cursor-1],this._lineBuffer=this._lineBuffer.slice(0,this.cursor-1)+this._lineBuffer.slice(this.cursor),this.cursor--,this.line=this._lineBuffer,this._refreshLine());return}if(n.name==="delete"){this.cursor<this._lineBuffer.length&&(this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+this._lineBuffer.slice(this.cursor+1),this.line=this._lineBuffer,this._refreshLine());return}if(n.ctrl&&n.name==="d"){this._lineBuffer.length===0?this.close():this.cursor<this._lineBuffer.length&&(this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+this._lineBuffer.slice(this.cursor+1),this.line=this._lineBuffer,this._refreshLine());return}if(n.name==="left"&&!n.ctrl&&!n.meta){this.cursor=Math.max(0,this.cursor-1),this._refreshLine();return}if(n.name==="right"&&!n.ctrl&&!n.meta){this.cursor=Math.min(this._lineBuffer.length,this.cursor+1),this._refreshLine();return}if(n.ctrl&&n.name==="left"||n.meta&&n.name==="b"){this.cursor=ra(this._lineBuffer,this.cursor),this._refreshLine();return}if(n.ctrl&&n.name==="right"||n.meta&&n.name==="f"){this.cursor=ia(this._lineBuffer,this.cursor),this._refreshLine();return}if(n.name==="home"||n.ctrl&&n.name==="a"){this.cursor=0,this._refreshLine();return}if(n.name==="end"||n.ctrl&&n.name==="e"){this.cursor=this._lineBuffer.length,this._refreshLine();return}if(n.ctrl&&n.name==="b"){this.cursor=Math.max(0,this.cursor-1),this._refreshLine();return}if(n.ctrl&&n.name==="f"){this.cursor=Math.min(this._lineBuffer.length,this.cursor+1),this._refreshLine();return}if(n.name==="up"||n.ctrl&&n.name==="p"){this.history.length>0&&this._historyIndex<this.history.length-1&&(this._historyIndex===-1&&(this._savedLine=this._lineBuffer),this._historyIndex++,this._lineBuffer=this.history[this._historyIndex],this.cursor=this._lineBuffer.length,this.line=this._lineBuffer,this._refreshLine());return}if(n.name==="down"||n.ctrl&&n.name==="n"){this._historyIndex>0?(this._historyIndex--,this._lineBuffer=this.history[this._historyIndex],this.cursor=this._lineBuffer.length,this.line=this._lineBuffer,this._refreshLine()):this._historyIndex===0&&(this._historyIndex=-1,this._lineBuffer=this._savedLine,this.cursor=this._lineBuffer.length,this.line=this._lineBuffer,this._refreshLine());return}if(n.ctrl&&n.name==="u"){const s=this._lineBuffer.slice(0,this.cursor);s&&this._killRing.push(s),this._lineBuffer=this._lineBuffer.slice(this.cursor),this.cursor=0,this.line=this._lineBuffer,this._refreshLine();return}if(n.ctrl&&n.name==="k"){const s=this._lineBuffer.slice(this.cursor);s&&this._killRing.push(s),this._lineBuffer=this._lineBuffer.slice(0,this.cursor),this.line=this._lineBuffer,this._refreshLine();return}if(n.ctrl&&n.name==="h"){this.cursor>0&&(this._lineBuffer=this._lineBuffer.slice(0,this.cursor-1)+this._lineBuffer.slice(this.cursor),this.cursor--,this.line=this._lineBuffer,this._refreshLine());return}if(n.ctrl&&n.name==="w"){const s=ra(this._lineBuffer,this.cursor),r=this._lineBuffer.slice(s,this.cursor);r&&this._killRing.push(r),this._lineBuffer=this._lineBuffer.slice(0,s)+this._lineBuffer.slice(this.cursor),this.cursor=s,this.line=this._lineBuffer,this._refreshLine();return}if(n.meta&&n.name==="d"){const s=ia(this._lineBuffer,this.cursor),r=this._lineBuffer.slice(this.cursor,s);r&&this._killRing.push(r),this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+this._lineBuffer.slice(s),this.line=this._lineBuffer,this._refreshLine();return}if(n.ctrl&&n.name==="y"){if(this._killRing.length>0){const s=this._killRing[this._killRing.length-1];this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+s+this._lineBuffer.slice(this.cursor),this.cursor+=s.length,this.line=this._lineBuffer,this._refreshLine()}return}if(n.ctrl&&n.name==="l"){this.output&&typeof this.output.write=="function"&&this.output.write("\x1B[2J\x1B[H"),this._refreshLine();return}if(t&&!n.ctrl&&!n.meta&&t.length===1&&t.charCodeAt(0)>=32){this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+t+this._lineBuffer.slice(this.cursor),this.cursor++,this.line=this._lineBuffer,this._refreshLine();return}}},lt.prototype._onData=function(t){for(const n of t)if(n===`
99
- `||n==="\r"){const s=this._lineBuffer;if(this._lineBuffer="",this.line=s,this._addToHistory(s),this._pendingQuestions.length>0){const r=this._pendingQuestions.shift();r.signal&&r.abortListener&&r.signal.removeEventListener("abort",r.abortListener),r.handler(s)}this.emit("line",s),this.line="",this.cursor=0}else n===""||n==="\b"?this._lineBuffer.length>0&&(this._lineBuffer=this._lineBuffer.slice(0,this.cursor-1)+this._lineBuffer.slice(this.cursor),this.cursor=Math.max(0,this.cursor-1),this.line=this._lineBuffer,this._refreshLine()):n.charCodeAt(0)>=32&&(this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+n+this._lineBuffer.slice(this.cursor),this.cursor++,this.line=this._lineBuffer,this._refreshLine())},lt.prototype.prompt=function(t){this.output&&typeof this.output.write=="function"&&this.output.write(this._promptStr),t||(this.cursor=0,this.line="",this._lineBuffer="")},lt.prototype.setPrompt=function(t){this._promptStr=t},lt.prototype.getPrompt=function(){return this._promptStr},lt.prototype.question=function(t,n,s){let r,o;if(typeof n=="function"?r=n:(n&&typeof n=="object"&&(o=n.signal),r=s),!!r){if(o!=null&&o.aborted)throw new DOMException("The operation was aborted","AbortError");if(this.output&&typeof this.output.write=="function"&&this.output.write(t),this.input&&typeof this.input.on=="function"){const c={query:t,handler:r,signal:o};if(o){const d=()=>{const p=this._pendingQuestions.indexOf(c);p!==-1&&this._pendingQuestions.splice(p,1),r("")};c.abortListener=d,o.addEventListener("abort",d,{once:!0})}this._pendingQuestions.push(c)}else setTimeout(()=>r(""),0)}},lt.prototype.pause=function(){return this.input&&typeof this.input.pause=="function"&&this.input.pause(),this.emit("pause"),this},lt.prototype.resume=function(){return this.input&&typeof this.input.resume=="function"&&this.input.resume(),this.emit("resume"),this},lt.prototype.close=function(){if(!this.closed){this.closed=!0,this.terminal&&this.input&&typeof this.input.setRawMode=="function"&&this.input.setRawMode(!1),this.input&&typeof this.input.on=="function"&&(Ur=Math.max(0,Ur-1),An());for(const t of this._pendingQuestions)t.signal&&t.abortListener&&t.signal.removeEventListener("abort",t.abortListener),t.handler("");this._pendingQuestions.length=0,this.emit("close")}},typeof Symbol.dispose<"u"&&(lt.prototype[Symbol.dispose]=function(){this.close()}),lt.prototype.write=function(t,n){if(!this.closed){if(t==null){if(n){const s=this.input&&typeof this.input.emit=="function";if(n.ctrl&&n.name==="c"){this.listenerCount("SIGINT")>0?this.emit("SIGINT"):this.close();return}if(n.ctrl&&n.name==="h"){this.cursor>0&&(this._lineBuffer=this._lineBuffer.slice(0,this.cursor-1)+this._lineBuffer.slice(this.cursor),this.cursor--,this.line=this._lineBuffer),s&&this.input.emit("keypress","",{sequence:"",name:"backspace",ctrl:!1,meta:!1,shift:!1});return}if(n.ctrl&&n.name==="u"){const r=this._lineBuffer.slice(0,this.cursor);r&&this._killRing.push(r),this._lineBuffer=this._lineBuffer.slice(this.cursor),this.cursor=0,this.line=this._lineBuffer;return}if(n.ctrl&&n.name==="k"){const r=this._lineBuffer.slice(this.cursor);r&&this._killRing.push(r),this._lineBuffer=this._lineBuffer.slice(0,this.cursor),this.line=this._lineBuffer;return}if(n.ctrl&&n.name==="w"){const r=ra(this._lineBuffer,this.cursor),o=this._lineBuffer.slice(r,this.cursor);o&&this._killRing.push(o),this._lineBuffer=this._lineBuffer.slice(0,r)+this._lineBuffer.slice(this.cursor),this.cursor=r,this.line=this._lineBuffer;return}if(n.ctrl&&n.name==="y"){if(this._killRing.length>0){const r=this._killRing[this._killRing.length-1];this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+r+this._lineBuffer.slice(this.cursor),this.cursor+=r.length,this.line=this._lineBuffer}return}if(n.ctrl&&n.name==="a"){this.cursor=0;return}if(n.ctrl&&n.name==="e"){this.cursor=this._lineBuffer.length;return}if(n.ctrl&&n.name==="b"){this.cursor=Math.max(0,this.cursor-1);return}if(n.ctrl&&n.name==="f"){this.cursor=Math.min(this._lineBuffer.length,this.cursor+1);return}if(n.ctrl&&n.name==="d"){this._lineBuffer.length===0?this.close():this.cursor<this._lineBuffer.length&&(this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+this._lineBuffer.slice(this.cursor+1),this.line=this._lineBuffer);return}if(n.ctrl&&n.name==="l"){this.output&&typeof this.output.write=="function"&&this.output.write("\x1B[2J\x1B[H");return}if(n.name==="left"){n.ctrl||n.meta?this.cursor=ra(this._lineBuffer,this.cursor):this.cursor=Math.max(0,this.cursor-1);return}if(n.name==="right"){n.ctrl||n.meta?this.cursor=ia(this._lineBuffer,this.cursor):this.cursor=Math.min(this._lineBuffer.length,this.cursor+1);return}if(n.name==="home"){this.cursor=0;return}if(n.name==="end"){this.cursor=this._lineBuffer.length;return}if(n.name==="up"){this.history.length>0&&this._historyIndex<this.history.length-1&&(this._historyIndex===-1&&(this._savedLine=this._lineBuffer),this._historyIndex++,this._lineBuffer=this.history[this._historyIndex],this.cursor=this._lineBuffer.length,this.line=this._lineBuffer);return}if(n.name==="down"){this._historyIndex>0?(this._historyIndex--,this._lineBuffer=this.history[this._historyIndex],this.cursor=this._lineBuffer.length,this.line=this._lineBuffer):this._historyIndex===0&&(this._historyIndex=-1,this._lineBuffer=this._savedLine,this.cursor=this._lineBuffer.length,this.line=this._lineBuffer);return}if(n.meta&&n.name==="b"){this.cursor=ra(this._lineBuffer,this.cursor);return}if(n.meta&&n.name==="f"){this.cursor=ia(this._lineBuffer,this.cursor);return}if(n.meta&&n.name==="d"){const r=ia(this._lineBuffer,this.cursor),o=this._lineBuffer.slice(this.cursor,r);o&&this._killRing.push(o),this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+this._lineBuffer.slice(r),this.line=this._lineBuffer;return}}return}if(n!=null&&n.ctrl&&(n==null?void 0:n.name)==="c"){this.listenerCount("SIGINT")>0?this.emit("SIGINT"):this.close();return}this._onData(t)}},lt.prototype.clearLine=function(t){this._lineBuffer="",this.line="",this.cursor=0,this.output&&typeof this.output.clearLine=="function"&&this.output.clearLine(t??0)},lt.prototype.getCursorPos=function(){const t=typeof this._promptStr=="string"?this._promptStr.length:0,n=this.output&&this.output.columns||80,s=t+this.cursor;return{rows:Math.floor(s/n),cols:s%n}},lt.prototype[Symbol.asyncIterator]=async function*(){const e=this;for(;!e.closed;){const t=await new Promise(n=>{if(e.closed){n(null);return}e.once("line",s=>n(s)),e.once("close",()=>n(null))});if(t===null)break;yield t}};function cu(e,t){return e&&typeof e=="object"&&!("on"in e)&&!("read"in e)?new lt(e):new lt({input:e,output:t})}function P_(e,t,n){return e&&typeof e.clearLine=="function"?e.clearLine(t,n):(n&&n(),!0)}function D_(e,t){return e&&typeof e.write=="function"&&e.write("\x1B[J"),t&&t(),!0}function O_(e,t,n,s){const r=typeof n=="function"?n:s;return e&&typeof e.cursorTo=="function"?e.cursorTo(t,typeof n=="number"?n:void 0,r):(r&&r(),!0)}function N_(e,t,n,s){return e&&typeof e.moveCursor=="function"?e.moveCursor(t,n,s):(s&&s(),!0)}class mC{constructor(t,n){W(this,"_stream"),W(this,"_buffer"),W(this,"_autoCommit"),this._stream=t,this._buffer=[],this._autoCommit=(n==null?void 0:n.autoCommit)??!1}clearLine(t){let n;return t===-1?n="\x1B[1K":t===1?n="\x1B[0K":n="\x1B[2K",this._autoCommit?this._stream.write(n):this._buffer.push(n),this}clearScreenDown(){return this._autoCommit?this._stream.write("\x1B[J"):this._buffer.push("\x1B[J"),this}cursorTo(t,n){let s;return n!==void 0?s=`\x1B[${n+1};${t+1}H`:s=`\x1B[${t+1}G`,this._autoCommit?this._stream.write(s):this._buffer.push(s),this}moveCursor(t,n){const s=[];t>0?s.push(`\x1B[${t}C`):t<0&&s.push(`\x1B[${-t}D`),n>0?s.push(`\x1B[${n}B`):n<0&&s.push(`\x1B[${-n}A`);const r=s.join("");return r&&(this._autoCommit?this._stream.write(r):this._buffer.push(r)),this}commit(){return this._buffer.length>0&&(this._stream.write(this._buffer.join("")),this._buffer.length=0),Promise.resolve()}rollback(){return this._buffer.length=0,this}}const B_={createInterface(e){const t=cu(e),n=Object.create(t);return n.question=function(s,r){return new Promise((o,c)=>{var d;if((d=r==null?void 0:r.signal)!=null&&d.aborted){c(new DOMException("The operation was aborted","AbortError"));return}let p;const y=g=>{r!=null&&r.signal&&p&&r.signal.removeEventListener("abort",p),o(g)};r!=null&&r.signal&&(p=()=>{c(new DOMException("The operation was aborted","AbortError"))},r.signal.addEventListener("abort",p,{once:!0})),t.question(s,y)})},n},Readline:mC};Object.freeze(Object.defineProperty({__proto__:null,Interface:lt,clearLine:P_,clearScreenDown:D_,createInterface:cu,cursorTo:O_,default:{Interface:lt,createInterface:cu,clearLine:P_,clearScreenDown:D_,cursorTo:O_,moveCursor:N_,emitKeypressEvents:lu,promises:B_},emitKeypressEvents:lu,getActiveInterfaceCount:hC,moveCursor:N_,promises:B_,resetActiveInterfaceCount:z0,setActiveInterfaceCount:pC},Symbol.toStringTag,{value:"Module"}));const rs=function(t,n){this&&(ne.call(this),this.authorized=!1,this.encrypted=!0)};Object.setPrototypeOf(rs.prototype,ne.prototype),rs.prototype.getPeerCertificate=function(t){return{}},rs.prototype.getCipher=function(){return null},rs.prototype.getProtocol=function(){return null},rs.prototype.setServername=function(t){},rs.prototype.renegotiate=function(t,n){return!1};const Vn=function(t,n){this&&ne.call(this)};Object.setPrototypeOf(Vn.prototype,ne.prototype),Vn.prototype.listen=function(...t){return this},Vn.prototype.close=function(t){return this},Vn.prototype.address=function(){return null},Vn.prototype.getTicketKeys=function(){return new Uint8Array(0)},Vn.prototype.setTicketKeys=function(t){},Vn.prototype.setSecureContext=function(t){};function L_(e,t){return new Vn}function M_(e,t){const n=new rs;return t&&setTimeout(t,0),n}function F_(e){return{}}const $_=()=>["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"],U_="auto",j_="TLSv1.3",V_="TLSv1.2",H_=[];Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_ECDH_CURVE:U_,DEFAULT_MAX_VERSION:j_,DEFAULT_MIN_VERSION:V_,Server:Vn,TLSSocket:rs,connect:M_,createSecureContext:F_,createServer:L_,default:{TLSSocket:rs,Server:Vn,createServer:L_,connect:M_,createSecureContext:F_,getCiphers:$_,DEFAULT_ECDH_CURVE:U_,DEFAULT_MAX_VERSION:j_,DEFAULT_MIN_VERSION:V_,rootCertificates:H_},getCiphers:$_,rootCertificates:H_},Symbol.toStringTag,{value:"Module"}));const It=function(){this&&ne.call(this)};Object.setPrototypeOf(It.prototype,ne.prototype),It.prototype.close=function(t){t&&setTimeout(t,0)},It.prototype.destroy=function(t,n){},Object.defineProperty(It.prototype,"destroyed",{get(){return!1},configurable:!0}),Object.defineProperty(It.prototype,"encrypted",{get(){return!1},configurable:!0}),Object.defineProperty(It.prototype,"closed",{get(){return!1},configurable:!0}),It.prototype.ping=function(t){return!1},It.prototype.ref=function(){},It.prototype.unref=function(){},It.prototype.setTimeout=function(t,n){};const Eo=function(){this&&It.call(this)};Object.setPrototypeOf(Eo.prototype,It.prototype);const uu=function(){this&&It.call(this)};Object.setPrototypeOf(uu.prototype,It.prototype);const xn=function(){this&&ne.call(this)};Object.setPrototypeOf(xn.prototype,ne.prototype),xn.prototype.close=function(t,n){},Object.defineProperty(xn.prototype,"id",{get(){return 0},configurable:!0}),Object.defineProperty(xn.prototype,"pending",{get(){return!1},configurable:!0}),Object.defineProperty(xn.prototype,"destroyed",{get(){return!1},configurable:!0}),Object.defineProperty(xn.prototype,"closed",{get(){return!1},configurable:!0}),xn.prototype.priority=function(t){},xn.prototype.setTimeout=function(t,n){},xn.prototype.end=function(t,n,s){};const du=function(){this&&ne.call(this)};Object.setPrototypeOf(du.prototype,ne.prototype);const aa=function(){this&&ne.call(this)};Object.setPrototypeOf(aa.prototype,ne.prototype),aa.prototype.writeHead=function(t,n){return this},aa.prototype.end=function(t){};function W_(e,t){return new ne}function z_(e,t){return new ne}function q_(e,t,n){return new Eo}const G_={NGHTTP2_SESSION_SERVER:0,NGHTTP2_SESSION_CLIENT:1,HTTP2_HEADER_STATUS:":status",HTTP2_HEADER_METHOD:":method",HTTP2_HEADER_AUTHORITY:":authority",HTTP2_HEADER_SCHEME:":scheme",HTTP2_HEADER_PATH:":path",HTTP_STATUS_OK:200,HTTP_STATUS_NOT_FOUND:404};function K_(){return{}}function Y_(e){return new Uint8Array(0)}function Z_(e){return{}}const X_=Symbol("sensitiveHeaders");Object.freeze(Object.defineProperty({__proto__:null,ClientHttp2Session:Eo,Http2ServerRequest:du,Http2ServerResponse:aa,Http2Session:It,Http2Stream:xn,ServerHttp2Session:uu,connect:q_,constants:G_,createSecureServer:z_,createServer:W_,default:{Http2Session:It,ClientHttp2Session:Eo,ServerHttp2Session:uu,Http2Stream:xn,Http2ServerRequest:du,Http2ServerResponse:aa,createServer:W_,createSecureServer:z_,connect:q_,constants:G_,getDefaultSettings:K_,getPackedSettings:Y_,getUnpackedSettings:Z_,sensitiveHeaders:X_},getDefaultSettings:K_,getPackedSettings:Y_,getUnpackedSettings:Z_,sensitiveHeaders:X_},Symbol.toStringTag,{value:"Module"}));const J_=!0,Q_=!0,eb=!1,is=function(){this&&(ne.call(this),this.id=0,this.process=null)};Object.setPrototypeOf(is.prototype,ne.prototype),is.prototype.send=function(t,n){return!1},is.prototype.kill=function(t){},is.prototype.disconnect=function(){},is.prototype.isDead=function(){return!1},is.prototype.isConnected=function(){return!1};const tb=null,nb={},sb={},rb=1,hu=2;let ib=hu;function ab(e){return new is}function ob(e){e&&setTimeout(e,0)}function lb(e){}function cb(e){}const ws=new ne,ub=ws.on.bind(ws),db=ws.once.bind(ws),hb=ws.emit.bind(ws),pb=ws.removeListener.bind(ws);Object.freeze(Object.defineProperty({__proto__:null,SCHED_NONE:rb,SCHED_RR:hu,Worker:is,default:{isMaster:J_,isPrimary:Q_,isWorker:eb,Worker:is,worker:tb,workers:nb,fork:ab,disconnect:ob,settings:sb,SCHED_NONE:rb,SCHED_RR:hu,schedulingPolicy:ib,setupMaster:lb,setupPrimary:cb,on:ub,once:db,emit:hb,removeListener:pb},disconnect:ob,emit:hb,fork:ab,isMaster:J_,isPrimary:Q_,isWorker:eb,on:ub,once:db,removeListener:pb,schedulingPolicy:ib,settings:sb,setupMaster:lb,setupPrimary:cb,worker:tb,workers:nb},Symbol.toStringTag,{value:"Module"}));const ct=function(){this&&ne.call(this)};Object.setPrototypeOf(ct.prototype,ne.prototype),ct.prototype.bind=function(t,n,s){return s&&setTimeout(s,0),this},ct.prototype.close=function(t){t&&setTimeout(t,0)},ct.prototype.send=function(t,n,s,r,o,c){c&&setTimeout(()=>c(null,0),0)},ct.prototype.address=function(){return{address:"0.0.0.0",family:"IPv4",port:0}},ct.prototype.setBroadcast=function(t){},ct.prototype.setTTL=function(t){return t},ct.prototype.setMulticastTTL=function(t){return t},ct.prototype.setMulticastLoopback=function(t){return t},ct.prototype.setMulticastInterface=function(t){},ct.prototype.addMembership=function(t,n){},ct.prototype.dropMembership=function(t,n){},ct.prototype.ref=function(){return this},ct.prototype.unref=function(){return this},ct.prototype.setRecvBufferSize=function(t){},ct.prototype.setSendBufferSize=function(t){},ct.prototype.getRecvBufferSize=function(){return 0},ct.prototype.getSendBufferSize=function(){return 0};function fb(e,t){return new ct}Object.freeze(Object.defineProperty({__proto__:null,Socket:ct,createSocket:fb,default:{Socket:ct,createSocket:fb}},Symbol.toStringTag,{value:"Module"}));const Gs=function(t,n){this&&(this._src=t)};Gs.prototype.runInThisContext=function(t){return(0,eval)(this._src)},Gs.prototype.runInNewContext=function(t,n){const s=t?Object.keys(t):[],r=t?Object.values(t):[];return new Function(...s,`return eval(${JSON.stringify(this._src)})`)(...r)},Gs.prototype.runInContext=function(t,n){return this.runInNewContext(t,n)},Gs.prototype.createCachedData=function(){return new Uint8Array(0)};function mb(e,t){return e??{}}function gb(e){return!0}function yb(e,t){return(0,eval)(e)}function pu(e,t,n){return new Gs(e).runInNewContext(t)}function _b(e,t,n){return pu(e,t)}function bb(e,t,n){return new Function(...t??[],e)}const fn=function(t,n){};fn.prototype.link=function(t){return Promise.resolve()},fn.prototype.evaluate=function(t){return Promise.resolve()},Object.defineProperty(fn.prototype,"status",{get(){return"unlinked"},configurable:!0}),Object.defineProperty(fn.prototype,"identifier",{get(){return""},configurable:!0}),Object.defineProperty(fn.prototype,"context",{get(){return{}},configurable:!0}),Object.defineProperty(fn.prototype,"namespace",{get(){return{}},configurable:!0});const fu=function(t,n){this&&fn.call(this,t,n)};Object.setPrototypeOf(fu.prototype,fn.prototype);const ko=function(t,n){this&&fn.call(this,t,n)};Object.setPrototypeOf(ko.prototype,fn.prototype),ko.prototype.setExport=function(t,n){},Object.freeze(Object.defineProperty({__proto__:null,Module:fn,Script:Gs,SourceTextModule:fu,SyntheticModule:ko,compileFunction:bb,createContext:mb,default:{Script:Gs,createContext:mb,isContext:gb,runInThisContext:yb,runInNewContext:pu,runInContext:_b,compileFunction:bb,Module:fn,SourceTextModule:fu,SyntheticModule:ko},isContext:gb,runInContext:_b,runInNewContext:pu,runInThisContext:yb},Symbol.toStringTag,{value:"Module"}));const Ks=function(){this&&ne.call(this)};Object.setPrototypeOf(Ks.prototype,ne.prototype),Ks.prototype.connect=function(){},Ks.prototype.connectToMainThread=function(){},Ks.prototype.disconnect=function(){},Ks.prototype.post=function(t,n,s){s&&setTimeout(()=>s(null,{}),0)};function vb(e,t,n){}function wb(){}function Sb(){}function xb(){}const Eb=globalThis.console;Object.freeze(Object.defineProperty({__proto__:null,Session:Ks,close:wb,console:Eb,default:{Session:Ks,open:vb,close:wb,url:Sb,waitForDebugger:xb,console:Eb},open:vb,url:Sb,waitForDebugger:xb},Symbol.toStringTag,{value:"Module"}));const Ys=function(t,n){};Ys.prototype.runInAsyncScope=function(t,n,...s){return t.apply(n,s)},Ys.prototype.emitDestroy=function(){return this},Ys.prototype.asyncId=function(){return 0},Ys.prototype.triggerAsyncId=function(){return 0},Ys.bind=function(t,n){return t};const Zs=function(){this&&(this._store=void 0)};Zs.prototype.disable=function(){},Zs.prototype.getStore=function(){return this._store},Zs.prototype.run=function(t,n,...s){const r=this._store;this._store=t;try{const o=n(...s);return o&&typeof o.then=="function"?(o.then(()=>{this._store=r},()=>{this._store=r}),o):(this._store=r,o)}catch(o){throw this._store=r,o}},Zs.prototype.exit=function(t,...n){const s=this._store;this._store=void 0;try{const r=t(...n);return r&&typeof r.then=="function"?(r.then(()=>{this._store=s},()=>{this._store=s}),r):(this._store=s,r)}catch(r){throw this._store=s,r}},Zs.prototype.enterWith=function(t){this._store=t};function kb(e){const t={enable(){return t},disable(){return t}};return t}function Cb(){return 0}function Ab(){return{}}function Tb(){return 0}Object.freeze(Object.defineProperty({__proto__:null,AsyncLocalStorage:Zs,AsyncResource:Ys,createHook:kb,default:{AsyncResource:Ys,AsyncLocalStorage:Zs,createHook:kb,executionAsyncId:Cb,executionAsyncResource:Ab,triggerAsyncId:Tb},executionAsyncId:Cb,executionAsyncResource:Ab,triggerAsyncId:Tb},Symbol.toStringTag,{value:"Module"}));const mn=function(){this&&(ne.call(this),this.members=[])};Object.setPrototypeOf(mn.prototype,ne.prototype),mn.prototype.add=function(t){this.members.push(t)},mn.prototype.remove=function(t){const n=this.members.indexOf(t);n>=0&&this.members.splice(n,1)},mn.prototype.bind=function(t){return t},mn.prototype.intercept=function(t){return t},mn.prototype.run=function(t){return t()},mn.prototype.dispose=function(){this.members.length=0},mn.prototype.enter=function(){},mn.prototype.exit=function(){};function Ib(){return new mn}let Rb=null;Object.freeze(Object.defineProperty({__proto__:null,Domain:mn,active:Rb,create:Ib,default:{Domain:mn,create:Ib,active:Rb}},Symbol.toStringTag,{value:"Module"}));const Ss=function(t){this&&(this.name=t,this._listeners=[])};Object.defineProperty(Ss.prototype,"hasSubscribers",{get(){return this._listeners.length>0},configurable:!0}),Ss.prototype.subscribe=function(t){this._listeners.push(t)},Ss.prototype.unsubscribe=function(t){const n=this._listeners.indexOf(t);return n===-1?!1:(this._listeners.splice(n,1),!0)},Ss.prototype.publish=function(t){for(const n of this._listeners)try{n(t,this.name)}catch{}};const oa=new Map;function mu(e){return oa.has(e)||oa.set(e,new Ss(e)),oa.get(e)}function Pb(e){var t;return((t=oa.get(e))==null?void 0:t.hasSubscribers)??!1}function Db(e,t){mu(e).subscribe(t)}function Ob(e,t){var n;return((n=oa.get(e))==null?void 0:n.unsubscribe(t))??!1}Object.freeze(Object.defineProperty({__proto__:null,Channel:Ss,DiagChannel:Ss,channel:mu,default:{channel:mu,hasSubscribers:Pb,subscribe:Db,unsubscribe:Ob,Channel:Ss},hasSubscribers:Pb,subscribe:Db,unsubscribe:Ob},Symbol.toStringTag,{value:"Module"}));const Ne=globalThis.console;Ne.log.bind(Ne),Ne.error.bind(Ne),Ne.warn.bind(Ne),Ne.info.bind(Ne),Ne.debug.bind(Ne),Ne.trace.bind(Ne),Ne.dir.bind(Ne),Ne.time.bind(Ne),Ne.timeEnd.bind(Ne),Ne.timeLog.bind(Ne),Ne.clear.bind(Ne),Ne.count.bind(Ne),Ne.countReset.bind(Ne),Ne.group.bind(Ne),Ne.groupCollapsed.bind(Ne),Ne.groupEnd.bind(Ne),Ne.table.bind(Ne),Ne.assert.bind(Ne);const Nb=Symbol.for("repl-sloppy"),Bb=Symbol.for("repl-strict"),gu=function e(t){this&&(SyntaxError.call(this,t.message),this.message=t.message,this.name="SyntaxError",this.err=t,Error.captureStackTrace&&Error.captureStackTrace(this,e))};Object.setPrototypeOf(gu.prototype,SyntaxError.prototype);const Hn=function(t){this&&(ne.call(this),this.context=Object.create(null),this.terminal=!1,this._prompt="> ",this._commands=new Map,typeof t=="string"?this._prompt=t:t&&(typeof t.prompt=="string"&&(this._prompt=t.prompt),t.terminal!==void 0&&(this.terminal=!!t.terminal)))};Object.setPrototypeOf(Hn.prototype,ne.prototype),Hn.prototype.setPrompt=function(t){this._prompt=t},Hn.prototype.getPrompt=function(){return this._prompt},Hn.prototype.displayPrompt=function(t){},Hn.prototype.defineCommand=function(t,n){typeof n=="function"?this._commands.set(t,{help:"",action:n}):this._commands.set(t,{help:n.help||"",action:n.action})},Hn.prototype.close=function(){this.emit("exit"),this.emit("close")},Hn.prototype.setupHistory=function(t,n){n(null,this)};function Lb(e){return new Hn(e)}Object.freeze(Object.defineProperty({__proto__:null,REPLServer:Hn,REPL_MODE_SLOPPY:Nb,REPL_MODE_STRICT:Bb,Recoverable:gu,default:{start:Lb,REPLServer:Hn,Recoverable:gu,REPL_MODE_SLOPPY:Nb,REPL_MODE_STRICT:Bb},start:Lb},Symbol.toStringTag,{value:"Module"}));const xs=function(t){this&&(this.name=t,this._controller=new AbortController,this.signal=this._controller.signal)};xs.prototype.diagnostic=function(t){globalThis.console.log(`# ${t}`)},xs.prototype.plan=function(t){},xs.prototype.todo=function(t){globalThis.console.log(`# TODO${t?": "+t:""}`)},xs.prototype.skip=function(t){globalThis.console.log(`# SKIP${t?": "+t:""}`)},xs.prototype.abort=function(){this._controller.abort()};function Mb(e,t){const n=typeof e=="string"?e:e.name,s=typeof e=="object"?e:{},r=t;if(s.skip){globalThis.console.log(`# SKIP - ${n}`);return}if(s.todo){globalThis.console.log(`# TODO - ${n}`);return}try{const o=r();o&&typeof o.then=="function"&&o.catch(c=>{globalThis.console.error(`Suite "${n}" failed:`,c)})}catch(o){globalThis.console.error(`Suite "${n}" failed:`,o)}}function Co(e,t){const n=typeof e=="string"?e:e.name,s=typeof e=="object"?e:{};if(s.skip||!t){globalThis.console.log(`# SKIP - ${n}`);return}if(s.todo){globalThis.console.log(`# TODO - ${n}`);return}const r=new xs(n);try{const o=t(r);o&&typeof o.then=="function"&&o.catch(c=>{globalThis.console.error(`Test "${n}" failed:`,c)})}catch(o){globalThis.console.error(`Test "${n}" failed:`,o)}}function Fb(e){try{e()}catch{}}function $b(e){try{e()}catch{}}function Ub(e){try{e()}catch{}}function jb(e){try{e()}catch{}}function Vb(e,t){e&&globalThis.console.log(`# SKIP - ${e}`)}function Hb(e,t){e&&globalThis.console.log(`# TODO - ${e}`)}const yu={fn(e){const t=[],n=(...s)=>(t.push(s),e?e(...s):void 0);return n.mock={calls:t,callCount:()=>t.length},n},method(e,t,n){const s=e[t],r=yu.fn(n||s);return e[t]=r,r},reset(){},restoreAll(){}};Object.freeze(Object.defineProperty({__proto__:null,TestContext:xs,after:$b,afterEach:jb,before:Fb,beforeEach:Ub,default:{describe:Mb,it:Co,test:Co,before:Fb,after:$b,beforeEach:Ub,afterEach:jb,skip:Vb,todo:Hb,mock:yu,TestContext:xs},describe:Mb,it:Co,mock:yu,skip:Vb,test:Co,todo:Hb},Symbol.toStringTag,{value:"Module"}));const la=function(t){this&&(this.categories=t.join(","),this.enabled=!1)};la.prototype.enable=function(){},la.prototype.disable=function(){};function Wb(e){return new la(e.categories)}function zb(){}Object.freeze(Object.defineProperty({__proto__:null,Tracing:la,createTracing:Wb,default:{createTracing:Wb,getEnabledCategories:zb,Tracing:la},getEnabledCategories:zb},Symbol.toStringTag,{value:"Module"}));const Te=0,gC=2,ze=8,qb=20,_u=28,Gb=29,yC=31,bu=44,xt=52,_C=54,bC=55,vC=70,Kb=0,Yb=1,Zb=2,Xb=3,vu=0,Ao=3,To=4,Jb=7,wu=1,wC=1,SC=2,xC=4,EC=8,kC=0,CC=1,AC=2,TC=0,Su=0x0000000000000002n,xu=0x0000000000000040n,IC=0x0000000000000004n,RC=0x0000000000000020n,PC=0x0000000000004000n,DC=0x0000000000002000n,OC=0x0000000000000200n,NC=0x0000000000000400n,BC=0x0000000004000000n,LC=0x0000000002000000n,MC=0x0000000000010000n,FC=0x0000000000020000n,$C=0x0000000000040000n,UC=0x0000000001000000n,jC=0x0000000000008000n,Qb=0x0000000000200000n,VC=0x0000000000400000n,HC=0x1fffffffn,ev=Su|PC|DC|OC|NC|BC|LC|MC|FC|$C|UC|jC|Qb,WC=Su|xu|IC|RC|Qb|VC,zC=1,qC=2;class Io extends Error{constructor(t){super(`WASI exit(${t})`),W(this,"code"),this.code=t}}function we(e){return function(...t){try{return e.apply(this,t)}catch(n){if(n instanceof Io)throw n;const s=n==null?void 0:n.code;return s==="ENOENT"?bu:s==="EEXIST"?qb:s==="EISDIR"?yC:s==="ENOTDIR"?_C:s==="ENOTEMPTY"?bC:s==="EACCES"||s==="EPERM"?gC:Gb}}}function Wn(e,t){if(t.startsWith("/"))return tv(t);const n=e.endsWith("/")?e+t:e+"/"+t;return tv(n)}function tv(e){const t=e.split("/"),n=[];for(const s of t)if(!(s==="."||s==="")){if(s===".."){n.pop();continue}n.push(s)}return"/"+n.join("/")}const Es=new TextEncoder,nv=new TextDecoder,sv=function e(t){if(!(this instanceof e))throw new TypeError("Class constructor WASI cannot be invoked without 'new'");const n=t??{},s=n.args??[],r=n.env??{},o=n.preopens??{},c=n.returnOnExit??!1,d=n.fs??null,p=new Map;let y=3;p.set(0,{kind:0,path:"",rights:Su}),p.set(1,{kind:1,path:"",rights:xu}),p.set(2,{kind:2,path:"",rights:xu});const g=[];for(const[I,D]of Object.entries(o)){const F=y++;p.set(F,{kind:3,path:D,rights:ev}),g.push({fd:F,virtualPath:I,realPath:D})}let x=null,k=null;const C=()=>{if(x||k&&(x=k.exports.memory,x))return x;throw new Error("WASI: WebAssembly.Memory not available")},T=()=>new DataView(C().buffer),L=()=>new Uint8Array(C().buffer);let V="",K="";const J=(I,D)=>{const F=D.lastIndexOf(`
100
- `);if(F<0)return D;const U=D.substring(0,F);return I===1?console.log(U):console.error(U),D.substring(F+1)},X=(I,D)=>nv.decode(new Uint8Array(C().buffer,I,D)),G=I=>{I.dirty&&d&&I.path&&I.data&&(d.writeFileSync(I.path,I.data),I.dirty=!1)},$={args_get:we((I,D)=>{const F=T(),U=L();for(const N of s){F.setUint32(I,D,!0),I+=4;const Q=Es.encode(N+"\0");U.set(Q,D),D+=Q.length}return Te}),args_sizes_get:we((I,D)=>{const F=T();F.setUint32(I,s.length,!0);let U=0;for(const N of s)U+=Es.encode(N+"\0").length;return F.setUint32(D,U,!0),Te}),environ_get:we((I,D)=>{const F=Object.entries(r),U=T(),N=L();for(const[Q,ce]of F){U.setUint32(I,D,!0),I+=4;const le=Es.encode(`${Q}=${ce}\0`);N.set(le,D),D+=le.length}return Te}),environ_sizes_get:we((I,D)=>{const F=Object.entries(r),U=T();U.setUint32(I,F.length,!0);let N=0;for(const[Q,ce]of F)N+=Es.encode(`${Q}=${ce}\0`).length;return U.setUint32(D,N,!0),Te}),clock_res_get:we((I,D)=>{const F=T();switch(I){case Kb:F.setBigUint64(D,BigInt(1e6),!0);break;case Yb:case Zb:case Xb:F.setBigUint64(D,BigInt(1e3),!0);break;default:return _u}return Te}),clock_time_get:we((I,D,F)=>{const U=T();switch(I){case Kb:{const N=BigInt(Date.now())*BigInt(1e6);U.setBigUint64(F,N,!0);break}case Yb:case Zb:case Xb:{const N=performance.now(),Q=Math.trunc(N),ce=Math.floor((N-Q)*1e3),le=BigInt(Q)*BigInt(1e9)+BigInt(ce)*BigInt(1e6);U.setBigUint64(F,le,!0);break}default:return _u}return Te}),fd_advise:we((I,D,F,U)=>Te),fd_allocate:we((I,D,F)=>xt),fd_close:we(I=>{const D=p.get(I);return D?(D.kind===4&&G(D),p.delete(I),Te):ze}),fd_datasync:we(I=>{const D=p.get(I);return D?(D.kind===4&&G(D),Te):ze}),fd_fdstat_get:we((I,D)=>{const F=p.get(I);if(!F)return ze;const U=T();let N=vu,Q=0,ce=F.rights,le=0n;switch(F.kind){case 0:case 1:case 2:N=vu;break;case 3:N=Ao,le=HC;break;case 4:N=To,F.flags&&F.flags&wu&&(Q|=wu);break}return U.setUint8(D,N),U.setUint16(D+2,Q,!0),U.setBigUint64(D+8,ce,!0),U.setBigUint64(D+16,le,!0),Te}),fd_fdstat_set_flags:we((I,D)=>xt),fd_fdstat_set_rights:we((I,D,F)=>xt),fd_filestat_get:we((I,D)=>{const F=p.get(I);if(!F)return ze;const U=T();let N=0n,Q=vu,ce=0n,le=0n,me=0n,ye=0n,Ue=1n;if(F.kind===4){if(N=BigInt(F.data?F.data.length:0),Q=To,d&&F.path)try{const Ie=d.statSync(F.path);ce=BigInt(Math.floor(Ie.mtimeMs))*BigInt(1e6),le=BigInt(Math.floor(Ie.atimeMs))*BigInt(1e6),me=BigInt(Math.floor(Ie.ctimeMs))*BigInt(1e6),Ie.ino&&(ye=BigInt(Ie.ino)),Ie.nlink&&(Ue=BigInt(Ie.nlink))}catch{}}else F.kind===3&&(Q=Ao);return U.setBigUint64(D,0n,!0),U.setBigUint64(D+8,ye,!0),U.setUint8(D+16,Q),U.setBigUint64(D+24,Ue,!0),U.setBigUint64(D+32,N,!0),U.setBigUint64(D+40,le,!0),U.setBigUint64(D+48,ce,!0),U.setBigUint64(D+56,me,!0),Te}),fd_filestat_set_size:we((I,D)=>{const F=p.get(I);if(!F||F.kind!==4)return ze;const U=Number(D);if(!F.data)F.data=new Uint8Array(U);else if(F.data.length!==U){const N=new Uint8Array(U);N.set(F.data.subarray(0,Math.min(F.data.length,U))),F.data=N}return F.dirty=!0,Te}),fd_filestat_set_times:we((I,D,F,U)=>Te),fd_pread:we((I,D,F,U,N)=>{const Q=p.get(I);if(!Q||Q.kind!==4)return ze;if(!Q.data)return T().setUint32(N,0,!0),Te;const ce=T();let le=Number(U),me=0;for(let ye=0;ye<F;ye++){const Ue=ce.getUint32(D+ye*8,!0),Ie=ce.getUint32(D+ye*8+4,!0),ut=Math.min(Ie,Q.data.length-le);if(ut<=0)break;L().set(Q.data.subarray(le,le+ut),Ue),le+=ut,me+=ut}return ce.setUint32(N,me,!0),Te}),fd_prestat_get:we((I,D)=>{const F=p.get(I);if(!F||F.kind!==3)return ze;const U=g.find(ce=>ce.fd===I);if(!U)return ze;const N=T(),Q=Es.encode(U.virtualPath).length;return N.setUint8(D,TC),N.setUint32(D+4,Q,!0),Te}),fd_prestat_dir_name:we((I,D,F)=>{const U=p.get(I);if(!U||U.kind!==3)return ze;const N=g.find(le=>le.fd===I);if(!N)return ze;const Q=Es.encode(N.virtualPath),ce=Math.min(Q.length,F);return L().set(Q.subarray(0,ce),D),Te}),fd_pwrite:we((I,D,F,U,N)=>{const Q=p.get(I);if(!Q||Q.kind!==4)return ze;const ce=T();let le=Number(U),me=0;for(let ye=0;ye<F;ye++){const Ue=ce.getUint32(D+ye*8,!0),Ie=ce.getUint32(D+ye*8+4,!0),ut=new Uint8Array(C().buffer,Ue,Ie),Rt=le+Ie;if(!Q.data||Q.data.length<Rt){const as=new Uint8Array(Rt);Q.data&&as.set(Q.data),Q.data=as}Q.data.set(ut,le),le+=Ie,me+=Ie}return Q.dirty=!0,ce.setUint32(N,me,!0),Te}),fd_read:we((I,D,F,U)=>{const N=p.get(I);if(!N)return ze;const Q=T();if(N.kind===0)return Q.setUint32(U,0,!0),Te;if(N.kind!==4)return ze;if(!N.data)return Q.setUint32(U,0,!0),Te;let ce=0,le=N.offset??0;for(let me=0;me<F;me++){const ye=Q.getUint32(D+me*8,!0),Ue=Q.getUint32(D+me*8+4,!0),Ie=Math.min(Ue,N.data.length-le);if(Ie<=0)break;L().set(N.data.subarray(le,le+Ie),ye),le+=Ie,ce+=Ie}return N.offset=le,Q.setUint32(U,ce,!0),Te}),fd_readdir:we((I,D,F,U,N)=>{const Q=p.get(I);if(!Q||Q.kind!==3&&Q.kind!==4)return ze;if(!d)return xt;let ce;try{ce=d.readdirSync(Q.path)}catch{return Gb}const le=T(),me=L();let ye=D;const Ue=D+F,Ie=Number(U);for(let ut=Ie;ut<ce.length;ut++){const Rt=ce[ut],as=Es.encode(Rt);if(24+as.length,ye+24>Ue)break;le.setBigUint64(ye,BigInt(ut+1),!0),le.setBigUint64(ye+8,BigInt(ut+1),!0),le.setUint32(ye+16,as.length,!0);let Yr=To;try{const Qt=d.statSync(Wn(Q.path,Rt));Qt.isDirectory()?Yr=Ao:Qt.isSymbolicLink()&&(Yr=Jb)}catch{}le.setUint8(ye+20,Yr);const os=Math.min(as.length,Ue-(ye+24));os>0&&me.set(as.subarray(0,os),ye+24),ye+=24+os}return le.setUint32(N,ye-D,!0),Te}),fd_renumber:we((I,D)=>{const F=p.get(I);if(!F)return ze;if(p.has(D)){const U=p.get(D);U.kind===4&&G(U)}return p.set(D,F),p.delete(I),Te}),fd_seek:we((I,D,F,U)=>{const N=p.get(I);if(!N)return ze;if(N.kind===0||N.kind===1||N.kind===2)return vC;if(N.kind===3)return ze;const Q=N.data?N.data.length:0;let ce=N.offset??0;const le=Number(D);switch(F){case kC:ce=le;break;case CC:ce+=le;break;case AC:ce=Q+le;break;default:return _u}return ce<0&&(ce=0),N.offset=ce,T().setBigUint64(U,BigInt(ce),!0),Te}),fd_sync:we(I=>{const D=p.get(I);return D?(D.kind===4&&G(D),Te):ze}),fd_tell:we((I,D)=>{const F=p.get(I);return!F||F.kind!==4?ze:(T().setBigUint64(D,BigInt(F.offset??0),!0),Te)}),fd_write:we((I,D,F,U)=>{const N=p.get(I);if(!N)return ze;const Q=T();if(N.kind===1||N.kind===2){let me=0;for(let ye=0;ye<F;ye++){const Ue=Q.getUint32(D+ye*8,!0),Ie=Q.getUint32(D+ye*8+4,!0),ut=new Uint8Array(C().buffer,Ue,Ie),Rt=nv.decode(ut);N.kind===1?(V+=Rt,V=J(1,V)):(K+=Rt,K=J(2,K)),me+=Ie}return Q.setUint32(U,me,!0),Te}if(N.kind!==4)return ze;let ce=0,le=N.flags&&N.flags&wu?N.data?N.data.length:0:N.offset??0;for(let me=0;me<F;me++){const ye=Q.getUint32(D+me*8,!0),Ue=Q.getUint32(D+me*8+4,!0),Ie=new Uint8Array(C().buffer,ye,Ue),ut=le+Ue;if(!N.data||N.data.length<ut){const Rt=new Uint8Array(ut);N.data&&Rt.set(N.data),N.data=Rt}N.data.set(Ie,le),le+=Ue,ce+=Ue}return N.offset=le,N.dirty=!0,Q.setUint32(U,ce,!0),Te}),path_create_directory:we((I,D,F)=>{if(!d)return xt;const U=p.get(I);if(!U)return ze;const N=X(D,F),Q=Wn(U.path,N);return d.mkdirSync(Q,{recursive:!0}),Te}),path_filestat_get:we((I,D,F,U,N)=>{if(!d)return xt;const Q=p.get(I);if(!Q)return ze;const ce=X(F,U),le=Wn(Q.path,ce),me=d.statSync(le),ye=T();let Ue=To;me.isDirectory()?Ue=Ao:me.isSymbolicLink()&&(Ue=Jb);const Ie=BigInt(Math.floor(me.mtimeMs))*BigInt(1e6),ut=BigInt(Math.floor(me.atimeMs))*BigInt(1e6),Rt=BigInt(Math.floor(me.ctimeMs))*BigInt(1e6);return ye.setBigUint64(N,0n,!0),ye.setBigUint64(N+8,BigInt(me.ino??0),!0),ye.setUint8(N+16,Ue),ye.setBigUint64(N+24,BigInt(me.nlink??1),!0),ye.setBigUint64(N+32,BigInt(me.size),!0),ye.setBigUint64(N+40,ut,!0),ye.setBigUint64(N+48,Ie,!0),ye.setBigUint64(N+56,Rt,!0),Te}),path_filestat_set_times:we((I,D,F,U,N,Q,ce)=>Te),path_link:we((I,D,F,U,N,Q,ce)=>xt),path_open:we((I,D,F,U,N,Q,ce,le,me)=>{if(!d)return xt;const ye=p.get(I);if(!ye)return ze;const Ue=X(F,U),Ie=Wn(ye.path,Ue),ut=(N&SC)!==0,Rt=(N&wC)!==0,as=(N&xC)!==0,Yr=(N&EC)!==0;let os=d.existsSync(Ie);if(as&&os)return qb;if(ut){if(!os)if(Rt)d.mkdirSync(Ie,{recursive:!0});else return bu;const Cs=y++;return p.set(Cs,{kind:3,path:Ie,rights:ev}),T().setUint32(me,Cs,!0),Te}let Qt;if(os&&!Yr){Qt=d.readFileSync(Ie);const Cs=new Uint8Array(Qt.length);Cs.set(Qt),Qt=Cs}else if(Rt||Yr)os||d.writeFileSync(Ie,new Uint8Array(0)),Qt=new Uint8Array(0);else{if(!os)return bu;Qt=d.readFileSync(Ie);const Cs=new Uint8Array(Qt.length);Cs.set(Qt),Qt=Cs}const Wv=y++;return p.set(Wv,{kind:4,path:Ie,rights:WC,data:Qt,offset:0,dirty:!1,flags:le}),T().setUint32(me,Wv,!0),Te}),path_readlink:we((I,D,F,U,N,Q)=>{if(!d||!d.readlinkSync)return xt;const ce=p.get(I);if(!ce)return ze;const le=X(D,F),me=Wn(ce.path,le),ye=d.readlinkSync(me),Ue=Es.encode(ye),Ie=Math.min(Ue.length,N);return L().set(Ue.subarray(0,Ie),U),T().setUint32(Q,Ie,!0),Te}),path_remove_directory:we((I,D,F)=>{if(!d)return xt;const U=p.get(I);if(!U)return ze;const N=X(D,F),Q=Wn(U.path,N);return d.rmdirSync(Q),Te}),path_rename:we((I,D,F,U,N,Q)=>{if(!d)return xt;const ce=p.get(I),le=p.get(U);if(!ce||!le)return ze;const me=X(D,F),ye=X(N,Q),Ue=Wn(ce.path,me),Ie=Wn(le.path,ye);return d.renameSync(Ue,Ie),Te}),path_symlink:we((I,D,F,U,N)=>{if(!d||!d.symlinkSync)return xt;const Q=p.get(F);if(!Q)return ze;const ce=X(I,D),le=X(U,N),me=Wn(Q.path,le);return d.symlinkSync(ce,me),Te}),path_unlink_file:we((I,D,F)=>{if(!d)return xt;const U=p.get(I);if(!U)return ze;const N=X(D,F),Q=Wn(U.path,N);return d.unlinkSync(Q),Te}),poll_oneoff:we((I,D,F,U)=>{const N=T();let Q=0;for(let ce=0;ce<F;ce++){const le=I+ce*48,me=D+Q*32,ye=N.getBigUint64(le,!0),Ue=N.getUint8(le+8);N.setBigUint64(me,ye,!0),N.setUint16(me+8,Te,!0),N.setUint8(me+10,Ue),(Ue===zC||Ue===qC)&&(N.setBigUint64(me+16,BigInt(1),!0),N.setUint16(me+24,0,!0)),Q++}return N.setUint32(U,Q,!0),Te}),proc_exit:we(I=>{throw V&&(console.log(V),V=""),K&&(console.error(K),K=""),new Io(I)}),proc_raise:we(I=>xt),sched_yield:we(()=>Te),random_get:we((I,D)=>{const F=new Uint8Array(C().buffer,I,D);return crypto.getRandomValues(F),Te}),sock_recv:we(()=>xt),sock_send:we(()=>xt),sock_shutdown:we(()=>xt),sock_accept:we(()=>xt)},te=this;te.wasiImport=$,te.start=function(D){k=D,x=D.exports.memory;const F=D.exports._start;if(typeof F!="function")throw new Error("WASI: instance has no _start export");try{F()}catch(U){if(U instanceof Io){if(c)return U.code;throw U}throw U}finally{V&&(console.log(V),V=""),K&&(console.error(K),K="")}return 0},te.initialize=function(D){k=D,x=D.exports.memory;const F=D.exports._initialize;typeof F=="function"&&F()},te.getImportObject=function(){return{wasi_snapshot_preview1:$}}};Object.freeze(Object.defineProperty({__proto__:null,ExitStatus:Io,WASI:sv,default:{WASI:sv}},Symbol.toStringTag,{value:"Module"}));function rv(){return!1}function iv(e){throw new Error("Single Executable Applications (SEA) are not supported in the browser")}function av(e){throw new Error("Single Executable Applications (SEA) are not supported in the browser")}function ov(e){throw new Error("Single Executable Applications (SEA) are not supported in the browser")}Object.freeze(Object.defineProperty({__proto__:null,default:{isSea:rv,getAsset:iv,getAssetAsBlob:av,getRawAsset:ov},getAsset:iv,getAssetAsBlob:av,getRawAsset:ov,isSea:rv},Symbol.toStringTag,{value:"Module"}));const Xs=function(){};Xs.prototype.run=function(...t){throw new Error("node:sqlite is not supported in the browser environment")},Xs.prototype.get=function(...t){throw new Error("node:sqlite is not supported in the browser environment")},Xs.prototype.all=function(...t){throw new Error("node:sqlite is not supported in the browser environment")},Xs.prototype.expandedSQL=function(){return""},Xs.prototype.sourceSQL=function(){return""};const jr=function(t,n){if(this)throw new Error("node:sqlite is not supported in the browser environment")};jr.prototype.close=function(){},jr.prototype.exec=function(t){},jr.prototype.prepare=function(t){throw new Error("node:sqlite is not supported in the browser environment")},jr.prototype.open=function(){},Object.freeze(Object.defineProperty({__proto__:null,DatabaseSync:jr,StatementSync:Xs,default:{DatabaseSync:jr,StatementSync:Xs}},Symbol.toStringTag,{value:"Module"}));const Vr=function(t){this&&ne.call(this)};Object.setPrototypeOf(Vr.prototype,ne.prototype),Vr.prototype.close=function(){this.emit("close")},Vr.prototype.destroy=function(t){this.emit("close")},Object.defineProperty(Vr.prototype,"address",{get:function(){return{address:"0.0.0.0",family:"IPv4",port:0}},configurable:!0});const Hr=function(){this&&ne.call(this)};Object.setPrototypeOf(Hr.prototype,ne.prototype),Hr.prototype.close=function(){this.emit("close")},Hr.prototype.destroy=function(t){this.emit("close")},Object.defineProperty(Hr.prototype,"destroyed",{get:function(){return!1},configurable:!0});const Ro=function(){this&&ne.call(this)};Object.setPrototypeOf(Ro.prototype,ne.prototype),Object.defineProperty(Ro.prototype,"id",{get:function(){return 0},configurable:!0}),Object.freeze(Object.defineProperty({__proto__:null,QuicEndpoint:Vr,QuicSession:Hr,QuicStream:Ro,default:{QuicEndpoint:Vr,QuicSession:Hr,QuicStream:Ro}},Symbol.toStringTag,{value:"Module"}));const ht=function(t){if(!this)return;const n=t.message??`${lv(t.actual)} ${t.operator??"=="} ${lv(t.expected)}`;Error.call(this,n),this.message=n,this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator??"",this.generatedMessage=!t.message,this.code="ERR_ASSERTION",Error.captureStackTrace&&t.stackStartFn&&Error.captureStackTrace(this,t.stackStartFn)};Object.setPrototypeOf(ht.prototype,Error.prototype);function lv(e){try{return JSON.stringify(e)}catch{return String(e)}}function Js(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||e===void 0||t===void 0)return e===t;if(typeof e!=typeof t)return!1;if(typeof e=="number"&&Number.isNaN(e)&&Number.isNaN(t))return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.source===t.source&&e.flags===t.flags;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Js(e[n],t[n]))return!1;return!0}if(e instanceof Uint8Array&&t instanceof Uint8Array){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,s]of e)if(!t.has(n)||!Js(s,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n)){let s=!1;for(const r of t)if(Js(n,r)){s=!0;break}if(!s)return!1}return!0}if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Js(e[r],t[r]))return!1;return!0}return!1}function En(e,t,n){if(e)throw n instanceof Error?n:(n!==void 0&&(t.message=n),new ht(t))}function at(e,t){En(!e,{actual:e,expected:!0,operator:"==",stackStartFn:at},t??"Value is falsy")}at.ok=function e(t,n){En(!t,{actual:t,expected:!0,operator:"==",stackStartFn:e},n??"Value is falsy")},at.equal=function e(t,n,s){En(t!=n,{actual:t,expected:n,operator:"==",stackStartFn:e},s)},at.notEqual=function e(t,n,s){En(t==n,{actual:t,expected:n,operator:"!=",stackStartFn:e},s)},at.strictEqual=function e(t,n,s){En(t!==n,{actual:t,expected:n,operator:"===",stackStartFn:e},s)},at.notStrictEqual=function e(t,n,s){En(t===n,{actual:t,expected:n,operator:"!==",stackStartFn:e},s)},at.deepEqual=function e(t,n,s){En(!Js(t,n),{actual:t,expected:n,operator:"deepEqual",stackStartFn:e},s)},at.deepStrictEqual=function e(t,n,s){En(!Js(t,n),{actual:t,expected:n,operator:"deepStrictEqual",stackStartFn:e},s)},at.notDeepStrictEqual=function e(t,n,s){En(Js(t,n),{actual:t,expected:n,operator:"notDeepStrictEqual",stackStartFn:e},s)},at.throws=function e(t,n,s){let r=!1,o;try{t()}catch(c){r=!0,o=c}if(!r)throw new ht({message:typeof n=="string"?n:s??"Expected function to throw",operator:"throws",stackStartFn:e});n!==void 0&&typeof n!="string"&&cv(o,n,s,e)},at.doesNotThrow=function e(t,n,s){try{t()}catch(r){if(n===void 0||typeof n=="string")throw new ht({message:typeof n=="string"?n:s??"Unexpected throw",actual:r,operator:"doesNotThrow",stackStartFn:e});if(n instanceof RegExp){const o=r instanceof Error?r.message:String(r);if(n.test(o))throw new ht({message:s??"Unexpected matching throw",actual:r,expected:n,operator:"doesNotThrow",stackStartFn:e})}else if(typeof n=="function"&&r instanceof n)throw new ht({message:s??"Unexpected throw of matching type",actual:r,expected:n,operator:"doesNotThrow",stackStartFn:e})}},at.rejects=async function e(t,n,s){const r=typeof t=="function"?t():t;let o=!1,c;try{await r}catch(d){o=!0,c=d}if(!o)throw new ht({message:typeof n=="string"?n:s??"Expected rejection",operator:"rejects",stackStartFn:e});n!==void 0&&typeof n!="string"&&cv(c,n,s,e)},at.doesNotReject=async function e(t,n,s){const r=typeof t=="function"?t():t;try{await r}catch(o){if(n===void 0||typeof n=="string")throw new ht({message:typeof n=="string"?n:s??"Unexpected rejection",actual:o,operator:"doesNotReject",stackStartFn:e});if(n instanceof RegExp){const c=o instanceof Error?o.message:String(o);if(n.test(c))throw new ht({message:s??"Unexpected matching rejection",actual:o,expected:n,operator:"doesNotReject",stackStartFn:e})}else if(typeof n=="function"&&o instanceof n)throw new ht({message:s??"Unexpected rejection of matching type",actual:o,expected:n,operator:"doesNotReject",stackStartFn:e})}},at.fail=function e(t,n,s,r){throw arguments.length<=1?new ht({message:typeof t=="string"?t:"Failed",stackStartFn:e}):new ht({message:s,actual:t,expected:n,operator:r??"fail",stackStartFn:e})},at.match=function e(t,n,s){En(!n.test(t),{actual:t,expected:n,operator:"match",stackStartFn:e},s)},at.doesNotMatch=function e(t,n,s){En(n.test(t),{actual:t,expected:n,operator:"doesNotMatch",stackStartFn:e},s)},at.ifError=function e(t){if(t!=null)throw t instanceof Error?t:new ht({message:`ifError received unwanted value: ${t}`,actual:t,expected:null,operator:"ifError",stackStartFn:e})},at.AssertionError=ht,at.strict=at;function cv(e,t,n,s){if(t instanceof RegExp){const r=e instanceof Error?e.message:String(e);if(!t.test(r))throw new ht({message:n??"Error message did not match",actual:e,expected:t,operator:"throws",stackStartFn:s})}else if(typeof t=="function"){if(!(e instanceof t))throw new ht({message:n??"Error type mismatch",actual:e,expected:t,operator:"throws",stackStartFn:s})}else if(typeof t=="object"){const r=t,o=e;if(r.message!==void 0){const c=o.message??String(e);if(r.message instanceof RegExp){if(!r.message.test(c))throw new ht({message:n??"Error message mismatch",actual:c,expected:r.message,operator:"throws",stackStartFn:s})}else if(c!==r.message)throw new ht({message:n??"Error message mismatch",actual:c,expected:r.message,operator:"throws",stackStartFn:s})}if(r.code!==void 0&&o.code!==r.code)throw new ht({message:n??"Error code mismatch",actual:o.code,expected:r.code,operator:"throws",stackStartFn:s})}}Object.freeze(Object.defineProperty({__proto__:null,AssertionError:ht,assert:at,default:at},Symbol.toStringTag,{value:"Module"}));const Ht=36,ca=1,ua=26,GC=38,KC=700,uv=72,dv=128,hv="-";function pv(e,t,n){let s=n?Math.floor(e/KC):e>>1;s+=Math.floor(s/t);let r=0;for(;s>(Ht-ca)*ua>>1;)s=Math.floor(s/(Ht-ca)),r+=Ht;return Math.floor(r+(Ht-ca+1)*s/(s+GC))}function YC(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:Ht}function fv(e,t){return e+22+75*(e<26?1:0)-0}function Eu(e){const t=[];let n=0,s=dv,r=uv,o=e.lastIndexOf(hv);o<0&&(o=0);for(let d=0;d<o;++d)t.push(e.charCodeAt(d));let c=o>0?o+1:0;for(;c<e.length;){const d=n;let p=1,y=Ht;for(;;){if(c>=e.length)throw new RangeError("Invalid input");const x=YC(e.charCodeAt(c++));if(x>=Ht)throw new RangeError("Invalid input");if(x>Math.floor((2147483647-n)/p))throw new RangeError("Overflow");n+=x*p;const k=y<=r?ca:y>=r+ua?ua:y-r;if(x<k)break;if(p>Math.floor(2147483647/(Ht-k)))throw new RangeError("Overflow");p*=Ht-k,y+=Ht}const g=t.length+1;if(r=pv(n-d,g,d===0),Math.floor(n/g)>2147483647-s)throw new RangeError("Overflow");s+=Math.floor(n/g),n%=g,t.splice(n++,0,s)}return String.fromCodePoint(...t)}function ku(e){const t=[],n=Array.from(e).map(p=>p.codePointAt(0));let s=dv,r=0,o=uv;for(const p of n)p<128&&t.push(String.fromCharCode(p));let c=t.length;const d=c;for(d>0&&t.push(hv);c<n.length;){let p=2147483647;for(const y of n)y>=s&&y<p&&(p=y);if(p-s>Math.floor((2147483647-r)/(c+1)))throw new RangeError("Overflow");r+=(p-s)*(c+1),s=p;for(const y of n){if(y<s&&++r>2147483647)throw new RangeError("Overflow");if(y===s){let g=r,x=Ht;for(;;){const k=x<=o?ca:x>=o+ua?ua:x-o;if(g<k)break;t.push(String.fromCharCode(fv(k+(g-k)%(Ht-k)))),g=Math.floor((g-k)/(Ht-k)),x+=Ht}t.push(String.fromCharCode(fv(g))),o=pv(r,c+1,c===d),r=0,++c}}++r,++s}return t.join("")}function mv(e){return e.split(".").map(t=>t.startsWith("xn--")?Eu(t.slice(4)):t).join(".")}function gv(e){return e.split(".").map(t=>/[^\x00-\x7E]/.test(t)?"xn--"+ku(t):t).join(".")}const yv={decode:e=>Array.from(e).map(t=>t.codePointAt(0)),encode:e=>String.fromCodePoint(...e)},_v="2.3.1";Object.freeze(Object.defineProperty({__proto__:null,decode:Eu,default:{decode:Eu,encode:ku,toUnicode:mv,toASCII:gv,ucs2:yv,version:_v},encode:ku,toASCII:gv,toUnicode:mv,ucs2:yv,version:_v},Symbol.toStringTag,{value:"Module"})),new Proxy({},{get(e,t){},ownKeys(){return[]},getOwnPropertyDescriptor(e,t){},has(e,t){return!1}});function ZC(){const e=Promise;class t extends e{constructor(s){let r,o=!1,c=!1,d;super((p,y)=>{s(g=>{if(g&&typeof g=="object"&&typeof g.then=="function"){let x=!1,k,C=!1,T;if(g.then(L=>{k=L,x=!0},L=>{T=L,C=!0}),x){r=k,o=!0,p(k);return}if(C){c=!0,d=T,y(T);return}p(g);return}r=g,o=!0,p(g)},g=>{c=!0,d=g,y(g)})}),W(this,"_syncValue"),W(this,"_syncResolved",!1),W(this,"_syncRejected",!1),W(this,"_syncError"),this._syncValue=r,this._syncResolved=o,this._syncRejected=c,this._syncError=d,c&&e.prototype.catch.call(this,()=>{})}then(s,r){if(this._syncResolved&&s)try{const o=s(this._syncValue);if(o&&typeof o=="object"&&typeof o.then=="function"){let c,d=!1,p=!1,y;return o.then(g=>{c=g,d=!0},g=>{y=g,p=!0}),d?new t(g=>g(c)):p?r?new t(g=>g(r(y))):new t((g,x)=>x(y)):e.resolve(o).then(null,r)}return new t(c=>c(o))}catch(o){return r?new t(c=>c(r(o))):new t((c,d)=>d(o))}if(this._syncRejected&&r)try{const o=r(this._syncError);return new t(c=>c(o))}catch(o){return new t((c,d)=>d(o))}return this._syncRejected&&!r?new t((o,c)=>c(this._syncError)):super.then(s,r)}}return Object.defineProperty(t,Symbol.hasInstance,{value:n=>n instanceof e,configurable:!0}),t.resolve=n=>n&&typeof n=="object"&&typeof n.then=="function"?new t(s=>s(n)):new t(s=>s(n)),t.reject=n=>new t((s,r)=>r(n)),t.all=n=>{const s=Array.from(n),r=new Array(s.length);let o=!0;for(let c=0;c<s.length;c++){const d=s[c];if(d instanceof t)if(d._syncResolved)r[c]=d._syncValue;else{if(d._syncRejected)return new t((p,y)=>y(d._syncError));o=!1;break}else if(d&&typeof d=="object"&&typeof d.then=="function"){let p=!1,y;if(d.then(g=>{y=g,p=!0}),p)r[c]=y;else{o=!1;break}}else r[c]=d}return o?new t(c=>c(r)):new t((c,d)=>{e.all(s).then(c,d)})},t.allSettled=n=>{const s=Array.from(n),r=new Array(s.length);let o=!0;for(let c=0;c<s.length;c++){const d=s[c];if(d instanceof t)if(d._syncResolved)r[c]={status:"fulfilled",value:d._syncValue};else if(d._syncRejected)r[c]={status:"rejected",reason:d._syncError};else{o=!1;break}else if(d&&typeof d=="object"&&typeof d.then=="function"){o=!1;break}else r[c]={status:"fulfilled",value:d}}return o?new t(c=>c(r)):new t((c,d)=>{e.allSettled(s).then(c,d)})},t.race=n=>{const s=Array.from(n);for(const r of s)if(r instanceof t){if(r._syncResolved)return new t(o=>o(r._syncValue));if(r._syncRejected)return new t((o,c)=>c(r._syncError))}else if(!(r&&typeof r=="object"&&typeof r.then=="function"))return new t(o=>o(r));return new t((r,o)=>{e.race(s).then(r,o)})},t.any=n=>{const s=Array.from(n);for(const c of s){if(c instanceof t&&c._syncResolved)return new t(d=>d(c._syncValue));if(!(c&&typeof c=="object"&&typeof c.then=="function"))return new t(d=>d(c))}let r=!0;const o=[];for(const c of s)if(c instanceof t&&c._syncRejected)o.push(c._syncError);else{r=!1;break}return r&&s.length>0?new t((c,d)=>d(new AggregateError(o,"All promises were rejected"))):new t((c,d)=>{e.any(s).then(c,d)})},t}ZC();function Cu(e){const t={};for(const n of Object.keys(e))t[n]=e[n];return t}Cu(V0),Cu(ux),Cu(sx);const bv=Symbol("Comlink.proxy"),XC=Symbol("Comlink.endpoint"),JC=Symbol("Comlink.releaseProxy"),Au=Symbol("Comlink.finalizer"),Po=Symbol("Comlink.thrown"),vv=e=>typeof e=="object"&&e!==null||typeof e=="function",QC={canHandle:e=>vv(e)&&e[bv],serialize(e){const{port1:t,port2:n}=new MessageChannel;return Sv(e,t),[n,[n]]},deserialize(e){return e.start(),Ev(e)}},eA={canHandle:e=>vv(e)&&Po in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},wv=new Map([["proxy",QC],["throw",eA]]);function tA(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function Sv(e,t=globalThis,n=["*"]){t.addEventListener("message",function s(r){if(!r||!r.data)return;if(!tA(n,r.origin)){console.warn(`Invalid origin '${r.origin}' for comlink proxy`);return}const{id:o,type:c,path:d}=Object.assign({path:[]},r.data),p=(r.data.argumentList||[]).map(Qs);let y;try{const g=d.slice(0,-1).reduce((k,C)=>k[C],e),x=d.reduce((k,C)=>k[C],e);switch(c){case"GET":y=x;break;case"SET":g[d.slice(-1)[0]]=Qs(r.data.value),y=!0;break;case"APPLY":y=x.apply(g,p);break;case"CONSTRUCT":{const k=new x(...p);y=oA(k)}break;case"ENDPOINT":{const{port1:k,port2:C}=new MessageChannel;Sv(e,C),y=aA(k,[k])}break;case"RELEASE":y=void 0;break;default:return}}catch(g){y={value:g,[Po]:0}}Promise.resolve(y).catch(g=>({value:g,[Po]:0})).then(g=>{const[x,k]=Bo(g);t.postMessage(Object.assign(Object.assign({},x),{id:o}),k),c==="RELEASE"&&(t.removeEventListener("message",s),xv(t),Au in e&&typeof e[Au]=="function"&&e[Au]())}).catch(g=>{const[x,k]=Bo({value:new TypeError("Unserializable return value"),[Po]:0});t.postMessage(Object.assign(Object.assign({},x),{id:o}),k)})}),t.start&&t.start()}function nA(e){return e.constructor.name==="MessagePort"}function xv(e){nA(e)&&e.close()}function Ev(e,t){const n=new Map;return e.addEventListener("message",function(r){const{data:o}=r;if(!o||!o.id)return;const c=n.get(o.id);if(c)try{c(o)}finally{n.delete(o.id)}}),Tu(e,n,[],t)}function Do(e){if(e)throw new Error("Proxy has been released and is not useable")}function kv(e){return Wr(e,new Map,{type:"RELEASE"}).then(()=>{xv(e)})}const Oo=new WeakMap,No="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(Oo.get(e)||0)-1;Oo.set(e,t),t===0&&kv(e)});function sA(e,t){const n=(Oo.get(t)||0)+1;Oo.set(t,n),No&&No.register(e,t,e)}function rA(e){No&&No.unregister(e)}function Tu(e,t,n=[],s=function(){}){let r=!1;const o=new Proxy(s,{get(c,d){if(Do(r),d===JC)return()=>{rA(o),kv(e),t.clear(),r=!0};if(d==="then"){if(n.length===0)return{then:()=>o};const p=Wr(e,t,{type:"GET",path:n.map(y=>y.toString())}).then(Qs);return p.then.bind(p)}return Tu(e,t,[...n,d])},set(c,d,p){Do(r);const[y,g]=Bo(p);return Wr(e,t,{type:"SET",path:[...n,d].map(x=>x.toString()),value:y},g).then(Qs)},apply(c,d,p){Do(r);const y=n[n.length-1];if(y===XC)return Wr(e,t,{type:"ENDPOINT"}).then(Qs);if(y==="bind")return Tu(e,t,n.slice(0,-1));const[g,x]=Cv(p);return Wr(e,t,{type:"APPLY",path:n.map(k=>k.toString()),argumentList:g},x).then(Qs)},construct(c,d){Do(r);const[p,y]=Cv(d);return Wr(e,t,{type:"CONSTRUCT",path:n.map(g=>g.toString()),argumentList:p},y).then(Qs)}});return sA(o,e),o}function iA(e){return Array.prototype.concat.apply([],e)}function Cv(e){const t=e.map(Bo);return[t.map(n=>n[0]),iA(t.map(n=>n[1]))]}const Av=new WeakMap;function aA(e,t){return Av.set(e,t),e}function oA(e){return Object.assign(e,{[bv]:!0})}function Bo(e){for(const[t,n]of wv)if(n.canHandle(e)){const[s,r]=n.serialize(e);return[{type:"HANDLER",name:t,value:s},r]}return[{type:"RAW",value:e},Av.get(e)||[]]}function Qs(e){switch(e.type){case"HANDLER":return wv.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Wr(e,t,n,s){return new Promise(r=>{const o=lA();t.set(o,r),e.start&&e.start(),e.postMessage(Object.assign({id:o},n),s)})}function lA(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}F0=class extends ne{constructor(e,t){super(),W(this,"pid"),W(this,"worker"),W(this,"command"),W(this,"args"),W(this,"parentPid"),W(this,"_state","starting"),W(this,"_exitCode"),W(this,"_stdout",""),W(this,"_stderr",""),W(this,"_exitHoldCount",0),W(this,"_deferredExit",null),W(this,"_shellDoneHoldCount",0),W(this,"_deferredShellDone",null),W(this,"_syncBlockedCount",0),this.pid=t.snapshot?Math.floor(Math.random()*9e4)+1e4:0,this.worker=e,this.command=t.command,this.args=t.args,this.parentPid=t.parentPid,this._setupWorkerListeners()}get workerExited(){return this._deferredExit!==null||this._state==="exited"}get shellCommandDone(){return this._deferredShellDone!==null}get syncBlocked(){return this._syncBlockedCount>0}holdSync(){this._syncBlockedCount++}releaseSync(){this._syncBlockedCount=Math.max(0,this._syncBlockedCount-1)}get stdout(){return this._stdout}get stderr(){return this._stderr}get state(){return this._state}get exitCode(){return this._exitCode}_setPid(e){this.pid=e}postMessage(e,t){this.worker.postMessage(e,t??[])}init(e){const t=[];e.snapshot.data.byteLength>0&&t.push(e.snapshot.data),this.postMessage(e,t)}exec(e){this.postMessage(e)}sendStdin(e){this.emit("stdin-forward",e),!this.workerExited&&!this.syncBlocked&&this.postMessage({type:"stdin",data:e})}kill(e="SIGTERM"){this.postMessage({type:"signal",signal:e}),this.emit("signal",e),e==="SIGKILL"&&this._terminate(137)}resize(e,t){this.postMessage({type:"resize",cols:e,rows:t})}holdExit(){this._exitHoldCount++}releaseExit(){if(this._exitHoldCount=Math.max(0,this._exitHoldCount-1),this._exitHoldCount===0&&this._deferredExit){const{exitCode:e,stdout:t,stderr:n}=this._deferredExit;this._deferredExit=null,this._state="exited",this._exitCode=e,this.emit("exit",e,t,n)}}holdShellDone(){this._shellDoneHoldCount++}releaseShellDone(){if(this._shellDoneHoldCount=Math.max(0,this._shellDoneHoldCount-1),this._shellDoneHoldCount===0&&this._deferredShellDone){const{exitCode:e,stdout:t,stderr:n}=this._deferredShellDone;this._deferredShellDone=null,this.emit("shell-done",e,t,n)}}_terminate(e=1){if(this._state!=="exited"){this._state="exited",this._exitCode=e,this._deferredExit=null,this._exitHoldCount=0;try{this.worker.terminate()}catch{}this.emit("exit",e,this._stdout,this._stderr)}}_setupWorkerListeners(){this.worker.addEventListener("message",e=>{const t=e.data;if(!(!t||!t.type))switch(t.type){case"ready":this._state="running",this.emit("ready");break;case"stdout":this._stdout+=t.data,this.emit("stdout",t.data);break;case"stderr":this._stderr+=t.data,this.emit("stderr",t.data);break;case"exit":{const n=t.stdout||this._stdout,s=t.stderr||this._stderr;this._stdout=n,this._stderr=s,this._exitHoldCount>0?(this._deferredExit={exitCode:t.exitCode,stdout:n,stderr:s},this.emit("worker-done",t.exitCode)):(this._state="exited",this._exitCode=t.exitCode,this.emit("exit",t.exitCode,n,s));break}case"console":this.emit("console",t.method,t.args);break;case"vfs-write":this.emit("vfs-write",t.path,t.content,t.isDirectory);break;case"vfs-delete":this.emit("vfs-delete",t.path);break;case"vfs-read":this.emit("vfs-read",t.requestId,t.path);break;case"spawn-request":this.emit("spawn-request",t);break;case"fork-request":this.emit("fork-request",t);break;case"workerthread-request":this.emit("workerthread-request",t);break;case"ipc-message":this.emit("ipc-message",t);break;case"spawn-sync":this.emit("spawn-sync",t);break;case"server-listen":this.emit("server-listen",t.port,t.hostname);break;case"server-close":this.emit("server-close",t.port);break;case"http-request":this.emit("http-request",t);break;case"http-response":this.emit("http-response",t);break;case"shell-done":{const n=t;this._shellDoneHoldCount>0?this._deferredShellDone={exitCode:n.exitCode,stdout:n.stdout,stderr:n.stderr}:this.emit("shell-done",n.exitCode,n.stdout,n.stderr);break}case"cwd-change":this.emit("cwd-change",t.cwd);break;case"stdin-raw-status":this.emit("stdin-raw-status",t.isRaw);break;case"ws-frame":this.emit("ws-frame",t);break;case"error":this.emit("worker-error",t.message,t.stack);break}}),this.worker.addEventListener("error",e=>{this.emit("worker-error",e.message,void 0),this._state!=="exited"&&this._terminate(1)})}};const cA=`"use strict";
93
+ `):g=String.fromCharCode(F),this.options.locations&&(++this.curLine,this.lineStart=this.pos),g}jsx_readString(S){let F="",g=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let _=this.input.charCodeAt(this.pos);if(_===S)break;_===38?(F+=this.input.slice(g,this.pos),F+=this.jsx_readEntity(),g=this.pos):N(_)?(F+=this.input.slice(g,this.pos),F+=this.jsx_readNewLine(!1),g=this.pos):++this.pos}return F+=this.input.slice(g,this.pos++),this.finishToken(h.string,F)}jsx_readEntity(){let S="",F=0,g,_=this.input[this.pos];_!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let w=++this.pos;for(;this.pos<this.input.length&&F++<10;){if(_=this.input[this.pos++],_===";"){S[0]==="#"?S[1]==="x"?(S=S.substr(2),t.test(S)&&(g=String.fromCharCode(parseInt(S,16)))):(S=S.substr(1),r.test(S)&&(g=String.fromCharCode(parseInt(S,10)))):g=n[S];break}S+=_}return g||(this.pos=w,"&")}jsx_readWord(){let S,F=this.pos;do S=this.input.charCodeAt(++this.pos);while(R(S)||S===45);return this.finishToken(f.jsxName,this.input.slice(F,this.pos))}jsx_parseIdentifier(){let S=this.startNode();return this.type===f.jsxName?S.name=this.value:this.type.keyword?S.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(S,"JSXIdentifier")}jsx_parseNamespacedName(){let S=this.start,F=this.startLoc,g=this.jsx_parseIdentifier();if(!l.allowNamespaces||!this.eat(h.colon))return g;var _=this.startNodeAt(S,F);return _.namespace=g,_.name=this.jsx_parseIdentifier(),this.finishNode(_,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===f.jsxTagEnd)return"";let S=this.start,F=this.startLoc,g=this.jsx_parseNamespacedName();for(this.type===h.dot&&g.type==="JSXNamespacedName"&&!l.allowNamespacedObjects&&this.unexpected();this.eat(h.dot);){let _=this.startNodeAt(S,F);_.object=g,_.property=this.jsx_parseIdentifier(),g=this.finishNode(_,"JSXMemberExpression")}return g}jsx_parseAttributeValue(){switch(this.type){case h.braceL:let S=this.jsx_parseExpressionContainer();return S.expression.type==="JSXEmptyExpression"&&this.raise(S.start,"JSX attributes must only be assigned a non-empty expression"),S;case f.jsxTagStart:case h.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let S=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(S,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let S=this.startNode();return this.next(),S.expression=this.type===h.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(h.braceR),this.finishNode(S,"JSXExpressionContainer")}jsx_parseAttribute(){let S=this.startNode();return this.eat(h.braceL)?(this.expect(h.ellipsis),S.argument=this.parseMaybeAssign(),this.expect(h.braceR),this.finishNode(S,"JSXSpreadAttribute")):(S.name=this.jsx_parseNamespacedName(),S.value=this.eat(h.eq)?this.jsx_parseAttributeValue():null,this.finishNode(S,"JSXAttribute"))}jsx_parseOpeningElementAt(S,F){let g=this.startNodeAt(S,F);g.attributes=[];let _=this.jsx_parseElementName();for(_&&(g.name=_);this.type!==h.slash&&this.type!==f.jsxTagEnd;)g.attributes.push(this.jsx_parseAttribute());return g.selfClosing=this.eat(h.slash),this.expect(f.jsxTagEnd),this.finishNode(g,_?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(S,F){let g=this.startNodeAt(S,F),_=this.jsx_parseElementName();return _&&(g.name=_),this.expect(f.jsxTagEnd),this.finishNode(g,_?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(S,F){let g=this.startNodeAt(S,F),_=[],w=this.jsx_parseOpeningElementAt(S,F),E=null;if(!w.selfClosing){e:for(;;)switch(this.type){case f.jsxTagStart:if(S=this.start,F=this.startLoc,this.next(),this.eat(h.slash)){E=this.jsx_parseClosingElementAt(S,F);break e}_.push(this.jsx_parseElementAt(S,F));break;case f.jsxText:_.push(this.parseExprAtom());break;case h.braceL:_.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}a(E.name)!==a(w.name)&&this.raise(E.start,"Expected corresponding JSX closing tag for <"+a(w.name)+">")}let b=w.name?"Element":"Fragment";return g["opening"+b]=w,g["closing"+b]=E,g.children=_,this.type===h.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(g,"JSX"+b)}jsx_parseText(){let S=this.parseLiteral(this.value);return S.type="JSXText",S}jsx_parseElement(){let S=this.start,F=this.startLoc;return this.next(),this.jsx_parseElementAt(S,F)}parseExprAtom(S){return this.type===f.jsxText?this.jsx_parseText():this.type===f.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(S)}readToken(S){let F=this.curContext();if(F===P)return this.jsx_readToken();if(F===v||F===k){if(O(S))return this.jsx_readWord();if(S==62)return++this.pos,this.finishToken(f.jsxTagEnd);if((S===34||S===39)&&F==v)return this.jsx_readString(S)}return S===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(f.jsxTagStart)):super.readToken(S)}updateContext(S){if(this.type==h.braceL){var F=this.curContext();F==v?this.context.push(m.b_expr):F==P?this.context.push(m.b_tmpl):super.updateContext(S),this.exprAllowed=!0}else if(this.type===h.slash&&S===f.jsxTagStart)this.context.length-=2,this.context.push(k),this.exprAllowed=!1;else return super.updateContext(S)}}}})(rm);var k0=rm.exports;const C0=S0(k0),im=Re.extend(C0());let vl=null,Xs=null;async function sa(){return vl||Xs||(Xs=(async()=>{try{const e=await Ii(Ry);return vl=e,e}catch(e){throw Xs=null,new Error(`rollup: failed to load @rollup/browser from CDN -- ${e}`)}})(),Xs)}const am=rd;async function om(e){return(await sa()).rollup(e)}async function lm(e){return(await sa()).watch(e)}function cm(e){return e}function wl(e,n){const t={ecmaVersion:"latest",sourceType:"module",allowReturnOutsideFunction:(n==null?void 0:n.allowReturnOutsideFunction)??!1,locations:!0};if(n!=null&&n.jsx)return im.parse(e,t);try{return ta(e,t)}catch{return im.parse(e,t)}}async function um(e,n){return wl(e,{allowReturnOutsideFunction:n==null?void 0:n.allowReturnOutsideFunction,jsx:n==null?void 0:n.jsx})}function A0(){return""}Object.freeze(Object.defineProperty({__proto__:null,VERSION:am,default:{VERSION:am,rollup:om,watch:lm,defineConfig:cm,parseAst:wl,parseAstAsync:um,loadRollup:sa},defineConfig:cm,getPackageBase:A0,loadRollup:sa,parseAst:wl,parseAstAsync:um,rollup:om,watch:lm},Symbol.toStringTag,{value:"Module"}));function dm(){return{total_heap_size:0,total_heap_size_executable:0,total_physical_size:0,total_available_size:0,used_heap_size:0,heap_size_limit:0,malloced_memory:0,peak_malloced_memory:0,does_zap_garbage:0,number_of_native_contexts:0,number_of_detached_contexts:0}}function pm(){return[]}function hm(){return{code_and_metadata_size:0,bytecode_and_metadata_size:0,external_script_source_size:0}}function fm(){return null}function mm(){return""}function gm(e){}function _m(){}function ym(){}function bm(){return 0}function vm(e){return new TextEncoder().encode(JSON.stringify(e))}function wm(e){return JSON.parse(new TextDecoder().decode(e))}const ir=function(){};ir.prototype.writeHeader=function(){},ir.prototype.writeValue=function(n){},ir.prototype.releaseBuffer=function(){return new Uint8Array(0)};const Kr=function(n){};Kr.prototype.readHeader=function(){return!0},Kr.prototype.readValue=function(){return null};const Sl=function(){this&&ir.call(this)};Object.setPrototypeOf(Sl.prototype,ir.prototype);const xl=function(n){this&&Kr.call(this,n)};Object.setPrototypeOf(xl.prototype,Kr.prototype);function Sm(){return{onInit:()=>{},onSettled:()=>{},onBefore:()=>{},onAfter:()=>{},createHook:()=>({enable:()=>{},disable:()=>{}})}}Object.freeze(Object.defineProperty({__proto__:null,DefaultDeserializer:xl,DefaultSerializer:Sl,Deserializer:Kr,Serializer:ir,cachedDataVersionTag:bm,default:{getHeapStatistics:dm,getHeapSpaceStatistics:pm,getHeapCodeStatistics:hm,getHeapSnapshot:fm,writeHeapSnapshot:mm,setFlagsFromString:gm,takeCoverage:_m,stopCoverage:ym,cachedDataVersionTag:bm,serialize:vm,deserialize:wm,Serializer:ir,Deserializer:Kr,DefaultSerializer:Sl,DefaultDeserializer:xl,promiseHooks:Sm},deserialize:wm,getHeapCodeStatistics:hm,getHeapSnapshot:fm,getHeapSpaceStatistics:pm,getHeapStatistics:dm,promiseHooks:Sm,serialize:vm,setFlagsFromString:gm,stopCoverage:ym,takeCoverage:_m,writeHeapSnapshot:mm},Symbol.toStringTag,{value:"Module"}));let Yr=0;function T0(){return Yr}function I0(e){Yr=e}ny=function(){Yr=0};const xm=Symbol("keypressDecoder");function R0(e,n,t){if(t.length>0){t.push(n);const i=t.join("");if(i.length>=3&&i[1]==="["){const a=i[i.length-1];if(/[A-Za-z~]/.test(a)){let o="",l=!1;return a==="A"?o="up":a==="B"?o="down":a==="C"?o="right":a==="D"?o="left":a==="H"?o="home":a==="F"?o="end":i==="\x1B[3~"?o="delete":i==="\x1B[2~"?o="insert":i==="\x1B[5~"?o="pageup":i==="\x1B[6~"?o="pagedown":i==="\x1B[1;5C"?(o="right",l=!0):i==="\x1B[1;5D"?(o="left",l=!0):o=a,e.emit("keypress",i,{sequence:i,name:o,ctrl:l,meta:!1,shift:!1}),[]}return i.length>8?(e.emit("keypress",i,{sequence:i,name:"unknown",ctrl:!1,meta:!1,shift:!1}),[]):t}if(i.length>=3&&i[1]==="O"){const a=i[i.length-1];let o="";return a==="A"?o="up":a==="B"?o="down":a==="C"?o="right":a==="D"?o="left":a==="H"?o="home":a==="F"?o="end":o=a,e.emit("keypress",i,{sequence:i,name:o,ctrl:!1,meta:!1,shift:!1}),[]}if(i.length>=2&&i[1]!=="["&&i[1]!=="O"){const a=i[1];let o=a;return a.charCodeAt(0)>=32&&(o=a.toLowerCase()),e.emit("keypress",i,{sequence:i,name:o,ctrl:!1,meta:!0,shift:!1}),[]}return t}if(n==="\x1B")return[n];let r=n,s=!1;return n==="\r"||n===`
94
+ `?r="return":n===""||n==="\b"?r="backspace":n===" "?r="tab":n===" "?r="space":n.charCodeAt(0)<32&&(s=!0,r=String.fromCharCode(n.charCodeAt(0)+96)),e.emit("keypress",n,{sequence:n,name:r,ctrl:s,meta:!1,shift:!1}),[]}function El(e,n){if(!e||typeof e.on!="function"||e[xm])return;e[xm]=!0;let t=[],r=null;e.on("data",s=>{if(e.listenerCount("keypress")<=0)return;const i=typeof s=="string"?s:String(s);for(const a of i)r&&(clearTimeout(r),r=null),t=R0(e,a,t),t.length>0&&(r=setTimeout(()=>{if(t.length>0){const o=t.join("");e.emit("keypress",o,{sequence:o,name:"escape",ctrl:!1,meta:!1,shift:!1}),t=[]}},50))})}function Js(e,n){let t=n-1;for(;t>=0&&/\s/.test(e[t]);)t--;for(;t>=0&&!/\s/.test(e[t]);)t--;return t+1}function Qs(e,n){let t=n;for(;t<e.length&&!/\s/.test(e[t]);)t++;for(;t<e.length&&/\s/.test(e[t]);)t++;return t}const Oe=function(n){if(this){if(M.call(this),this._promptStr=(n==null?void 0:n.prompt)??"> ",this.input=n==null?void 0:n.input,this.output=n==null?void 0:n.output,this.closed=!1,this._lineBuffer="",this._pendingQuestions=[],this.terminal=(n==null?void 0:n.terminal)??!1,this.line="",this.cursor=0,this._historySize=(n==null?void 0:n.historySize)??30,this._removeHistoryDuplicates=(n==null?void 0:n.removeHistoryDuplicates)??!1,this.history=Array.isArray(n==null?void 0:n.history)?n.history.slice(0,this._historySize):[],this._historyIndex=-1,this._savedLine="",this._killRing=[],n!=null&&n.signal){const t=n.signal;if(t.aborted)queueMicrotask(()=>this.close());else{const r=()=>this.close();t.addEventListener("abort",r,{once:!0})}}if(this.input&&typeof this.input.on=="function"){Yr++,Tt();const t=this.input,r=this;this.terminal?(typeof this.input.setRawMode=="function"&&this.input.setRawMode(!0),El(this.input),t.on("keypress",(s,i)=>{r.closed||r._onKeypress(s,i)})):t.on("data",s=>{if(r.closed)return;const i=typeof s=="string"?s:String(s);r._onData(i)}),t.on("end",()=>{r.closed||r.close()})}}};Object.setPrototypeOf(Oe.prototype,M.prototype),Oe.prototype._refreshLine=function(){this.output&&typeof this.output.write=="function"&&this.output.write(this.line)},Oe.prototype._addToHistory=function(n){if(!(this._historySize===0||!n)){if(this._removeHistoryDuplicates){const t=this.history.indexOf(n);t!==-1&&this.history.splice(t,1)}this.history.unshift(n),this.history.length>this._historySize&&(this.history.length=this._historySize),this._historyIndex=-1,this.emit("history",this.history)}},Oe.prototype._onKeypress=function(n,t){if(t){if(t.ctrl&&t.name==="c"){this.listenerCount("SIGINT")>0?this.emit("SIGINT"):this.close();return}if(t.ctrl&&t.name==="z"){this.listenerCount("SIGTSTP")>0&&this.emit("SIGTSTP");return}if(t.name==="return"){const r=this._lineBuffer;if(this._lineBuffer="",this.line=r,this._addToHistory(r),this._pendingQuestions.length>0){const s=this._pendingQuestions.shift();s.signal&&s.abortListener&&s.signal.removeEventListener("abort",s.abortListener),s.handler(r)}this.emit("line",r),this.line="",this.cursor=0;return}if(t.name==="backspace"){this.cursor>0&&(this._lineBuffer[this.cursor-1],this._lineBuffer=this._lineBuffer.slice(0,this.cursor-1)+this._lineBuffer.slice(this.cursor),this.cursor--,this.line=this._lineBuffer,this._refreshLine());return}if(t.name==="delete"){this.cursor<this._lineBuffer.length&&(this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+this._lineBuffer.slice(this.cursor+1),this.line=this._lineBuffer,this._refreshLine());return}if(t.ctrl&&t.name==="d"){this._lineBuffer.length===0?this.close():this.cursor<this._lineBuffer.length&&(this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+this._lineBuffer.slice(this.cursor+1),this.line=this._lineBuffer,this._refreshLine());return}if(t.name==="left"&&!t.ctrl&&!t.meta){this.cursor=Math.max(0,this.cursor-1),this._refreshLine();return}if(t.name==="right"&&!t.ctrl&&!t.meta){this.cursor=Math.min(this._lineBuffer.length,this.cursor+1),this._refreshLine();return}if(t.ctrl&&t.name==="left"||t.meta&&t.name==="b"){this.cursor=Js(this._lineBuffer,this.cursor),this._refreshLine();return}if(t.ctrl&&t.name==="right"||t.meta&&t.name==="f"){this.cursor=Qs(this._lineBuffer,this.cursor),this._refreshLine();return}if(t.name==="home"||t.ctrl&&t.name==="a"){this.cursor=0,this._refreshLine();return}if(t.name==="end"||t.ctrl&&t.name==="e"){this.cursor=this._lineBuffer.length,this._refreshLine();return}if(t.ctrl&&t.name==="b"){this.cursor=Math.max(0,this.cursor-1),this._refreshLine();return}if(t.ctrl&&t.name==="f"){this.cursor=Math.min(this._lineBuffer.length,this.cursor+1),this._refreshLine();return}if(t.name==="up"||t.ctrl&&t.name==="p"){this.history.length>0&&this._historyIndex<this.history.length-1&&(this._historyIndex===-1&&(this._savedLine=this._lineBuffer),this._historyIndex++,this._lineBuffer=this.history[this._historyIndex],this.cursor=this._lineBuffer.length,this.line=this._lineBuffer,this._refreshLine());return}if(t.name==="down"||t.ctrl&&t.name==="n"){this._historyIndex>0?(this._historyIndex--,this._lineBuffer=this.history[this._historyIndex],this.cursor=this._lineBuffer.length,this.line=this._lineBuffer,this._refreshLine()):this._historyIndex===0&&(this._historyIndex=-1,this._lineBuffer=this._savedLine,this.cursor=this._lineBuffer.length,this.line=this._lineBuffer,this._refreshLine());return}if(t.ctrl&&t.name==="u"){const r=this._lineBuffer.slice(0,this.cursor);r&&this._killRing.push(r),this._lineBuffer=this._lineBuffer.slice(this.cursor),this.cursor=0,this.line=this._lineBuffer,this._refreshLine();return}if(t.ctrl&&t.name==="k"){const r=this._lineBuffer.slice(this.cursor);r&&this._killRing.push(r),this._lineBuffer=this._lineBuffer.slice(0,this.cursor),this.line=this._lineBuffer,this._refreshLine();return}if(t.ctrl&&t.name==="h"){this.cursor>0&&(this._lineBuffer=this._lineBuffer.slice(0,this.cursor-1)+this._lineBuffer.slice(this.cursor),this.cursor--,this.line=this._lineBuffer,this._refreshLine());return}if(t.ctrl&&t.name==="w"){const r=Js(this._lineBuffer,this.cursor),s=this._lineBuffer.slice(r,this.cursor);s&&this._killRing.push(s),this._lineBuffer=this._lineBuffer.slice(0,r)+this._lineBuffer.slice(this.cursor),this.cursor=r,this.line=this._lineBuffer,this._refreshLine();return}if(t.meta&&t.name==="d"){const r=Qs(this._lineBuffer,this.cursor),s=this._lineBuffer.slice(this.cursor,r);s&&this._killRing.push(s),this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+this._lineBuffer.slice(r),this.line=this._lineBuffer,this._refreshLine();return}if(t.ctrl&&t.name==="y"){if(this._killRing.length>0){const r=this._killRing[this._killRing.length-1];this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+r+this._lineBuffer.slice(this.cursor),this.cursor+=r.length,this.line=this._lineBuffer,this._refreshLine()}return}if(t.ctrl&&t.name==="l"){this.output&&typeof this.output.write=="function"&&this.output.write("\x1B[2J\x1B[H"),this._refreshLine();return}if(n&&!t.ctrl&&!t.meta&&n.length===1&&n.charCodeAt(0)>=32){this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+n+this._lineBuffer.slice(this.cursor),this.cursor++,this.line=this._lineBuffer,this._refreshLine();return}}},Oe.prototype._onData=function(n){for(const t of n)if(t===`
95
+ `||t==="\r"){const r=this._lineBuffer;if(this._lineBuffer="",this.line=r,this._addToHistory(r),this._pendingQuestions.length>0){const s=this._pendingQuestions.shift();s.signal&&s.abortListener&&s.signal.removeEventListener("abort",s.abortListener),s.handler(r)}this.emit("line",r),this.line="",this.cursor=0}else t===""||t==="\b"?this._lineBuffer.length>0&&(this._lineBuffer=this._lineBuffer.slice(0,this.cursor-1)+this._lineBuffer.slice(this.cursor),this.cursor=Math.max(0,this.cursor-1),this.line=this._lineBuffer,this._refreshLine()):t.charCodeAt(0)>=32&&(this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+t+this._lineBuffer.slice(this.cursor),this.cursor++,this.line=this._lineBuffer,this._refreshLine())},Oe.prototype.prompt=function(n){this.output&&typeof this.output.write=="function"&&this.output.write(this._promptStr),n||(this.cursor=0,this.line="",this._lineBuffer="")},Oe.prototype.setPrompt=function(n){this._promptStr=n},Oe.prototype.getPrompt=function(){return this._promptStr},Oe.prototype.question=function(n,t,r){let s,i;if(typeof t=="function"?s=t:(t&&typeof t=="object"&&(i=t.signal),s=r),!!s){if(i!=null&&i.aborted)throw new DOMException("The operation was aborted","AbortError");if(this.output&&typeof this.output.write=="function"&&this.output.write(n),this.input&&typeof this.input.on=="function"){const a={query:n,handler:s,signal:i};if(i){const o=()=>{const l=this._pendingQuestions.indexOf(a);l!==-1&&this._pendingQuestions.splice(l,1),s("")};a.abortListener=o,i.addEventListener("abort",o,{once:!0})}this._pendingQuestions.push(a)}else setTimeout(()=>s(""),0)}},Oe.prototype.pause=function(){return this.input&&typeof this.input.pause=="function"&&this.input.pause(),this.emit("pause"),this},Oe.prototype.resume=function(){return this.input&&typeof this.input.resume=="function"&&this.input.resume(),this.emit("resume"),this},Oe.prototype.close=function(){if(!this.closed){this.closed=!0,this.terminal&&this.input&&typeof this.input.setRawMode=="function"&&this.input.setRawMode(!1),this.input&&typeof this.input.on=="function"&&(Yr=Math.max(0,Yr-1),Yn());for(const n of this._pendingQuestions)n.signal&&n.abortListener&&n.signal.removeEventListener("abort",n.abortListener),n.handler("");this._pendingQuestions.length=0,this.emit("close")}},typeof Symbol.dispose<"u"&&(Oe.prototype[Symbol.dispose]=function(){this.close()}),Oe.prototype.write=function(n,t){if(!this.closed){if(n==null){if(t){const r=this.input&&typeof this.input.emit=="function";if(t.ctrl&&t.name==="c"){this.listenerCount("SIGINT")>0?this.emit("SIGINT"):this.close();return}if(t.ctrl&&t.name==="h"){this.cursor>0&&(this._lineBuffer=this._lineBuffer.slice(0,this.cursor-1)+this._lineBuffer.slice(this.cursor),this.cursor--,this.line=this._lineBuffer),r&&this.input.emit("keypress","",{sequence:"",name:"backspace",ctrl:!1,meta:!1,shift:!1});return}if(t.ctrl&&t.name==="u"){const s=this._lineBuffer.slice(0,this.cursor);s&&this._killRing.push(s),this._lineBuffer=this._lineBuffer.slice(this.cursor),this.cursor=0,this.line=this._lineBuffer;return}if(t.ctrl&&t.name==="k"){const s=this._lineBuffer.slice(this.cursor);s&&this._killRing.push(s),this._lineBuffer=this._lineBuffer.slice(0,this.cursor),this.line=this._lineBuffer;return}if(t.ctrl&&t.name==="w"){const s=Js(this._lineBuffer,this.cursor),i=this._lineBuffer.slice(s,this.cursor);i&&this._killRing.push(i),this._lineBuffer=this._lineBuffer.slice(0,s)+this._lineBuffer.slice(this.cursor),this.cursor=s,this.line=this._lineBuffer;return}if(t.ctrl&&t.name==="y"){if(this._killRing.length>0){const s=this._killRing[this._killRing.length-1];this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+s+this._lineBuffer.slice(this.cursor),this.cursor+=s.length,this.line=this._lineBuffer}return}if(t.ctrl&&t.name==="a"){this.cursor=0;return}if(t.ctrl&&t.name==="e"){this.cursor=this._lineBuffer.length;return}if(t.ctrl&&t.name==="b"){this.cursor=Math.max(0,this.cursor-1);return}if(t.ctrl&&t.name==="f"){this.cursor=Math.min(this._lineBuffer.length,this.cursor+1);return}if(t.ctrl&&t.name==="d"){this._lineBuffer.length===0?this.close():this.cursor<this._lineBuffer.length&&(this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+this._lineBuffer.slice(this.cursor+1),this.line=this._lineBuffer);return}if(t.ctrl&&t.name==="l"){this.output&&typeof this.output.write=="function"&&this.output.write("\x1B[2J\x1B[H");return}if(t.name==="left"){t.ctrl||t.meta?this.cursor=Js(this._lineBuffer,this.cursor):this.cursor=Math.max(0,this.cursor-1);return}if(t.name==="right"){t.ctrl||t.meta?this.cursor=Qs(this._lineBuffer,this.cursor):this.cursor=Math.min(this._lineBuffer.length,this.cursor+1);return}if(t.name==="home"){this.cursor=0;return}if(t.name==="end"){this.cursor=this._lineBuffer.length;return}if(t.name==="up"){this.history.length>0&&this._historyIndex<this.history.length-1&&(this._historyIndex===-1&&(this._savedLine=this._lineBuffer),this._historyIndex++,this._lineBuffer=this.history[this._historyIndex],this.cursor=this._lineBuffer.length,this.line=this._lineBuffer);return}if(t.name==="down"){this._historyIndex>0?(this._historyIndex--,this._lineBuffer=this.history[this._historyIndex],this.cursor=this._lineBuffer.length,this.line=this._lineBuffer):this._historyIndex===0&&(this._historyIndex=-1,this._lineBuffer=this._savedLine,this.cursor=this._lineBuffer.length,this.line=this._lineBuffer);return}if(t.meta&&t.name==="b"){this.cursor=Js(this._lineBuffer,this.cursor);return}if(t.meta&&t.name==="f"){this.cursor=Qs(this._lineBuffer,this.cursor);return}if(t.meta&&t.name==="d"){const s=Qs(this._lineBuffer,this.cursor),i=this._lineBuffer.slice(this.cursor,s);i&&this._killRing.push(i),this._lineBuffer=this._lineBuffer.slice(0,this.cursor)+this._lineBuffer.slice(s),this.line=this._lineBuffer;return}}return}if(t!=null&&t.ctrl&&(t==null?void 0:t.name)==="c"){this.listenerCount("SIGINT")>0?this.emit("SIGINT"):this.close();return}this._onData(n)}},Oe.prototype.clearLine=function(n){this._lineBuffer="",this.line="",this.cursor=0,this.output&&typeof this.output.clearLine=="function"&&this.output.clearLine(n??0)},Oe.prototype.getCursorPos=function(){const n=typeof this._promptStr=="string"?this._promptStr.length:0,t=this.output&&this.output.columns||80,r=n+this.cursor;return{rows:Math.floor(r/t),cols:r%t}},Oe.prototype[Symbol.asyncIterator]=async function*(){const e=this;for(;!e.closed;){const n=await new Promise(t=>{if(e.closed){t(null);return}e.once("line",r=>t(r)),e.once("close",()=>t(null))});if(n===null)break;yield n}};function kl(e,n){return e&&typeof e=="object"&&!("on"in e)&&!("read"in e)?new Oe(e):new Oe({input:e,output:n})}function Em(e,n,t){return e&&typeof e.clearLine=="function"?e.clearLine(n,t):(t&&t(),!0)}function km(e,n){return e&&typeof e.write=="function"&&e.write("\x1B[J"),n&&n(),!0}function Cm(e,n,t,r){const s=typeof t=="function"?t:r;return e&&typeof e.cursorTo=="function"?e.cursorTo(n,typeof t=="number"?t:void 0,s):(s&&s(),!0)}function Am(e,n,t,r){return e&&typeof e.moveCursor=="function"?e.moveCursor(n,t,r):(r&&r(),!0)}class P0{constructor(n,t){T(this,"_stream"),T(this,"_buffer"),T(this,"_autoCommit"),this._stream=n,this._buffer=[],this._autoCommit=(t==null?void 0:t.autoCommit)??!1}clearLine(n){let t;return n===-1?t="\x1B[1K":n===1?t="\x1B[0K":t="\x1B[2K",this._autoCommit?this._stream.write(t):this._buffer.push(t),this}clearScreenDown(){return this._autoCommit?this._stream.write("\x1B[J"):this._buffer.push("\x1B[J"),this}cursorTo(n,t){let r;return t!==void 0?r=`\x1B[${t+1};${n+1}H`:r=`\x1B[${n+1}G`,this._autoCommit?this._stream.write(r):this._buffer.push(r),this}moveCursor(n,t){const r=[];n>0?r.push(`\x1B[${n}C`):n<0&&r.push(`\x1B[${-n}D`),t>0?r.push(`\x1B[${t}B`):t<0&&r.push(`\x1B[${-t}A`);const s=r.join("");return s&&(this._autoCommit?this._stream.write(s):this._buffer.push(s)),this}commit(){return this._buffer.length>0&&(this._stream.write(this._buffer.join("")),this._buffer.length=0),Promise.resolve()}rollback(){return this._buffer.length=0,this}}const Tm={createInterface(e){const n=kl(e),t=Object.create(n);return t.question=function(r,s){return new Promise((i,a)=>{var o;if((o=s==null?void 0:s.signal)!=null&&o.aborted){a(new DOMException("The operation was aborted","AbortError"));return}let l;const u=c=>{s!=null&&s.signal&&l&&s.signal.removeEventListener("abort",l),i(c)};s!=null&&s.signal&&(l=()=>{a(new DOMException("The operation was aborted","AbortError"))},s.signal.addEventListener("abort",l,{once:!0})),n.question(r,u)})},t},Readline:P0};Object.freeze(Object.defineProperty({__proto__:null,Interface:Oe,clearLine:Em,clearScreenDown:km,createInterface:kl,cursorTo:Cm,default:{Interface:Oe,createInterface:kl,clearLine:Em,clearScreenDown:km,cursorTo:Cm,moveCursor:Am,emitKeypressEvents:El,promises:Tm},emitKeypressEvents:El,getActiveInterfaceCount:T0,moveCursor:Am,promises:Tm,resetActiveInterfaceCount:ny,setActiveInterfaceCount:I0},Symbol.toStringTag,{value:"Module"}));const Et=function(n,t){this&&(M.call(this),this.authorized=!1,this.encrypted=!0)};Object.setPrototypeOf(Et.prototype,M.prototype),Et.prototype.getPeerCertificate=function(n){return{}},Et.prototype.getCipher=function(){return null},Et.prototype.getProtocol=function(){return null},Et.prototype.setServername=function(n){},Et.prototype.renegotiate=function(n,t){return!1};const ut=function(n,t){this&&M.call(this)};Object.setPrototypeOf(ut.prototype,M.prototype),ut.prototype.listen=function(...n){return this},ut.prototype.close=function(n){return this},ut.prototype.address=function(){return null},ut.prototype.getTicketKeys=function(){return new Uint8Array(0)},ut.prototype.setTicketKeys=function(n){},ut.prototype.setSecureContext=function(n){};function Im(e,n){return new ut}function Rm(e,n){const t=new Et;return n&&setTimeout(n,0),t}function Pm(e){return{}}const Dm=()=>["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"],Om="auto",Nm="TLSv1.3",Bm="TLSv1.2",Lm=[];Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_ECDH_CURVE:Om,DEFAULT_MAX_VERSION:Nm,DEFAULT_MIN_VERSION:Bm,Server:ut,TLSSocket:Et,connect:Rm,createSecureContext:Pm,createServer:Im,default:{TLSSocket:Et,Server:ut,createServer:Im,connect:Rm,createSecureContext:Pm,getCiphers:Dm,DEFAULT_ECDH_CURVE:Om,DEFAULT_MAX_VERSION:Nm,DEFAULT_MIN_VERSION:Bm,rootCertificates:Lm},getCiphers:Dm,rootCertificates:Lm},Symbol.toStringTag,{value:"Module"}));const tn=function(){this&&M.call(this)};Object.setPrototypeOf(tn.prototype,M.prototype),tn.prototype.close=function(n){n&&setTimeout(n,0)},tn.prototype.destroy=function(n,t){},Object.defineProperty(tn.prototype,"destroyed",{get(){return!1},configurable:!0}),Object.defineProperty(tn.prototype,"encrypted",{get(){return!1},configurable:!0}),Object.defineProperty(tn.prototype,"closed",{get(){return!1},configurable:!0}),tn.prototype.ping=function(n){return!1},tn.prototype.ref=function(){},tn.prototype.unref=function(){},tn.prototype.setTimeout=function(n,t){};const ia=function(){this&&tn.call(this)};Object.setPrototypeOf(ia.prototype,tn.prototype);const Cl=function(){this&&tn.call(this)};Object.setPrototypeOf(Cl.prototype,tn.prototype);const zn=function(){this&&M.call(this)};Object.setPrototypeOf(zn.prototype,M.prototype),zn.prototype.close=function(n,t){},Object.defineProperty(zn.prototype,"id",{get(){return 0},configurable:!0}),Object.defineProperty(zn.prototype,"pending",{get(){return!1},configurable:!0}),Object.defineProperty(zn.prototype,"destroyed",{get(){return!1},configurable:!0}),Object.defineProperty(zn.prototype,"closed",{get(){return!1},configurable:!0}),zn.prototype.priority=function(n){},zn.prototype.setTimeout=function(n,t){},zn.prototype.end=function(n,t,r){};const Al=function(){this&&M.call(this)};Object.setPrototypeOf(Al.prototype,M.prototype);const ei=function(){this&&M.call(this)};Object.setPrototypeOf(ei.prototype,M.prototype),ei.prototype.writeHead=function(n,t){return this},ei.prototype.end=function(n){};function Fm(e,n){return new M}function Mm(e,n){return new M}function $m(e,n,t){return new ia}const Um={NGHTTP2_SESSION_SERVER:0,NGHTTP2_SESSION_CLIENT:1,HTTP2_HEADER_STATUS:":status",HTTP2_HEADER_METHOD:":method",HTTP2_HEADER_AUTHORITY:":authority",HTTP2_HEADER_SCHEME:":scheme",HTTP2_HEADER_PATH:":path",HTTP_STATUS_OK:200,HTTP_STATUS_NOT_FOUND:404};function jm(){return{}}function Hm(e){return new Uint8Array(0)}function Wm(e){return{}}const Vm=Symbol("sensitiveHeaders");Object.freeze(Object.defineProperty({__proto__:null,ClientHttp2Session:ia,Http2ServerRequest:Al,Http2ServerResponse:ei,Http2Session:tn,Http2Stream:zn,ServerHttp2Session:Cl,connect:$m,constants:Um,createSecureServer:Mm,createServer:Fm,default:{Http2Session:tn,ClientHttp2Session:ia,ServerHttp2Session:Cl,Http2Stream:zn,Http2ServerRequest:Al,Http2ServerResponse:ei,createServer:Fm,createSecureServer:Mm,connect:$m,constants:Um,getDefaultSettings:jm,getPackedSettings:Hm,getUnpackedSettings:Wm,sensitiveHeaders:Vm},getDefaultSettings:jm,getPackedSettings:Hm,getUnpackedSettings:Wm,sensitiveHeaders:Vm},Symbol.toStringTag,{value:"Module"}));const qm=!0,zm=!0,Gm=!1,kt=function(){this&&(M.call(this),this.id=0,this.process=null)};Object.setPrototypeOf(kt.prototype,M.prototype),kt.prototype.send=function(n,t){return!1},kt.prototype.kill=function(n){},kt.prototype.disconnect=function(){},kt.prototype.isDead=function(){return!1},kt.prototype.isConnected=function(){return!1};const Km=null,Ym={},Zm={},Xm=1,Tl=2;let Jm=Tl;function Qm(e){return new kt}function eg(e){e&&setTimeout(e,0)}function ng(e){}function tg(e){}const $t=new M,rg=$t.on.bind($t),sg=$t.once.bind($t),ig=$t.emit.bind($t),ag=$t.removeListener.bind($t);Object.freeze(Object.defineProperty({__proto__:null,SCHED_NONE:Xm,SCHED_RR:Tl,Worker:kt,default:{isMaster:qm,isPrimary:zm,isWorker:Gm,Worker:kt,worker:Km,workers:Ym,fork:Qm,disconnect:eg,settings:Zm,SCHED_NONE:Xm,SCHED_RR:Tl,schedulingPolicy:Jm,setupMaster:ng,setupPrimary:tg,on:rg,once:sg,emit:ig,removeListener:ag},disconnect:eg,emit:ig,fork:Qm,isMaster:qm,isPrimary:zm,isWorker:Gm,on:rg,once:sg,removeListener:ag,schedulingPolicy:Jm,settings:Zm,setupMaster:ng,setupPrimary:tg,worker:Km,workers:Ym},Symbol.toStringTag,{value:"Module"}));const Ne=function(){this&&M.call(this)};Object.setPrototypeOf(Ne.prototype,M.prototype),Ne.prototype.bind=function(n,t,r){return r&&setTimeout(r,0),this},Ne.prototype.close=function(n){n&&setTimeout(n,0)},Ne.prototype.send=function(n,t,r,s,i,a){a&&setTimeout(()=>a(null,0),0)},Ne.prototype.address=function(){return{address:"0.0.0.0",family:"IPv4",port:0}},Ne.prototype.setBroadcast=function(n){},Ne.prototype.setTTL=function(n){return n},Ne.prototype.setMulticastTTL=function(n){return n},Ne.prototype.setMulticastLoopback=function(n){return n},Ne.prototype.setMulticastInterface=function(n){},Ne.prototype.addMembership=function(n,t){},Ne.prototype.dropMembership=function(n,t){},Ne.prototype.ref=function(){return this},Ne.prototype.unref=function(){return this},Ne.prototype.setRecvBufferSize=function(n){},Ne.prototype.setSendBufferSize=function(n){},Ne.prototype.getRecvBufferSize=function(){return 0},Ne.prototype.getSendBufferSize=function(){return 0};function og(e,n){return new Ne}Object.freeze(Object.defineProperty({__proto__:null,Socket:Ne,createSocket:og,default:{Socket:Ne,createSocket:og}},Symbol.toStringTag,{value:"Module"}));const ar=function(n,t){this&&(this._src=n)};ar.prototype.runInThisContext=function(n){return(0,eval)(this._src)},ar.prototype.runInNewContext=function(n,t){const r=n?Object.keys(n):[],s=n?Object.values(n):[];return new Function(...r,`return eval(${JSON.stringify(this._src)})`)(...s)},ar.prototype.runInContext=function(n,t){return this.runInNewContext(n,t)},ar.prototype.createCachedData=function(){return new Uint8Array(0)};function lg(e,n){return e??{}}function cg(e){return!0}function ug(e,n){return(0,eval)(e)}function Il(e,n,t){return new ar(e).runInNewContext(n)}function dg(e,n,t){return Il(e,n)}function pg(e,n,t){return new Function(...n??[],e)}const Hn=function(n,t){};Hn.prototype.link=function(n){return Promise.resolve()},Hn.prototype.evaluate=function(n){return Promise.resolve()},Object.defineProperty(Hn.prototype,"status",{get(){return"unlinked"},configurable:!0}),Object.defineProperty(Hn.prototype,"identifier",{get(){return""},configurable:!0}),Object.defineProperty(Hn.prototype,"context",{get(){return{}},configurable:!0}),Object.defineProperty(Hn.prototype,"namespace",{get(){return{}},configurable:!0});const Rl=function(n,t){this&&Hn.call(this,n,t)};Object.setPrototypeOf(Rl.prototype,Hn.prototype);const aa=function(n,t){this&&Hn.call(this,n,t)};Object.setPrototypeOf(aa.prototype,Hn.prototype),aa.prototype.setExport=function(n,t){},Object.freeze(Object.defineProperty({__proto__:null,Module:Hn,Script:ar,SourceTextModule:Rl,SyntheticModule:aa,compileFunction:pg,createContext:lg,default:{Script:ar,createContext:lg,isContext:cg,runInThisContext:ug,runInNewContext:Il,runInContext:dg,compileFunction:pg,Module:Hn,SourceTextModule:Rl,SyntheticModule:aa},isContext:cg,runInContext:dg,runInNewContext:Il,runInThisContext:ug},Symbol.toStringTag,{value:"Module"}));const or=function(){this&&M.call(this)};Object.setPrototypeOf(or.prototype,M.prototype),or.prototype.connect=function(){},or.prototype.connectToMainThread=function(){},or.prototype.disconnect=function(){},or.prototype.post=function(n,t,r){r&&setTimeout(()=>r(null,{}),0)};function hg(e,n,t){}function fg(){}function mg(){}function gg(){}const _g=globalThis.console;Object.freeze(Object.defineProperty({__proto__:null,Session:or,close:fg,console:_g,default:{Session:or,open:hg,close:fg,url:mg,waitForDebugger:gg,console:_g},open:hg,url:mg,waitForDebugger:gg},Symbol.toStringTag,{value:"Module"}));const lr=function(n,t){};lr.prototype.runInAsyncScope=function(n,t,...r){return n.apply(t,r)},lr.prototype.emitDestroy=function(){return this},lr.prototype.asyncId=function(){return 0},lr.prototype.triggerAsyncId=function(){return 0},lr.bind=function(n,t){return n};const cr=function(){this&&(this._store=void 0)};cr.prototype.disable=function(){},cr.prototype.getStore=function(){return this._store},cr.prototype.run=function(n,t,...r){const s=this._store;this._store=n;try{const i=t(...r);return i&&typeof i.then=="function"?(i.then(()=>{this._store=s},()=>{this._store=s}),i):(this._store=s,i)}catch(i){throw this._store=s,i}},cr.prototype.exit=function(n,...t){const r=this._store;this._store=void 0;try{const s=n(...t);return s&&typeof s.then=="function"?(s.then(()=>{this._store=r},()=>{this._store=r}),s):(this._store=r,s)}catch(s){throw this._store=r,s}},cr.prototype.enterWith=function(n){this._store=n};function yg(e){const n={enable(){return n},disable(){return n}};return n}function bg(){return 0}function vg(){return{}}function wg(){return 0}Object.freeze(Object.defineProperty({__proto__:null,AsyncLocalStorage:cr,AsyncResource:lr,createHook:yg,default:{AsyncResource:lr,AsyncLocalStorage:cr,createHook:yg,executionAsyncId:bg,executionAsyncResource:vg,triggerAsyncId:wg},executionAsyncId:bg,executionAsyncResource:vg,triggerAsyncId:wg},Symbol.toStringTag,{value:"Module"}));const Wn=function(){this&&(M.call(this),this.members=[])};Object.setPrototypeOf(Wn.prototype,M.prototype),Wn.prototype.add=function(n){this.members.push(n)},Wn.prototype.remove=function(n){const t=this.members.indexOf(n);t>=0&&this.members.splice(t,1)},Wn.prototype.bind=function(n){return n},Wn.prototype.intercept=function(n){return n},Wn.prototype.run=function(n){return n()},Wn.prototype.dispose=function(){this.members.length=0},Wn.prototype.enter=function(){},Wn.prototype.exit=function(){};function Sg(){return new Wn}let xg=null;Object.freeze(Object.defineProperty({__proto__:null,Domain:Wn,active:xg,create:Sg,default:{Domain:Wn,create:Sg,active:xg}},Symbol.toStringTag,{value:"Module"}));const Ut=function(n){this&&(this.name=n,this._listeners=[])};Object.defineProperty(Ut.prototype,"hasSubscribers",{get(){return this._listeners.length>0},configurable:!0}),Ut.prototype.subscribe=function(n){this._listeners.push(n)},Ut.prototype.unsubscribe=function(n){const t=this._listeners.indexOf(n);return t===-1?!1:(this._listeners.splice(t,1),!0)},Ut.prototype.publish=function(n){for(const t of this._listeners)try{t(n,this.name)}catch{}};const ni=new Map;function Pl(e){return ni.has(e)||ni.set(e,new Ut(e)),ni.get(e)}function Eg(e){var n;return((n=ni.get(e))==null?void 0:n.hasSubscribers)??!1}function kg(e,n){Pl(e).subscribe(n)}function Cg(e,n){var t;return((t=ni.get(e))==null?void 0:t.unsubscribe(n))??!1}Object.freeze(Object.defineProperty({__proto__:null,Channel:Ut,DiagChannel:Ut,channel:Pl,default:{channel:Pl,hasSubscribers:Eg,subscribe:kg,unsubscribe:Cg,Channel:Ut},hasSubscribers:Eg,subscribe:kg,unsubscribe:Cg},Symbol.toStringTag,{value:"Module"}));const le=globalThis.console;le.log.bind(le),le.error.bind(le),le.warn.bind(le),le.info.bind(le),le.debug.bind(le),le.trace.bind(le),le.dir.bind(le),le.time.bind(le),le.timeEnd.bind(le),le.timeLog.bind(le),le.clear.bind(le),le.count.bind(le),le.countReset.bind(le),le.group.bind(le),le.groupCollapsed.bind(le),le.groupEnd.bind(le),le.table.bind(le),le.assert.bind(le);const Ag=Symbol.for("repl-sloppy"),Tg=Symbol.for("repl-strict"),Dl=function e(n){this&&(SyntaxError.call(this,n.message),this.message=n.message,this.name="SyntaxError",this.err=n,Error.captureStackTrace&&Error.captureStackTrace(this,e))};Object.setPrototypeOf(Dl.prototype,SyntaxError.prototype);const dt=function(n){this&&(M.call(this),this.context=Object.create(null),this.terminal=!1,this._prompt="> ",this._commands=new Map,typeof n=="string"?this._prompt=n:n&&(typeof n.prompt=="string"&&(this._prompt=n.prompt),n.terminal!==void 0&&(this.terminal=!!n.terminal)))};Object.setPrototypeOf(dt.prototype,M.prototype),dt.prototype.setPrompt=function(n){this._prompt=n},dt.prototype.getPrompt=function(){return this._prompt},dt.prototype.displayPrompt=function(n){},dt.prototype.defineCommand=function(n,t){typeof t=="function"?this._commands.set(n,{help:"",action:t}):this._commands.set(n,{help:t.help||"",action:t.action})},dt.prototype.close=function(){this.emit("exit"),this.emit("close")},dt.prototype.setupHistory=function(n,t){t(null,this)};function Ig(e){return new dt(e)}Object.freeze(Object.defineProperty({__proto__:null,REPLServer:dt,REPL_MODE_SLOPPY:Ag,REPL_MODE_STRICT:Tg,Recoverable:Dl,default:{start:Ig,REPLServer:dt,Recoverable:Dl,REPL_MODE_SLOPPY:Ag,REPL_MODE_STRICT:Tg},start:Ig},Symbol.toStringTag,{value:"Module"}));const jt=function(n){this&&(this.name=n,this._controller=new AbortController,this.signal=this._controller.signal)};jt.prototype.diagnostic=function(n){globalThis.console.log(`# ${n}`)},jt.prototype.plan=function(n){},jt.prototype.todo=function(n){globalThis.console.log(`# TODO${n?": "+n:""}`)},jt.prototype.skip=function(n){globalThis.console.log(`# SKIP${n?": "+n:""}`)},jt.prototype.abort=function(){this._controller.abort()};function Rg(e,n){const t=typeof e=="string"?e:e.name,r=typeof e=="object"?e:{},s=n;if(r.skip){globalThis.console.log(`# SKIP - ${t}`);return}if(r.todo){globalThis.console.log(`# TODO - ${t}`);return}try{const i=s();i&&typeof i.then=="function"&&i.catch(a=>{globalThis.console.error(`Suite "${t}" failed:`,a)})}catch(i){globalThis.console.error(`Suite "${t}" failed:`,i)}}function oa(e,n){const t=typeof e=="string"?e:e.name,r=typeof e=="object"?e:{};if(r.skip||!n){globalThis.console.log(`# SKIP - ${t}`);return}if(r.todo){globalThis.console.log(`# TODO - ${t}`);return}const s=new jt(t);try{const i=n(s);i&&typeof i.then=="function"&&i.catch(a=>{globalThis.console.error(`Test "${t}" failed:`,a)})}catch(i){globalThis.console.error(`Test "${t}" failed:`,i)}}function Pg(e){try{e()}catch{}}function Dg(e){try{e()}catch{}}function Og(e){try{e()}catch{}}function Ng(e){try{e()}catch{}}function Bg(e,n){e&&globalThis.console.log(`# SKIP - ${e}`)}function Lg(e,n){e&&globalThis.console.log(`# TODO - ${e}`)}const Ol={fn(e){const n=[],t=(...r)=>(n.push(r),e?e(...r):void 0);return t.mock={calls:n,callCount:()=>n.length},t},method(e,n,t){const r=e[n],s=Ol.fn(t||r);return e[n]=s,s},reset(){},restoreAll(){}};Object.freeze(Object.defineProperty({__proto__:null,TestContext:jt,after:Dg,afterEach:Ng,before:Pg,beforeEach:Og,default:{describe:Rg,it:oa,test:oa,before:Pg,after:Dg,beforeEach:Og,afterEach:Ng,skip:Bg,todo:Lg,mock:Ol,TestContext:jt},describe:Rg,it:oa,mock:Ol,skip:Bg,test:oa,todo:Lg},Symbol.toStringTag,{value:"Module"}));const ti=function(n){this&&(this.categories=n.join(","),this.enabled=!1)};ti.prototype.enable=function(){},ti.prototype.disable=function(){};function Fg(e){return new ti(e.categories)}function Mg(){}Object.freeze(Object.defineProperty({__proto__:null,Tracing:ti,createTracing:Fg,default:{createTracing:Fg,getEnabledCategories:Mg,Tracing:ti},getEnabledCategories:Mg},Symbol.toStringTag,{value:"Module"}));const re=0,D0=2,be=8,$g=20,Nl=28,Ug=29,O0=31,Bl=44,Xe=52,N0=54,B0=55,L0=70,jg=0,Hg=1,Wg=2,Vg=3,Ll=0,la=3,ca=4,qg=7,Fl=1,F0=1,M0=2,$0=4,U0=8,j0=0,H0=1,W0=2,V0=0,Ml=0x0000000000000002n,$l=0x0000000000000040n,q0=0x0000000000000004n,z0=0x0000000000000020n,G0=0x0000000000004000n,K0=0x0000000000002000n,Y0=0x0000000000000200n,Z0=0x0000000000000400n,X0=0x0000000004000000n,J0=0x0000000002000000n,Q0=0x0000000000010000n,ew=0x0000000000020000n,nw=0x0000000000040000n,tw=0x0000000001000000n,rw=0x0000000000008000n,zg=0x0000000000200000n,sw=0x0000000000400000n,iw=0x1fffffffn,Gg=Ml|G0|K0|Y0|Z0|X0|J0|Q0|ew|nw|tw|rw|zg,aw=Ml|$l|q0|z0|zg|sw,ow=1,lw=2;class ua extends Error{constructor(n){super(`WASI exit(${n})`),T(this,"code"),this.code=n}}function ne(e){return function(...n){try{return e.apply(this,n)}catch(t){if(t instanceof ua)throw t;const r=t==null?void 0:t.code;return r==="ENOENT"?Bl:r==="EEXIST"?$g:r==="EISDIR"?O0:r==="ENOTDIR"?N0:r==="ENOTEMPTY"?B0:r==="EACCES"||r==="EPERM"?D0:Ug}}}function pt(e,n){if(n.startsWith("/"))return Kg(n);const t=e.endsWith("/")?e+n:e+"/"+n;return Kg(t)}function Kg(e){const n=e.split("/"),t=[];for(const r of n)if(!(r==="."||r==="")){if(r===".."){t.pop();continue}t.push(r)}return"/"+t.join("/")}const Ht=new TextEncoder,Yg=new TextDecoder,Zg=function e(n){if(!(this instanceof e))throw new TypeError("Class constructor WASI cannot be invoked without 'new'");const t=n??{},r=t.args??[],s=t.env??{},i=t.preopens??{},a=t.returnOnExit??!1,o=t.fs??null,l=new Map;let u=3;l.set(0,{kind:0,path:"",rights:Ml}),l.set(1,{kind:1,path:"",rights:$l}),l.set(2,{kind:2,path:"",rights:$l});const c=[];for(const[g,_]of Object.entries(i)){const w=u++;l.set(w,{kind:3,path:_,rights:Gg}),c.push({fd:w,virtualPath:g,realPath:_})}let p=null,h=null;const f=()=>{if(p||h&&(p=h.exports.memory,p))return p;throw new Error("WASI: WebAssembly.Memory not available")},m=()=>new DataView(f().buffer),v=()=>new Uint8Array(f().buffer);let k="",P="";const N=(g,_)=>{const w=_.lastIndexOf(`
96
+ `);if(w<0)return _;const E=_.substring(0,w);return g===1?console.log(E):console.error(E),_.substring(w+1)},O=(g,_)=>Yg.decode(new Uint8Array(f().buffer,g,_)),R=g=>{g.dirty&&o&&g.path&&g.data&&(o.writeFileSync(g.path,g.data),g.dirty=!1)},S={args_get:ne((g,_)=>{const w=m(),E=v();for(const b of r){w.setUint32(g,_,!0),g+=4;const L=Ht.encode(b+"\0");E.set(L,_),_+=L.length}return re}),args_sizes_get:ne((g,_)=>{const w=m();w.setUint32(g,r.length,!0);let E=0;for(const b of r)E+=Ht.encode(b+"\0").length;return w.setUint32(_,E,!0),re}),environ_get:ne((g,_)=>{const w=Object.entries(s),E=m(),b=v();for(const[L,W]of w){E.setUint32(g,_,!0),g+=4;const H=Ht.encode(`${L}=${W}\0`);b.set(H,_),_+=H.length}return re}),environ_sizes_get:ne((g,_)=>{const w=Object.entries(s),E=m();E.setUint32(g,w.length,!0);let b=0;for(const[L,W]of w)b+=Ht.encode(`${L}=${W}\0`).length;return E.setUint32(_,b,!0),re}),clock_res_get:ne((g,_)=>{const w=m();switch(g){case jg:w.setBigUint64(_,BigInt(1e6),!0);break;case Hg:case Wg:case Vg:w.setBigUint64(_,BigInt(1e3),!0);break;default:return Nl}return re}),clock_time_get:ne((g,_,w)=>{const E=m();switch(g){case jg:{const b=BigInt(Date.now())*BigInt(1e6);E.setBigUint64(w,b,!0);break}case Hg:case Wg:case Vg:{const b=performance.now(),L=Math.trunc(b),W=Math.floor((b-L)*1e3),H=BigInt(L)*BigInt(1e9)+BigInt(W)*BigInt(1e6);E.setBigUint64(w,H,!0);break}default:return Nl}return re}),fd_advise:ne((g,_,w,E)=>re),fd_allocate:ne((g,_,w)=>Xe),fd_close:ne(g=>{const _=l.get(g);return _?(_.kind===4&&R(_),l.delete(g),re):be}),fd_datasync:ne(g=>{const _=l.get(g);return _?(_.kind===4&&R(_),re):be}),fd_fdstat_get:ne((g,_)=>{const w=l.get(g);if(!w)return be;const E=m();let b=Ll,L=0,W=w.rights,H=0n;switch(w.kind){case 0:case 1:case 2:b=Ll;break;case 3:b=la,H=iw;break;case 4:b=ca,w.flags&&w.flags&Fl&&(L|=Fl);break}return E.setUint8(_,b),E.setUint16(_+2,L,!0),E.setBigUint64(_+8,W,!0),E.setBigUint64(_+16,H,!0),re}),fd_fdstat_set_flags:ne((g,_)=>Xe),fd_fdstat_set_rights:ne((g,_,w)=>Xe),fd_filestat_get:ne((g,_)=>{const w=l.get(g);if(!w)return be;const E=m();let b=0n,L=Ll,W=0n,H=0n,Z=0n,X=0n,fe=1n;if(w.kind===4){if(b=BigInt(w.data?w.data.length:0),L=ca,o&&w.path)try{const se=o.statSync(w.path);W=BigInt(Math.floor(se.mtimeMs))*BigInt(1e6),H=BigInt(Math.floor(se.atimeMs))*BigInt(1e6),Z=BigInt(Math.floor(se.ctimeMs))*BigInt(1e6),se.ino&&(X=BigInt(se.ino)),se.nlink&&(fe=BigInt(se.nlink))}catch{}}else w.kind===3&&(L=la);return E.setBigUint64(_,0n,!0),E.setBigUint64(_+8,X,!0),E.setUint8(_+16,L),E.setBigUint64(_+24,fe,!0),E.setBigUint64(_+32,b,!0),E.setBigUint64(_+40,H,!0),E.setBigUint64(_+48,W,!0),E.setBigUint64(_+56,Z,!0),re}),fd_filestat_set_size:ne((g,_)=>{const w=l.get(g);if(!w||w.kind!==4)return be;const E=Number(_);if(!w.data)w.data=new Uint8Array(E);else if(w.data.length!==E){const b=new Uint8Array(E);b.set(w.data.subarray(0,Math.min(w.data.length,E))),w.data=b}return w.dirty=!0,re}),fd_filestat_set_times:ne((g,_,w,E)=>re),fd_pread:ne((g,_,w,E,b)=>{const L=l.get(g);if(!L||L.kind!==4)return be;if(!L.data)return m().setUint32(b,0,!0),re;const W=m();let H=Number(E),Z=0;for(let X=0;X<w;X++){const fe=W.getUint32(_+X*8,!0),se=W.getUint32(_+X*8+4,!0),Be=Math.min(se,L.data.length-H);if(Be<=0)break;v().set(L.data.subarray(H,H+Be),fe),H+=Be,Z+=Be}return W.setUint32(b,Z,!0),re}),fd_prestat_get:ne((g,_)=>{const w=l.get(g);if(!w||w.kind!==3)return be;const E=c.find(W=>W.fd===g);if(!E)return be;const b=m(),L=Ht.encode(E.virtualPath).length;return b.setUint8(_,V0),b.setUint32(_+4,L,!0),re}),fd_prestat_dir_name:ne((g,_,w)=>{const E=l.get(g);if(!E||E.kind!==3)return be;const b=c.find(H=>H.fd===g);if(!b)return be;const L=Ht.encode(b.virtualPath),W=Math.min(L.length,w);return v().set(L.subarray(0,W),_),re}),fd_pwrite:ne((g,_,w,E,b)=>{const L=l.get(g);if(!L||L.kind!==4)return be;const W=m();let H=Number(E),Z=0;for(let X=0;X<w;X++){const fe=W.getUint32(_+X*8,!0),se=W.getUint32(_+X*8+4,!0),Be=new Uint8Array(f().buffer,fe,se),rn=H+se;if(!L.data||L.data.length<rn){const Ct=new Uint8Array(rn);L.data&&Ct.set(L.data),L.data=Ct}L.data.set(Be,H),H+=se,Z+=se}return L.dirty=!0,W.setUint32(b,Z,!0),re}),fd_read:ne((g,_,w,E)=>{const b=l.get(g);if(!b)return be;const L=m();if(b.kind===0)return L.setUint32(E,0,!0),re;if(b.kind!==4)return be;if(!b.data)return L.setUint32(E,0,!0),re;let W=0,H=b.offset??0;for(let Z=0;Z<w;Z++){const X=L.getUint32(_+Z*8,!0),fe=L.getUint32(_+Z*8+4,!0),se=Math.min(fe,b.data.length-H);if(se<=0)break;v().set(b.data.subarray(H,H+se),X),H+=se,W+=se}return b.offset=H,L.setUint32(E,W,!0),re}),fd_readdir:ne((g,_,w,E,b)=>{const L=l.get(g);if(!L||L.kind!==3&&L.kind!==4)return be;if(!o)return Xe;let W;try{W=o.readdirSync(L.path)}catch{return Ug}const H=m(),Z=v();let X=_;const fe=_+w,se=Number(E);for(let Be=se;Be<W.length;Be++){const rn=W[Be],Ct=Ht.encode(rn);if(24+Ct.length,X+24>fe)break;H.setBigUint64(X,BigInt(Be+1),!0),H.setBigUint64(X+8,BigInt(Be+1),!0),H.setUint32(X+16,Ct.length,!0);let ss=ca;try{const Cn=o.statSync(pt(L.path,rn));Cn.isDirectory()?ss=la:Cn.isSymbolicLink()&&(ss=qg)}catch{}H.setUint8(X+20,ss);const At=Math.min(Ct.length,fe-(X+24));At>0&&Z.set(Ct.subarray(0,At),X+24),X+=24+At}return H.setUint32(b,X-_,!0),re}),fd_renumber:ne((g,_)=>{const w=l.get(g);if(!w)return be;if(l.has(_)){const E=l.get(_);E.kind===4&&R(E)}return l.set(_,w),l.delete(g),re}),fd_seek:ne((g,_,w,E)=>{const b=l.get(g);if(!b)return be;if(b.kind===0||b.kind===1||b.kind===2)return L0;if(b.kind===3)return be;const L=b.data?b.data.length:0;let W=b.offset??0;const H=Number(_);switch(w){case j0:W=H;break;case H0:W+=H;break;case W0:W=L+H;break;default:return Nl}return W<0&&(W=0),b.offset=W,m().setBigUint64(E,BigInt(W),!0),re}),fd_sync:ne(g=>{const _=l.get(g);return _?(_.kind===4&&R(_),re):be}),fd_tell:ne((g,_)=>{const w=l.get(g);return!w||w.kind!==4?be:(m().setBigUint64(_,BigInt(w.offset??0),!0),re)}),fd_write:ne((g,_,w,E)=>{const b=l.get(g);if(!b)return be;const L=m();if(b.kind===1||b.kind===2){let Z=0;for(let X=0;X<w;X++){const fe=L.getUint32(_+X*8,!0),se=L.getUint32(_+X*8+4,!0),Be=new Uint8Array(f().buffer,fe,se),rn=Yg.decode(Be);b.kind===1?(k+=rn,k=N(1,k)):(P+=rn,P=N(2,P)),Z+=se}return L.setUint32(E,Z,!0),re}if(b.kind!==4)return be;let W=0,H=b.flags&&b.flags&Fl?b.data?b.data.length:0:b.offset??0;for(let Z=0;Z<w;Z++){const X=L.getUint32(_+Z*8,!0),fe=L.getUint32(_+Z*8+4,!0),se=new Uint8Array(f().buffer,X,fe),Be=H+fe;if(!b.data||b.data.length<Be){const rn=new Uint8Array(Be);b.data&&rn.set(b.data),b.data=rn}b.data.set(se,H),H+=fe,W+=fe}return b.offset=H,b.dirty=!0,L.setUint32(E,W,!0),re}),path_create_directory:ne((g,_,w)=>{if(!o)return Xe;const E=l.get(g);if(!E)return be;const b=O(_,w),L=pt(E.path,b);return o.mkdirSync(L,{recursive:!0}),re}),path_filestat_get:ne((g,_,w,E,b)=>{if(!o)return Xe;const L=l.get(g);if(!L)return be;const W=O(w,E),H=pt(L.path,W),Z=o.statSync(H),X=m();let fe=ca;Z.isDirectory()?fe=la:Z.isSymbolicLink()&&(fe=qg);const se=BigInt(Math.floor(Z.mtimeMs))*BigInt(1e6),Be=BigInt(Math.floor(Z.atimeMs))*BigInt(1e6),rn=BigInt(Math.floor(Z.ctimeMs))*BigInt(1e6);return X.setBigUint64(b,0n,!0),X.setBigUint64(b+8,BigInt(Z.ino??0),!0),X.setUint8(b+16,fe),X.setBigUint64(b+24,BigInt(Z.nlink??1),!0),X.setBigUint64(b+32,BigInt(Z.size),!0),X.setBigUint64(b+40,Be,!0),X.setBigUint64(b+48,se,!0),X.setBigUint64(b+56,rn,!0),re}),path_filestat_set_times:ne((g,_,w,E,b,L,W)=>re),path_link:ne((g,_,w,E,b,L,W)=>Xe),path_open:ne((g,_,w,E,b,L,W,H,Z)=>{if(!o)return Xe;const X=l.get(g);if(!X)return be;const fe=O(w,E),se=pt(X.path,fe),Be=(b&M0)!==0,rn=(b&F0)!==0,Ct=(b&$0)!==0,ss=(b&U0)!==0;let At=o.existsSync(se);if(Ct&&At)return $g;if(Be){if(!At)if(rn)o.mkdirSync(se,{recursive:!0});else return Bl;const Vt=u++;return l.set(Vt,{kind:3,path:se,rights:Gg}),m().setUint32(Z,Vt,!0),re}let Cn;if(At&&!ss){Cn=o.readFileSync(se);const Vt=new Uint8Array(Cn.length);Vt.set(Cn),Cn=Vt}else if(rn||ss)At||o.writeFileSync(se,new Uint8Array(0)),Cn=new Uint8Array(0);else{if(!At)return Bl;Cn=o.readFileSync(se);const Vt=new Uint8Array(Cn.length);Vt.set(Cn),Cn=Vt}const F_=u++;return l.set(F_,{kind:4,path:se,rights:aw,data:Cn,offset:0,dirty:!1,flags:H}),m().setUint32(Z,F_,!0),re}),path_readlink:ne((g,_,w,E,b,L)=>{if(!o||!o.readlinkSync)return Xe;const W=l.get(g);if(!W)return be;const H=O(_,w),Z=pt(W.path,H),X=o.readlinkSync(Z),fe=Ht.encode(X),se=Math.min(fe.length,b);return v().set(fe.subarray(0,se),E),m().setUint32(L,se,!0),re}),path_remove_directory:ne((g,_,w)=>{if(!o)return Xe;const E=l.get(g);if(!E)return be;const b=O(_,w),L=pt(E.path,b);return o.rmdirSync(L),re}),path_rename:ne((g,_,w,E,b,L)=>{if(!o)return Xe;const W=l.get(g),H=l.get(E);if(!W||!H)return be;const Z=O(_,w),X=O(b,L),fe=pt(W.path,Z),se=pt(H.path,X);return o.renameSync(fe,se),re}),path_symlink:ne((g,_,w,E,b)=>{if(!o||!o.symlinkSync)return Xe;const L=l.get(w);if(!L)return be;const W=O(g,_),H=O(E,b),Z=pt(L.path,H);return o.symlinkSync(W,Z),re}),path_unlink_file:ne((g,_,w)=>{if(!o)return Xe;const E=l.get(g);if(!E)return be;const b=O(_,w),L=pt(E.path,b);return o.unlinkSync(L),re}),poll_oneoff:ne((g,_,w,E)=>{const b=m();let L=0;for(let W=0;W<w;W++){const H=g+W*48,Z=_+L*32,X=b.getBigUint64(H,!0),fe=b.getUint8(H+8);b.setBigUint64(Z,X,!0),b.setUint16(Z+8,re,!0),b.setUint8(Z+10,fe),(fe===ow||fe===lw)&&(b.setBigUint64(Z+16,BigInt(1),!0),b.setUint16(Z+24,0,!0)),L++}return b.setUint32(E,L,!0),re}),proc_exit:ne(g=>{throw k&&(console.log(k),k=""),P&&(console.error(P),P=""),new ua(g)}),proc_raise:ne(g=>Xe),sched_yield:ne(()=>re),random_get:ne((g,_)=>{const w=new Uint8Array(f().buffer,g,_);return crypto.getRandomValues(w),re}),sock_recv:ne(()=>Xe),sock_send:ne(()=>Xe),sock_shutdown:ne(()=>Xe),sock_accept:ne(()=>Xe)},F=this;F.wasiImport=S,F.start=function(_){h=_,p=_.exports.memory;const w=_.exports._start;if(typeof w!="function")throw new Error("WASI: instance has no _start export");try{w()}catch(E){if(E instanceof ua){if(a)return E.code;throw E}throw E}finally{k&&(console.log(k),k=""),P&&(console.error(P),P="")}return 0},F.initialize=function(_){h=_,p=_.exports.memory;const w=_.exports._initialize;typeof w=="function"&&w()},F.getImportObject=function(){return{wasi_snapshot_preview1:S}}};Object.freeze(Object.defineProperty({__proto__:null,ExitStatus:ua,WASI:Zg,default:{WASI:Zg}},Symbol.toStringTag,{value:"Module"}));function Xg(){return!1}function Jg(e){throw new Error("Single Executable Applications (SEA) are not supported in the browser")}function Qg(e){throw new Error("Single Executable Applications (SEA) are not supported in the browser")}function e_(e){throw new Error("Single Executable Applications (SEA) are not supported in the browser")}Object.freeze(Object.defineProperty({__proto__:null,default:{isSea:Xg,getAsset:Jg,getAssetAsBlob:Qg,getRawAsset:e_},getAsset:Jg,getAssetAsBlob:Qg,getRawAsset:e_,isSea:Xg},Symbol.toStringTag,{value:"Module"}));const ur=function(){};ur.prototype.run=function(...n){throw new Error("node:sqlite is not supported in the browser environment")},ur.prototype.get=function(...n){throw new Error("node:sqlite is not supported in the browser environment")},ur.prototype.all=function(...n){throw new Error("node:sqlite is not supported in the browser environment")},ur.prototype.expandedSQL=function(){return""},ur.prototype.sourceSQL=function(){return""};const Zr=function(n,t){if(this)throw new Error("node:sqlite is not supported in the browser environment")};Zr.prototype.close=function(){},Zr.prototype.exec=function(n){},Zr.prototype.prepare=function(n){throw new Error("node:sqlite is not supported in the browser environment")},Zr.prototype.open=function(){},Object.freeze(Object.defineProperty({__proto__:null,DatabaseSync:Zr,StatementSync:ur,default:{DatabaseSync:Zr,StatementSync:ur}},Symbol.toStringTag,{value:"Module"}));const Xr=function(n){this&&M.call(this)};Object.setPrototypeOf(Xr.prototype,M.prototype),Xr.prototype.close=function(){this.emit("close")},Xr.prototype.destroy=function(n){this.emit("close")},Object.defineProperty(Xr.prototype,"address",{get:function(){return{address:"0.0.0.0",family:"IPv4",port:0}},configurable:!0});const Jr=function(){this&&M.call(this)};Object.setPrototypeOf(Jr.prototype,M.prototype),Jr.prototype.close=function(){this.emit("close")},Jr.prototype.destroy=function(n){this.emit("close")},Object.defineProperty(Jr.prototype,"destroyed",{get:function(){return!1},configurable:!0});const da=function(){this&&M.call(this)};Object.setPrototypeOf(da.prototype,M.prototype),Object.defineProperty(da.prototype,"id",{get:function(){return 0},configurable:!0}),Object.freeze(Object.defineProperty({__proto__:null,QuicEndpoint:Xr,QuicSession:Jr,QuicStream:da,default:{QuicEndpoint:Xr,QuicSession:Jr,QuicStream:da}},Symbol.toStringTag,{value:"Module"}));const $e=function(n){if(!this)return;const t=n.message??`${n_(n.actual)} ${n.operator??"=="} ${n_(n.expected)}`;Error.call(this,t),this.message=t,this.name="AssertionError",this.actual=n.actual,this.expected=n.expected,this.operator=n.operator??"",this.generatedMessage=!n.message,this.code="ERR_ASSERTION",Error.captureStackTrace&&n.stackStartFn&&Error.captureStackTrace(this,n.stackStartFn)};Object.setPrototypeOf($e.prototype,Error.prototype);function n_(e){try{return JSON.stringify(e)}catch{return String(e)}}function dr(e,n){if(Object.is(e,n))return!0;if(e===null||n===null||e===void 0||n===void 0)return e===n;if(typeof e!=typeof n)return!1;if(typeof e=="number"&&Number.isNaN(e)&&Number.isNaN(n))return!0;if(e instanceof Date&&n instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp&&n instanceof RegExp)return e.source===n.source&&e.flags===n.flags;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!dr(e[t],n[t]))return!1;return!0}if(e instanceof Uint8Array&&n instanceof Uint8Array){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[t,r]of e)if(!n.has(t)||!dr(r,n.get(t)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t)){let r=!1;for(const s of n)if(dr(t,s)){r=!0;break}if(!r)return!1}return!0}if(typeof e=="object"&&typeof n=="object"){const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;for(const s of t)if(!Object.prototype.hasOwnProperty.call(n,s)||!dr(e[s],n[s]))return!1;return!0}return!1}function Gn(e,n,t){if(e)throw t instanceof Error?t:(t!==void 0&&(n.message=t),new $e(n))}function Pe(e,n){Gn(!e,{actual:e,expected:!0,operator:"==",stackStartFn:Pe},n??"Value is falsy")}Pe.ok=function e(n,t){Gn(!n,{actual:n,expected:!0,operator:"==",stackStartFn:e},t??"Value is falsy")},Pe.equal=function e(n,t,r){Gn(n!=t,{actual:n,expected:t,operator:"==",stackStartFn:e},r)},Pe.notEqual=function e(n,t,r){Gn(n==t,{actual:n,expected:t,operator:"!=",stackStartFn:e},r)},Pe.strictEqual=function e(n,t,r){Gn(n!==t,{actual:n,expected:t,operator:"===",stackStartFn:e},r)},Pe.notStrictEqual=function e(n,t,r){Gn(n===t,{actual:n,expected:t,operator:"!==",stackStartFn:e},r)},Pe.deepEqual=function e(n,t,r){Gn(!dr(n,t),{actual:n,expected:t,operator:"deepEqual",stackStartFn:e},r)},Pe.deepStrictEqual=function e(n,t,r){Gn(!dr(n,t),{actual:n,expected:t,operator:"deepStrictEqual",stackStartFn:e},r)},Pe.notDeepStrictEqual=function e(n,t,r){Gn(dr(n,t),{actual:n,expected:t,operator:"notDeepStrictEqual",stackStartFn:e},r)},Pe.throws=function e(n,t,r){let s=!1,i;try{n()}catch(a){s=!0,i=a}if(!s)throw new $e({message:typeof t=="string"?t:r??"Expected function to throw",operator:"throws",stackStartFn:e});t!==void 0&&typeof t!="string"&&t_(i,t,r,e)},Pe.doesNotThrow=function e(n,t,r){try{n()}catch(s){if(t===void 0||typeof t=="string")throw new $e({message:typeof t=="string"?t:r??"Unexpected throw",actual:s,operator:"doesNotThrow",stackStartFn:e});if(t instanceof RegExp){const i=s instanceof Error?s.message:String(s);if(t.test(i))throw new $e({message:r??"Unexpected matching throw",actual:s,expected:t,operator:"doesNotThrow",stackStartFn:e})}else if(typeof t=="function"&&s instanceof t)throw new $e({message:r??"Unexpected throw of matching type",actual:s,expected:t,operator:"doesNotThrow",stackStartFn:e})}},Pe.rejects=async function e(n,t,r){const s=typeof n=="function"?n():n;let i=!1,a;try{await s}catch(o){i=!0,a=o}if(!i)throw new $e({message:typeof t=="string"?t:r??"Expected rejection",operator:"rejects",stackStartFn:e});t!==void 0&&typeof t!="string"&&t_(a,t,r,e)},Pe.doesNotReject=async function e(n,t,r){const s=typeof n=="function"?n():n;try{await s}catch(i){if(t===void 0||typeof t=="string")throw new $e({message:typeof t=="string"?t:r??"Unexpected rejection",actual:i,operator:"doesNotReject",stackStartFn:e});if(t instanceof RegExp){const a=i instanceof Error?i.message:String(i);if(t.test(a))throw new $e({message:r??"Unexpected matching rejection",actual:i,expected:t,operator:"doesNotReject",stackStartFn:e})}else if(typeof t=="function"&&i instanceof t)throw new $e({message:r??"Unexpected rejection of matching type",actual:i,expected:t,operator:"doesNotReject",stackStartFn:e})}},Pe.fail=function e(n,t,r,s){throw arguments.length<=1?new $e({message:typeof n=="string"?n:"Failed",stackStartFn:e}):new $e({message:r,actual:n,expected:t,operator:s??"fail",stackStartFn:e})},Pe.match=function e(n,t,r){Gn(!t.test(n),{actual:n,expected:t,operator:"match",stackStartFn:e},r)},Pe.doesNotMatch=function e(n,t,r){Gn(t.test(n),{actual:n,expected:t,operator:"doesNotMatch",stackStartFn:e},r)},Pe.ifError=function e(n){if(n!=null)throw n instanceof Error?n:new $e({message:`ifError received unwanted value: ${n}`,actual:n,expected:null,operator:"ifError",stackStartFn:e})},Pe.AssertionError=$e,Pe.strict=Pe;function t_(e,n,t,r){if(n instanceof RegExp){const s=e instanceof Error?e.message:String(e);if(!n.test(s))throw new $e({message:t??"Error message did not match",actual:e,expected:n,operator:"throws",stackStartFn:r})}else if(typeof n=="function"){if(!(e instanceof n))throw new $e({message:t??"Error type mismatch",actual:e,expected:n,operator:"throws",stackStartFn:r})}else if(typeof n=="object"){const s=n,i=e;if(s.message!==void 0){const a=i.message??String(e);if(s.message instanceof RegExp){if(!s.message.test(a))throw new $e({message:t??"Error message mismatch",actual:a,expected:s.message,operator:"throws",stackStartFn:r})}else if(a!==s.message)throw new $e({message:t??"Error message mismatch",actual:a,expected:s.message,operator:"throws",stackStartFn:r})}if(s.code!==void 0&&i.code!==s.code)throw new $e({message:t??"Error code mismatch",actual:i.code,expected:s.code,operator:"throws",stackStartFn:r})}}Object.freeze(Object.defineProperty({__proto__:null,AssertionError:$e,assert:Pe,default:Pe},Symbol.toStringTag,{value:"Module"}));const _n=36,ri=1,si=26,cw=38,uw=700,r_=72,s_=128,i_="-";function a_(e,n,t){let r=t?Math.floor(e/uw):e>>1;r+=Math.floor(r/n);let s=0;for(;r>(_n-ri)*si>>1;)r=Math.floor(r/(_n-ri)),s+=_n;return Math.floor(s+(_n-ri+1)*r/(r+cw))}function dw(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:_n}function o_(e,n){return e+22+75*(e<26?1:0)-0}function Ul(e){const n=[];let t=0,r=s_,s=r_,i=e.lastIndexOf(i_);i<0&&(i=0);for(let o=0;o<i;++o)n.push(e.charCodeAt(o));let a=i>0?i+1:0;for(;a<e.length;){const o=t;let l=1,u=_n;for(;;){if(a>=e.length)throw new RangeError("Invalid input");const p=dw(e.charCodeAt(a++));if(p>=_n)throw new RangeError("Invalid input");if(p>Math.floor((2147483647-t)/l))throw new RangeError("Overflow");t+=p*l;const h=u<=s?ri:u>=s+si?si:u-s;if(p<h)break;if(l>Math.floor(2147483647/(_n-h)))throw new RangeError("Overflow");l*=_n-h,u+=_n}const c=n.length+1;if(s=a_(t-o,c,o===0),Math.floor(t/c)>2147483647-r)throw new RangeError("Overflow");r+=Math.floor(t/c),t%=c,n.splice(t++,0,r)}return String.fromCodePoint(...n)}function jl(e){const n=[],t=Array.from(e).map(l=>l.codePointAt(0));let r=s_,s=0,i=r_;for(const l of t)l<128&&n.push(String.fromCharCode(l));let a=n.length;const o=a;for(o>0&&n.push(i_);a<t.length;){let l=2147483647;for(const u of t)u>=r&&u<l&&(l=u);if(l-r>Math.floor((2147483647-s)/(a+1)))throw new RangeError("Overflow");s+=(l-r)*(a+1),r=l;for(const u of t){if(u<r&&++s>2147483647)throw new RangeError("Overflow");if(u===r){let c=s,p=_n;for(;;){const h=p<=i?ri:p>=i+si?si:p-i;if(c<h)break;n.push(String.fromCharCode(o_(h+(c-h)%(_n-h)))),c=Math.floor((c-h)/(_n-h)),p+=_n}n.push(String.fromCharCode(o_(c))),i=a_(s,a+1,a===o),s=0,++a}}++s,++r}return n.join("")}function l_(e){return e.split(".").map(n=>n.startsWith("xn--")?Ul(n.slice(4)):n).join(".")}function c_(e){return e.split(".").map(n=>/[^\x00-\x7E]/.test(n)?"xn--"+jl(n):n).join(".")}const u_={decode:e=>Array.from(e).map(n=>n.codePointAt(0)),encode:e=>String.fromCodePoint(...e)},d_="2.3.1";Object.freeze(Object.defineProperty({__proto__:null,decode:Ul,default:{decode:Ul,encode:jl,toUnicode:l_,toASCII:c_,ucs2:u_,version:d_},encode:jl,toASCII:c_,toUnicode:l_,ucs2:u_,version:d_},Symbol.toStringTag,{value:"Module"})),new Proxy({},{get(e,n){},ownKeys(){return[]},getOwnPropertyDescriptor(e,n){},has(e,n){return!1}});function pw(){const e=Promise;class n extends e{constructor(r){let s,i=!1,a=!1,o;super((l,u)=>{r(c=>{if(c&&typeof c=="object"&&typeof c.then=="function"){let p=!1,h,f=!1,m;if(c.then(v=>{h=v,p=!0},v=>{m=v,f=!0}),p){s=h,i=!0,l(h);return}if(f){a=!0,o=m,u(m);return}l(c);return}s=c,i=!0,l(c)},c=>{a=!0,o=c,u(c)})}),T(this,"_syncValue"),T(this,"_syncResolved",!1),T(this,"_syncRejected",!1),T(this,"_syncError"),this._syncValue=s,this._syncResolved=i,this._syncRejected=a,this._syncError=o,a&&e.prototype.catch.call(this,()=>{})}then(r,s){if(this._syncResolved&&r)try{const i=r(this._syncValue);if(i&&typeof i=="object"&&typeof i.then=="function"){let a,o=!1,l=!1,u;return i.then(c=>{a=c,o=!0},c=>{u=c,l=!0}),o?new n(c=>c(a)):l?s?new n(c=>c(s(u))):new n((c,p)=>p(u)):e.resolve(i).then(null,s)}return new n(a=>a(i))}catch(i){return s?new n(a=>a(s(i))):new n((a,o)=>o(i))}if(this._syncRejected&&s)try{const i=s(this._syncError);return new n(a=>a(i))}catch(i){return new n((a,o)=>o(i))}return this._syncRejected&&!s?new n((i,a)=>a(this._syncError)):super.then(r,s)}}return Object.defineProperty(n,Symbol.hasInstance,{value:t=>t instanceof e,configurable:!0}),n.resolve=t=>t&&typeof t=="object"&&typeof t.then=="function"?new n(r=>r(t)):new n(r=>r(t)),n.reject=t=>new n((r,s)=>s(t)),n.all=t=>{const r=Array.from(t),s=new Array(r.length);let i=!0;for(let a=0;a<r.length;a++){const o=r[a];if(o instanceof n)if(o._syncResolved)s[a]=o._syncValue;else{if(o._syncRejected)return new n((l,u)=>u(o._syncError));i=!1;break}else if(o&&typeof o=="object"&&typeof o.then=="function"){let l=!1,u;if(o.then(c=>{u=c,l=!0}),l)s[a]=u;else{i=!1;break}}else s[a]=o}return i?new n(a=>a(s)):new n((a,o)=>{e.all(r).then(a,o)})},n.allSettled=t=>{const r=Array.from(t),s=new Array(r.length);let i=!0;for(let a=0;a<r.length;a++){const o=r[a];if(o instanceof n)if(o._syncResolved)s[a]={status:"fulfilled",value:o._syncValue};else if(o._syncRejected)s[a]={status:"rejected",reason:o._syncError};else{i=!1;break}else if(o&&typeof o=="object"&&typeof o.then=="function"){i=!1;break}else s[a]={status:"fulfilled",value:o}}return i?new n(a=>a(s)):new n((a,o)=>{e.allSettled(r).then(a,o)})},n.race=t=>{const r=Array.from(t);for(const s of r)if(s instanceof n){if(s._syncResolved)return new n(i=>i(s._syncValue));if(s._syncRejected)return new n((i,a)=>a(s._syncError))}else if(!(s&&typeof s=="object"&&typeof s.then=="function"))return new n(i=>i(s));return new n((s,i)=>{e.race(r).then(s,i)})},n.any=t=>{const r=Array.from(t);for(const a of r){if(a instanceof n&&a._syncResolved)return new n(o=>o(a._syncValue));if(!(a&&typeof a=="object"&&typeof a.then=="function"))return new n(o=>o(a))}let s=!0;const i=[];for(const a of r)if(a instanceof n&&a._syncRejected)i.push(a._syncError);else{s=!1;break}return s&&r.length>0?new n((a,o)=>o(new AggregateError(i,"All promises were rejected"))):new n((a,o)=>{e.any(r).then(a,o)})},n}pw();function Hl(e){const n={};for(const t of Object.keys(e))n[t]=e[t];return n}Hl(J_),Hl(Cy),Hl(by);const p_=Symbol("Comlink.proxy"),hw=Symbol("Comlink.endpoint"),fw=Symbol("Comlink.releaseProxy"),Wl=Symbol("Comlink.finalizer"),pa=Symbol("Comlink.thrown"),h_=e=>typeof e=="object"&&e!==null||typeof e=="function",mw={canHandle:e=>h_(e)&&e[p_],serialize(e){const{port1:n,port2:t}=new MessageChannel;return m_(e,n),[t,[t]]},deserialize(e){return e.start(),__(e)}},gw={canHandle:e=>h_(e)&&pa in e,serialize({value:e}){let n;return e instanceof Error?n={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:n={isError:!1,value:e},[n,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},f_=new Map([["proxy",mw],["throw",gw]]);function _w(e,n){for(const t of e)if(n===t||t==="*"||t instanceof RegExp&&t.test(n))return!0;return!1}function m_(e,n=globalThis,t=["*"]){n.addEventListener("message",function r(s){if(!s||!s.data)return;if(!_w(t,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}const{id:i,type:a,path:o}=Object.assign({path:[]},s.data),l=(s.data.argumentList||[]).map(pr);let u;try{const c=o.slice(0,-1).reduce((h,f)=>h[f],e),p=o.reduce((h,f)=>h[f],e);switch(a){case"GET":u=p;break;case"SET":c[o.slice(-1)[0]]=pr(s.data.value),u=!0;break;case"APPLY":u=p.apply(c,l);break;case"CONSTRUCT":{const h=new p(...l);u=xw(h)}break;case"ENDPOINT":{const{port1:h,port2:f}=new MessageChannel;m_(e,f),u=Sw(h,[h])}break;case"RELEASE":u=void 0;break;default:return}}catch(c){u={value:c,[pa]:0}}Promise.resolve(u).catch(c=>({value:c,[pa]:0})).then(c=>{const[p,h]=ga(c);n.postMessage(Object.assign(Object.assign({},p),{id:i}),h),a==="RELEASE"&&(n.removeEventListener("message",r),g_(n),Wl in e&&typeof e[Wl]=="function"&&e[Wl]())}).catch(c=>{const[p,h]=ga({value:new TypeError("Unserializable return value"),[pa]:0});n.postMessage(Object.assign(Object.assign({},p),{id:i}),h)})}),n.start&&n.start()}function yw(e){return e.constructor.name==="MessagePort"}function g_(e){yw(e)&&e.close()}function __(e,n){const t=new Map;return e.addEventListener("message",function(s){const{data:i}=s;if(!i||!i.id)return;const a=t.get(i.id);if(a)try{a(i)}finally{t.delete(i.id)}}),Vl(e,t,[],n)}function ha(e){if(e)throw new Error("Proxy has been released and is not useable")}function y_(e){return Qr(e,new Map,{type:"RELEASE"}).then(()=>{g_(e)})}const fa=new WeakMap,ma="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const n=(fa.get(e)||0)-1;fa.set(e,n),n===0&&y_(e)});function bw(e,n){const t=(fa.get(n)||0)+1;fa.set(n,t),ma&&ma.register(e,n,e)}function vw(e){ma&&ma.unregister(e)}function Vl(e,n,t=[],r=function(){}){let s=!1;const i=new Proxy(r,{get(a,o){if(ha(s),o===fw)return()=>{vw(i),y_(e),n.clear(),s=!0};if(o==="then"){if(t.length===0)return{then:()=>i};const l=Qr(e,n,{type:"GET",path:t.map(u=>u.toString())}).then(pr);return l.then.bind(l)}return Vl(e,n,[...t,o])},set(a,o,l){ha(s);const[u,c]=ga(l);return Qr(e,n,{type:"SET",path:[...t,o].map(p=>p.toString()),value:u},c).then(pr)},apply(a,o,l){ha(s);const u=t[t.length-1];if(u===hw)return Qr(e,n,{type:"ENDPOINT"}).then(pr);if(u==="bind")return Vl(e,n,t.slice(0,-1));const[c,p]=b_(l);return Qr(e,n,{type:"APPLY",path:t.map(h=>h.toString()),argumentList:c},p).then(pr)},construct(a,o){ha(s);const[l,u]=b_(o);return Qr(e,n,{type:"CONSTRUCT",path:t.map(c=>c.toString()),argumentList:l},u).then(pr)}});return bw(i,e),i}function ww(e){return Array.prototype.concat.apply([],e)}function b_(e){const n=e.map(ga);return[n.map(t=>t[0]),ww(n.map(t=>t[1]))]}const v_=new WeakMap;function Sw(e,n){return v_.set(e,n),e}function xw(e){return Object.assign(e,{[p_]:!0})}function ga(e){for(const[n,t]of f_)if(t.canHandle(e)){const[r,s]=t.serialize(e);return[{type:"HANDLER",name:n,value:r},s]}return[{type:"RAW",value:e},v_.get(e)||[]]}function pr(e){switch(e.type){case"HANDLER":return f_.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Qr(e,n,t,r){return new Promise(s=>{const i=Ew();n.set(i,s),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),r)})}function Ew(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}K_=class extends M{constructor(e,n){super(),T(this,"pid"),T(this,"worker"),T(this,"command"),T(this,"args"),T(this,"parentPid"),T(this,"_state","starting"),T(this,"_exitCode"),T(this,"_stdout",""),T(this,"_stderr",""),T(this,"_exitHoldCount",0),T(this,"_deferredExit",null),T(this,"_shellDoneHoldCount",0),T(this,"_deferredShellDone",null),T(this,"_syncBlockedCount",0),this.pid=n.snapshot?Math.floor(Math.random()*9e4)+1e4:0,this.worker=e,this.command=n.command,this.args=n.args,this.parentPid=n.parentPid,this._setupWorkerListeners()}get workerExited(){return this._deferredExit!==null||this._state==="exited"}get shellCommandDone(){return this._deferredShellDone!==null}get syncBlocked(){return this._syncBlockedCount>0}holdSync(){this._syncBlockedCount++}releaseSync(){this._syncBlockedCount=Math.max(0,this._syncBlockedCount-1)}get stdout(){return this._stdout}get stderr(){return this._stderr}get state(){return this._state}get exitCode(){return this._exitCode}_setPid(e){this.pid=e}postMessage(e,n){this.worker.postMessage(e,n??[])}init(e){const n=[];e.snapshot.data.byteLength>0&&n.push(e.snapshot.data),this.postMessage(e,n)}exec(e){this.postMessage(e)}sendStdin(e){this.emit("stdin-forward",e),!this.workerExited&&!this.syncBlocked&&this.postMessage({type:"stdin",data:e})}kill(e="SIGTERM"){this.postMessage({type:"signal",signal:e}),this.emit("signal",e),e==="SIGKILL"&&this._terminate(137)}resize(e,n){this.postMessage({type:"resize",cols:e,rows:n})}holdExit(){this._exitHoldCount++}releaseExit(){if(this._exitHoldCount=Math.max(0,this._exitHoldCount-1),this._exitHoldCount===0&&this._deferredExit){const{exitCode:e,stdout:n,stderr:t}=this._deferredExit;this._deferredExit=null,this._state="exited",this._exitCode=e,this.emit("exit",e,n,t)}}holdShellDone(){this._shellDoneHoldCount++}releaseShellDone(){if(this._shellDoneHoldCount=Math.max(0,this._shellDoneHoldCount-1),this._shellDoneHoldCount===0&&this._deferredShellDone){const{exitCode:e,stdout:n,stderr:t}=this._deferredShellDone;this._deferredShellDone=null,this.emit("shell-done",e,n,t)}}_terminate(e=1){if(this._state!=="exited"){this._state="exited",this._exitCode=e,this._deferredExit=null,this._exitHoldCount=0;try{this.worker.terminate()}catch{}this.emit("exit",e,this._stdout,this._stderr)}}_setupWorkerListeners(){this.worker.addEventListener("message",e=>{const n=e.data;if(!(!n||!n.type))switch(n.type){case"ready":this._state="running",this.emit("ready");break;case"stdout":this._stdout+=n.data,this.emit("stdout",n.data);break;case"stderr":this._stderr+=n.data,this.emit("stderr",n.data);break;case"exit":{const t=n.stdout||this._stdout,r=n.stderr||this._stderr;this._stdout=t,this._stderr=r,this._exitHoldCount>0?(this._deferredExit={exitCode:n.exitCode,stdout:t,stderr:r},this.emit("worker-done",n.exitCode)):(this._state="exited",this._exitCode=n.exitCode,this.emit("exit",n.exitCode,t,r));break}case"console":this.emit("console",n.method,n.args);break;case"vfs-write":this.emit("vfs-write",n.path,n.content,n.isDirectory);break;case"vfs-delete":this.emit("vfs-delete",n.path);break;case"vfs-read":this.emit("vfs-read",n.requestId,n.path);break;case"spawn-request":this.emit("spawn-request",n);break;case"fork-request":this.emit("fork-request",n);break;case"workerthread-request":this.emit("workerthread-request",n);break;case"ipc-message":this.emit("ipc-message",n);break;case"spawn-sync":this.emit("spawn-sync",n);break;case"server-listen":this.emit("server-listen",n.port,n.hostname);break;case"server-close":this.emit("server-close",n.port);break;case"http-request":this.emit("http-request",n);break;case"http-response":this.emit("http-response",n);break;case"shell-done":{const t=n;this._shellDoneHoldCount>0?this._deferredShellDone={exitCode:t.exitCode,stdout:t.stdout,stderr:t.stderr}:this.emit("shell-done",t.exitCode,t.stdout,t.stderr);break}case"cwd-change":this.emit("cwd-change",n.cwd);break;case"stdin-raw-status":this.emit("stdin-raw-status",n.isRaw);break;case"ws-frame":this.emit("ws-frame",n);break;case"error":this.emit("worker-error",n.message,n.stack);break}}),this.worker.addEventListener("error",e=>{this.emit("worker-error",e.message,void 0),this._state!=="exited"&&this._terminate(1)})}};const kw=`"use strict";
101
97
  (() => {
102
98
  var __create = Object.create;
103
99
  var __defProp = Object.defineProperty;
@@ -46311,14 +46307,14 @@ comlink/dist/esm/comlink.mjs:
46311
46307
  * SPDX-License-Identifier: Apache-2.0
46312
46308
  *)
46313
46309
  */
46314
- `;Zo=function(){try{return typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"}catch{return!1}};const er=264,da=0,Lo=4,Mo=8,Iu=12,zr=16,Tv=248,Fo=1,Iv=2,tr=16,Ru=16384,uA=Ru*er,qr=tr+uA,dA=64*1024*1024;L0=class{constructor(e=dA){if(W(this,"_buffer"),W(this,"_view"),W(this,"_int32"),W(this,"_uint8"),W(this,"_pathEncoder",new TextEncoder),W(this,"_pathDecoder",new TextDecoder),!Zo())throw new Error("SharedArrayBuffer not available. Ensure COOP/COEP headers are set.");this._buffer=new SharedArrayBuffer(e),this._view=new DataView(this._buffer),this._int32=new Int32Array(this._buffer),this._uint8=new Uint8Array(this._buffer),Atomics.store(this._int32,0,0),Atomics.store(this._int32,1,0),this._view.setUint32(8,0),Atomics.store(this._int32,3,0)}get buffer(){return this._buffer}writeFile(e,t){this._lock();try{const n=Atomics.load(this._int32,1),s=this._view.getUint32(8),r=this._findEntry(e);if(r!==-1)return this._updateEntry(r,t,s);if(n>=Ru||qr+s+t.byteLength>this._buffer.byteLength)return!1;const o=s;this._uint8.set(t,qr+o);const c=tr+n*er;this._view.setUint32(c+da,Fo),this._view.setUint32(c+Lo,o),this._view.setUint32(c+Mo,t.byteLength),this._view.setUint32(c+Iu,Date.now()/1e3|0);const d=this._pathEncoder.encode(e),p=Math.min(d.byteLength,Tv-1);return this._uint8.set(d.subarray(0,p),c+zr),this._uint8[c+zr+p]=0,Atomics.store(this._int32,1,n+1),this._view.setUint32(8,s+t.byteLength),Atomics.add(this._int32,0,1),Atomics.notify(this._int32,0),!0}finally{this._unlock()}}writeDirectory(e){this._lock();try{const t=Atomics.load(this._int32,1);if(t>=Ru)return!1;if(this._findEntry(e)!==-1)return!0;const n=tr+t*er;this._view.setUint32(n+da,Fo|Iv),this._view.setUint32(n+Lo,0),this._view.setUint32(n+Mo,0),this._view.setUint32(n+Iu,Date.now()/1e3|0);const s=this._pathEncoder.encode(e),r=Math.min(s.byteLength,Tv-1);return this._uint8.set(s.subarray(0,r),n+zr),this._uint8[n+zr+r]=0,Atomics.store(this._int32,1,t+1),Atomics.add(this._int32,0,1),Atomics.notify(this._int32,0),!0}finally{this._unlock()}}deleteFile(e){this._lock();try{const t=this._findEntry(e);if(t===-1)return!1;const n=tr+t*er;return this._view.setUint32(n+da,0),Atomics.add(this._int32,0,1),Atomics.notify(this._int32,0),!0}finally{this._unlock()}}readFile(e){const t=this._findEntry(e);if(t===-1)return null;const n=tr+t*er,s=this._view.getUint32(n+da);if(!(s&Fo)||s&Iv)return null;const r=this._view.getUint32(n+Lo),o=this._view.getUint32(n+Mo);return new Uint8Array(this._uint8.slice(qr+r,qr+r+o))}exists(e){return this._findEntry(e)!==-1}get version(){return Atomics.load(this._int32,0)}_findEntry(e){const t=Atomics.load(this._int32,1),n=this._pathEncoder.encode(e);for(let s=0;s<t;s++){const r=tr+s*er;if(!(this._view.getUint32(r+da)&Fo))continue;let c=!0;for(let d=0;d<n.byteLength;d++)if(this._uint8[r+zr+d]!==n[d]){c=!1;break}if(c&&this._uint8[r+zr+n.byteLength]===0)return s}return-1}_updateEntry(e,t,n){if(qr+n+t.byteLength>this._buffer.byteLength)return!1;const s=tr+e*er,r=n;return this._uint8.set(t,qr+r),this._view.setUint32(s+Lo,r),this._view.setUint32(s+Mo,t.byteLength),this._view.setUint32(s+Iu,Date.now()/1e3|0),this._view.setUint32(8,n+t.byteLength),Atomics.add(this._int32,0,1),Atomics.notify(this._int32,0),!0}_lock(){for(;Atomics.compareExchange(this._int32,3,0,1)!==0;)Atomics.wait(this._int32,3,1,1)}_unlock(){Atomics.store(this._int32,3,0),Atomics.notify(this._int32,3)}};const zn=4096,Pu=64,hA=0,pA=1,fA=2,mA=Pu*zn*4+4,gA=Pu*zn;M0=class{constructor(e=mA){if(W(this,"_buffer"),W(this,"_int32"),W(this,"_uint8"),!Zo())throw new Error("SharedArrayBuffer not available. Ensure COOP/COEP headers are set.");this._buffer=new SharedArrayBuffer(e),this._int32=new Int32Array(this._buffer),this._uint8=new Uint8Array(this._buffer);for(let t=0;t<Pu;t++)Atomics.store(this._int32,t*zn,hA);Atomics.store(this._int32,gA,0)}get buffer(){return this._buffer}writeResult(e,t,n){const s=e*zn;Atomics.store(this._int32,s+1,t);const o=new TextEncoder().encode(n),c=(zn-3)*4,d=Math.min(o.byteLength,c);Atomics.store(this._int32,s+2,d);const p=(s+3)*4;this._uint8.set(o.subarray(0,d),p),Atomics.store(this._int32,s,pA),Atomics.notify(this._int32,s)}writeError(e,t,n){const s=e*zn;Atomics.store(this._int32,s+1,t);const o=new TextEncoder().encode(n),c=(zn-3)*4,d=Math.min(o.byteLength,c);Atomics.store(this._int32,s+2,d);const p=(s+3)*4;this._uint8.set(o.subarray(0,d),p),Atomics.store(this._int32,s,fA),Atomics.notify(this._int32,s)}};const Du=10,Rv=50;ya=(a=class extends ne{constructor(e){super(),W(this,"_processes",new Map),W(this,"_nextPid",100),W(this,"_volume"),W(this,"_vfsBridge",null),W(this,"_sharedBuffer",null),W(this,"_syncBuffer",null),W(this,"_serverPorts",new Map),W(this,"_childPids",new Map),W(this,"_httpCallbacks",new Map),W(this,"_nextHttpRequestId",1),this._volume=e}setVFSBridge(e){this._vfsBridge=e}setSharedBuffer(e){this._sharedBuffer=e}setSyncBuffer(e){this._syncBuffer=e}spawn(e){if(this._processes.size>=Rv)throw new Error(`Process limit exceeded (max ${Rv})`);if(e.parentPid!==void 0){let d=0,p=e.parentPid;for(;p!==void 0&&d<Du;){const y=this._processes.get(p);p=y==null?void 0:y.parentPid,d++}if(d>=Du)throw new Error(`Process tree depth limit exceeded (max ${Du})`)}const t=this._nextPid++,n=this._vfsBridge?this._vfsBridge.createSnapshot():this._createEmptySnapshot(),s={command:e.command,args:e.args??[],cwd:e.cwd??"/",env:e.env??{},snapshot:n,sharedBuffer:this._sharedBuffer??void 0,syncBuffer:this._syncBuffer??void 0,parentPid:e.parentPid},r=this._createWorker(),o=new F0(r,s);o._setPid(t),this._processes.set(t,o),this._wireHandleEvents(o);const c={type:"init",pid:t,cwd:s.cwd,env:s.env,snapshot:s.snapshot,sharedBuffer:s.sharedBuffer,syncBuffer:s.syncBuffer};return o.init(c),this.emit("spawn",t,e.command,e.args),o}getProcess(e){return this._processes.get(e)}listProcesses(){const e=[];for(const[t,n]of this._processes)e.push({pid:t,command:n.command,args:n.args,state:n.state,exitCode:n.exitCode,parentPid:n.parentPid});return e}kill(e,t="SIGTERM"){const n=this._processes.get(e);return n?(n.kill(t),this._killDescendants(e,t),this._cleanupServerPorts(e),!0):!1}_cleanupServerPorts(e){for(const[n,s]of this._serverPorts)s===e&&(this._serverPorts.delete(n),this.emit("server-close",e,n));const t=this._childPids.get(e);if(t)for(const n of t)this._cleanupServerPorts(n)}_killDescendants(e,t){const n=this._childPids.get(e);if(n)for(const s of n){const r=this._processes.get(s);r&&r.state!=="exited"&&(r.kill(t),r.removeAllListeners("stdout"),r.removeAllListeners("stderr")),this._killDescendants(s,t)}}teardown(){for(const[e,t]of this._processes)try{t.kill("SIGKILL")}catch{}this._processes.clear()}get processCount(){return this._processes.size}registerServerPort(e,t){this._serverPorts.set(e,t)}unregisterServerPort(e){this._serverPorts.delete(e)}getServerPorts(){return[...this._serverPorts.keys()]}dispatchHttpRequest(e,t,n,s,r){const o=this._serverPorts.get(e);if(o===void 0)return Promise.resolve({statusCode:503,statusMessage:"Service Unavailable",headers:{"Content-Type":"text/plain"},body:`No server on port ${e}`});const c=this._processes.get(o);if(!c||c.state==="exited")return this._serverPorts.delete(e),Promise.resolve({statusCode:503,statusMessage:"Service Unavailable",headers:{"Content-Type":"text/plain"},body:`Server process exited (pid ${o})`});const d=this._nextHttpRequestId++;return new Promise(p=>{this._httpCallbacks.set(d,y=>{this._httpCallbacks.delete(d),p({statusCode:y.statusCode,statusMessage:y.statusMessage,headers:y.headers,body:y.body})}),c.postMessage({type:"http-request",requestId:d,port:e,method:t,path:n,headers:s,body:r??null})})}dispatchWsUpgrade(e,t,n,s){const r=this._serverPorts.get(e);if(r===void 0)return-1;const o=this._processes.get(r);return!o||o.state==="exited"?(this._serverPorts.delete(e),-1):(o.postMessage({type:"ws-upgrade",uid:t,port:e,path:n,headers:s}),r)}dispatchWsData(e,t,n){const s=this._processes.get(e);!s||s.state==="exited"||s.postMessage({type:"ws-data",uid:t,frame:n})}dispatchWsClose(e,t,n){const s=this._processes.get(e);!s||s.state==="exited"||s.postMessage({type:"ws-close",uid:t,code:n})}_createWorker(){if(!ya._workerBlobUrl){const e=new Blob([cA],{type:"application/javascript"});ya._workerBlobUrl=URL.createObjectURL(e)}return new Worker(ya._workerBlobUrl)}_wireHandleEvents(e){e.on("signal",t=>{this._killDescendants(e.pid,t)}),e.on("stdin-forward",t=>{const n=this._childPids.get(e.pid);if(n)for(const s of n){const r=this._processes.get(s);r&&r.state!=="exited"&&r.sendStdin(t)}}),e.on("exit",t=>{for(const[n,s]of this._serverPorts)s===e.pid&&(this._serverPorts.delete(n),this.emit("server-close",e.pid,n));for(const[n,s]of this._httpCallbacks)s({type:"http-response",requestId:n,statusCode:503,statusMessage:"Worker Exited",headers:{},body:"Worker process exited before completing the request"});this.emit("exit",e.pid,t),setTimeout(()=>{this._processes.delete(e.pid)},100)}),e.on("vfs-write",(t,n,s)=>{this._vfsBridge&&(s?this._vfsBridge.handleWorkerMkdir(t):this._vfsBridge.handleWorkerWrite(t,new Uint8Array(n)),this._vfsBridge.broadcastChange(t,n,e.pid))}),e.on("vfs-delete",t=>{this._vfsBridge&&(this._vfsBridge.handleWorkerDelete(t),this._vfsBridge.broadcastChange(t,null,e.pid))}),e.on("vfs-read",(t,n)=>{try{if(this._volume.existsSync(n))if(this._volume.statSync(n).isDirectory())e.postMessage({type:"vfs-sync",path:n,content:null,isDirectory:!0});else{const r=this._volume.readFileSync(n),o=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);e.postMessage({type:"vfs-sync",path:n,content:o,isDirectory:!1},[o])}else e.postMessage({type:"vfs-sync",path:n,content:null,isDirectory:!1})}catch{try{e.postMessage({type:"vfs-sync",path:n,content:null,isDirectory:!1})}catch{}}}),e.on("spawn-request",t=>{const n=t.args.length?`${t.command} ${t.args.join(" ")}`:t.command;try{const s=this.spawn({command:t.command,args:t.args,cwd:t.cwd,env:t.env,parentPid:e.pid});this._childPids.has(e.pid)||this._childPids.set(e.pid,new Set),this._childPids.get(e.pid).add(s.pid),e.holdExit(),e.holdShellDone(),e.postMessage({type:"spawn-result",requestId:t.requestId,pid:s.pid});const r=/(?:^|\/)node$/.test(t.command),o=()=>{r&&t.args.length>0?s.exec({type:"exec",filePath:t.args[0],args:t.args.slice(1),cwd:t.cwd,env:t.env,isShell:!1}):s.exec({type:"exec",filePath:"",args:t.args,cwd:t.cwd,env:t.env,isShell:!0,shellCommand:n})};s.state==="running"?o():s.on("ready",o),s.on("stdout",c=>{e.workerExited||e.shellCommandDone?e.emit("stdout",c):e.postMessage({type:"child-output",requestId:t.requestId,stream:"stdout",data:c})}),s.on("stderr",c=>{e.workerExited||e.shellCommandDone?e.emit("stderr",c):e.postMessage({type:"child-output",requestId:t.requestId,stream:"stderr",data:c})}),s.on("stdin-raw-status",c=>{e.emit("stdin-raw-status",c)}),s.on("exit",c=>{e.workerExited||e.postMessage({type:"child-exit",requestId:t.requestId,exitCode:c,stdout:s.stdout,stderr:s.stderr});const d=this._childPids.get(e.pid);d&&(d.delete(s.pid),d.size===0&&this._childPids.delete(e.pid)),e.releaseExit(),e.releaseShellDone()})}catch(s){e.postMessage({type:"spawn-result",requestId:t.requestId,pid:-1,error:s instanceof Error?s.message:String(s)})}}),e.on("fork-request",t=>{try{const n=this.spawn({command:"node",args:[t.modulePath,...t.args],cwd:t.cwd,env:t.env,parentPid:e.pid});this._childPids.has(e.pid)||this._childPids.set(e.pid,new Set),this._childPids.get(e.pid).add(n.pid),e.holdExit(),e.holdShellDone(),e.postMessage({type:"spawn-result",requestId:t.requestId,pid:n.pid});const s=()=>{n.exec({type:"exec",filePath:t.modulePath,args:t.args,cwd:t.cwd,env:t.env,isShell:!1,isFork:!0})};n.state==="running"?s():n.on("ready",s),n.on("stdout",r=>{e.workerExited||e.shellCommandDone?e.emit("stdout",r):e.postMessage({type:"child-output",requestId:t.requestId,stream:"stdout",data:r})}),n.on("stderr",r=>{e.workerExited||e.shellCommandDone?e.emit("stderr",r):e.postMessage({type:"child-output",requestId:t.requestId,stream:"stderr",data:r})}),n.on("ipc-message",r=>{const o=(r==null?void 0:r.data)??r;e.workerExited||e.postMessage({type:"ipc-message",targetRequestId:t.requestId,data:o})}),e.on("ipc-message",r=>{r.targetRequestId===t.requestId&&n.postMessage({type:"ipc-message",data:r.data})}),n.on("exit",r=>{e.workerExited||e.postMessage({type:"child-exit",requestId:t.requestId,exitCode:r,stdout:n.stdout,stderr:n.stderr});const o=this._childPids.get(e.pid);o&&(o.delete(n.pid),o.size===0&&this._childPids.delete(e.pid)),e.releaseExit(),e.releaseShellDone()})}catch(n){e.postMessage({type:"spawn-result",requestId:t.requestId,pid:-1,error:n instanceof Error?n.message:String(n)})}}),e.on("workerthread-request",t=>{try{let n=t.modulePath;if(t.isEval){const o=`/__wt_eval_${t.threadId}__.js`;if(this._volume.writeFileSync(o,t.modulePath),n=o,this._vfsBridge){const d=new TextEncoder().encode(t.modulePath).buffer;this._vfsBridge.handleWorkerWrite(o,new Uint8Array(d)),this._vfsBridge.broadcastChange(o,d,e.pid)}}const s=this.spawn({command:"node",args:[n],cwd:t.cwd,env:t.env,parentPid:e.pid});this._childPids.has(e.pid)||this._childPids.set(e.pid,new Set),this._childPids.get(e.pid).add(s.pid),e.holdExit(),e.holdShellDone(),e.postMessage({type:"spawn-result",requestId:t.requestId,pid:s.pid});const r=()=>{s.exec({type:"exec",filePath:n,args:t.args||[],cwd:t.cwd,env:t.env,isShell:!1,isFork:!0,isWorkerThread:!0,workerData:t.workerData,threadId:t.threadId})};s.state==="running"?r():s.on("ready",r),s.on("stdout",o=>{e.workerExited||e.shellCommandDone?e.emit("stdout",o):e.postMessage({type:"child-output",requestId:t.requestId,stream:"stdout",data:o})}),s.on("stderr",o=>{e.workerExited||e.shellCommandDone?e.emit("stderr",o):e.postMessage({type:"child-output",requestId:t.requestId,stream:"stderr",data:o})}),s.on("ipc-message",o=>{const c=(o==null?void 0:o.data)??o;e.workerExited||e.postMessage({type:"ipc-message",targetRequestId:t.requestId,data:c})}),e.on("ipc-message",o=>{o.targetRequestId===t.requestId&&s.postMessage({type:"ipc-message",data:o.data})}),s.on("exit",o=>{if(t.isEval)try{this._volume.unlinkSync(`/__wt_eval_${t.threadId}__.js`)}catch{}e.workerExited||e.postMessage({type:"child-exit",requestId:t.requestId,exitCode:o,stdout:s.stdout,stderr:s.stderr});const c=this._childPids.get(e.pid);c&&(c.delete(s.pid),c.size===0&&this._childPids.delete(e.pid)),e.releaseExit(),e.releaseShellDone()})}catch(n){e.postMessage({type:"spawn-result",requestId:t.requestId,pid:-1,error:n instanceof Error?n.message:String(n)})}}),e.on("spawn-sync",t=>{if(!this._syncBuffer)return;const n=t.shellCommand??(t.args.length?`${t.command} ${t.args.join(" ")}`:t.command),s=(zn-3)*4,r=o=>{try{const c=new Int32Array(this._syncBuffer),d=t.syncSlot*zn;Atomics.store(c,d+1,o),Atomics.store(c,d+2,0),Atomics.store(c,d,2),Atomics.notify(c,d)}catch{}};try{const o=this.spawn({command:t.command,args:t.args,cwd:t.cwd,env:t.env,parentPid:e.pid});this._childPids.has(e.pid)||this._childPids.set(e.pid,new Set),this._childPids.get(e.pid).add(o.pid),e.holdExit(),e.holdShellDone(),e.holdSync();const c=()=>{o.exec({type:"exec",filePath:"",args:t.args,cwd:t.cwd,env:t.env,isShell:!0,shellCommand:n})};o.state==="running"?c():o.on("ready",c),o.on("stdout",d=>{e.emit("stdout",d)}),o.on("stderr",d=>{e.emit("stderr",d)}),o.on("stdin-raw-status",d=>{e.emit("stdin-raw-status",d)}),o.on("exit",d=>{try{const y=new Int32Array(this._syncBuffer),g=new TextEncoder,x=t.syncSlot*zn,k=g.encode(o.stdout),C=Math.min(k.byteLength,s);Atomics.store(y,x+1,d),Atomics.store(y,x+2,C);const T=new Uint8Array(this._syncBuffer),L=(x+3)*4;T.set(k.subarray(0,C),L),Atomics.store(y,x,1),Atomics.notify(y,x)}catch{r(1)}const p=this._childPids.get(e.pid);p&&(p.delete(o.pid),p.size===0&&this._childPids.delete(e.pid)),e.releaseSync(),e.releaseExit(),e.releaseShellDone()}),o.on("worker-error",()=>{r(1);const d=this._childPids.get(e.pid);d&&(d.delete(o.pid),d.size===0&&this._childPids.delete(e.pid)),e.releaseSync(),e.releaseExit(),e.releaseShellDone()})}catch{r(1)}}),e.on("server-listen",(t,n)=>{this.registerServerPort(t,e.pid),this.emit("server-listen",e.pid,t,n)}),e.on("server-close",t=>{this.unregisterServerPort(t),this.emit("server-close",e.pid,t)}),e.on("http-response",t=>{const n=this._httpCallbacks.get(t.requestId);n&&n(t)}),e.on("ws-frame",t=>{this.emit("ws-frame",t)}),e.on("cwd-change",t=>{this.emit("cwd-change",e.pid,t)}),e.on("stdin-raw-status",t=>{this.emit("stdin-raw-status",e.pid,t)}),e.on("worker-error",(t,n)=>{this.emit("error",e.pid,t,n)})}_createEmptySnapshot(){return{manifest:[],data:new ArrayBuffer(0)}}broadcastVFSChange(e,t,n,s){for(const[r,o]of this._processes)if(!(r===s||o.state==="exited"))try{const c=t?t.slice(0):null;o.postMessage({type:"vfs-sync",path:e,content:c,isDirectory:n},c?[c]:[])}catch{}}},W(a,"_workerBlobUrl",null),a);const Ou=4*1024*1024;$0=class{constructor(e){W(this,"_volume"),W(this,"_broadcaster",null),W(this,"_sharedVFS",null),W(this,"_suppressWatch",!1),this._volume=e}setBroadcaster(e){this._broadcaster=e}setSharedVFS(e){this._sharedVFS=e}createSnapshot(){const e=[],t=[];let n=0;this._walkVolume("/",(c,d,p)=>{d?e.push({path:c,offset:0,length:0,isDirectory:!0}):p&&(e.push({path:c,offset:n,length:p.byteLength,isDirectory:!1}),t.push(p),n+=p.byteLength)});const s=new ArrayBuffer(n),r=new Uint8Array(s);let o=0;for(const c of t)r.set(c,o),o+=c.byteLength;return{manifest:e,data:s}}createChunkedSnapshots(){const e=this.createSnapshot(),t=e.data.byteLength;if(t<=Ou)return[{chunkIndex:0,totalChunks:1,data:e.data,manifest:e.manifest}];const n=[],s=new Uint8Array(e.data),r=Math.ceil(t/Ou);let o=0;for(let c=0;c<r;c++){const d=Math.min(o+Ou,t),p=s.slice(o,d),y=e.manifest.filter(g=>g.isDirectory?c===0:g.offset>=o&&g.offset<d).map(g=>({...g,offset:g.isDirectory?0:g.offset-o}));n.push({chunkIndex:c,totalChunks:r,data:p.buffer.slice(p.byteOffset,p.byteOffset+p.byteLength),manifest:y}),o=d}return n}handleWorkerWrite(e,t){this._suppressWatch=!0;try{const n=e.substring(0,e.lastIndexOf("/"))||"/";n!=="/"&&!this._volume.existsSync(n)&&this._volume.mkdirSync(n,{recursive:!0}),this._volume.writeFileSync(e,t),this._sharedVFS&&this._sharedVFS.writeFile(e,t)}finally{this._suppressWatch=!1}}handleWorkerMkdir(e){this._suppressWatch=!0;try{this._volume.existsSync(e)||this._volume.mkdirSync(e,{recursive:!0}),this._sharedVFS&&this._sharedVFS.writeDirectory(e)}finally{this._suppressWatch=!1}}handleWorkerDelete(e){this._suppressWatch=!0;try{try{this._volume.existsSync(e)&&(this._volume.statSync(e).isDirectory()?this._volume.rmdirSync(e):this._volume.unlinkSync(e))}catch(t){console.warn(`[VFSBridge] Failed to delete "${e}":`,t)}this._sharedVFS&&this._sharedVFS.deleteFile(e)}finally{this._suppressWatch=!1}}broadcastChange(e,t,n){this._broadcaster&&this._broadcaster(e,t,n)}watch(){const e=this._volume.watch("/",{recursive:!0},(t,n)=>{if(!(!n||this._suppressWatch))try{if(this._volume.existsSync(n))if(this._volume.statSync(n).isDirectory())this.broadcastChange(n,new ArrayBuffer(0),-1),this._sharedVFS&&this._sharedVFS.writeDirectory(n);else{const r=this._volume.readFileSync(n),o=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);this.broadcastChange(n,o,-1),this._sharedVFS&&this._sharedVFS.writeFile(n,r)}else this.broadcastChange(n,null,-1),this._sharedVFS&&this._sharedVFS.deleteFile(n)}catch(s){console.warn(`[VFSBridge] Watch error for "${n}":`,s)}});return()=>e.close()}_walkVolume(e,t){try{const n=this._volume.readdirSync(e);for(const s of n){const r=e==="/"?`/${s}`:`${e}/${s}`;try{if(this._volume.statSync(r).isDirectory())t(r,!0,null),this._walkVolume(r,t);else{const c=this._volume.readFileSync(r);t(r,!1,c)}}catch(o){console.warn(`[VFSBridge] Failed to stat/read "${r}":`,o)}}}catch(n){console.warn(`[VFSBridge] Failed to read directory "${e}":`,n)}}};const yA=E;function _A(e){return e.replace(/\//g,"%2f")}class Gr{constructor(t={}){W(this,"baseUrl"),W(this,"metadataStore"),this.baseUrl=(t.endpoint||yA).replace(/\/+$/,""),this.metadataStore=t.metadataCache||new Map}async fetchManifest(t){const n=this.metadataStore.get(t);if(n)return n;const s=`${this.baseUrl}/${_A(t)}`,r=await fetch(s,{headers:{Accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8"}});if(r.status===404)throw new Error(`Package "${t}" does not exist in the registry`);if(!r.ok)throw new Error(`Registry request for "${t}" failed with HTTP ${r.status}`);const o=await r.json();return this.metadataStore.set(t,o),o}async fetchVersion(t,n){const s=await this.fetchManifest(t),o=s["dist-tags"][n]||n,c=s.versions[o];if(!c)throw new Error(`Version "${n}" does not exist for package "${t}"`);return c}async getLatestVersion(t){return(await this.fetchManifest(t))["dist-tags"].latest}async listVersions(t){const n=await this.fetchManifest(t);return Object.keys(n.versions)}async getTarballUrl(t,n){return(await this.fetchVersion(t,n)).dist.tarball}async downloadArchive(t){const n=await fetch(t);if(!n.ok)throw new Error(`Tarball download failed (HTTP ${n.status}): ${t}`);return n.arrayBuffer()}flushCache(){this.metadataStore.clear()}}Object.freeze(Object.defineProperty({__proto__:null,RegistryClient:Gr,default:Gr},Symbol.toStringTag,{value:"Module"}));const bA=/^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/;function ha(e){const t=e.match(bA);return t?{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),prerelease:t[4]}:null}function Jt(e,t){const n=ha(e),s=ha(t);if(!n||!s)return e.localeCompare(t);const r=n.major-s.major;if(r!==0)return r;const o=n.minor-s.minor;if(o!==0)return o;const c=n.patch-s.patch;return c!==0?c:n.prerelease&&!s.prerelease?-1:!n.prerelease&&s.prerelease?1:n.prerelease&&s.prerelease?n.prerelease.localeCompare(s.prerelease):0}function $o(e,t){const n=ha(e);if(!n||n.prerelease&&!t.includes("-"))return!1;if(t=t.trim(),t==="*"||t==="latest"||t==="")return!0;if(t.includes("||"))return t.split("||").some(r=>$o(e,r.trim()));if(t.includes(" - ")){const[r,o]=t.split(" - ").map(c=>c.trim());return Jt(e,r)>=0&&Jt(e,o)<=0}const s=t.match(/(>=|<=|>|<|=)\s*(\d+(?:\.\d+)?(?:\.\d+)?(?:-[^\s]*)?)/g);if(s&&s.length>1)return s.every(r=>{const o=r.match(/^(>=|<=|>|<|=)\s*(\d+(?:\.\d+)?(?:\.\d+)?(?:-[^\s]*)?)$/);if(!o)return!0;const c=o[1];let d=o[2];const p=(d.match(/\./g)||[]).length;return p===0?d+=".0.0":p===1&&(d+=".0"),vA(e,c,d)});if(t.startsWith("^")){const r=nr(t.slice(1)),o=ha(r);return!o||n.major!==o.major||o.major===0&&(o.minor!==0&&n.minor!==o.minor||o.minor===0&&n.minor!==0)?!1:Jt(e,r)>=0}if(t.startsWith("~")){const r=nr(t.slice(1)),o=ha(r);return o?n.major===o.major&&n.minor===o.minor&&Jt(e,r)>=0:!1}if(t.startsWith(">="))return Jt(e,nr(t.slice(2).trim()))>=0;if(t.startsWith(">"))return Jt(e,nr(t.slice(1).trim()))>0;if(t.startsWith("<="))return Jt(e,nr(t.slice(2).trim()))<=0;if(t.startsWith("<"))return Jt(e,nr(t.slice(1).trim()))<0;if(t.startsWith("="))return Jt(e,nr(t.slice(1).trim()))===0;if(t.includes("x")||t.includes("X")||/^\d+$/.test(t)||/^\d+\.\d+$/.test(t)){const r=t.replace(/[xX]/g,"").split(".").filter(Boolean);if(r.length===1)return n.major===Number(r[0]);if(r.length===2)return n.major===Number(r[0])&&n.minor===Number(r[1])}if(t.includes(" "))return t.split(/\s+/).filter(Boolean).every(r=>$o(e,r));if(/^\d+\.\d+\.\d+/.test(t)){const r=t.match(/^(\d+\.\d+\.\d+(?:-[^\s]+)?)/);if(r)return Jt(e,r[1])===0}return Jt(e,t)===0}function nr(e){const t=e.replace(/[xX*]/g,"0").split(".");for(;t.length<3;)t.push("0");return t.join(".")}function vA(e,t,n){const s=Jt(e,n);switch(t){case">=":return s>=0;case"<=":return s<=0;case">":return s>0;case"<":return s<0;default:return s===0}}function wA(e,t){const n=[...e].sort((s,r)=>Jt(r,s));for(const s of n)if($o(s,t))return s;return null}function SA(e){if(!e.startsWith("npm:"))return null;const t=e.slice(4);let n;return t.startsWith("@")?n=t.indexOf("@",1):n=t.indexOf("@"),n===-1?{realName:t,realRange:"latest"}:{realName:t.slice(0,n),realRange:t.slice(n+1)}}async function xA(e,t="latest",n={}){const r={registry:n.registry||new Gr,completed:new Map,inFlight:new Set,config:n};return await Nu(e,t,r),r.completed}async function EA(e,t={}){const s={registry:t.registry||new Gr,completed:new Map,inFlight:new Set,config:t},r={...e.dependencies};t.devDependencies&&e.devDependencies&&Object.assign(r,e.devDependencies);for(const[o,c]of Object.entries(r))await Nu(o,c,s);return s.completed}async function Nu(e,t,n){var s,r;const{registry:o,completed:c,inFlight:d,config:p}=n,y=SA(t),g=e,x=(y==null?void 0:y.realName)??e;t=(y==null?void 0:y.realRange)??t;const k=`${g}@${t}`;if(!d.has(k)){if(c.has(g)){const C=c.get(g);return $o(C.version,t),void 0}d.add(k);try{(s=p.onProgress)==null||s.call(p,`Resolving ${x}@${t}`);const C=await o.fetchManifest(x),T=Object.keys(C.versions);let L;if(t==="latest"||t==="*")L=C["dist-tags"].latest;else if(C["dist-tags"][t])L=C["dist-tags"][t];else{const G=wA(T,t);if(!G)throw new Error(`Could not find a version of "${x}" matching "${t}"`);L=G}const V=C.versions[L];c.set(g,{name:g,version:L,tarballUrl:V.dist.tarball,dependencies:V.dependencies||{},shasum:V.dist.shasum});const K={};if(V.peerDependencies){const G=V.peerDependenciesMeta||{};for(const[$,te]of Object.entries(V.peerDependencies))(r=G[$])!=null&&r.optional||(K[$]=te)}if(V.dependencies&&Object.assign(K,V.dependencies),V.optionalDependencies)if(p.optionalDependencies)Object.assign(K,V.optionalDependencies);else for(const[G,$]of Object.entries(V.optionalDependencies))G.includes("wasm32-wasi")&&(K[G]=$);const J=Object.entries(K),X=8;for(let G=0;G<J.length;G+=X){const $=J.slice(G,G+X);await Promise.all($.map(([te,I])=>Nu(te,I,n)))}}finally{d.delete(k)}}}const kA=`
46310
+ `;Ea=function(){try{return typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"}catch{return!1}};const hr=264,ii=0,_a=4,ya=8,ql=12,es=16,w_=248,ba=1,S_=2,fr=16,zl=16384,Cw=zl*hr,ns=fr+Cw,Aw=64*1024*1024;z_=class{constructor(e=Aw){if(T(this,"_buffer"),T(this,"_view"),T(this,"_int32"),T(this,"_uint8"),T(this,"_pathEncoder",new TextEncoder),T(this,"_pathDecoder",new TextDecoder),!Ea())throw new Error("SharedArrayBuffer not available. Ensure COOP/COEP headers are set.");this._buffer=new SharedArrayBuffer(e),this._view=new DataView(this._buffer),this._int32=new Int32Array(this._buffer),this._uint8=new Uint8Array(this._buffer),Atomics.store(this._int32,0,0),Atomics.store(this._int32,1,0),this._view.setUint32(8,0),Atomics.store(this._int32,3,0)}get buffer(){return this._buffer}writeFile(e,n){this._lock();try{const t=Atomics.load(this._int32,1),r=this._view.getUint32(8),s=this._findEntry(e);if(s!==-1)return this._updateEntry(s,n,r);if(t>=zl||ns+r+n.byteLength>this._buffer.byteLength)return!1;const i=r;this._uint8.set(n,ns+i);const a=fr+t*hr;this._view.setUint32(a+ii,ba),this._view.setUint32(a+_a,i),this._view.setUint32(a+ya,n.byteLength),this._view.setUint32(a+ql,Date.now()/1e3|0);const o=this._pathEncoder.encode(e),l=Math.min(o.byteLength,w_-1);return this._uint8.set(o.subarray(0,l),a+es),this._uint8[a+es+l]=0,Atomics.store(this._int32,1,t+1),this._view.setUint32(8,r+n.byteLength),Atomics.add(this._int32,0,1),Atomics.notify(this._int32,0),!0}finally{this._unlock()}}writeDirectory(e){this._lock();try{const n=Atomics.load(this._int32,1);if(n>=zl)return!1;if(this._findEntry(e)!==-1)return!0;const t=fr+n*hr;this._view.setUint32(t+ii,ba|S_),this._view.setUint32(t+_a,0),this._view.setUint32(t+ya,0),this._view.setUint32(t+ql,Date.now()/1e3|0);const r=this._pathEncoder.encode(e),s=Math.min(r.byteLength,w_-1);return this._uint8.set(r.subarray(0,s),t+es),this._uint8[t+es+s]=0,Atomics.store(this._int32,1,n+1),Atomics.add(this._int32,0,1),Atomics.notify(this._int32,0),!0}finally{this._unlock()}}deleteFile(e){this._lock();try{const n=this._findEntry(e);if(n===-1)return!1;const t=fr+n*hr;return this._view.setUint32(t+ii,0),Atomics.add(this._int32,0,1),Atomics.notify(this._int32,0),!0}finally{this._unlock()}}readFile(e){const n=this._findEntry(e);if(n===-1)return null;const t=fr+n*hr,r=this._view.getUint32(t+ii);if(!(r&ba)||r&S_)return null;const s=this._view.getUint32(t+_a),i=this._view.getUint32(t+ya);return new Uint8Array(this._uint8.slice(ns+s,ns+s+i))}exists(e){return this._findEntry(e)!==-1}get version(){return Atomics.load(this._int32,0)}_findEntry(e){const n=Atomics.load(this._int32,1),t=this._pathEncoder.encode(e);for(let r=0;r<n;r++){const s=fr+r*hr;if(!(this._view.getUint32(s+ii)&ba))continue;let a=!0;for(let o=0;o<t.byteLength;o++)if(this._uint8[s+es+o]!==t[o]){a=!1;break}if(a&&this._uint8[s+es+t.byteLength]===0)return r}return-1}_updateEntry(e,n,t){if(ns+t+n.byteLength>this._buffer.byteLength)return!1;const r=fr+e*hr,s=t;return this._uint8.set(n,ns+s),this._view.setUint32(r+_a,s),this._view.setUint32(r+ya,n.byteLength),this._view.setUint32(r+ql,Date.now()/1e3|0),this._view.setUint32(8,t+n.byteLength),Atomics.add(this._int32,0,1),Atomics.notify(this._int32,0),!0}_lock(){for(;Atomics.compareExchange(this._int32,3,0,1)!==0;)Atomics.wait(this._int32,3,1,1)}_unlock(){Atomics.store(this._int32,3,0),Atomics.notify(this._int32,3)}};const ht=4096,Gl=64,Tw=0,Iw=1,Rw=2,Pw=Gl*ht*4+4,Dw=Gl*ht;G_=class{constructor(e=Pw){if(T(this,"_buffer"),T(this,"_int32"),T(this,"_uint8"),!Ea())throw new Error("SharedArrayBuffer not available. Ensure COOP/COEP headers are set.");this._buffer=new SharedArrayBuffer(e),this._int32=new Int32Array(this._buffer),this._uint8=new Uint8Array(this._buffer);for(let n=0;n<Gl;n++)Atomics.store(this._int32,n*ht,Tw);Atomics.store(this._int32,Dw,0)}get buffer(){return this._buffer}writeResult(e,n,t){const r=e*ht;Atomics.store(this._int32,r+1,n);const i=new TextEncoder().encode(t),a=(ht-3)*4,o=Math.min(i.byteLength,a);Atomics.store(this._int32,r+2,o);const l=(r+3)*4;this._uint8.set(i.subarray(0,o),l),Atomics.store(this._int32,r,Iw),Atomics.notify(this._int32,r)}writeError(e,n,t){const r=e*ht;Atomics.store(this._int32,r+1,n);const i=new TextEncoder().encode(t),a=(ht-3)*4,o=Math.min(i.byteLength,a);Atomics.store(this._int32,r+2,o);const l=(r+3)*4;this._uint8.set(i.subarray(0,o),l),Atomics.store(this._int32,r,Rw),Atomics.notify(this._int32,r)}};const Kl=10,x_=50;ci=(D=class extends M{constructor(e){super(),T(this,"_processes",new Map),T(this,"_nextPid",100),T(this,"_volume"),T(this,"_vfsBridge",null),T(this,"_sharedBuffer",null),T(this,"_syncBuffer",null),T(this,"_serverPorts",new Map),T(this,"_childPids",new Map),T(this,"_httpCallbacks",new Map),T(this,"_nextHttpRequestId",1),this._volume=e}setVFSBridge(e){this._vfsBridge=e}setSharedBuffer(e){this._sharedBuffer=e}setSyncBuffer(e){this._syncBuffer=e}spawn(e){if(this._processes.size>=x_)throw new Error(`Process limit exceeded (max ${x_})`);if(e.parentPid!==void 0){let o=0,l=e.parentPid;for(;l!==void 0&&o<Kl;){const u=this._processes.get(l);l=u==null?void 0:u.parentPid,o++}if(o>=Kl)throw new Error(`Process tree depth limit exceeded (max ${Kl})`)}const n=this._nextPid++,t=this._vfsBridge?this._vfsBridge.createSnapshot():this._createEmptySnapshot(),r={command:e.command,args:e.args??[],cwd:e.cwd??"/",env:e.env??{},snapshot:t,sharedBuffer:this._sharedBuffer??void 0,syncBuffer:this._syncBuffer??void 0,parentPid:e.parentPid},s=this._createWorker(),i=new K_(s,r);i._setPid(n),this._processes.set(n,i),this._wireHandleEvents(i);const a={type:"init",pid:n,cwd:r.cwd,env:r.env,snapshot:r.snapshot,sharedBuffer:r.sharedBuffer,syncBuffer:r.syncBuffer};return i.init(a),this.emit("spawn",n,e.command,e.args),i}getProcess(e){return this._processes.get(e)}listProcesses(){const e=[];for(const[n,t]of this._processes)e.push({pid:n,command:t.command,args:t.args,state:t.state,exitCode:t.exitCode,parentPid:t.parentPid});return e}kill(e,n="SIGTERM"){const t=this._processes.get(e);return t?(t.kill(n),this._killDescendants(e,n),this._cleanupServerPorts(e),!0):!1}_cleanupServerPorts(e){for(const[t,r]of this._serverPorts)r===e&&(this._serverPorts.delete(t),this.emit("server-close",e,t));const n=this._childPids.get(e);if(n)for(const t of n)this._cleanupServerPorts(t)}_killDescendants(e,n){const t=this._childPids.get(e);if(t)for(const r of t){const s=this._processes.get(r);s&&s.state!=="exited"&&(s.kill(n),s.removeAllListeners("stdout"),s.removeAllListeners("stderr")),this._killDescendants(r,n)}}teardown(){for(const[e,n]of this._processes)try{n.kill("SIGKILL")}catch{}this._processes.clear()}get processCount(){return this._processes.size}registerServerPort(e,n){this._serverPorts.set(e,n)}unregisterServerPort(e){this._serverPorts.delete(e)}getServerPorts(){return[...this._serverPorts.keys()]}dispatchHttpRequest(e,n,t,r,s){const i=this._serverPorts.get(e);if(i===void 0)return Promise.resolve({statusCode:503,statusMessage:"Service Unavailable",headers:{"Content-Type":"text/plain"},body:`No server on port ${e}`});const a=this._processes.get(i);if(!a||a.state==="exited")return this._serverPorts.delete(e),Promise.resolve({statusCode:503,statusMessage:"Service Unavailable",headers:{"Content-Type":"text/plain"},body:`Server process exited (pid ${i})`});const o=this._nextHttpRequestId++;return new Promise(l=>{this._httpCallbacks.set(o,u=>{this._httpCallbacks.delete(o),l({statusCode:u.statusCode,statusMessage:u.statusMessage,headers:u.headers,body:u.body})}),a.postMessage({type:"http-request",requestId:o,port:e,method:n,path:t,headers:r,body:s??null})})}dispatchWsUpgrade(e,n,t,r){const s=this._serverPorts.get(e);if(s===void 0)return-1;const i=this._processes.get(s);return!i||i.state==="exited"?(this._serverPorts.delete(e),-1):(i.postMessage({type:"ws-upgrade",uid:n,port:e,path:t,headers:r}),s)}dispatchWsData(e,n,t){const r=this._processes.get(e);!r||r.state==="exited"||r.postMessage({type:"ws-data",uid:n,frame:t})}dispatchWsClose(e,n,t){const r=this._processes.get(e);!r||r.state==="exited"||r.postMessage({type:"ws-close",uid:n,code:t})}_createWorker(){if(!ci._workerBlobUrl){const e=new Blob([kw],{type:"application/javascript"});ci._workerBlobUrl=URL.createObjectURL(e)}return new Worker(ci._workerBlobUrl)}_wireHandleEvents(e){e.on("signal",n=>{this._killDescendants(e.pid,n)}),e.on("stdin-forward",n=>{const t=this._childPids.get(e.pid);if(t)for(const r of t){const s=this._processes.get(r);s&&s.state!=="exited"&&s.sendStdin(n)}}),e.on("exit",n=>{for(const[t,r]of this._serverPorts)r===e.pid&&(this._serverPorts.delete(t),this.emit("server-close",e.pid,t));for(const[t,r]of this._httpCallbacks)r({type:"http-response",requestId:t,statusCode:503,statusMessage:"Worker Exited",headers:{},body:"Worker process exited before completing the request"});this.emit("exit",e.pid,n),setTimeout(()=>{this._processes.delete(e.pid)},100)}),e.on("vfs-write",(n,t,r)=>{this._vfsBridge&&(r?this._vfsBridge.handleWorkerMkdir(n):this._vfsBridge.handleWorkerWrite(n,new Uint8Array(t)),this._vfsBridge.broadcastChange(n,t,e.pid))}),e.on("vfs-delete",n=>{this._vfsBridge&&(this._vfsBridge.handleWorkerDelete(n),this._vfsBridge.broadcastChange(n,null,e.pid))}),e.on("vfs-read",(n,t)=>{try{if(this._volume.existsSync(t))if(this._volume.statSync(t).isDirectory())e.postMessage({type:"vfs-sync",path:t,content:null,isDirectory:!0});else{const s=this._volume.readFileSync(t),i=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);e.postMessage({type:"vfs-sync",path:t,content:i,isDirectory:!1},[i])}else e.postMessage({type:"vfs-sync",path:t,content:null,isDirectory:!1})}catch{try{e.postMessage({type:"vfs-sync",path:t,content:null,isDirectory:!1})}catch{}}}),e.on("spawn-request",n=>{const t=n.args.length?`${n.command} ${n.args.join(" ")}`:n.command;try{const r=this.spawn({command:n.command,args:n.args,cwd:n.cwd,env:n.env,parentPid:e.pid});this._childPids.has(e.pid)||this._childPids.set(e.pid,new Set),this._childPids.get(e.pid).add(r.pid),e.holdExit(),e.holdShellDone(),e.postMessage({type:"spawn-result",requestId:n.requestId,pid:r.pid});const s=/(?:^|\/)node$/.test(n.command),i=()=>{s&&n.args.length>0?r.exec({type:"exec",filePath:n.args[0],args:n.args.slice(1),cwd:n.cwd,env:n.env,isShell:!1}):r.exec({type:"exec",filePath:"",args:n.args,cwd:n.cwd,env:n.env,isShell:!0,shellCommand:t})};r.state==="running"?i():r.on("ready",i),r.on("stdout",a=>{e.workerExited||e.shellCommandDone?e.emit("stdout",a):e.postMessage({type:"child-output",requestId:n.requestId,stream:"stdout",data:a})}),r.on("stderr",a=>{e.workerExited||e.shellCommandDone?e.emit("stderr",a):e.postMessage({type:"child-output",requestId:n.requestId,stream:"stderr",data:a})}),r.on("stdin-raw-status",a=>{e.emit("stdin-raw-status",a)}),r.on("exit",a=>{e.workerExited||e.postMessage({type:"child-exit",requestId:n.requestId,exitCode:a,stdout:r.stdout,stderr:r.stderr});const o=this._childPids.get(e.pid);o&&(o.delete(r.pid),o.size===0&&this._childPids.delete(e.pid)),e.releaseExit(),e.releaseShellDone()})}catch(r){e.postMessage({type:"spawn-result",requestId:n.requestId,pid:-1,error:r instanceof Error?r.message:String(r)})}}),e.on("fork-request",n=>{try{const t=this.spawn({command:"node",args:[n.modulePath,...n.args],cwd:n.cwd,env:n.env,parentPid:e.pid});this._childPids.has(e.pid)||this._childPids.set(e.pid,new Set),this._childPids.get(e.pid).add(t.pid),e.holdExit(),e.holdShellDone(),e.postMessage({type:"spawn-result",requestId:n.requestId,pid:t.pid});const r=()=>{t.exec({type:"exec",filePath:n.modulePath,args:n.args,cwd:n.cwd,env:n.env,isShell:!1,isFork:!0})};t.state==="running"?r():t.on("ready",r),t.on("stdout",s=>{e.workerExited||e.shellCommandDone?e.emit("stdout",s):e.postMessage({type:"child-output",requestId:n.requestId,stream:"stdout",data:s})}),t.on("stderr",s=>{e.workerExited||e.shellCommandDone?e.emit("stderr",s):e.postMessage({type:"child-output",requestId:n.requestId,stream:"stderr",data:s})}),t.on("ipc-message",s=>{const i=(s==null?void 0:s.data)??s;e.workerExited||e.postMessage({type:"ipc-message",targetRequestId:n.requestId,data:i})}),e.on("ipc-message",s=>{s.targetRequestId===n.requestId&&t.postMessage({type:"ipc-message",data:s.data})}),t.on("exit",s=>{e.workerExited||e.postMessage({type:"child-exit",requestId:n.requestId,exitCode:s,stdout:t.stdout,stderr:t.stderr});const i=this._childPids.get(e.pid);i&&(i.delete(t.pid),i.size===0&&this._childPids.delete(e.pid)),e.releaseExit(),e.releaseShellDone()})}catch(t){e.postMessage({type:"spawn-result",requestId:n.requestId,pid:-1,error:t instanceof Error?t.message:String(t)})}}),e.on("workerthread-request",n=>{try{let t=n.modulePath;if(n.isEval){const i=`/__wt_eval_${n.threadId}__.js`;if(this._volume.writeFileSync(i,n.modulePath),t=i,this._vfsBridge){const o=new TextEncoder().encode(n.modulePath).buffer;this._vfsBridge.handleWorkerWrite(i,new Uint8Array(o)),this._vfsBridge.broadcastChange(i,o,e.pid)}}const r=this.spawn({command:"node",args:[t],cwd:n.cwd,env:n.env,parentPid:e.pid});this._childPids.has(e.pid)||this._childPids.set(e.pid,new Set),this._childPids.get(e.pid).add(r.pid),e.holdExit(),e.holdShellDone(),e.postMessage({type:"spawn-result",requestId:n.requestId,pid:r.pid});const s=()=>{r.exec({type:"exec",filePath:t,args:n.args||[],cwd:n.cwd,env:n.env,isShell:!1,isFork:!0,isWorkerThread:!0,workerData:n.workerData,threadId:n.threadId})};r.state==="running"?s():r.on("ready",s),r.on("stdout",i=>{e.workerExited||e.shellCommandDone?e.emit("stdout",i):e.postMessage({type:"child-output",requestId:n.requestId,stream:"stdout",data:i})}),r.on("stderr",i=>{e.workerExited||e.shellCommandDone?e.emit("stderr",i):e.postMessage({type:"child-output",requestId:n.requestId,stream:"stderr",data:i})}),r.on("ipc-message",i=>{const a=(i==null?void 0:i.data)??i;e.workerExited||e.postMessage({type:"ipc-message",targetRequestId:n.requestId,data:a})}),e.on("ipc-message",i=>{i.targetRequestId===n.requestId&&r.postMessage({type:"ipc-message",data:i.data})}),r.on("exit",i=>{if(n.isEval)try{this._volume.unlinkSync(`/__wt_eval_${n.threadId}__.js`)}catch{}e.workerExited||e.postMessage({type:"child-exit",requestId:n.requestId,exitCode:i,stdout:r.stdout,stderr:r.stderr});const a=this._childPids.get(e.pid);a&&(a.delete(r.pid),a.size===0&&this._childPids.delete(e.pid)),e.releaseExit(),e.releaseShellDone()})}catch(t){e.postMessage({type:"spawn-result",requestId:n.requestId,pid:-1,error:t instanceof Error?t.message:String(t)})}}),e.on("spawn-sync",n=>{if(!this._syncBuffer)return;const t=n.shellCommand??(n.args.length?`${n.command} ${n.args.join(" ")}`:n.command),r=(ht-3)*4,s=i=>{try{const a=new Int32Array(this._syncBuffer),o=n.syncSlot*ht;Atomics.store(a,o+1,i),Atomics.store(a,o+2,0),Atomics.store(a,o,2),Atomics.notify(a,o)}catch{}};try{const i=this.spawn({command:n.command,args:n.args,cwd:n.cwd,env:n.env,parentPid:e.pid});this._childPids.has(e.pid)||this._childPids.set(e.pid,new Set),this._childPids.get(e.pid).add(i.pid),e.holdExit(),e.holdShellDone(),e.holdSync();const a=()=>{i.exec({type:"exec",filePath:"",args:n.args,cwd:n.cwd,env:n.env,isShell:!0,shellCommand:t})};i.state==="running"?a():i.on("ready",a),i.on("stdout",o=>{e.emit("stdout",o)}),i.on("stderr",o=>{e.emit("stderr",o)}),i.on("stdin-raw-status",o=>{e.emit("stdin-raw-status",o)}),i.on("exit",o=>{try{const u=new Int32Array(this._syncBuffer),c=new TextEncoder,p=n.syncSlot*ht,h=c.encode(i.stdout),f=Math.min(h.byteLength,r);Atomics.store(u,p+1,o),Atomics.store(u,p+2,f);const m=new Uint8Array(this._syncBuffer),v=(p+3)*4;m.set(h.subarray(0,f),v),Atomics.store(u,p,1),Atomics.notify(u,p)}catch{s(1)}const l=this._childPids.get(e.pid);l&&(l.delete(i.pid),l.size===0&&this._childPids.delete(e.pid)),e.releaseSync(),e.releaseExit(),e.releaseShellDone()}),i.on("worker-error",()=>{s(1);const o=this._childPids.get(e.pid);o&&(o.delete(i.pid),o.size===0&&this._childPids.delete(e.pid)),e.releaseSync(),e.releaseExit(),e.releaseShellDone()})}catch{s(1)}}),e.on("server-listen",(n,t)=>{this.registerServerPort(n,e.pid),this.emit("server-listen",e.pid,n,t)}),e.on("server-close",n=>{this.unregisterServerPort(n),this.emit("server-close",e.pid,n)}),e.on("http-response",n=>{const t=this._httpCallbacks.get(n.requestId);t&&t(n)}),e.on("ws-frame",n=>{this.emit("ws-frame",n)}),e.on("cwd-change",n=>{this.emit("cwd-change",e.pid,n)}),e.on("stdin-raw-status",n=>{this.emit("stdin-raw-status",e.pid,n)}),e.on("worker-error",(n,t)=>{this.emit("error",e.pid,n,t)})}_createEmptySnapshot(){return{manifest:[],data:new ArrayBuffer(0)}}broadcastVFSChange(e,n,t,r){for(const[s,i]of this._processes)if(!(s===r||i.state==="exited"))try{const a=n?n.slice(0):null;i.postMessage({type:"vfs-sync",path:e,content:a,isDirectory:t},a?[a]:[])}catch{}}},T(D,"_workerBlobUrl",null),D);const Yl=4*1024*1024;Y_=class{constructor(e){T(this,"_volume"),T(this,"_broadcaster",null),T(this,"_sharedVFS",null),T(this,"_suppressWatch",!1),this._volume=e}setBroadcaster(e){this._broadcaster=e}setSharedVFS(e){this._sharedVFS=e}createSnapshot(){const e=[],n=[];let t=0;this._walkVolume("/",(a,o,l)=>{o?e.push({path:a,offset:0,length:0,isDirectory:!0}):l&&(e.push({path:a,offset:t,length:l.byteLength,isDirectory:!1}),n.push(l),t+=l.byteLength)});const r=new ArrayBuffer(t),s=new Uint8Array(r);let i=0;for(const a of n)s.set(a,i),i+=a.byteLength;return{manifest:e,data:r}}createChunkedSnapshots(){const e=this.createSnapshot(),n=e.data.byteLength;if(n<=Yl)return[{chunkIndex:0,totalChunks:1,data:e.data,manifest:e.manifest}];const t=[],r=new Uint8Array(e.data),s=Math.ceil(n/Yl);let i=0;for(let a=0;a<s;a++){const o=Math.min(i+Yl,n),l=r.slice(i,o),u=e.manifest.filter(c=>c.isDirectory?a===0:c.offset>=i&&c.offset<o).map(c=>({...c,offset:c.isDirectory?0:c.offset-i}));t.push({chunkIndex:a,totalChunks:s,data:l.buffer.slice(l.byteOffset,l.byteOffset+l.byteLength),manifest:u}),i=o}return t}handleWorkerWrite(e,n){this._suppressWatch=!0;try{const t=e.substring(0,e.lastIndexOf("/"))||"/";t!=="/"&&!this._volume.existsSync(t)&&this._volume.mkdirSync(t,{recursive:!0}),this._volume.writeFileSync(e,n),this._sharedVFS&&this._sharedVFS.writeFile(e,n)}finally{this._suppressWatch=!1}}handleWorkerMkdir(e){this._suppressWatch=!0;try{this._volume.existsSync(e)||this._volume.mkdirSync(e,{recursive:!0}),this._sharedVFS&&this._sharedVFS.writeDirectory(e)}finally{this._suppressWatch=!1}}handleWorkerDelete(e){this._suppressWatch=!0;try{try{this._volume.existsSync(e)&&(this._volume.statSync(e).isDirectory()?this._volume.rmdirSync(e):this._volume.unlinkSync(e))}catch(n){console.warn(`[VFSBridge] Failed to delete "${e}":`,n)}this._sharedVFS&&this._sharedVFS.deleteFile(e)}finally{this._suppressWatch=!1}}broadcastChange(e,n,t){this._broadcaster&&this._broadcaster(e,n,t)}watch(){const e=this._volume.watch("/",{recursive:!0},(n,t)=>{if(!(!t||this._suppressWatch))try{if(this._volume.existsSync(t))if(this._volume.statSync(t).isDirectory())this.broadcastChange(t,new ArrayBuffer(0),-1),this._sharedVFS&&this._sharedVFS.writeDirectory(t);else{const s=this._volume.readFileSync(t),i=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);this.broadcastChange(t,i,-1),this._sharedVFS&&this._sharedVFS.writeFile(t,s)}else this.broadcastChange(t,null,-1),this._sharedVFS&&this._sharedVFS.deleteFile(t)}catch(r){console.warn(`[VFSBridge] Watch error for "${t}":`,r)}});return()=>e.close()}_walkVolume(e,n){try{const t=this._volume.readdirSync(e);for(const r of t){const s=e==="/"?`/${r}`:`${e}/${r}`;try{if(this._volume.statSync(s).isDirectory())n(s,!0,null),this._walkVolume(s,n);else{const a=this._volume.readFileSync(s);n(s,!1,a)}}catch(i){console.warn(`[VFSBridge] Failed to stat/read "${s}":`,i)}}}catch(t){console.warn(`[VFSBridge] Failed to read directory "${e}":`,t)}}};const Ow=ie;function Nw(e){return e.replace(/\//g,"%2f")}class ts{constructor(n={}){T(this,"baseUrl"),T(this,"metadataStore"),this.baseUrl=(n.endpoint||Ow).replace(/\/+$/,""),this.metadataStore=n.metadataCache||new Map}async fetchManifest(n){const t=this.metadataStore.get(n);if(t)return t;const r=`${this.baseUrl}/${Nw(n)}`,s=await fetch(r,{headers:{Accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8"}});if(s.status===404)throw new Error(`Package "${n}" does not exist in the registry`);if(!s.ok)throw new Error(`Registry request for "${n}" failed with HTTP ${s.status}`);const i=await s.json();return this.metadataStore.set(n,i),i}async fetchVersion(n,t){const r=await this.fetchManifest(n),i=r["dist-tags"][t]||t,a=r.versions[i];if(!a)throw new Error(`Version "${t}" does not exist for package "${n}"`);return a}async getLatestVersion(n){return(await this.fetchManifest(n))["dist-tags"].latest}async listVersions(n){const t=await this.fetchManifest(n);return Object.keys(t.versions)}async getTarballUrl(n,t){return(await this.fetchVersion(n,t)).dist.tarball}async downloadArchive(n){const t=await fetch(n);if(!t.ok)throw new Error(`Tarball download failed (HTTP ${t.status}): ${n}`);return t.arrayBuffer()}flushCache(){this.metadataStore.clear()}}Object.freeze(Object.defineProperty({__proto__:null,RegistryClient:ts,default:ts},Symbol.toStringTag,{value:"Module"}));const Bw=/^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/;function ai(e){const n=e.match(Bw);return n?{major:Number(n[1]),minor:Number(n[2]),patch:Number(n[3]),prerelease:n[4]}:null}function kn(e,n){const t=ai(e),r=ai(n);if(!t||!r)return e.localeCompare(n);const s=t.major-r.major;if(s!==0)return s;const i=t.minor-r.minor;if(i!==0)return i;const a=t.patch-r.patch;return a!==0?a:t.prerelease&&!r.prerelease?-1:!t.prerelease&&r.prerelease?1:t.prerelease&&r.prerelease?t.prerelease.localeCompare(r.prerelease):0}function va(e,n){const t=ai(e);if(!t||t.prerelease&&!n.includes("-"))return!1;if(n=n.trim(),n==="*"||n==="latest"||n==="")return!0;if(n.includes("||"))return n.split("||").some(s=>va(e,s.trim()));if(n.includes(" - ")){const[s,i]=n.split(" - ").map(a=>a.trim());return kn(e,s)>=0&&kn(e,i)<=0}const r=n.match(/(>=|<=|>|<|=)\s*(\d+(?:\.\d+)?(?:\.\d+)?(?:-[^\s]*)?)/g);if(r&&r.length>1)return r.every(s=>{const i=s.match(/^(>=|<=|>|<|=)\s*(\d+(?:\.\d+)?(?:\.\d+)?(?:-[^\s]*)?)$/);if(!i)return!0;const a=i[1];let o=i[2];const l=(o.match(/\./g)||[]).length;return l===0?o+=".0.0":l===1&&(o+=".0"),Lw(e,a,o)});if(n.startsWith("^")){const s=mr(n.slice(1)),i=ai(s);return!i||t.major!==i.major||i.major===0&&(i.minor!==0&&t.minor!==i.minor||i.minor===0&&t.minor!==0)?!1:kn(e,s)>=0}if(n.startsWith("~")){const s=mr(n.slice(1)),i=ai(s);return i?t.major===i.major&&t.minor===i.minor&&kn(e,s)>=0:!1}if(n.startsWith(">="))return kn(e,mr(n.slice(2).trim()))>=0;if(n.startsWith(">"))return kn(e,mr(n.slice(1).trim()))>0;if(n.startsWith("<="))return kn(e,mr(n.slice(2).trim()))<=0;if(n.startsWith("<"))return kn(e,mr(n.slice(1).trim()))<0;if(n.startsWith("="))return kn(e,mr(n.slice(1).trim()))===0;if(n.includes("x")||n.includes("X")||/^\d+$/.test(n)||/^\d+\.\d+$/.test(n)){const s=n.replace(/[xX]/g,"").split(".").filter(Boolean);if(s.length===1)return t.major===Number(s[0]);if(s.length===2)return t.major===Number(s[0])&&t.minor===Number(s[1])}if(n.includes(" "))return n.split(/\s+/).filter(Boolean).every(s=>va(e,s));if(/^\d+\.\d+\.\d+/.test(n)){const s=n.match(/^(\d+\.\d+\.\d+(?:-[^\s]+)?)/);if(s)return kn(e,s[1])===0}return kn(e,n)===0}function mr(e){const n=e.replace(/[xX*]/g,"0").split(".");for(;n.length<3;)n.push("0");return n.join(".")}function Lw(e,n,t){const r=kn(e,t);switch(n){case">=":return r>=0;case"<=":return r<=0;case">":return r>0;case"<":return r<0;default:return r===0}}function Fw(e,n){const t=[...e].sort((r,s)=>kn(s,r));for(const r of t)if(va(r,n))return r;return null}function Mw(e){if(!e.startsWith("npm:"))return null;const n=e.slice(4);let t;return n.startsWith("@")?t=n.indexOf("@",1):t=n.indexOf("@"),t===-1?{realName:n,realRange:"latest"}:{realName:n.slice(0,t),realRange:n.slice(t+1)}}async function $w(e,n="latest",t={}){const s={registry:t.registry||new ts,completed:new Map,inFlight:new Set,config:t};return await Zl(e,n,s),s.completed}async function Uw(e,n={}){const r={registry:n.registry||new ts,completed:new Map,inFlight:new Set,config:n},s={...e.dependencies};n.devDependencies&&e.devDependencies&&Object.assign(s,e.devDependencies);for(const[i,a]of Object.entries(s))await Zl(i,a,r);return r.completed}async function Zl(e,n,t){var r,s;const{registry:i,completed:a,inFlight:o,config:l}=t,u=Mw(n),c=e,p=(u==null?void 0:u.realName)??e;n=(u==null?void 0:u.realRange)??n;const h=`${c}@${n}`;if(!o.has(h)){if(a.has(c)){const f=a.get(c);return va(f.version,n),void 0}o.add(h);try{(r=l.onProgress)==null||r.call(l,`Resolving ${p}@${n}`);const f=await i.fetchManifest(p),m=Object.keys(f.versions);let v;if(n==="latest"||n==="*")v=f["dist-tags"].latest;else if(f["dist-tags"][n])v=f["dist-tags"][n];else{const R=Fw(m,n);if(!R)throw new Error(`Could not find a version of "${p}" matching "${n}"`);v=R}const k=f.versions[v];a.set(c,{name:c,version:v,tarballUrl:k.dist.tarball,dependencies:k.dependencies||{},shasum:k.dist.shasum});const P={};if(k.peerDependencies){const R=k.peerDependenciesMeta||{};for(const[S,F]of Object.entries(k.peerDependencies))(s=R[S])!=null&&s.optional||(P[S]=F)}if(k.dependencies&&Object.assign(P,k.dependencies),k.optionalDependencies)if(l.optionalDependencies)Object.assign(P,k.optionalDependencies);else for(const[R,S]of Object.entries(k.optionalDependencies))R.includes("wasm32-wasi")&&(P[R]=S);const N=Object.entries(P),O=8;for(let R=0;R<N.length;R+=O){const S=N.slice(R,R+O);await Promise.all(S.map(([F,g])=>Zl(F,g,t)))}}finally{o.delete(h)}}}const jw=`
46315
46311
  "use strict";
46316
46312
 
46317
46313
  // CDN URLs (injected at build time)
46318
46314
 
46319
- const ESBUILD_ESM_URL = "${hf}";
46320
- const ESBUILD_WASM_URL = "${uc}";
46321
- const PAKO_URL = "${R}";
46315
+ const ESBUILD_ESM_URL = "${sd}";
46316
+ const ESBUILD_WASM_URL = "${Co}";
46317
+ const PAKO_URL = "${Le}";
46322
46318
 
46323
46319
  const cdnImport = new Function("url", "return import(url)");
46324
46320
 
@@ -46648,24 +46644,24 @@ const endpoint = {
46648
46644
  };
46649
46645
 
46650
46646
  miniExpose(endpoint);
46651
- `;let Kr=null;function CA(){try{if(!Kr){const e=new Blob([kA],{type:"application/javascript"});Kr=URL.createObjectURL(e)}return new Worker(Kr)}catch{return null}}function AA(){Kr&&(URL.revokeObjectURL(Kr),Kr=null)}class TA{constructor(t={}){W(this,"workers",[]),W(this,"waitQueue",[]),W(this,"nextId",0),W(this,"config"),W(this,"idleTimer",null),W(this,"disposed",!1),W(this,"broken",!1);const n=typeof navigator<"u"&&navigator.hardwareConcurrency||4;this.config={minWorkers:t.minWorkers??1,maxWorkers:t.maxWorkers??Math.min(n,ae.MAX_WORKERS_CAP),idleTimeoutMs:t.idleTimeoutMs??As.WORKER_IDLE_TIMEOUT,warmUpOnCreate:t.warmUpOnCreate??!0},this.idleTimer=setInterval(()=>this.reapIdle(),As.WORKER_REAP_INTERVAL)}async acquire(){if(this.disposed)throw new Error("WorkerPool is disposed");if(this.broken)throw new Error("WorkerPool is broken — Workers unavailable");const t=this.workers.find(n=>!n.busy&&n.initialized);if(t)return t.busy=!0,t.lastUsed=Date.now(),{worker:t,release:()=>this.release(t)};if(this.workers.length<this.config.maxWorkers){const n=this.tryCreateWorker();if(!n)throw this.broken=!0,this.rejectAllWaiters(),new Error("WorkerPool is broken — Worker construction failed");if(n.busy=!0,!n.initialized&&n.initPromise)try{await n.initPromise}catch(s){throw this.terminateWorker(n),this.broken=!0,this.rejectAllWaiters(),new Error(`WorkerPool is broken — Worker init failed: ${s instanceof Error?s.message:s}`)}return n.lastUsed=Date.now(),{worker:n,release:()=>this.release(n)}}return new Promise((n,s)=>{this.waitQueue.push({resolve:n,reject:s})})}dispose(){this.disposed=!0,this.idleTimer&&(clearInterval(this.idleTimer),this.idleTimer=null);for(const t of[...this.workers])this.terminateWorker(t);this.rejectAllWaiters(),AA()}stats(){return{total:this.workers.length,busy:this.workers.filter(t=>t.busy).length,idle:this.workers.filter(t=>!t.busy).length,initialized:this.workers.filter(t=>t.initialized).length}}rejectAllWaiters(){for(const t of this.waitQueue)t.reject(new Error("WorkerPool is no longer available"));this.waitQueue.length=0}release(t){if(t.busy=!1,t.lastUsed=Date.now(),this.waitQueue.length>0){const n=this.waitQueue.shift();t.busy=!0,t.lastUsed=Date.now(),n.resolve({worker:t,release:()=>this.release(t)})}}tryCreateWorker(){const t=CA();if(!t)return null;try{const n=Ev(t),s=this.nextId++,r={thread:t,endpoint:n,busy:!1,initialized:!1,initPromise:null,lastUsed:Date.now(),id:s};if(this.config.warmUpOnCreate){const o=As.WORKER_INIT_TIMEOUT,c=n.init(),d=new Promise((p,y)=>setTimeout(()=>y(new Error("Worker init timed out")),o));r.initPromise=Promise.race([c,d]).then(()=>{r.initialized=!0,r.initPromise=null}).catch(p=>{throw this.terminateWorker(r),p})}return this.workers.push(r),r}catch{try{t.terminate()}catch{}return null}}reapIdle(){const t=Date.now(),n=this.workers.filter(o=>!o.busy&&o.initialized&&t-o.lastUsed>this.config.idleTimeoutMs),s=Math.max(0,this.workers.length-this.config.minWorkers),r=n.slice(0,s);for(const o of r)this.terminateWorker(o)}terminateWorker(t){const n=this.workers.indexOf(t);n>=0&&this.workers.splice(n,1);try{t.thread.terminate()}catch{}}}class IA{constructor(t){W(this,"queue",[]),W(this,"pool"),W(this,"dispatching",!1),this.pool=t}submit(t){return new Promise((n,s)=>{const r={task:t,resolve:n,reject:s,cancelled:!1},o=this.queue.findIndex(c=>c.task.priority>t.priority);o===-1?this.queue.push(r):this.queue.splice(o,0,r),this.dispatch()})}submitBatch(t){return Promise.all(t.map(n=>this.submit(n)))}cancel(t){const n=this.queue.findIndex(s=>s.task.id===t&&!s.cancelled);if(n>=0){const s=this.queue[n];return s.cancelled=!0,s.reject(new Error(`Task ${t} cancelled`)),this.queue.splice(n,1),!0}return!1}get pending(){return this.queue.length}async dispatch(){if(!this.dispatching){this.dispatching=!0;try{for(;this.queue.length>0;){const t=this.queue.shift();if(t.cancelled)continue;let n,s;try{const r=await this.pool.acquire();n=r.worker,s=r.release}catch(r){const o=r instanceof Error?r:new Error(String(r));t.reject(o),this.rejectAll(o);return}this.executeTask(n.endpoint,t).finally(()=>{s(),this.queue.length>0&&(this.dispatching=!1,this.dispatch())})}}finally{this.dispatching=!1}}}rejectAll(t){const n=this.queue.splice(0);for(const s of n)s.cancelled||s.reject(t)}async executeTask(t,n){if(!n.cancelled)try{let s;switch(n.task.type){case"transform":s=await t.transform(n.task);break;case"extract":s=await t.extract(n.task);break;case"build":s=await t.build(n.task);break;default:throw new Error(`Unknown task type: ${n.task.type}`)}n.cancelled||n.resolve(s)}catch(s){n.cancelled||n.reject(s instanceof Error?s:new Error(String(s)))}}}var Bu=(e=>(e[e.HIGH=0]="HIGH",e[e.NORMAL=1]="NORMAL",e[e.LOW=2]="LOW",e))(Bu||{});let pa=null,fa=null,Uo=!1,RA;function PA(){return typeof Worker<"u"&&typeof Blob<"u"&&typeof URL<"u"&&typeof URL.createObjectURL=="function"}function DA(){if(fa)return fa;if(!PA())throw Uo=!0,new Error("Workers not available");return pa=new TA(RA),fa=new IA(pa),fa}async function OA(e){const{convertFileDirect:t,prepareTransformer:n}=await Promise.resolve().then(()=>WA);await n();const s=await t(e.source,e.filePath);return{type:"transform",id:e.id,code:s,warnings:[]}}async function NA(e){const t=await Promise.resolve().then(()=>Y1),{parseTarArchive:n}=await Promise.resolve().then(()=>$A),{bytesToBase64:s}=await Promise.resolve().then(()=>v),r=await fetch(e.tarballUrl);if(!r.ok)throw new Error(`Archive download failed (HTTP ${r.status}): ${e.tarballUrl}`);const o=new Uint8Array(await r.arrayBuffer()),c=t.inflate(o),d=[];for(const p of n(c)){if(p.kind!=="file"||!p.payload)continue;let y=p.filepath;if(e.stripComponents>0){const k=y.split("/").filter(Boolean);if(k.length<=e.stripComponents)continue;y=k.slice(e.stripComponents).join("/")}let g,x=!1;try{g=new TextDecoder("utf-8",{fatal:!0}).decode(p.payload)}catch{g=s(p.payload),x=!0}d.push({path:y,data:g,isBinary:x})}return{type:"extract",id:e.id,files:d}}async function BA(e){const t=await Promise.resolve().then(()=>U0);try{const n=await t.build({entryPoints:e.entryPoints,stdin:e.stdin,bundle:e.bundle,format:e.format,platform:e.platform,target:e.target,minify:e.minify,external:e.external,write:!1,absWorkingDir:e.absWorkingDir});return{type:"build",id:e.id,outputFiles:(n.outputFiles||[]).map(s=>({path:s.path,text:s.text||new TextDecoder().decode(s.contents)})),errors:(n.errors||[]).map(s=>s.text||String(s)),warnings:(n.warnings||[]).map(s=>s.text||String(s))}}catch(n){return{type:"build",id:e.id,outputFiles:[],errors:[(n==null?void 0:n.message)||"build failed"],warnings:[]}}}function Pv(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`task-${Date.now()}-${Math.random().toString(36).slice(2)}`}async function Dv(e){if(Uo)return Ov(e);try{return await DA().submit(e)}catch(t){return Uo||console.debug("[offload] Falling back to main thread:",t instanceof Error?t.message:t),LA(),Ov(e)}}function LA(){Uo=!0,pa&&(pa.dispose(),pa=null),fa=null}async function Ov(e){switch(e.type){case"transform":return OA(e);case"extract":return NA(e);case"build":return BA(e);default:throw new Error(`Unknown task type: ${e.type}`)}}function jo(e,t,n){const s=e.slice(t,t+n),r=s.indexOf(0),o=r>=0?s.slice(0,r):s;return new TextDecoder().decode(o)}function Nv(e,t,n){const s=jo(e,t,n).trim();return parseInt(s,8)||0}function MA(e){switch(e){case"0":case"\0":case"":return"file";case"5":return"directory";case"1":case"2":return"link";default:return"other"}}function*FA(e){let n=0;for(;n+512<=e.length;){const s=e.slice(n,n+512);if(n+=512,s.every(T=>T===0))break;const o=jo(s,0,100);if(!o)continue;const c=Nv(s,100,8),d=Nv(s,124,12),p=String.fromCharCode(s[156]),y=jo(s,157,100),g=jo(s,345,155),x=g?`${g}/${o}`:o,k=MA(p);let C;k==="file"&&(C=d>0?e.slice(n,n+d):new Uint8Array(0),d>0&&(n+=Math.ceil(d/512)*512)),yield{filepath:x,kind:k,byteSize:d,fileMode:c,payload:C,linkDestination:k==="link"?y:void 0}}}async function Bv(e,t,n,s={}){var r,o;(r=s.onProgress)==null||r.call(s,`Fetching ${e}...`);const c=await Dv({type:"extract",id:Pv(),tarballUrl:e,stripComponents:s.stripComponents??1,priority:Bu.NORMAL,expectedShasum:s.expectedShasum}),d=[];for(const p of c.files){if(s.filter&&!s.filter(p.path))continue;const y=yt(n,p.path),g=ir(y);t.mkdirSync(g,{recursive:!0}),p.isBinary?t.writeFileSync(y,m(p.data)):t.writeFileSync(y,p.data),d.push(y)}return(o=s.onProgress)==null||o.call(s,`Extracted ${d.length} files`),d}const $A=Object.freeze(Object.defineProperty({__proto__:null,downloadAndExtract:Bv,parseTarArchive:FA},Symbol.toStringTag,{value:"Module"})),Lu=typeof window<"u";async function Mu(){if(Lu&&!window.__esbuildEngine)return window.__esbuildReady||(window.__esbuildReady=(async()=>{try{const e=await Ga(hf),t=e.default||e;try{await t.initialize({wasmURL:uc})}catch(n){if(!(n instanceof Error&&n.message.includes('Cannot call "initialize" more than once')))throw n}window.__esbuildEngine=t}catch(e){throw window.__esbuildReady=void 0,e}})()),window.__esbuildReady}function UA(e){return!!(/<[A-Z][a-zA-Z0-9.]*[\s/>]/.test(e)||/<\/[a-zA-Z]/.test(e)||/\/>/.test(e)||/<>|<\/>/.test(e)||/React\.createElement\b/.test(e)||/jsx\(|jsxs\(|jsxDEV\(/.test(e))}function Lv(e,t){return e.endsWith(".jsx")?"jsx":e.endsWith(".ts")?"ts":e.endsWith(".tsx")?"tsx":e.endsWith(".mjs")?"js":UA(t)?"jsx":"js"}async function Mv(e,t){if(!Lu)return e;let s=(await Dv({type:"transform",id:Pv(),source:e,filePath:t,options:{loader:Lv(t,e),format:"cjs",target:"esnext",platform:"neutral",define:{"import.meta.url":"import_meta.url","import.meta.dirname":"import_meta.dirname","import.meta.filename":"import_meta.filename","import.meta":"import_meta"}},priority:Bu.NORMAL})).code;s=s.replace(/\bimport\s*\(\s*["']node:([^"']+)["']\s*\)/g,'Promise.resolve(require("node:$1"))');const r=["assert","buffer","child_process","cluster","crypto","dgram","dns","events","fs","http","http2","https","net","os","path","perf_hooks","querystring","readline","stream","string_decoder","timers","tls","url","util","v8","vm","worker_threads","zlib","async_hooks","inspector","module"];for(const o of r){const c=new RegExp(`\\bimport\\s*\\(\\s*["']${o}["']\\s*\\)`,"g");s=s.replace(c,`Promise.resolve(require("${o}"))`)}return s}async function jA(e,t){if(!Lu)return e;window.__esbuildEngine||await Mu();const n=window.__esbuildEngine;if(!n)throw new Error("esbuild engine not available");const s=Lv(t,e);try{return(await n.transform(e,{loader:s,format:"cjs",target:"esnext",platform:"neutral",define:{"import.meta.url":"import_meta.url","import.meta.dirname":"import_meta.dirname","import.meta.filename":"import_meta.filename","import.meta":"import_meta"}})).code}catch(r){const o=r instanceof Error?r.message:String(r);if(s==="js"||s==="jsx"){const c=s==="js"?["jsx","tsx","ts"]:["tsx"];for(const d of c)try{return(await n.transform(e,{loader:d,format:"cjs",target:"esnext",platform:"neutral",define:{"import.meta.url":"import_meta.url","import.meta.dirname":"import_meta.dirname","import.meta.filename":"import_meta.filename","import.meta":"import_meta"}})).code}catch{}}if(o.includes("Top-level await"))try{return(await n.transform(e,{loader:s,format:"esm",target:"esnext",platform:"neutral",define:{"import.meta.url":"import_meta.url","import.meta.dirname":"import_meta.dirname","import.meta.filename":"import_meta.filename","import.meta":"import_meta"}})).code}catch{return e}return e}}function VA(e,t){return e.endsWith(".mjs")||e.endsWith(".cjs")?!1:/\bimport\s+[\w{*'"]/m.test(t)||/\bexport\s+(?:default|const|let|var|function|class|{|\*)/m.test(t)||/\bimport\.meta\b/.test(t)}function Fu(e){return/\bimport\s*\(\s*["']node:/.test(e)||/\bimport\s*\(\s*["'](fs|path|http|https|net|url|util|events|stream|os|crypto)["']/.test(e)}function $u(e){let t=e;t=t.replace(/\bimport\s*\(\s*["']node:([^"']+)["']\s*\)/g,'Promise.resolve(require("node:$1"))');const n=["assert","buffer","child_process","cluster","crypto","dgram","dns","events","fs","http","http2","https","net","os","path","perf_hooks","querystring","readline","stream","string_decoder","timers","tls","url","util","v8","vm","worker_threads","zlib","async_hooks","inspector","module"];for(const s of n)t=t.replace(new RegExp(`\\bimport\\s*\\(\\s*["']${s}["']\\s*\\)`,"g"),`Promise.resolve(require("${s}"))`);return t}function Fv(e,t){const n=[];try{for(const s of e.readdirSync(t)){const r=t+"/"+s;try{e.statSync(r).isDirectory()?s!=="node_modules"&&n.push(...Fv(e,r)):(s.endsWith(".js")||s.endsWith(".mjs")||s.endsWith(".jsx"))&&n.push(r)}catch{}}}catch{}return n}function HA(e,t){try{const n=t+"/package.json";if(e.existsSync(n)){const s=e.readFileSync(n,"utf8");return JSON.parse(s).type==="module"}}catch{}return!1}async function $v(e,t,n){let s=0;const r=Fv(e,t);n==null||n(` Converting ${r.length} files in ${t}...`);const o=HA(e,t),c=50;for(let d=0;d<r.length;d+=c){const p=r.slice(d,d+c);await Promise.all(p.map(async y=>{try{const g=e.readFileSync(y,"utf8");if(o){Fu(g)&&(e.writeFileSync(y,$u(g)),s++);return}if(y.endsWith(".mjs")){Fu(g)&&(e.writeFileSync(y,$u(g)),s++);return}if(VA(y,g)){const x=await Mv(g,y);e.writeFileSync(y,x),s++}else Fu(g)&&(e.writeFileSync(y,$u(g)),s++)}catch{}}))}return s}const WA=Object.freeze(Object.defineProperty({__proto__:null,convertFile:Mv,convertFileDirect:jA,convertPackage:$v,prepareTransformer:Mu},Symbol.toStringTag,{value:"Module"}));function zA(e,t){return t?typeof t=="string"?{[e.includes("/")?e.split("/").pop():e]:t}:t:{}}function Uv(e){if(e.startsWith("@")){const n=e.indexOf("/");if(n===-1)throw new Error(`Malformed package specifier: ${e}`);const s=e.slice(n+1),r=s.indexOf("@");return r===-1?{name:e}:{name:e.slice(0,n+1+r),version:s.slice(r+1)}}const t=e.indexOf("@");return t===-1?{name:e}:{name:e.slice(0,t),version:e.slice(t+1)}}let jv=!1;Jo=class{constructor(e,t={}){W(this,"vol"),W(this,"registryClient"),W(this,"workingDir"),W(this,"_snapshotCache"),this.vol=e,this.registryClient=new Gr(t),this.workingDir=t.cwd||"/",this._snapshotCache=t.snapshotCache??null}async install(e,t,n={}){const{onProgress:s}=n,r=Uv(e),o=r.name,c=t||r.version||"latest";s==null||s(`Resolving ${o}@${c}...`);const d={registry:this.registryClient,devDependencies:n.withDevDeps,optionalDependencies:n.withOptionalDeps,onProgress:s},p=await xA(o,c,d),y=await this.materializePackages(p,n);if(n.persist||n.persistDev){const g=p.get(o);g&&await this.patchManifest(o,`^${g.version}`,!!n.persistDev)}return s==null||s(`Installed ${p.size} package(s)`),{resolved:p,newPackages:y}}async installFromManifest(e,t={}){const{onProgress:n}=t,s=e||yt(this.workingDir,"package.json");if(!this.vol.existsSync(s))throw new Error(`Manifest not found at ${s}`);const r=this.vol.readFileSync(s,"utf8"),o=JSON.parse(r),c=this._snapshotCache?Ee(r):null;if(this._snapshotCache&&c)try{const g=await this._snapshotCache.get(c);if(g){n==null||n("Restoring cached node_modules...");const{entries:x}=g;for(const k of x)if(k.path.includes("/node_modules/")){if(k.kind==="directory")this.vol.existsSync(k.path)||this.vol.mkdirSync(k.path,{recursive:!0});else if(k.kind==="file"&&k.data){const C=k.path.substring(0,k.path.lastIndexOf("/"))||"/";C!=="/"&&!this.vol.existsSync(C)&&this.vol.mkdirSync(C,{recursive:!0}),this.vol.writeFileSync(k.path,m(k.data))}}return n==null||n(`Restored ${x.length} cached entries`),{resolved:new Map,newPackages:[]}}}catch{}n==null||n("Resolving dependency tree...");const d={registry:this.registryClient,devDependencies:t.withDevDeps,optionalDependencies:t.withOptionalDeps,onProgress:n},p=await EA(o,d),y=await this.materializePackages(p,t);if(this._snapshotCache&&c&&y.length>0)try{const x={entries:this.vol.toSnapshot().entries.filter(k=>k.path.includes("/node_modules/"))};await this._snapshotCache.set(c,x)}catch{}return n==null||n(`Installed ${p.size} package(s)`),{resolved:p,newPackages:y}}listInstalled(){const e=yt(this.workingDir,"node_modules");if(!this.vol.existsSync(e))return{};const t={},n=this.vol.readdirSync(e);for(const s of n)if(!s.startsWith("."))if(s.startsWith("@")){const r=yt(e,s),o=this.vol.readdirSync(r);for(const c of o){const d=yt(r,c,"package.json");if(this.vol.existsSync(d)){const p=JSON.parse(this.vol.readFileSync(d,"utf8"));t[`${s}/${c}`]=p.version}}}else{const r=yt(e,s,"package.json");if(this.vol.existsSync(r)){const o=JSON.parse(this.vol.readFileSync(r,"utf8"));t[s]=o.version}}return t}async materializePackages(e,t){const{onProgress:n}=t,s=[],r=yt(this.workingDir,"node_modules");this.vol.mkdirSync(r,{recursive:!0});const o=[];for(const[p,y]of e){const g=yt(r,p),x=yt(g,"package.json");if(this.vol.existsSync(x))try{if(JSON.parse(this.vol.readFileSync(x,"utf8")).version===y.version){n==null||n(`Skipping ${p}@${y.version} (up to date)`);continue}}catch{}o.push({depName:p,dep:y,targetDir:g})}const c=t.transformModules!==!1;c&&!jv&&(typeof Worker>"u"&&(n==null||n("Preparing module transformer..."),await Mu()),jv=!0);const d=12;n==null||n(`Downloading ${o.length} package(s)...`);for(let p=0;p<o.length;p+=d){const y=o.slice(p,p+d);await Promise.all(y.map(async({depName:g,dep:x,targetDir:k})=>{if(n==null||n(` Fetching ${g}@${x.version}...`),await Bv(x.tarballUrl,this.vol,k,{stripComponents:1,expectedShasum:x.shasum}),c)try{const C=await $v(this.vol,k,n);C>0&&(n==null||n(` Transformed ${C} file(s) in ${g}`))}catch(C){n==null||n(` Warning: transformation failed for ${g}: ${C}`)}this.createBinStubs(r,g,k),s.push(g)}))}return this.writeLockFile(e),s}createBinStubs(e,t,n){try{const s=yt(n,"package.json");if(!this.vol.existsSync(s))return;const r=JSON.parse(this.vol.readFileSync(s,"utf8")),o=zA(t,r.bin),c=yt(e,".bin");for(const[d,p]of Object.entries(o)){this.vol.mkdirSync(c,{recursive:!0});const y=yt(n,p);this.vol.writeFileSync(yt(c,d),`node "${y}" "$@"
46652
- `)}}catch{}}writeLockFile(e){const t={};for(const[s,r]of e)t[s]={version:r.version,resolved:r.tarballUrl};const n=yt(this.workingDir,"node_modules",".package-lock.json");this.vol.writeFileSync(n,JSON.stringify(t,null,2))}async patchManifest(e,t,n){const s=yt(this.workingDir,"package.json");let r={};this.vol.existsSync(s)&&(r=JSON.parse(this.vol.readFileSync(s,"utf8")));const o=n?"devDependencies":"dependencies";r[o]||(r[o]={}),r[o][e]=t,this.vol.writeFileSync(s,JSON.stringify(r,null,2))}},H0=async function(e,t,n){return new Jo(t).install(e,void 0,n)},Object.freeze(Object.defineProperty({__proto__:null,DependencyInstaller:Jo,RegistryClient:Gr,install:H0,splitSpecifier:Uv},Symbol.toStringTag,{value:"Module"}));const qA=new TextEncoder;pd=(i=class extends ne{constructor(e={}){super(),W(this,"registry",new Map),W(this,"baseUrl"),W(this,"opts"),W(this,"channel",null),W(this,"swReady",!1),W(this,"heartbeat",null),W(this,"_processManager",null),W(this,"_workerWsConns",new Map),W(this,"_previewScript",null),W(this,"_swAuthToken",null),W(this,"_wsBridgeToken",null),W(this,"_wsBridge",null),W(this,"_wsConns",new Map),this.opts=e,this.baseUrl=typeof location<"u"?e.baseUrl||`${location.protocol}//${location.host}`:e.baseUrl||"http://localhost",Si((t,n)=>this.register(n,t)),xi(t=>this.unregister(t))}setProcessManager(e){this._processManager=e,e.on("ws-frame",t=>{this._handleWorkerWsFrame(t)})}register(e,t,n="0.0.0.0"){var s,r;this.registry.set(t,{server:e,port:t,hostname:n});const o=this.serverUrl(t);this.emit("server-ready",t,o),(r=(s=this.opts).onServerReady)==null||r.call(s,t,o),this.notifySW("server-registered",{port:t,hostname:n})}unregister(e){this.registry.delete(e),this.notifySW("server-unregistered",{port:e})}setPreviewScript(e){this._previewScript=e,this._sendPreviewScriptToSW()}setWatermark(e){var t;typeof navigator<"u"&&((t=navigator.serviceWorker)!=null&&t.controller)&&navigator.serviceWorker.controller.postMessage({type:"set-watermark",enabled:e,token:this._swAuthToken})}_sendPreviewScriptToSW(){var e;typeof navigator<"u"&&((e=navigator.serviceWorker)!=null&&e.controller)&&navigator.serviceWorker.controller.postMessage({type:"set-preview-script",script:this._previewScript,token:this._swAuthToken})}_sendWsTokenToSW(){var e;typeof navigator<"u"&&((e=navigator.serviceWorker)!=null&&e.controller)&&navigator.serviceWorker.controller.postMessage({type:"set-ws-token",wsToken:this._wsBridgeToken,token:this._swAuthToken})}serverUrl(e){return`${this.baseUrl}/__virtual__/${e}`}activePorts(){return[...this.registry.keys()]}async handleRequest(e,t,n,s,r){const o=this.registry.get(e);if(!o)return{statusCode:503,statusMessage:"Service Unavailable",headers:{"Content-Type":"text/plain"},body:z.from(`No server on port ${e}`)};try{const c=r?z.from(new Uint8Array(r)):void 0;return await o.server.dispatchRequest(t,n,s,c)}catch(c){return{statusCode:500,statusMessage:"Internal Server Error",headers:{"Content-Type":"text/plain"},body:z.from(c instanceof Error?c.message:"Internal Server Error")}}}async initServiceWorker(e){if(!("serviceWorker"in navigator))throw new Error("Service Workers not supported");const t=(e==null?void 0:e.swUrl)??"/__sw__.js",n=await navigator.serviceWorker.getRegistrations();for(const p of n)await p.unregister();await new Promise(p=>setTimeout(p,100));const s=new Promise(p=>{navigator.serviceWorker.addEventListener("controllerchange",()=>p(),{once:!0})}),r=`${t}?v=${Date.now()}`,o=await navigator.serviceWorker.register(r,{scope:"/",updateViaCache:"none"}),c=o.installing||o.waiting||o.active;if(!c)throw new Error("Service Worker registration failed");await new Promise(p=>{if(c.state==="activated")return p();const y=()=>{c.state==="activated"&&(c.removeEventListener("statechange",y),p())};c.addEventListener("statechange",y)}),this._swAuthToken=crypto.randomUUID(),this.channel=new MessageChannel,this.channel.port1.onmessage=this.onSWMessage.bind(this),c.postMessage({type:"init",port:this.channel.port2,token:this._swAuthToken},[this.channel.port2]),await s;const d=()=>{navigator.serviceWorker.controller&&(this.channel=new MessageChannel,this.channel.port1.onmessage=this.onSWMessage.bind(this),navigator.serviceWorker.controller.postMessage({type:"init",port:this.channel.port2,token:this._swAuthToken},[this.channel.port2]),this._previewScript!==null&&this._sendPreviewScriptToSW(),this._wsBridgeToken&&this._sendWsTokenToSW())};navigator.serviceWorker.addEventListener("controllerchange",d),navigator.serviceWorker.addEventListener("message",p=>{var y;((y=p.data)==null?void 0:y.type)==="sw-needs-init"&&d()}),this.heartbeat=setInterval(()=>{var p;(p=this.channel)==null||p.port1.postMessage({type:"keepalive"})},As.SW_HEARTBEAT),this.swReady=!0,this.emit("sw-ready"),this._startWsBridge()}_normalizeSwUrl(e,t){const n=e.match(/^\/__preview__\/\d+(.*)?$/);if(n){let s=n[1]||"/";s[0]!=="/"&&(s="/"+s);const r=e.indexOf("?");return r>=0&&!s.includes("?")&&(s+=e.slice(r)),s}return e}async onSWMessage(e){var t,n,s,r;const{type:o,id:c,data:d}=e.data;if(pd.DEBUG&&console.log("[RequestProxy] SW:",o,c,d==null?void 0:d.url),o==="request"){const{port:p,method:y,headers:g,body:x,streaming:k,originalUrl:C}=d;let T=d.url;const L=this._normalizeSwUrl(T,g);L!==null&&L!==T&&(T=L);try{if(k)await this.handleStreaming(c,p,y,T,g,x);else{const V=await this.handleRequest(p,y,T,g,x);if(V.statusCode===404&&C)try{const J=new URL(C);if(!(J.hostname==="localhost"||J.hostname==="127.0.0.1"||J.hostname==="0.0.0.0")){const G=await fetch(C),$=await G.arrayBuffer(),te={};G.headers.forEach((D,F)=>{te[F]=D});const I=$.byteLength>0?h(new Uint8Array($)):"";(t=this.channel)==null||t.port1.postMessage({type:"response",id:c,data:{statusCode:G.status,statusMessage:G.statusText||"OK",headers:te,bodyBase64:I}});return}}catch{}let K="";if((n=V.body)!=null&&n.length){const J=V.body instanceof Uint8Array?V.body:new Uint8Array(0);K=h(J)}(s=this.channel)==null||s.port1.postMessage({type:"response",id:c,data:{statusCode:V.statusCode,statusMessage:V.statusMessage,headers:V.headers,bodyBase64:K}})}}catch(V){(r=this.channel)==null||r.port1.postMessage({type:"response",id:c,error:V instanceof Error?V.message:"Unknown error"})}}}async handleStreaming(e,t,n,s,r,o){var c,d,p,y,g,x;const k=this.registry.get(t);if(!k){(c=this.channel)==null||c.port1.postMessage({type:"stream-start",id:e,data:{statusCode:503,statusMessage:"Service Unavailable",headers:{}}}),(d=this.channel)==null||d.port1.postMessage({type:"stream-end",id:e});return}const C=k.server;if(typeof C.handleStreamingRequest=="function"){const T=o?z.from(new Uint8Array(o)):void 0;await C.handleStreamingRequest(n,s,r,T,(L,V,K)=>{var J;(J=this.channel)==null||J.port1.postMessage({type:"stream-start",id:e,data:{statusCode:L,statusMessage:V,headers:K}})},L=>{var V;const K=typeof L=="string"?qA.encode(L):L;(V=this.channel)==null||V.port1.postMessage({type:"stream-chunk",id:e,data:{chunkBase64:h(K)}})},()=>{var L;(L=this.channel)==null||L.port1.postMessage({type:"stream-end",id:e})})}else{const T=o?z.from(new Uint8Array(o)):void 0,L=await k.server.dispatchRequest(n,s,r,T);if((p=this.channel)==null||p.port1.postMessage({type:"stream-start",id:e,data:{statusCode:L.statusCode,statusMessage:L.statusMessage,headers:L.headers}}),(y=L.body)!=null&&y.length){const V=L.body instanceof Uint8Array?L.body:new Uint8Array(0);(g=this.channel)==null||g.port1.postMessage({type:"stream-chunk",id:e,data:{chunkBase64:h(V)}})}(x=this.channel)==null||x.port1.postMessage({type:"stream-end",id:e})}}_startWsBridge(){typeof BroadcastChannel>"u"||this._wsBridge||(this._wsBridgeToken=crypto.randomUUID(),this._wsBridge=new BroadcastChannel("nodepod-ws"),this._wsBridge.onmessage=e=>{const t=e.data;!t||!t.kind||this._wsBridgeToken&&t.token!==this._wsBridgeToken||(t.kind==="ws-connect"?this._handleWsConnect(t.uid,t.port,t.path,t.protocols):t.kind==="ws-send"?this._handleWsSend(t.uid,t.data,t.type):t.kind==="ws-close"&&this._handleWsClose(t.uid,t.code,t.reason))},this._sendWsTokenToSW())}_handleWsConnect(e,t,n,s){var r;const o=wi(t),d={upgrade:"websocket",connection:"Upgrade","sec-websocket-key":btoa(String.fromCharCode(...crypto.getRandomValues(new Uint8Array(16)))),"sec-websocket-version":"13",host:`localhost:${t}`};if(s&&(d["sec-websocket-protocol"]=s),!o){if(this._processManager){const C=this._processManager.dispatchWsUpgrade(t,e,n||"/",d);if(C>=0){this._workerWsConns.set(e,{pid:C});return}}(r=this._wsBridge)==null||r.postMessage({kind:"ws-error",uid:e,message:`No server on port ${t}`,token:this._wsBridgeToken});return}const{socket:p}=o.dispatchUpgrade(n||"/",d),y=this._wsBridge;let g=new Uint8Array(0),x=!1;p.write=(C,T,L)=>{const V=typeof C=="string"?z.from(C):new Uint8Array(C),K=typeof T=="function"?T:L;if(!x&&new TextDecoder().decode(V).startsWith("HTTP/1.1 101"))return x=!0,y.postMessage({kind:"ws-open",uid:e,token:this._wsBridgeToken}),K&&queueMicrotask(()=>K(null)),!0;const J=new Uint8Array(g.length+V.length);for(J.set(g,0),J.set(V,g.length),g=J;g.length>=2;){const X=Ei(g);if(!X)break;switch(g=g.slice(X.consumed),X.op){case oe.TEXT:{const G=new TextDecoder().decode(X.data);y.postMessage({kind:"ws-message",uid:e,data:G,type:"text",token:this._wsBridgeToken});break}case oe.BINARY:y.postMessage({kind:"ws-message",uid:e,data:Array.from(X.data),type:"binary",token:this._wsBridgeToken});break;case oe.CLOSE:{const G=X.data.length>=2?X.data[0]<<8|X.data[1]:1e3;y.postMessage({kind:"ws-closed",uid:e,code:G,token:this._wsBridgeToken});break}case oe.PING:p._feedData(z.from(wn(oe.PONG,X.data,!0)));break}}return K&&queueMicrotask(()=>K(null)),!0};const k=()=>{g=new Uint8Array(0);try{p.destroy()}catch{}};this._wsConns.set(e,{socket:p,cleanup:k})}_handleWorkerWsFrame(e){const t=this._wsBridge;if(!t)return;const n=e.uid;switch(e.kind){case"open":t.postMessage({kind:"ws-open",uid:n,token:this._wsBridgeToken});break;case"text":t.postMessage({kind:"ws-message",uid:n,data:e.data,type:"text",token:this._wsBridgeToken});break;case"binary":t.postMessage({kind:"ws-message",uid:n,data:e.bytes,type:"binary",token:this._wsBridgeToken});break;case"close":t.postMessage({kind:"ws-closed",uid:n,code:e.code||1e3,token:this._wsBridgeToken}),this._workerWsConns.delete(n);break;case"error":t.postMessage({kind:"ws-error",uid:n,message:e.message,token:this._wsBridgeToken}),this._workerWsConns.delete(n);break}}_handleWsSend(e,t,n){const s=this._workerWsConns.get(e);if(s&&this._processManager){let p,y;n==="binary"&&Array.isArray(t)?(p=new Uint8Array(t),y=oe.BINARY):(p=new TextEncoder().encode(String(t)),y=oe.TEXT);const g=wn(y,p,!0);this._processManager.dispatchWsData(s.pid,e,Array.from(new Uint8Array(g)));return}const r=this._wsConns.get(e);if(!r)return;let o,c;n==="binary"&&Array.isArray(t)?(o=new Uint8Array(t),c=oe.BINARY):(o=new TextEncoder().encode(String(t)),c=oe.TEXT);const d=wn(c,o,!0);r.socket._feedData(z.from(d))}_handleWsClose(e,t,n){const s=this._workerWsConns.get(e);if(s&&this._processManager){this._processManager.dispatchWsClose(s.pid,e,t??1e3),this._workerWsConns.delete(e);return}const r=this._wsConns.get(e);if(!r)return;const o=new Uint8Array(2);o[0]=(t??1e3)>>8&255,o[1]=(t??1e3)&255;const c=wn(oe.CLOSE,o,!0);try{r.socket._feedData(z.from(c))}catch{}r.cleanup(),this._wsConns.delete(e)}notifySW(e,t){this.swReady&&this.channel&&this.channel.port1.postMessage({type:e,data:t})}createFetchHandler(){return async e=>{const t=new URL(e.url),n=t.pathname.match(/^\/__virtual__\/(\d+)(\/.*)?$/);if(!n)throw new Error("Not a virtual server request");const s=parseInt(n[1],10),r=n[2]||"/",o={};e.headers.forEach((y,g)=>{o[g]=y});let c;e.method!=="GET"&&e.method!=="HEAD"&&(c=await e.arrayBuffer());const d=await this.handleRequest(s,e.method,r+t.search,o,c);let p=null;return d.body instanceof Uint8Array?p=new Uint8Array(d.body.buffer,d.body.byteOffset,d.body.byteLength):typeof d.body=="string"&&(p=d.body),new Response(p,{status:d.statusCode,statusText:d.statusMessage,headers:d.headers})}}},W(i,"DEBUG",!1),i);let Uu=null;j0=function(e){return Uu||(Uu=new pd(e)),Uu},G0=class{constructor(e){this._vol=e}async writeFile(e,t){const n=e.substring(0,e.lastIndexOf("/"))||"/";n!=="/"&&!this._vol.existsSync(n)&&this._vol.mkdirSync(n,{recursive:!0}),this._vol.writeFileSync(e,t)}async readFile(e,t){return t?this._vol.readFileSync(e,"utf8"):this._vol.readFileSync(e)}async mkdir(e,t){this._vol.mkdirSync(e,t)}async readdir(e){return this._vol.readdirSync(e)}async exists(e){return this._vol.existsSync(e)}async stat(e){const t=this._vol.statSync(e);return{isFile:t.isFile(),isDirectory:t.isDirectory(),size:t.size,mtime:t.mtimeMs??Date.now()}}async unlink(e){this._vol.unlinkSync(e)}async rmdir(e,t){t!=null&&t.recursive?this._removeRecursive(e):this._vol.rmdirSync(e)}async rename(e,t){this._vol.renameSync(e,t)}watch(e,t,n){return typeof t=="function"?this._vol.watch(e,t):this._vol.watch(e,t??{},n)}get volume(){return this._vol}_removeRecursive(e){for(const t of this._vol.readdirSync(e)){const n=`${e}/${t}`;this._vol.statSync(n).isDirectory()?this._removeRecursive(n):this._vol.unlinkSync(n)}this._vol.rmdirSync(e)}},K0=class extends ne{constructor(e=4194304){super(),W(this,"_abortController",new AbortController),W(this,"_resolve"),W(this,"_stdout",""),W(this,"_stderr",""),W(this,"_exitCode",null),W(this,"_sendStdinFn",null),W(this,"_killFn",null),W(this,"_maxOutputBytes"),W(this,"completion"),this._maxOutputBytes=e,this.completion=new Promise(t=>{this._resolve=t})}_setSendStdin(e){this._sendStdinFn=e}_setKillFn(e){this._killFn=e}_pushStdout(e){this._stdout+=e,this._stdout.length>this._maxOutputBytes&&(this._stdout=this._stdout.slice(-Math.floor(this._maxOutputBytes*.75))),this.emit("output",e)}_pushStderr(e){this._stderr+=e,this._stderr.length>this._maxOutputBytes&&(this._stderr=this._stderr.slice(-Math.floor(this._maxOutputBytes*.75))),this.emit("error",e)}_finish(e){this._exitCode===null&&(this._exitCode=e,this.emit("exit",e),this._resolve({stdout:this._stdout,stderr:this._stderr,exitCode:e}))}get signal(){return this._abortController.signal}get exited(){return this._exitCode!==null}write(e){this._sendStdinFn&&this._sendStdinFn(e)}kill(){this._abortController.abort(),this._killFn&&this._killFn()}on(e,t){return super.on(e,t)}};const GA={background:"#0d1117",foreground:"#c9d1d9",cursor:"#58a6ff",selectionBackground:"#264f78",black:"#0d1117",red:"#f85149",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#c9d1d9",brightBlack:"#8b949e",brightRed:"#f85149",brightGreen:"#3fb950",brightYellow:"#d29922",brightBlue:"#58a6ff",brightMagenta:"#bc8cff",brightCyan:"#39c5cf",brightWhite:"#ffffff"},KA=e=>`\x1B[36mnodepod\x1B[0m:\x1B[34m${e}\x1B[0m$ `;Y0=class{constructor(e){W(this,"_term",null),W(this,"_fitAddon",null),W(this,"_dataDisposable",null),W(this,"_resizeHandler",null),W(this,"_lineBuffer",""),W(this,"_history",[]),W(this,"_historyIndex",-1),W(this,"_savedLine",""),W(this,"_running",!1),W(this,"_cwd","/"),W(this,"_promptFn"),W(this,"_theme"),W(this,"_opts"),W(this,"_wiring",null),this._opts=e,this._theme=e.theme??GA,this._promptFn=e.prompt??KA}_wireExecution(e){this._wiring=e}_setRunning(e){this._running=e}_writePrompt(){var e;(e=this._term)==null||e.write(this._promptFn(this._cwd))}_getCols(){var e;return((e=this._term)==null?void 0:e.cols)??80}_getRows(){var e;return((e=this._term)==null?void 0:e.rows)??24}_writeOutput(e,t=!1){if(!this._term)return;const n=e.replace(/\r?\n/g,`\r
46653
- `);t?this._term.write("\x1B[31m"+n+"\x1B[0m"):this._term.write(n)}attach(e){const t=typeof e=="string"?document.querySelector(e):e;if(!t)throw new Error(`Terminal target not found: ${e}`);const n=this._opts.Terminal;if(this._term=new n({cursorBlink:!0,fontSize:this._opts.fontSize??ge.FONT_SIZE,fontFamily:this._opts.fontFamily??'"Cascadia Code", "Fira Code", "Consolas", "Monaco", monospace',theme:this._theme}),this._opts.FitAddon&&(this._fitAddon=new this._opts.FitAddon,this._term.loadAddon(this._fitAddon)),this._term.open(t),this._opts.WebglAddon)try{this._term.loadAddon(new this._opts.WebglAddon)}catch{}if(this._fitAddon){const s=this._fitAddon;requestAnimationFrame(()=>{s.fit(),setTimeout(()=>s.fit(),100)}),this._resizeHandler=()=>{var r;return(r=this._fitAddon)==null?void 0:r.fit()},window.addEventListener("resize",this._resizeHandler)}this._dataDisposable=this._term.onData(s=>this._handleInput(s)),this._term.focus()}detach(){this._dataDisposable&&(this._dataDisposable.dispose(),this._dataDisposable=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._term&&(this._term.dispose(),this._term=null),this._fitAddon=null}clear(){this._term&&(this._term.clear(),this._running||this._term.write(this._promptFn(this._cwd)))}input(e){if(this._term)for(const t of e)this._handleInput(t)}setTheme(e){this._theme={...this._theme,...e},this._term&&(this._term.options.theme=this._theme)}fit(){var e;(e=this._fitAddon)==null||e.fit()}write(e){var t;(t=this._term)==null||t.write(e)}writeln(e){var t;(t=this._term)==null||t.writeln(e)}showPrompt(){var e;(e=this._term)==null||e.write(this._promptFn(this._cwd))}setCwd(e){this._cwd=e}getCwd(){return this._cwd}get xterm(){return this._term}_handleInput(e){var t,n,s;if(this._term){if(this._running){if(e.includes("")){const c=(t=this._wiring)==null?void 0:t.getActiveAbort();c&&c.abort(),this._term.write(`^C\r
46654
- `),this._running=!1,this._writePrompt();return}const r=((n=this._wiring)==null?void 0:n.getIsStdinRaw())??!1,o=(s=this._wiring)==null?void 0:s.getSendStdin();if(r&&o)o(e);else if(o)for(let c=0;c<e.length;c++){const d=e[c],p=d.charCodeAt(0);if(d==="\r"||d===`
46647
+ `;let rs=null;function Hw(){try{if(!rs){const e=new Blob([jw],{type:"application/javascript"});rs=URL.createObjectURL(e)}return new Worker(rs)}catch{return null}}function Ww(){rs&&(URL.revokeObjectURL(rs),rs=null)}class Vw{constructor(n={}){T(this,"workers",[]),T(this,"waitQueue",[]),T(this,"nextId",0),T(this,"config"),T(this,"idleTimer",null),T(this,"disposed",!1),T(this,"broken",!1);const t=typeof navigator<"u"&&navigator.hardwareConcurrency||4;this.config={minWorkers:n.minWorkers??1,maxWorkers:n.maxWorkers??Math.min(t,mt.MAX_WORKERS_CAP),idleTimeoutMs:n.idleTimeoutMs??qt.WORKER_IDLE_TIMEOUT,warmUpOnCreate:n.warmUpOnCreate??!0},this.idleTimer=setInterval(()=>this.reapIdle(),qt.WORKER_REAP_INTERVAL)}async acquire(){if(this.disposed)throw new Error("WorkerPool is disposed");if(this.broken)throw new Error("WorkerPool is broken — Workers unavailable");const n=this.workers.find(t=>!t.busy&&t.initialized);if(n)return n.busy=!0,n.lastUsed=Date.now(),{worker:n,release:()=>this.release(n)};if(this.workers.length<this.config.maxWorkers){const t=this.tryCreateWorker();if(!t)throw this.broken=!0,this.rejectAllWaiters(),new Error("WorkerPool is broken — Worker construction failed");if(t.busy=!0,!t.initialized&&t.initPromise)try{await t.initPromise}catch(r){throw this.terminateWorker(t),this.broken=!0,this.rejectAllWaiters(),new Error(`WorkerPool is broken — Worker init failed: ${r instanceof Error?r.message:r}`)}return t.lastUsed=Date.now(),{worker:t,release:()=>this.release(t)}}return new Promise((t,r)=>{this.waitQueue.push({resolve:t,reject:r})})}dispose(){this.disposed=!0,this.idleTimer&&(clearInterval(this.idleTimer),this.idleTimer=null);for(const n of[...this.workers])this.terminateWorker(n);this.rejectAllWaiters(),Ww()}stats(){return{total:this.workers.length,busy:this.workers.filter(n=>n.busy).length,idle:this.workers.filter(n=>!n.busy).length,initialized:this.workers.filter(n=>n.initialized).length}}rejectAllWaiters(){for(const n of this.waitQueue)n.reject(new Error("WorkerPool is no longer available"));this.waitQueue.length=0}release(n){if(n.busy=!1,n.lastUsed=Date.now(),this.waitQueue.length>0){const t=this.waitQueue.shift();n.busy=!0,n.lastUsed=Date.now(),t.resolve({worker:n,release:()=>this.release(n)})}}tryCreateWorker(){const n=Hw();if(!n)return null;try{const t=__(n),r=this.nextId++,s={thread:n,endpoint:t,busy:!1,initialized:!1,initPromise:null,lastUsed:Date.now(),id:r};if(this.config.warmUpOnCreate){const i=qt.WORKER_INIT_TIMEOUT,a=t.init(),o=new Promise((l,u)=>setTimeout(()=>u(new Error("Worker init timed out")),i));s.initPromise=Promise.race([a,o]).then(()=>{s.initialized=!0,s.initPromise=null}).catch(l=>{throw this.terminateWorker(s),l})}return this.workers.push(s),s}catch{try{n.terminate()}catch{}return null}}reapIdle(){const n=Date.now(),t=this.workers.filter(i=>!i.busy&&i.initialized&&n-i.lastUsed>this.config.idleTimeoutMs),r=Math.max(0,this.workers.length-this.config.minWorkers),s=t.slice(0,r);for(const i of s)this.terminateWorker(i)}terminateWorker(n){const t=this.workers.indexOf(n);t>=0&&this.workers.splice(t,1);try{n.thread.terminate()}catch{}}}class qw{constructor(n){T(this,"queue",[]),T(this,"pool"),T(this,"dispatching",!1),this.pool=n}submit(n){return new Promise((t,r)=>{const s={task:n,resolve:t,reject:r,cancelled:!1},i=this.queue.findIndex(a=>a.task.priority>n.priority);i===-1?this.queue.push(s):this.queue.splice(i,0,s),this.dispatch()})}submitBatch(n){return Promise.all(n.map(t=>this.submit(t)))}cancel(n){const t=this.queue.findIndex(r=>r.task.id===n&&!r.cancelled);if(t>=0){const r=this.queue[t];return r.cancelled=!0,r.reject(new Error(`Task ${n} cancelled`)),this.queue.splice(t,1),!0}return!1}get pending(){return this.queue.length}async dispatch(){if(!this.dispatching){this.dispatching=!0;try{for(;this.queue.length>0;){const n=this.queue.shift();if(n.cancelled)continue;let t,r;try{const s=await this.pool.acquire();t=s.worker,r=s.release}catch(s){const i=s instanceof Error?s:new Error(String(s));n.reject(i),this.rejectAll(i);return}this.executeTask(t.endpoint,n).finally(()=>{r(),this.queue.length>0&&(this.dispatching=!1,this.dispatch())})}}finally{this.dispatching=!1}}}rejectAll(n){const t=this.queue.splice(0);for(const r of t)r.cancelled||r.reject(n)}async executeTask(n,t){if(!t.cancelled)try{let r;switch(t.task.type){case"transform":r=await n.transform(t.task);break;case"extract":r=await n.extract(t.task);break;case"build":r=await n.build(t.task);break;default:throw new Error(`Unknown task type: ${t.task.type}`)}t.cancelled||t.resolve(r)}catch(r){t.cancelled||t.reject(r instanceof Error?r:new Error(String(r)))}}}var Xl=(e=>(e[e.HIGH=0]="HIGH",e[e.NORMAL=1]="NORMAL",e[e.LOW=2]="LOW",e))(Xl||{});let oi=null,li=null,wa=!1,zw;function Gw(){return typeof Worker<"u"&&typeof Blob<"u"&&typeof URL<"u"&&typeof URL.createObjectURL=="function"}function Kw(){if(li)return li;if(!Gw())throw wa=!0,new Error("Workers not available");return oi=new Vw(zw),li=new qw(oi),li}async function Yw(e){const{convertFileDirect:n,prepareTransformer:t}=await Promise.resolve().then(()=>aS);await t();const r=await n(e.source,e.filePath);return{type:"transform",id:e.id,code:r,warnings:[]}}async function Zw(e){const n=await Promise.resolve().then(()=>dv),{parseTarArchive:t}=await Promise.resolve().then(()=>nS),{bytesToBase64:r}=await Promise.resolve().then(()=>V),s=await fetch(e.tarballUrl);if(!s.ok)throw new Error(`Archive download failed (HTTP ${s.status}): ${e.tarballUrl}`);const i=new Uint8Array(await s.arrayBuffer()),a=n.inflate(i),o=[];for(const l of t(a)){if(l.kind!=="file"||!l.payload)continue;let u=l.filepath;if(e.stripComponents>0){const h=u.split("/").filter(Boolean);if(h.length<=e.stripComponents)continue;u=h.slice(e.stripComponents).join("/")}let c,p=!1;try{c=new TextDecoder("utf-8",{fatal:!0}).decode(l.payload)}catch{c=r(l.payload),p=!0}o.push({path:u,data:c,isBinary:p})}return{type:"extract",id:e.id,files:o}}async function Xw(e){const n=await Promise.resolve().then(()=>Z_);try{const t=await n.build({entryPoints:e.entryPoints,stdin:e.stdin,bundle:e.bundle,format:e.format,platform:e.platform,target:e.target,minify:e.minify,external:e.external,write:!1,absWorkingDir:e.absWorkingDir});return{type:"build",id:e.id,outputFiles:(t.outputFiles||[]).map(r=>({path:r.path,text:r.text||new TextDecoder().decode(r.contents)})),errors:(t.errors||[]).map(r=>r.text||String(r)),warnings:(t.warnings||[]).map(r=>r.text||String(r))}}catch(t){return{type:"build",id:e.id,outputFiles:[],errors:[(t==null?void 0:t.message)||"build failed"],warnings:[]}}}function E_(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`task-${Date.now()}-${Math.random().toString(36).slice(2)}`}async function k_(e){if(wa)return C_(e);try{return await Kw().submit(e)}catch(n){return wa||console.debug("[offload] Falling back to main thread:",n instanceof Error?n.message:n),Jw(),C_(e)}}function Jw(){wa=!0,oi&&(oi.dispose(),oi=null),li=null}async function C_(e){switch(e.type){case"transform":return Yw(e);case"extract":return Zw(e);case"build":return Xw(e);default:throw new Error(`Unknown task type: ${e.type}`)}}function Sa(e,n,t){const r=e.slice(n,n+t),s=r.indexOf(0),i=s>=0?r.slice(0,s):r;return new TextDecoder().decode(i)}function A_(e,n,t){const r=Sa(e,n,t).trim();return parseInt(r,8)||0}function Qw(e){switch(e){case"0":case"\0":case"":return"file";case"5":return"directory";case"1":case"2":return"link";default:return"other"}}function*eS(e){let t=0;for(;t+512<=e.length;){const r=e.slice(t,t+512);if(t+=512,r.every(m=>m===0))break;const i=Sa(r,0,100);if(!i)continue;const a=A_(r,100,8),o=A_(r,124,12),l=String.fromCharCode(r[156]),u=Sa(r,157,100),c=Sa(r,345,155),p=c?`${c}/${i}`:i,h=Qw(l);let f;h==="file"&&(f=o>0?e.slice(t,t+o):new Uint8Array(0),o>0&&(t+=Math.ceil(o/512)*512)),yield{filepath:p,kind:h,byteSize:o,fileMode:a,payload:f,linkDestination:h==="link"?u:void 0}}}async function T_(e,n,t,r={}){var s,i;(s=r.onProgress)==null||s.call(r,`Fetching ${e}...`);const a=await k_({type:"extract",id:E_(),tarballUrl:e,stripComponents:r.stripComponents??1,priority:Xl.NORMAL,expectedShasum:r.expectedShasum}),o=[];for(const l of a.files){if(r.filter&&!r.filter(l.path))continue;const u=Ve(t,l.path),c=_r(u);n.mkdirSync(c,{recursive:!0}),l.isBinary?n.writeFileSync(u,j(l.data)):n.writeFileSync(u,l.data),o.push(u)}return(i=r.onProgress)==null||i.call(r,`Extracted ${o.length} files`),o}const nS=Object.freeze(Object.defineProperty({__proto__:null,downloadAndExtract:T_,parseTarArchive:eS},Symbol.toStringTag,{value:"Module"})),Jl=typeof window<"u";async function Ql(){if(Jl&&!window.__esbuildEngine)return window.__esbuildReady||(window.__esbuildReady=(async()=>{try{const e=await Ii(sd),n=e.default||e;try{await n.initialize({wasmURL:Co})}catch(t){if(!(t instanceof Error&&t.message.includes('Cannot call "initialize" more than once')))throw t}window.__esbuildEngine=n}catch(e){throw window.__esbuildReady=void 0,e}})()),window.__esbuildReady}function tS(e){return!!(/<[A-Z][a-zA-Z0-9.]*[\s/>]/.test(e)||/<\/[a-zA-Z]/.test(e)||/\/>/.test(e)||/<>|<\/>/.test(e)||/React\.createElement\b/.test(e)||/jsx\(|jsxs\(|jsxDEV\(/.test(e))}function I_(e,n){return e.endsWith(".jsx")?"jsx":e.endsWith(".ts")?"ts":e.endsWith(".tsx")?"tsx":e.endsWith(".mjs")?"js":tS(n)?"jsx":"js"}async function R_(e,n){if(!Jl)return e;let r=(await k_({type:"transform",id:E_(),source:e,filePath:n,options:{loader:I_(n,e),format:"cjs",target:"esnext",platform:"neutral",define:{"import.meta.url":"import_meta.url","import.meta.dirname":"import_meta.dirname","import.meta.filename":"import_meta.filename","import.meta":"import_meta"}},priority:Xl.NORMAL})).code;r=r.replace(/\bimport\s*\(\s*["']node:([^"']+)["']\s*\)/g,'Promise.resolve(require("node:$1"))');const s=["assert","buffer","child_process","cluster","crypto","dgram","dns","events","fs","http","http2","https","net","os","path","perf_hooks","querystring","readline","stream","string_decoder","timers","tls","url","util","v8","vm","worker_threads","zlib","async_hooks","inspector","module"];for(const i of s){const a=new RegExp(`\\bimport\\s*\\(\\s*["']${i}["']\\s*\\)`,"g");r=r.replace(a,`Promise.resolve(require("${i}"))`)}return r}async function rS(e,n){if(!Jl)return e;window.__esbuildEngine||await Ql();const t=window.__esbuildEngine;if(!t)throw new Error("esbuild engine not available");const r=I_(n,e);try{return(await t.transform(e,{loader:r,format:"cjs",target:"esnext",platform:"neutral",define:{"import.meta.url":"import_meta.url","import.meta.dirname":"import_meta.dirname","import.meta.filename":"import_meta.filename","import.meta":"import_meta"}})).code}catch(s){const i=s instanceof Error?s.message:String(s);if(r==="js"||r==="jsx"){const a=r==="js"?["jsx","tsx","ts"]:["tsx"];for(const o of a)try{return(await t.transform(e,{loader:o,format:"cjs",target:"esnext",platform:"neutral",define:{"import.meta.url":"import_meta.url","import.meta.dirname":"import_meta.dirname","import.meta.filename":"import_meta.filename","import.meta":"import_meta"}})).code}catch{}}if(i.includes("Top-level await"))try{return(await t.transform(e,{loader:r,format:"esm",target:"esnext",platform:"neutral",define:{"import.meta.url":"import_meta.url","import.meta.dirname":"import_meta.dirname","import.meta.filename":"import_meta.filename","import.meta":"import_meta"}})).code}catch{return e}return e}}function sS(e,n){return e.endsWith(".mjs")||e.endsWith(".cjs")?!1:/\bimport\s+[\w{*'"]/m.test(n)||/\bexport\s+(?:default|const|let|var|function|class|{|\*)/m.test(n)||/\bimport\.meta\b/.test(n)}function ec(e){return/\bimport\s*\(\s*["']node:/.test(e)||/\bimport\s*\(\s*["'](fs|path|http|https|net|url|util|events|stream|os|crypto)["']/.test(e)}function nc(e){let n=e;n=n.replace(/\bimport\s*\(\s*["']node:([^"']+)["']\s*\)/g,'Promise.resolve(require("node:$1"))');const t=["assert","buffer","child_process","cluster","crypto","dgram","dns","events","fs","http","http2","https","net","os","path","perf_hooks","querystring","readline","stream","string_decoder","timers","tls","url","util","v8","vm","worker_threads","zlib","async_hooks","inspector","module"];for(const r of t)n=n.replace(new RegExp(`\\bimport\\s*\\(\\s*["']${r}["']\\s*\\)`,"g"),`Promise.resolve(require("${r}"))`);return n}function P_(e,n){const t=[];try{for(const r of e.readdirSync(n)){const s=n+"/"+r;try{e.statSync(s).isDirectory()?r!=="node_modules"&&t.push(...P_(e,s)):(r.endsWith(".js")||r.endsWith(".mjs")||r.endsWith(".jsx"))&&t.push(s)}catch{}}}catch{}return t}function iS(e,n){try{const t=n+"/package.json";if(e.existsSync(t)){const r=e.readFileSync(t,"utf8");return JSON.parse(r).type==="module"}}catch{}return!1}async function D_(e,n,t){let r=0;const s=P_(e,n);t==null||t(` Converting ${s.length} files in ${n}...`);const i=iS(e,n),a=50;for(let o=0;o<s.length;o+=a){const l=s.slice(o,o+a);await Promise.all(l.map(async u=>{try{const c=e.readFileSync(u,"utf8");if(i){ec(c)&&(e.writeFileSync(u,nc(c)),r++);return}if(u.endsWith(".mjs")){ec(c)&&(e.writeFileSync(u,nc(c)),r++);return}if(sS(u,c)){const p=await R_(c,u);e.writeFileSync(u,p),r++}else ec(c)&&(e.writeFileSync(u,nc(c)),r++)}catch{}}))}return r}const aS=Object.freeze(Object.defineProperty({__proto__:null,convertFile:R_,convertFileDirect:rS,convertPackage:D_,prepareTransformer:Ql},Symbol.toStringTag,{value:"Module"}));function oS(e,n){return n?typeof n=="string"?{[e.includes("/")?e.split("/").pop():e]:n}:n:{}}function O_(e){if(e.startsWith("@")){const t=e.indexOf("/");if(t===-1)throw new Error(`Malformed package specifier: ${e}`);const r=e.slice(t+1),s=r.indexOf("@");return s===-1?{name:e}:{name:e.slice(0,t+1+s),version:r.slice(s+1)}}const n=e.indexOf("@");return n===-1?{name:e}:{name:e.slice(0,n),version:e.slice(n+1)}}let N_=!1;Ca=class{constructor(e,n={}){T(this,"vol"),T(this,"registryClient"),T(this,"workingDir"),T(this,"_snapshotCache"),this.vol=e,this.registryClient=new ts(n),this.workingDir=n.cwd||"/",this._snapshotCache=n.snapshotCache??null}async install(e,n,t={}){const{onProgress:r}=t,s=O_(e),i=s.name,a=n||s.version||"latest";r==null||r(`Resolving ${i}@${a}...`);const o={registry:this.registryClient,devDependencies:t.withDevDeps,optionalDependencies:t.withOptionalDeps,onProgress:r},l=await $w(i,a,o),u=await this.materializePackages(l,t);if(t.persist||t.persistDev){const c=l.get(i);c&&await this.patchManifest(i,`^${c.version}`,!!t.persistDev)}return r==null||r(`Installed ${l.size} package(s)`),{resolved:l,newPackages:u}}async installFromManifest(e,n={}){const{onProgress:t}=n,r=e||Ve(this.workingDir,"package.json");if(!this.vol.existsSync(r))throw new Error(`Manifest not found at ${r}`);const s=this.vol.readFileSync(r,"utf8"),i=JSON.parse(s),a=this._snapshotCache?Pa(s):null;if(this._snapshotCache&&a)try{const c=await this._snapshotCache.get(a);if(c){t==null||t("Restoring cached node_modules...");const{entries:p}=c;for(const h of p)if(h.path.includes("/node_modules/")){if(h.kind==="directory")this.vol.existsSync(h.path)||this.vol.mkdirSync(h.path,{recursive:!0});else if(h.kind==="file"&&h.data){const f=h.path.substring(0,h.path.lastIndexOf("/"))||"/";f!=="/"&&!this.vol.existsSync(f)&&this.vol.mkdirSync(f,{recursive:!0}),this.vol.writeFileSync(h.path,j(h.data))}}return t==null||t(`Restored ${p.length} cached entries`),{resolved:new Map,newPackages:[]}}}catch{}t==null||t("Resolving dependency tree...");const o={registry:this.registryClient,devDependencies:n.withDevDeps,optionalDependencies:n.withOptionalDeps,onProgress:t},l=await Uw(i,o),u=await this.materializePackages(l,n);if(this._snapshotCache&&a&&u.length>0)try{const p={entries:this.vol.toSnapshot().entries.filter(h=>h.path.includes("/node_modules/"))};await this._snapshotCache.set(a,p)}catch{}return t==null||t(`Installed ${l.size} package(s)`),{resolved:l,newPackages:u}}listInstalled(){const e=Ve(this.workingDir,"node_modules");if(!this.vol.existsSync(e))return{};const n={},t=this.vol.readdirSync(e);for(const r of t)if(!r.startsWith("."))if(r.startsWith("@")){const s=Ve(e,r),i=this.vol.readdirSync(s);for(const a of i){const o=Ve(s,a,"package.json");if(this.vol.existsSync(o)){const l=JSON.parse(this.vol.readFileSync(o,"utf8"));n[`${r}/${a}`]=l.version}}}else{const s=Ve(e,r,"package.json");if(this.vol.existsSync(s)){const i=JSON.parse(this.vol.readFileSync(s,"utf8"));n[r]=i.version}}return n}async materializePackages(e,n){const{onProgress:t}=n,r=[],s=Ve(this.workingDir,"node_modules");this.vol.mkdirSync(s,{recursive:!0});const i=[];for(const[l,u]of e){const c=Ve(s,l),p=Ve(c,"package.json");if(this.vol.existsSync(p))try{if(JSON.parse(this.vol.readFileSync(p,"utf8")).version===u.version){t==null||t(`Skipping ${l}@${u.version} (up to date)`);continue}}catch{}i.push({depName:l,dep:u,targetDir:c})}const a=n.transformModules!==!1;a&&!N_&&(typeof Worker>"u"&&(t==null||t("Preparing module transformer..."),await Ql()),N_=!0);const o=12;t==null||t(`Downloading ${i.length} package(s)...`);for(let l=0;l<i.length;l+=o){const u=i.slice(l,l+o);await Promise.all(u.map(async({depName:c,dep:p,targetDir:h})=>{if(t==null||t(` Fetching ${c}@${p.version}...`),await T_(p.tarballUrl,this.vol,h,{stripComponents:1,expectedShasum:p.shasum}),a)try{const f=await D_(this.vol,h,t);f>0&&(t==null||t(` Transformed ${f} file(s) in ${c}`))}catch(f){t==null||t(` Warning: transformation failed for ${c}: ${f}`)}this.createBinStubs(s,c,h),r.push(c)}))}return this.writeLockFile(e),r}createBinStubs(e,n,t){try{const r=Ve(t,"package.json");if(!this.vol.existsSync(r))return;const s=JSON.parse(this.vol.readFileSync(r,"utf8")),i=oS(n,s.bin),a=Ve(e,".bin");for(const[o,l]of Object.entries(i)){this.vol.mkdirSync(a,{recursive:!0});const u=Ve(t,l);this.vol.writeFileSync(Ve(a,o),`node "${u}" "$@"
46648
+ `)}}catch{}}writeLockFile(e){const n={};for(const[r,s]of e)n[r]={version:s.version,resolved:s.tarballUrl};const t=Ve(this.workingDir,"node_modules",".package-lock.json");this.vol.writeFileSync(t,JSON.stringify(n,null,2))}async patchManifest(e,n,t){const r=Ve(this.workingDir,"package.json");let s={};this.vol.existsSync(r)&&(s=JSON.parse(this.vol.readFileSync(r,"utf8")));const i=t?"devDependencies":"dependencies";s[i]||(s[i]={}),s[i][e]=n,this.vol.writeFileSync(r,JSON.stringify(s,null,2))}},Q_=async function(e,n,t){return new Ca(n).install(e,void 0,t)},Object.freeze(Object.defineProperty({__proto__:null,DependencyInstaller:Ca,RegistryClient:ts,install:Q_,splitSpecifier:O_},Symbol.toStringTag,{value:"Module"}));const lS=new TextEncoder;lc=(x=class extends M{constructor(e={}){super(),T(this,"registry",new Map),T(this,"baseUrl"),T(this,"opts"),T(this,"channel",null),T(this,"swReady",!1),T(this,"heartbeat",null),T(this,"_processManager",null),T(this,"_workerWsConns",new Map),T(this,"_previewScript",null),T(this,"_swAuthToken",null),T(this,"_wsBridgeToken",null),T(this,"_wsBridge",null),T(this,"_wsConns",new Map),this.opts=e,this.baseUrl=typeof location<"u"?e.baseUrl||`${location.protocol}//${location.host}`:e.baseUrl||"http://localhost",gs((n,t)=>this.register(t,n)),_s(n=>this.unregister(n))}setProcessManager(e){this._processManager=e,e.on("ws-frame",n=>{this._handleWorkerWsFrame(n)})}register(e,n,t="0.0.0.0"){var r,s;this.registry.set(n,{server:e,port:n,hostname:t});const i=this.serverUrl(n);this.emit("server-ready",n,i),(s=(r=this.opts).onServerReady)==null||s.call(r,n,i),this.notifySW("server-registered",{port:n,hostname:t})}unregister(e){this.registry.delete(e),this.notifySW("server-unregistered",{port:e})}setPreviewScript(e){this._previewScript=e,this._sendPreviewScriptToSW()}setWatermark(e){var n;typeof navigator<"u"&&((n=navigator.serviceWorker)!=null&&n.controller)&&navigator.serviceWorker.controller.postMessage({type:"set-watermark",enabled:e,token:this._swAuthToken})}_sendPreviewScriptToSW(){var e;typeof navigator<"u"&&((e=navigator.serviceWorker)!=null&&e.controller)&&navigator.serviceWorker.controller.postMessage({type:"set-preview-script",script:this._previewScript,token:this._swAuthToken})}_sendWsTokenToSW(){var e;typeof navigator<"u"&&((e=navigator.serviceWorker)!=null&&e.controller)&&navigator.serviceWorker.controller.postMessage({type:"set-ws-token",wsToken:this._wsBridgeToken,token:this._swAuthToken})}serverUrl(e){return`${this.baseUrl}/__virtual__/${e}`}activePorts(){return[...this.registry.keys()]}async handleRequest(e,n,t,r,s){const i=this.registry.get(e);if(!i)return{statusCode:503,statusMessage:"Service Unavailable",headers:{"Content-Type":"text/plain"},body:I.from(`No server on port ${e}`)};try{const a=s?I.from(new Uint8Array(s)):void 0;return await i.server.dispatchRequest(n,t,r,a)}catch(a){return{statusCode:500,statusMessage:"Internal Server Error",headers:{"Content-Type":"text/plain"},body:I.from(a instanceof Error?a.message:"Internal Server Error")}}}async initServiceWorker(e){if(!("serviceWorker"in navigator))throw new Error("Service Workers not supported");const n=(e==null?void 0:e.swUrl)??"/__sw__.js",t=await navigator.serviceWorker.getRegistrations();for(const l of t)await l.unregister();await new Promise(l=>setTimeout(l,100));const r=new Promise(l=>{navigator.serviceWorker.addEventListener("controllerchange",()=>l(),{once:!0})}),s=`${n}?v=${Date.now()}`,i=await navigator.serviceWorker.register(s,{scope:"/",updateViaCache:"none"}),a=i.installing||i.waiting||i.active;if(!a)throw new Error("Service Worker registration failed");await new Promise(l=>{if(a.state==="activated")return l();const u=()=>{a.state==="activated"&&(a.removeEventListener("statechange",u),l())};a.addEventListener("statechange",u)}),this._swAuthToken=crypto.randomUUID(),this.channel=new MessageChannel,this.channel.port1.onmessage=this.onSWMessage.bind(this),a.postMessage({type:"init",port:this.channel.port2,token:this._swAuthToken},[this.channel.port2]),await r;const o=()=>{navigator.serviceWorker.controller&&(this.channel=new MessageChannel,this.channel.port1.onmessage=this.onSWMessage.bind(this),navigator.serviceWorker.controller.postMessage({type:"init",port:this.channel.port2,token:this._swAuthToken},[this.channel.port2]),this._previewScript!==null&&this._sendPreviewScriptToSW(),this._wsBridgeToken&&this._sendWsTokenToSW())};navigator.serviceWorker.addEventListener("controllerchange",o),navigator.serviceWorker.addEventListener("message",l=>{var u;((u=l.data)==null?void 0:u.type)==="sw-needs-init"&&o()}),this.heartbeat=setInterval(()=>{var l;(l=this.channel)==null||l.port1.postMessage({type:"keepalive"})},qt.SW_HEARTBEAT),this.swReady=!0,this.emit("sw-ready"),this._startWsBridge()}_normalizeSwUrl(e,n){const t=e.match(/^\/__preview__\/\d+(.*)?$/);if(t){let r=t[1]||"/";r[0]!=="/"&&(r="/"+r);const s=e.indexOf("?");return s>=0&&!r.includes("?")&&(r+=e.slice(s)),r}return e}async onSWMessage(e){var n,t,r,s;const{type:i,id:a,data:o}=e.data;if(lc.DEBUG&&console.log("[RequestProxy] SW:",i,a,o==null?void 0:o.url),i==="request"){const{port:l,method:u,headers:c,body:p,streaming:h,originalUrl:f}=o;let m=o.url;const v=this._normalizeSwUrl(m,c);v!==null&&v!==m&&(m=v);try{if(h)await this.handleStreaming(a,l,u,m,c,p);else{const k=await this.handleRequest(l,u,m,c,p);if(k.statusCode===404&&f)try{const N=new URL(f);if(!(N.hostname==="localhost"||N.hostname==="127.0.0.1"||N.hostname==="0.0.0.0")){const R=await fetch(f),S=await R.arrayBuffer(),F={};R.headers.forEach((_,w)=>{F[w]=_});const g=S.byteLength>0?B(new Uint8Array(S)):"";(n=this.channel)==null||n.port1.postMessage({type:"response",id:a,data:{statusCode:R.status,statusMessage:R.statusText||"OK",headers:F,bodyBase64:g}});return}}catch{}let P="";if((t=k.body)!=null&&t.length){const N=k.body instanceof Uint8Array?k.body:new Uint8Array(0);P=B(N)}(r=this.channel)==null||r.port1.postMessage({type:"response",id:a,data:{statusCode:k.statusCode,statusMessage:k.statusMessage,headers:k.headers,bodyBase64:P}})}}catch(k){(s=this.channel)==null||s.port1.postMessage({type:"response",id:a,error:k instanceof Error?k.message:"Unknown error"})}}}async handleStreaming(e,n,t,r,s,i){var a,o,l,u,c,p;const h=this.registry.get(n);if(!h){(a=this.channel)==null||a.port1.postMessage({type:"stream-start",id:e,data:{statusCode:503,statusMessage:"Service Unavailable",headers:{}}}),(o=this.channel)==null||o.port1.postMessage({type:"stream-end",id:e});return}const f=h.server;if(typeof f.handleStreamingRequest=="function"){const m=i?I.from(new Uint8Array(i)):void 0;await f.handleStreamingRequest(t,r,s,m,(v,k,P)=>{var N;(N=this.channel)==null||N.port1.postMessage({type:"stream-start",id:e,data:{statusCode:v,statusMessage:k,headers:P}})},v=>{var k;const P=typeof v=="string"?lS.encode(v):v;(k=this.channel)==null||k.port1.postMessage({type:"stream-chunk",id:e,data:{chunkBase64:B(P)}})},()=>{var v;(v=this.channel)==null||v.port1.postMessage({type:"stream-end",id:e})})}else{const m=i?I.from(new Uint8Array(i)):void 0,v=await h.server.dispatchRequest(t,r,s,m);if((l=this.channel)==null||l.port1.postMessage({type:"stream-start",id:e,data:{statusCode:v.statusCode,statusMessage:v.statusMessage,headers:v.headers}}),(u=v.body)!=null&&u.length){const k=v.body instanceof Uint8Array?v.body:new Uint8Array(0);(c=this.channel)==null||c.port1.postMessage({type:"stream-chunk",id:e,data:{chunkBase64:B(k)}})}(p=this.channel)==null||p.port1.postMessage({type:"stream-end",id:e})}}_startWsBridge(){typeof BroadcastChannel>"u"||this._wsBridge||(this._wsBridgeToken=crypto.randomUUID(),this._wsBridge=new BroadcastChannel("nodepod-ws"),this._wsBridge.onmessage=e=>{const n=e.data;!n||!n.kind||this._wsBridgeToken&&n.token!==this._wsBridgeToken||(n.kind==="ws-connect"?this._handleWsConnect(n.uid,n.port,n.path,n.protocols):n.kind==="ws-send"?this._handleWsSend(n.uid,n.data,n.type):n.kind==="ws-close"&&this._handleWsClose(n.uid,n.code,n.reason))},this._sendWsTokenToSW())}_handleWsConnect(e,n,t,r){var s;const i=ms(n),o={upgrade:"websocket",connection:"Upgrade","sec-websocket-key":btoa(String.fromCharCode(...crypto.getRandomValues(new Uint8Array(16)))),"sec-websocket-version":"13",host:`localhost:${n}`};if(r&&(o["sec-websocket-protocol"]=r),!i){if(this._processManager){const f=this._processManager.dispatchWsUpgrade(n,e,t||"/",o);if(f>=0){this._workerWsConns.set(e,{pid:f});return}}(s=this._wsBridge)==null||s.postMessage({kind:"ws-error",uid:e,message:`No server on port ${n}`,token:this._wsBridgeToken});return}const{socket:l}=i.dispatchUpgrade(t||"/",o),u=this._wsBridge;let c=new Uint8Array(0),p=!1;l.write=(f,m,v)=>{const k=typeof f=="string"?I.from(f):new Uint8Array(f),P=typeof m=="function"?m:v;if(!p&&new TextDecoder().decode(k).startsWith("HTTP/1.1 101"))return p=!0,u.postMessage({kind:"ws-open",uid:e,token:this._wsBridgeToken}),P&&queueMicrotask(()=>P(null)),!0;const N=new Uint8Array(c.length+k.length);for(N.set(c,0),N.set(k,c.length),c=N;c.length>=2;){const O=ys(c);if(!O)break;switch(c=c.slice(O.consumed),O.op){case an.TEXT:{const R=new TextDecoder().decode(O.data);u.postMessage({kind:"ws-message",uid:e,data:R,type:"text",token:this._wsBridgeToken});break}case an.BINARY:u.postMessage({kind:"ws-message",uid:e,data:Array.from(O.data),type:"binary",token:this._wsBridgeToken});break;case an.CLOSE:{const R=O.data.length>=2?O.data[0]<<8|O.data[1]:1e3;u.postMessage({kind:"ws-closed",uid:e,code:R,token:this._wsBridgeToken});break}case an.PING:l._feedData(I.from(Vn(an.PONG,O.data,!0)));break}}return P&&queueMicrotask(()=>P(null)),!0};const h=()=>{c=new Uint8Array(0);try{l.destroy()}catch{}};this._wsConns.set(e,{socket:l,cleanup:h})}_handleWorkerWsFrame(e){const n=this._wsBridge;if(!n)return;const t=e.uid;switch(e.kind){case"open":n.postMessage({kind:"ws-open",uid:t,token:this._wsBridgeToken});break;case"text":n.postMessage({kind:"ws-message",uid:t,data:e.data,type:"text",token:this._wsBridgeToken});break;case"binary":n.postMessage({kind:"ws-message",uid:t,data:e.bytes,type:"binary",token:this._wsBridgeToken});break;case"close":n.postMessage({kind:"ws-closed",uid:t,code:e.code||1e3,token:this._wsBridgeToken}),this._workerWsConns.delete(t);break;case"error":n.postMessage({kind:"ws-error",uid:t,message:e.message,token:this._wsBridgeToken}),this._workerWsConns.delete(t);break}}_handleWsSend(e,n,t){const r=this._workerWsConns.get(e);if(r&&this._processManager){let l,u;t==="binary"&&Array.isArray(n)?(l=new Uint8Array(n),u=an.BINARY):(l=new TextEncoder().encode(String(n)),u=an.TEXT);const c=Vn(u,l,!0);this._processManager.dispatchWsData(r.pid,e,Array.from(new Uint8Array(c)));return}const s=this._wsConns.get(e);if(!s)return;let i,a;t==="binary"&&Array.isArray(n)?(i=new Uint8Array(n),a=an.BINARY):(i=new TextEncoder().encode(String(n)),a=an.TEXT);const o=Vn(a,i,!0);s.socket._feedData(I.from(o))}_handleWsClose(e,n,t){const r=this._workerWsConns.get(e);if(r&&this._processManager){this._processManager.dispatchWsClose(r.pid,e,n??1e3),this._workerWsConns.delete(e);return}const s=this._wsConns.get(e);if(!s)return;const i=new Uint8Array(2);i[0]=(n??1e3)>>8&255,i[1]=(n??1e3)&255;const a=Vn(an.CLOSE,i,!0);try{s.socket._feedData(I.from(a))}catch{}s.cleanup(),this._wsConns.delete(e)}notifySW(e,n){this.swReady&&this.channel&&this.channel.port1.postMessage({type:e,data:n})}createFetchHandler(){return async e=>{const n=new URL(e.url),t=n.pathname.match(/^\/__virtual__\/(\d+)(\/.*)?$/);if(!t)throw new Error("Not a virtual server request");const r=parseInt(t[1],10),s=t[2]||"/",i={};e.headers.forEach((u,c)=>{i[c]=u});let a;e.method!=="GET"&&e.method!=="HEAD"&&(a=await e.arrayBuffer());const o=await this.handleRequest(r,e.method,s+n.search,i,a);let l=null;return o.body instanceof Uint8Array?l=new Uint8Array(o.body.buffer,o.body.byteOffset,o.body.byteLength):typeof o.body=="string"&&(l=o.body),new Response(l,{status:o.statusCode,statusText:o.statusMessage,headers:o.headers})}}},T(x,"DEBUG",!1),x);let tc=null;X_=function(e){return tc||(tc=new lc(e)),tc},ry=class{constructor(e){this._vol=e}async writeFile(e,n){const t=e.substring(0,e.lastIndexOf("/"))||"/";t!=="/"&&!this._vol.existsSync(t)&&this._vol.mkdirSync(t,{recursive:!0}),this._vol.writeFileSync(e,n)}async readFile(e,n){return n?this._vol.readFileSync(e,"utf8"):this._vol.readFileSync(e)}async mkdir(e,n){this._vol.mkdirSync(e,n)}async readdir(e){return this._vol.readdirSync(e)}async exists(e){return this._vol.existsSync(e)}async stat(e){const n=this._vol.statSync(e);return{isFile:n.isFile(),isDirectory:n.isDirectory(),size:n.size,mtime:n.mtimeMs??Date.now()}}async unlink(e){this._vol.unlinkSync(e)}async rmdir(e,n){n!=null&&n.recursive?this._removeRecursive(e):this._vol.rmdirSync(e)}async rename(e,n){this._vol.renameSync(e,n)}watch(e,n,t){return typeof n=="function"?this._vol.watch(e,n):this._vol.watch(e,n??{},t)}get volume(){return this._vol}_removeRecursive(e){for(const n of this._vol.readdirSync(e)){const t=`${e}/${n}`;this._vol.statSync(t).isDirectory()?this._removeRecursive(t):this._vol.unlinkSync(t)}this._vol.rmdirSync(e)}},sy=class extends M{constructor(e=4194304){super(),T(this,"_abortController",new AbortController),T(this,"_resolve"),T(this,"_stdout",""),T(this,"_stderr",""),T(this,"_exitCode",null),T(this,"_sendStdinFn",null),T(this,"_killFn",null),T(this,"_maxOutputBytes"),T(this,"completion"),this._maxOutputBytes=e,this.completion=new Promise(n=>{this._resolve=n})}_setSendStdin(e){this._sendStdinFn=e}_setKillFn(e){this._killFn=e}_pushStdout(e){this._stdout+=e,this._stdout.length>this._maxOutputBytes&&(this._stdout=this._stdout.slice(-Math.floor(this._maxOutputBytes*.75))),this.emit("output",e)}_pushStderr(e){this._stderr+=e,this._stderr.length>this._maxOutputBytes&&(this._stderr=this._stderr.slice(-Math.floor(this._maxOutputBytes*.75))),this.emit("error",e)}_finish(e){this._exitCode===null&&(this._exitCode=e,this.emit("exit",e),this._resolve({stdout:this._stdout,stderr:this._stderr,exitCode:e}))}get signal(){return this._abortController.signal}get exited(){return this._exitCode!==null}write(e){this._sendStdinFn&&this._sendStdinFn(e)}kill(){this._abortController.abort(),this._killFn&&this._killFn()}on(e,n){return super.on(e,n)}};const cS={background:"#0d1117",foreground:"#c9d1d9",cursor:"#58a6ff",selectionBackground:"#264f78",black:"#0d1117",red:"#f85149",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#c9d1d9",brightBlack:"#8b949e",brightRed:"#f85149",brightGreen:"#3fb950",brightYellow:"#d29922",brightBlue:"#58a6ff",brightMagenta:"#bc8cff",brightCyan:"#39c5cf",brightWhite:"#ffffff"},uS=e=>`\x1B[36mnodepod\x1B[0m:\x1B[34m${e}\x1B[0m$ `;iy=class{constructor(e){T(this,"_term",null),T(this,"_fitAddon",null),T(this,"_dataDisposable",null),T(this,"_resizeHandler",null),T(this,"_lineBuffer",""),T(this,"_history",[]),T(this,"_historyIndex",-1),T(this,"_savedLine",""),T(this,"_running",!1),T(this,"_cwd","/"),T(this,"_promptFn"),T(this,"_theme"),T(this,"_opts"),T(this,"_wiring",null),this._opts=e,this._theme=e.theme??cS,this._promptFn=e.prompt??uS}_wireExecution(e){this._wiring=e}_setRunning(e){this._running=e}_writePrompt(){var e;(e=this._term)==null||e.write(this._promptFn(this._cwd))}_getCols(){var e;return((e=this._term)==null?void 0:e.cols)??80}_getRows(){var e;return((e=this._term)==null?void 0:e.rows)??24}_writeOutput(e,n=!1){if(!this._term)return;const t=e.replace(/\r?\n/g,`\r
46649
+ `);n?this._term.write("\x1B[31m"+t+"\x1B[0m"):this._term.write(t)}attach(e){const n=typeof e=="string"?document.querySelector(e):e;if(!n)throw new Error(`Terminal target not found: ${e}`);const t=this._opts.Terminal;if(this._term=new t({cursorBlink:!0,fontSize:this._opts.fontSize??pn.FONT_SIZE,fontFamily:this._opts.fontFamily??'"Cascadia Code", "Fira Code", "Consolas", "Monaco", monospace',theme:this._theme}),this._opts.FitAddon&&(this._fitAddon=new this._opts.FitAddon,this._term.loadAddon(this._fitAddon)),this._term.open(n),this._opts.WebglAddon)try{this._term.loadAddon(new this._opts.WebglAddon)}catch{}if(this._fitAddon){const r=this._fitAddon;requestAnimationFrame(()=>{r.fit(),setTimeout(()=>r.fit(),100)}),this._resizeHandler=()=>{var s;return(s=this._fitAddon)==null?void 0:s.fit()},window.addEventListener("resize",this._resizeHandler)}this._dataDisposable=this._term.onData(r=>this._handleInput(r)),this._term.focus()}detach(){this._dataDisposable&&(this._dataDisposable.dispose(),this._dataDisposable=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._term&&(this._term.dispose(),this._term=null),this._fitAddon=null}clear(){this._term&&(this._term.clear(),this._running||this._term.write(this._promptFn(this._cwd)))}input(e){if(this._term)for(const n of e)this._handleInput(n)}setTheme(e){this._theme={...this._theme,...e},this._term&&(this._term.options.theme=this._theme)}fit(){var e;(e=this._fitAddon)==null||e.fit()}write(e){var n;(n=this._term)==null||n.write(e)}writeln(e){var n;(n=this._term)==null||n.writeln(e)}showPrompt(){var e;(e=this._term)==null||e.write(this._promptFn(this._cwd))}setCwd(e){this._cwd=e}getCwd(){return this._cwd}get xterm(){return this._term}_handleInput(e){var n,t,r;if(this._term){if(this._running){if(e.includes("")){const a=(n=this._wiring)==null?void 0:n.getActiveAbort();a&&a.abort(),this._term.write(`^C\r
46650
+ `),this._running=!1,this._writePrompt();return}const s=((t=this._wiring)==null?void 0:t.getIsStdinRaw())??!1,i=(r=this._wiring)==null?void 0:r.getSendStdin();if(s&&i)i(e);else if(i)for(let a=0;a<e.length;a++){const o=e[a],l=o.charCodeAt(0);if(o==="\r"||o===`
46655
46651
  `)this._term.write(`\r
46656
- `),o(`
46657
- `);else if(p===127||p===8)this._term.write("\b \b"),o("");else if(p>=32)this._term.write(d),o(d);else{o(e.slice(c));break}}return}for(let r=0;r<e.length;r++){const o=e[r],c=o.charCodeAt(0);if(o==="\r"||o===`
46658
- `){const d=this._lineBuffer;this._lineBuffer="",this._historyIndex=-1,this._executeCommand(d)}else if(c===127||c===8)this._lineBuffer.length>0&&(this._lineBuffer=this._lineBuffer.slice(0,-1),this._term.write("\b \b"));else if(c===3)this._lineBuffer="",this._term.write("^C"),this._writePrompt();else if(c===12)this._term.clear(),this._term.write(this._promptFn(this._cwd)+this._lineBuffer);else if(o==="\x1B"&&r+2<e.length&&e[r+1]==="["){const d=e[r+2];r+=2,d==="A"?this._historyUp():d==="B"&&this._historyDown()}else c>=32&&(this._lineBuffer+=o,this._term.write(o))}}}_historyUp(){if(this._history.length!==0){if(this._historyIndex===-1)this._savedLine=this._lineBuffer,this._historyIndex=this._history.length-1;else if(this._historyIndex>0)this._historyIndex--;else return;this._replaceLineWith(this._history[this._historyIndex])}}_historyDown(){this._historyIndex!==-1&&(this._historyIndex<this._history.length-1?(this._historyIndex++,this._replaceLineWith(this._history[this._historyIndex])):(this._historyIndex=-1,this._replaceLineWith(this._savedLine)))}_replaceLineWith(e){const t=this._promptFn(this._cwd);this._term.write("\r"+t+" ".repeat(this._lineBuffer.length)+"\r"+t),this._lineBuffer=e,this._term.write(e)}async _executeCommand(e){var t,n;if(!e.trim()){(t=this._term)==null||t.write(`\r
46659
- `+this._promptFn(this._cwd));return}this._history.push(e),this._historyIndex=-1,this._running=!0,(n=this._wiring)!=null&&n.onCommand?await this._wiring.onCommand(e):(this._running=!1,this._writePrompt())}};const YA=["registry.npmjs.org","github.com","raw.githubusercontent.com","api.github.com","objects.githubusercontent.com","esm.sh","unpkg.com","cdn.jsdelivr.net","localhost","127.0.0.1"];function Vv(e){e!==null&&[...YA,...e]}const ZA="nodepod-snapshots",ks="snapshots",XA=1,Hv=10080*60*1e3;function JA(){return typeof indexedDB>"u"?Promise.resolve(null):new Promise(e=>{try{const t=indexedDB.open(ZA,XA);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(ks)||n.createObjectStore(ks)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null)}catch{e(null)}})}function QA(e,t){return new Promise((n,s)=>{const c=e.transaction(ks,"readonly").objectStore(ks).get(t);c.onsuccess=()=>n(c.result??null),c.onerror=()=>s(c.error)})}function eT(e,t,n){return new Promise((s,r)=>{const o=e.transaction(ks,"readwrite");o.objectStore(ks).put(n,t),o.oncomplete=()=>s(),o.onerror=()=>r(o.error)})}function tT(e){try{const s=e.transaction(ks,"readwrite").objectStore(ks).openCursor(),r=Date.now();s.onsuccess=()=>{const o=s.result;if(!o)return;const c=o.value;c!=null&&c.createdAt&&r-c.createdAt>Hv&&o.delete(),o.continue()}}catch{}}async function nT(){const e=await JA();return e?(tT(e),{async get(t){try{const n=await QA(e,t);return!(n!=null&&n.snapshot)||n.createdAt&&Date.now()-n.createdAt>Hv?null:n.snapshot}catch{return null}},async set(t,n){try{await eT(e,t,{snapshot:n,createdAt:Date.now()})}catch{}},close(){try{e.close()}catch{}}}):null}ol=(l=class{constructor(e,t,n,s,r){if(W(this,"fs"),W(this,"_volume"),W(this,"_packages"),W(this,"_proxy"),W(this,"_cwd"),W(this,"_processManager"),W(this,"_vfsBridge"),W(this,"_sharedVFS",null),W(this,"_syncChannel",null),W(this,"_unwatchVFS",null),W(this,"_handler"),this._volume=e,this._packages=t,this._proxy=n,this._cwd=s,this._handler=r,this.fs=new G0(e),this._processManager=new ya(e),this._vfsBridge=new $0(e),this._vfsBridge.setBroadcaster((o,c,d)=>{const p=c!==null&&c.byteLength===0;this._processManager.broadcastVFSChange(o,c,p,d)}),this._processManager.setVFSBridge(this._vfsBridge),this._unwatchVFS=this._vfsBridge.watch(),Zo()){try{this._sharedVFS=new L0,this._processManager.setSharedBuffer(this._sharedVFS.buffer),this._vfsBridge.setSharedVFS(this._sharedVFS)}catch{}try{this._syncChannel=new M0,this._processManager.setSyncBuffer(this._syncChannel.buffer)}catch{}}this._processManager.on("server-listen",(o,c,d)=>{const p={listening:!0,address:()=>({port:c,address:"0.0.0.0",family:"IPv4"}),dispatchRequest:async(y,g,x,k)=>{const C=k?typeof k=="string"?k:k.toString("utf8"):null,T=await this._processManager.dispatchHttpRequest(c,y,g,x,C),L=T.body instanceof ArrayBuffer?z.from(new Uint8Array(T.body)):z.from(T.body);return{statusCode:T.statusCode,statusMessage:T.statusMessage,headers:T.headers,body:L}}};this._proxy.register(p,c)}),this._processManager.on("server-close",(o,c)=>{this._proxy.unregister(c)}),this._proxy.setProcessManager(this._processManager)}static async boot(e={}){if(typeof Worker>"u")throw new Error("[Nodepod] Web Workers are required. Nodepod cannot run without Web Worker support.");if(typeof SharedArrayBuffer>"u")throw new Error("[Nodepod] SharedArrayBuffer is required. Ensure Cross-Origin-Isolation headers are set (Cross-Origin-Opener-Policy: same-origin, Cross-Origin-Embedder-Policy: credentialless).");const t=e.workdir??"/",n=new q0(e.memory);n.startMonitoring();const s=new wa(n);let r=null;if(e.enableSnapshotCache!==!1)try{r=await nT()}catch{}const o=new Jo(s,{snapshotCache:r}),c=j0({onServerReady:e.onServerReady});e.allowedFetchDomains===null?Vv(null):Vv(e.allowedFetchDomains??[]);const d=new ol(s,o,c,t,n);if(e.files)for(const[p,y]of Object.entries(e.files)){const g=p.substring(0,p.lastIndexOf("/"))||"/";g!=="/"&&!s.existsSync(g)&&s.mkdirSync(g,{recursive:!0}),s.writeFileSync(p,y)}t!=="/"&&!s.existsSync(t)&&s.mkdirSync(t,{recursive:!0});for(const p of["/tmp","/home"])s.existsSync(p)||s.mkdirSync(p,{recursive:!0});if(e.swUrl&&typeof navigator<"u"&&"serviceWorker"in navigator)try{await c.initServiceWorker({swUrl:e.swUrl}),e.watermark===!1&&c.setWatermark(!1)}catch{}return d}async spawn(e,t,n){const s=new K0,r=(n==null?void 0:n.cwd)??this._cwd,o=this._processManager.spawn({command:e,args:t??[],cwd:r,env:(n==null?void 0:n.env)??{}});if(o.on("stdout",d=>{s.exited||s._pushStdout(d)}),o.on("stderr",d=>{s.exited||s._pushStderr(d)}),o.on("exit",d=>{s.exited||s._finish(d)}),o.on("worker-error",d=>{s.exited||(s._pushStderr(`Worker error: ${d}
46660
- `),s._finish(1))}),s._setSendStdin(d=>o.sendStdin(d)),s._setKillFn(()=>o.kill("SIGINT")),n!=null&&n.signal&&n.signal.addEventListener("abort",()=>{o.kill("SIGINT")},{once:!0}),await new Promise(d=>{o.state==="running"?d():o.on("ready",()=>d())}),e==="node"&&(t==null?void 0:t.length)){const d=this._resolveCommand(e,t);o.exec({type:"exec",filePath:d,args:t??[],cwd:r,env:n==null?void 0:n.env,isShell:!1})}else{const d=t!=null&&t.length?`${e} ${t.join(" ")}`:e;o.exec({type:"exec",filePath:"",args:t??[],cwd:r,env:n==null?void 0:n.env,isShell:!0,shellCommand:d})}return s}_resolveCommand(e,t){if(e==="node"&&(t!=null&&t.length)){const n=t[0];return n.startsWith("/")?n:`${this._cwd}/${n}`.replace(/\/+/g,"/")}return e}createTerminal(e){const t=new Y0(e);t.setCwd(this._cwd);let n=null,s=null,r=0;const o=()=>(r=(r+1)%Number.MAX_SAFE_INTEGER,r);let c=!1,d=null,p=null;const y=()=>(d&&d.state!=="exited"||(d=this._processManager.spawn({command:"shell",args:[],cwd:this._cwd,env:{}}),p=new Promise(g=>{d.state==="running"?g():d.on("ready",()=>g())}),d.on("cwd-change",g=>{this._cwd=g,t.setCwd(g)}),d.on("stdin-raw-status",g=>{c=g}),d.on("exit",()=>{d=null,p=null})),p);return t._wireExecution({onCommand:async g=>{const x=new AbortController;n=x;const k=o();let C=!1,T=!1;function L(){T||(T=!0,t.write(`\r
46661
- `))}await y();const V=d;let K=!1;const J=G=>{k===r&&K&&(C=!0,L(),t._writeOutput(G))},X=G=>{k===r&&K&&(C=!0,L(),t._writeOutput(G,!0))};return V.on("stdout",J),V.on("stderr",X),s=G=>V.sendStdin(G),x.signal.addEventListener("abort",()=>{this._processManager.kill(V.pid,"SIGINT")},{once:!0}),V.exec({type:"exec",filePath:"",args:[],cwd:this._cwd,isShell:!0,shellCommand:g,persistent:!0}),K=!0,new Promise(G=>{const $=()=>{V.removeListener("shell-done",te),V.removeListener("exit",I),V.removeListener("stdout",J),V.removeListener("stderr",X)},te=(D,F,U)=>{$();const N=k!==r;N||(s=null);const Q=x.signal.aborted;if(!Q&&!C&&!N){const ce=String(F??""),le=String(U??"");(ce||le)&&L(),ce&&t._writeOutput(ce),le&&t._writeOutput(le,!0)}n===x&&(n=null),!Q&&!N&&(T||t.write(`\r
46662
- `),t._setRunning(!1),t._writePrompt()),G()},I=(D,F,U)=>{$();const N=k!==r;N||(s=null);const Q=x.signal.aborted;if(!Q&&!C&&!N){const ce=String(F??""),le=String(U??"");(ce||le)&&L(),ce&&t._writeOutput(ce),le&&t._writeOutput(le,!0)}n===x&&(n=null),!Q&&!N&&(T||t.write(`\r
46663
- `),t._setRunning(!1),t._writePrompt()),G()};V.on("shell-done",te),V.on("exit",I)})},getSendStdin:()=>s,getIsStdinRaw:()=>c,getActiveAbort:()=>n,setActiveAbort:g=>{n=g}}),t}async setPreviewScript(e){this._proxy.setPreviewScript(e)}async clearPreviewScript(){this._proxy.setPreviewScript(null)}port(e){return this._proxy.activePorts().includes(e)?this._proxy.serverUrl(e):null}snapshot(e){const t=(e==null?void 0:e.shallow)??!0;return this._volume.toSnapshot(void 0,t?ol.SHALLOW_EXCLUDE_DIRS:void 0)}async restore(e,t){const n=(t==null?void 0:t.autoInstall)??!0,s=wa.fromSnapshot(e);this._volume.tree=s.tree,n&&this._volume.existsSync("/package.json")&&await this._packages.installFromManifest()}teardown(){this._unwatchVFS&&(this._unwatchVFS(),this._unwatchVFS=null),this._processManager.teardown(),this._volume.dispose(),this._handler.destroy()}memoryStats(){const e=this._volume.getStats(),t={moduleCacheSize:0,transformCacheSize:0};let n=null;const s=typeof performance<"u"?performance:null;return s!=null&&s.memory&&(n={usedMB:Math.round(s.memory.usedJSHeapSize/1048576*10)/10,totalMB:Math.round(s.memory.totalJSHeapSize/1048576*10)/10,limitMB:Math.round(s.memory.jsHeapSizeLimit/1048576*10)/10}),{vfs:e,engine:t,heap:n}}get volume(){return this._volume}get engine(){throw new Error("[Nodepod] Main-thread engine removed for security. All code now runs in isolated Web Workers via spawn().")}get packages(){return this._packages}get proxy(){return this._proxy}get processManager(){return this._processManager}get cwd(){return this._cwd}},W(l,"SHALLOW_EXCLUDE_DIRS",new Set(["node_modules",".cache",".npm"])),l)})();const pt="[CodeSandbox:Runtime]";class XS{constructor(i){this.nodepod=null,this.serverProcess=null,this.originalFiles={},this.currentFiles={},this.terminalOutput=[],this.status="initializing",this.error=null,this.previewUrl=null,this.errors=[],this.errorIdCounter=0,this.onProgress=null,this.onOutput=null,this.onServerReady=null,this.onSandboxError=null,this.config={workdir:"/app",port:3e3,...i},console.log(pt,"constructor",{workdir:this.config.workdir,port:this.config.port,entryCommand:this.config.entryCommand,fileCount:Object.keys(this.config.files).length,files:Object.keys(this.config.files)})}setProgressCallback(i){this.onProgress=i}setOutputCallback(i){this.onOutput=i}setServerReadyCallback(i){this.onServerReady=i}setErrorCallback(i){this.onSandboxError=i}getPreviewUrl(){return this.previewUrl}getStatus(){return this.status}getTerminalOutput(){return[...this.terminalOutput]}getCurrentFiles(){return{...this.currentFiles}}getOriginalFiles(){return{...this.originalFiles}}getChangedFiles(){const i={};for(const[l,u]of Object.entries(this.currentFiles))this.originalFiles[l]!==u&&(i[l]=u);return i}getError(){return this.error}getErrors(){return[...this.errors]}async reportError(i){var l;i.filePath&&i.line&&!i.sourceContext&&(i.sourceContext=await this.getSourceContext(i.filePath,i.line)),this.errors.push(i),(l=this.onSandboxError)==null||l.call(this,i)}async boot(){const i=performance.now();console.log(pt,"boot() started");try{this.emitProgress("initializing","Booting runtime environment...",5);const l=this.config.port??3e3;console.log(pt,"boot: calling Nodepod.boot()",{swUrl:"/__sw__.js",workdir:this.config.workdir,port:l}),console.log(pt,"boot: SharedArrayBuffer available?",typeof SharedArrayBuffer<"u"),console.log(pt,"boot: Worker available?",typeof Worker<"u");const u=performance.now();this.nodepod=await ol.boot({swUrl:"/__sw__.js",workdir:this.config.workdir,env:this.config.env,onServerReady:(_,b)=>{var v;console.log(pt,"onServerReady fired!",{readyPort:_,url:b,expectedPort:l}),_===l&&(this.previewUrl=this.rewritePreviewUrl(b),console.log(pt,"previewUrl set to:",this.previewUrl),this.emitProgress("ready","Application is running",100),(v=this.onServerReady)==null||v.call(this,_,this.previewUrl))}}),console.log(pt,`boot: Nodepod.boot() completed in ${(performance.now()-u).toFixed(0)}ms`),this.emitProgress("initializing","Runtime environment ready",15),this.emitProgress("writing-files","Writing project files...",20);const h=performance.now();await this.writeFiles(this.config.files),console.log(pt,`boot: writeFiles completed in ${(performance.now()-h).toFixed(0)}ms`),this.emitProgress("writing-files",`Wrote ${Object.keys(this.config.files).length} files`,35);try{const _=this.config.workdir??"/app",b=Object.keys(this.config.files)[0];if(b){const v=b.startsWith("/")?b:`${_}/${b}`,w=await this.nodepod.fs.exists(v);if(console.log(pt,`boot: verify file "${v}" exists:`,w),w){const E=await this.nodepod.fs.readFile(v,"utf-8");console.log(pt,`boot: verify file "${v}" has ${E.length} chars`)}}}catch(_){console.warn(pt,"boot: file verification failed:",_)}if(this.config.files["package.json"]){this.emitProgress("installing","Installing dependencies...",40);const _=performance.now();await this.installDependencies(),console.log(pt,`boot: installDependencies completed in ${(performance.now()-_).toFixed(0)}ms`),this.emitProgress("installing","Dependencies installed",70)}else console.log(pt,"boot: no package.json found, skipping install");this.emitProgress("starting","Starting application...",75);const m=performance.now();await this.startServer(),console.log(pt,`boot: startServer returned in ${(performance.now()-m).toFixed(0)}ms`),console.log(pt,`boot: total elapsed ${(performance.now()-i).toFixed(0)}ms, status=${this.status}`);const f=[1e3,3e3,5e3,1e4];for(const _ of f)setTimeout(()=>{var b,v,w;if(this.status==="starting"){const E=(b=this.nodepod)==null?void 0:b.port(l);console.log(pt,`boot: fallback check @${_}ms, port(${l}) =`,E,"status =",this.status),E?(this.previewUrl=this.rewritePreviewUrl(E),console.log(pt,"fallback: previewUrl set to:",this.previewUrl),this.emitProgress("ready","Application is running",100),(v=this.onServerReady)==null||v.call(this,l,this.previewUrl)):_===f[f.length-1]&&(console.error(pt,"boot: server never became ready after 10s. Process state:",{processExited:(w=this.serverProcess)==null?void 0:w.exited,previewUrl:this.previewUrl,status:this.status}),this.appendOutput("[system] Server did not start within 10 seconds. Check the logs above for errors."))}},_)}catch(l){const u=l instanceof Error?l.message:String(l),h=l instanceof Error?l.stack:void 0;throw console.error(pt,"boot: FATAL ERROR:",l),this.error=u,this.emitProgress("error",`Error: ${u}`,0),this.emitError("boot",u,{stack:h}),l}}async writeFile(i,l){if(!this.nodepod)throw new Error("Runtime not booted");const u=this.resolvePath(i);await this.nodepod.fs.writeFile(u,l),this.currentFiles[i]=l}async readFile(i){if(!this.nodepod)throw new Error("Runtime not booted");const l=this.resolvePath(i);return await this.nodepod.fs.readFile(l,"utf-8")}async restart(){this.serverProcess&&!this.serverProcess.exited&&(this.serverProcess.kill(),await this.serverProcess.completion.catch(()=>{})),this.previewUrl=null,this.emitProgress("starting","Restarting application...",75),await this.startServer()}teardown(){var i;this.serverProcess&&!this.serverProcess.exited&&this.serverProcess.kill(),(i=this.nodepod)==null||i.teardown(),this.nodepod=null,this.serverProcess=null,this.previewUrl=null,this.status="initializing",this.terminalOutput=[]}getNodepod(){return this.nodepod}rewritePreviewUrl(i){return i.replace("/__virtual__/","/__preview__/")}resolvePath(i){const l=this.config.workdir??"/app",u=i.replace(/^\.\//,"");return u.startsWith("/")?u:`${l}/${u}`}async writeFiles(i){if(!this.nodepod)return;this.originalFiles={...i},this.currentFiles={...i};const l=Object.entries(i),u=10;for(let h=0;h<l.length;h+=u){const m=l.slice(h,h+u);await Promise.all(m.map(([_,b])=>{const v=this.resolvePath(_);return this.nodepod.fs.writeFile(v,b)}));const f=20+Math.round(h/l.length*15);this.emitProgress("writing-files",`Writing files... (${Math.min(h+u,l.length)}/${l.length})`,f)}}async installDependencies(){if(this.nodepod){this.config.workdir;try{const i=this.config.files["package.json"];if(!i)return;const l=JSON.parse(i),u={...l.dependencies||{},...l.devDependencies||{}},h=Object.keys(u);if(h.length===0)return;this.appendOutput(`Installing ${h.length} dependencies...`);for(let m=0;m<h.length;m++){const f=h[m],_=u[f],b=_?`${f}@${_.replace(/[\^~>=<]/g,"")}`:f;try{await this.nodepod.packages.install(b),this.appendOutput(` ✓ ${f}`)}catch(w){this.appendOutput(` ✗ ${f}: ${w instanceof Error?w.message:w}`)}const v=40+Math.round(m/h.length*30);this.emitProgress("installing",`Installing ${f}... (${m+1}/${h.length})`,v)}this.appendOutput("Dependencies installed.")}catch(i){this.appendOutput(`Warning: Could not parse package.json: ${i}`)}}}async startServer(){if(!this.nodepod)return;const i=this.config.workdir??"/app",l=this.config.entryCommand,u=l.split(/\s+/),h=u[0],m=u.slice(1);this.appendOutput(`
46664
- $ ${l}`),this.serverProcess=await this.nodepod.spawn(h,m,{cwd:i}),this.serverProcess.on("output",f=>{this.appendOutput(f)}),this.serverProcess.on("error",f=>{this.appendOutput(`[stderr] ${f}`);const _=f.trim();_&&!this.isStderrNoise(_)&&this.emitError("process-stderr",_)}),this.serverProcess.on("exit",f=>{this.appendOutput(`
46665
- Process exited with code ${f}`),f!==0&&this.status!=="ready"&&(this.error=`Process exited with code ${f}`,this.emitProgress("error",`Process exited with code ${f}`,0),this.emitError("process-exit",`Process exited with code ${f}`,{stack:this.terminalOutput.slice(-20).join(`
46666
- `)}))})}emitProgress(i,l,u){var m;this.status=i;const h={stage:i,message:l,percent:u};(m=this.onProgress)==null||m.call(this,h)}appendOutput(i){var l;this.terminalOutput.push(i),(l=this.onOutput)==null||l.call(this,i)}nextErrorId(){return`err_${++this.errorIdCounter}_${Date.now()}`}async emitError(i,l,u){var v;let h=u==null?void 0:u.filePath,m=u==null?void 0:u.line,f=u==null?void 0:u.column;if(!h){const w=this.parseErrorLocation(l+((u==null?void 0:u.stack)??""));h=w.filePath,m=w.line??m,f=w.column??f}let _=u==null?void 0:u.sourceContext;h&&m&&!_&&(_=await this.getSourceContext(h,m));const b={id:this.nextErrorId(),category:i,message:l,timestamp:new Date().toISOString(),...u,filePath:h,line:m,column:f,sourceContext:_};this.errors.push(b),(v=this.onSandboxError)==null||v.call(this,b)}isStderrNoise(i){return[/^DeprecationWarning:/,/^ExperimentalWarning:/,/^\(node:\d+\) /,/^npm WARN /,/^warn /i,/^Debugger listening/,/^Debugger attached/,/^Waiting for the debugger/].some(u=>u.test(i))}parseErrorLocation(i){const l=this.config.workdir??"/app",u=i.match(/\(?(\/[^:)]+):(\d+):(\d+)\)?/);if(u){const f=u[1];return{filePath:f.startsWith(l+"/")?f.slice(l.length+1):f,line:parseInt(u[2],10),column:parseInt(u[3],10)}}const h=i.match(/\(?(\/[^:)]+):(\d+)\)?/);if(h){const f=h[1];return{filePath:f.startsWith(l+"/")?f.slice(l.length+1):f,line:parseInt(h[2],10)}}const m=i.match(/(\/[^\s:]+)\s*:\s*[^(]*\((\d+):(\d+)\)/);if(m){const f=m[1];return{filePath:f.startsWith(l+"/")?f.slice(l.length+1):f,line:parseInt(m[2],10),column:parseInt(m[3],10)}}return{}}async getSourceContext(i,l,u=5){try{const h=this.currentFiles[i];if(!h){if(!this.nodepod)return;const m=this.resolvePath(i);if(!await this.nodepod.fs.exists(m))return;const _=await this.nodepod.fs.readFile(m,"utf-8");return this.formatSourceContext(_,l,u)}return this.formatSourceContext(h,l,u)}catch{return}}formatSourceContext(i,l,u){const h=i.split(`
46667
- `),m=Math.max(0,l-u-1),f=Math.min(h.length,l+u);return h.slice(m,f).map((_,b)=>`${m+b+1}: ${_}`).join(`
46668
- `)}}const nN=`# .ranger — Project Manifest
46652
+ `),i(`
46653
+ `);else if(l===127||l===8)this._term.write("\b \b"),i("");else if(l>=32)this._term.write(o),i(o);else{i(e.slice(a));break}}return}for(let s=0;s<e.length;s++){const i=e[s],a=i.charCodeAt(0);if(i==="\r"||i===`
46654
+ `){const o=this._lineBuffer;this._lineBuffer="",this._historyIndex=-1,this._executeCommand(o)}else if(a===127||a===8)this._lineBuffer.length>0&&(this._lineBuffer=this._lineBuffer.slice(0,-1),this._term.write("\b \b"));else if(a===3)this._lineBuffer="",this._term.write("^C"),this._writePrompt();else if(a===12)this._term.clear(),this._term.write(this._promptFn(this._cwd)+this._lineBuffer);else if(i==="\x1B"&&s+2<e.length&&e[s+1]==="["){const o=e[s+2];s+=2,o==="A"?this._historyUp():o==="B"&&this._historyDown()}else a>=32&&(this._lineBuffer+=i,this._term.write(i))}}}_historyUp(){if(this._history.length!==0){if(this._historyIndex===-1)this._savedLine=this._lineBuffer,this._historyIndex=this._history.length-1;else if(this._historyIndex>0)this._historyIndex--;else return;this._replaceLineWith(this._history[this._historyIndex])}}_historyDown(){this._historyIndex!==-1&&(this._historyIndex<this._history.length-1?(this._historyIndex++,this._replaceLineWith(this._history[this._historyIndex])):(this._historyIndex=-1,this._replaceLineWith(this._savedLine)))}_replaceLineWith(e){const n=this._promptFn(this._cwd);this._term.write("\r"+n+" ".repeat(this._lineBuffer.length)+"\r"+n),this._lineBuffer=e,this._term.write(e)}async _executeCommand(e){var n,t;if(!e.trim()){(n=this._term)==null||n.write(`\r
46655
+ `+this._promptFn(this._cwd));return}this._history.push(e),this._historyIndex=-1,this._running=!0,(t=this._wiring)!=null&&t.onCommand?await this._wiring.onCommand(e):(this._running=!1,this._writePrompt())}};const dS=["registry.npmjs.org","github.com","raw.githubusercontent.com","api.github.com","objects.githubusercontent.com","esm.sh","unpkg.com","cdn.jsdelivr.net","localhost","127.0.0.1"];function B_(e){e!==null&&[...dS,...e]}const pS="nodepod-snapshots",Wt="snapshots",hS=1,L_=10080*60*1e3;function fS(){return typeof indexedDB>"u"?Promise.resolve(null):new Promise(e=>{try{const n=indexedDB.open(pS,hS);n.onupgradeneeded=()=>{const t=n.result;t.objectStoreNames.contains(Wt)||t.createObjectStore(Wt)},n.onsuccess=()=>e(n.result),n.onerror=()=>e(null)}catch{e(null)}})}function mS(e,n){return new Promise((t,r)=>{const a=e.transaction(Wt,"readonly").objectStore(Wt).get(n);a.onsuccess=()=>t(a.result??null),a.onerror=()=>r(a.error)})}function gS(e,n,t){return new Promise((r,s)=>{const i=e.transaction(Wt,"readwrite");i.objectStore(Wt).put(t,n),i.oncomplete=()=>r(),i.onerror=()=>s(i.error)})}function _S(e){try{const r=e.transaction(Wt,"readwrite").objectStore(Wt).openCursor(),s=Date.now();r.onsuccess=()=>{const i=r.result;if(!i)return;const a=i.value;a!=null&&a.createdAt&&s-a.createdAt>L_&&i.delete(),i.continue()}}catch{}}async function yS(){const e=await fS();return e?(_S(e),{async get(n){try{const t=await mS(e,n);return!(t!=null&&t.snapshot)||t.createdAt&&Date.now()-t.createdAt>L_?null:t.snapshot}catch{return null}},async set(n,t){try{await gS(e,n,{snapshot:t,createdAt:Date.now()})}catch{}},close(){try{e.close()}catch{}}}):null}Ia=(C=class{constructor(e,n,t,r,s){if(T(this,"fs"),T(this,"_volume"),T(this,"_packages"),T(this,"_proxy"),T(this,"_cwd"),T(this,"_processManager"),T(this,"_vfsBridge"),T(this,"_sharedVFS",null),T(this,"_syncChannel",null),T(this,"_unwatchVFS",null),T(this,"_handler"),this._volume=e,this._packages=n,this._proxy=t,this._cwd=r,this._handler=s,this.fs=new ry(e),this._processManager=new ci(e),this._vfsBridge=new Y_(e),this._vfsBridge.setBroadcaster((i,a,o)=>{const l=a!==null&&a.byteLength===0;this._processManager.broadcastVFSChange(i,a,l,o)}),this._processManager.setVFSBridge(this._vfsBridge),this._unwatchVFS=this._vfsBridge.watch(),Ea()){try{this._sharedVFS=new z_,this._processManager.setSharedBuffer(this._sharedVFS.buffer),this._vfsBridge.setSharedVFS(this._sharedVFS)}catch{}try{this._syncChannel=new G_,this._processManager.setSyncBuffer(this._syncChannel.buffer)}catch{}}this._processManager.on("server-listen",(i,a,o)=>{const l={listening:!0,address:()=>({port:a,address:"0.0.0.0",family:"IPv4"}),dispatchRequest:async(u,c,p,h)=>{const f=h?typeof h=="string"?h:h.toString("utf8"):null,m=await this._processManager.dispatchHttpRequest(a,u,c,p,f),v=m.body instanceof ArrayBuffer?I.from(new Uint8Array(m.body)):I.from(m.body);return{statusCode:m.statusCode,statusMessage:m.statusMessage,headers:m.headers,body:v}}};this._proxy.register(l,a)}),this._processManager.on("server-close",(i,a)=>{this._proxy.unregister(a)}),this._proxy.setProcessManager(this._processManager)}static async boot(e={}){if(typeof Worker>"u")throw new Error("[Nodepod] Web Workers are required. Nodepod cannot run without Web Worker support.");if(typeof SharedArrayBuffer>"u")throw new Error("[Nodepod] SharedArrayBuffer is required. Ensure Cross-Origin-Isolation headers are set (Cross-Origin-Opener-Policy: same-origin, Cross-Origin-Embedder-Policy: credentialless).");const n=e.workdir??"/",t=new ty(e.memory);t.startMonitoring();const r=new hi(t);let s=null;if(e.enableSnapshotCache!==!1)try{s=await yS()}catch{}const i=new Ca(r,{snapshotCache:s}),a=X_({onServerReady:e.onServerReady});e.allowedFetchDomains===null?B_(null):B_(e.allowedFetchDomains??[]);const o=new Ia(r,i,a,n,t);if(e.files)for(const[l,u]of Object.entries(e.files)){const c=l.substring(0,l.lastIndexOf("/"))||"/";c!=="/"&&!r.existsSync(c)&&r.mkdirSync(c,{recursive:!0}),r.writeFileSync(l,u)}n!=="/"&&!r.existsSync(n)&&r.mkdirSync(n,{recursive:!0});for(const l of["/tmp","/home"])r.existsSync(l)||r.mkdirSync(l,{recursive:!0});if(e.swUrl&&typeof navigator<"u"&&"serviceWorker"in navigator)try{await a.initServiceWorker({swUrl:e.swUrl}),e.watermark===!1&&a.setWatermark(!1)}catch{}return o}async spawn(e,n,t){const r=new sy,s=(t==null?void 0:t.cwd)??this._cwd,i=this._processManager.spawn({command:e,args:n??[],cwd:s,env:(t==null?void 0:t.env)??{}});if(i.on("stdout",o=>{r.exited||r._pushStdout(o)}),i.on("stderr",o=>{r.exited||r._pushStderr(o)}),i.on("exit",o=>{r.exited||r._finish(o)}),i.on("worker-error",o=>{r.exited||(r._pushStderr(`Worker error: ${o}
46656
+ `),r._finish(1))}),r._setSendStdin(o=>i.sendStdin(o)),r._setKillFn(()=>i.kill("SIGINT")),t!=null&&t.signal&&t.signal.addEventListener("abort",()=>{i.kill("SIGINT")},{once:!0}),await new Promise(o=>{i.state==="running"?o():i.on("ready",()=>o())}),e==="node"&&(n==null?void 0:n.length)){const o=this._resolveCommand(e,n);i.exec({type:"exec",filePath:o,args:n??[],cwd:s,env:t==null?void 0:t.env,isShell:!1})}else{const o=n!=null&&n.length?`${e} ${n.join(" ")}`:e;i.exec({type:"exec",filePath:"",args:n??[],cwd:s,env:t==null?void 0:t.env,isShell:!0,shellCommand:o})}return r}_resolveCommand(e,n){if(e==="node"&&(n!=null&&n.length)){const t=n[0];return t.startsWith("/")?t:`${this._cwd}/${t}`.replace(/\/+/g,"/")}return e}createTerminal(e){const n=new iy(e);n.setCwd(this._cwd);let t=null,r=null,s=0;const i=()=>(s=(s+1)%Number.MAX_SAFE_INTEGER,s);let a=!1,o=null,l=null;const u=()=>(o&&o.state!=="exited"||(o=this._processManager.spawn({command:"shell",args:[],cwd:this._cwd,env:{}}),l=new Promise(c=>{o.state==="running"?c():o.on("ready",()=>c())}),o.on("cwd-change",c=>{this._cwd=c,n.setCwd(c)}),o.on("stdin-raw-status",c=>{a=c}),o.on("exit",()=>{o=null,l=null})),l);return n._wireExecution({onCommand:async c=>{const p=new AbortController;t=p;const h=i();let f=!1,m=!1;function v(){m||(m=!0,n.write(`\r
46657
+ `))}await u();const k=o;let P=!1;const N=R=>{h===s&&P&&(f=!0,v(),n._writeOutput(R))},O=R=>{h===s&&P&&(f=!0,v(),n._writeOutput(R,!0))};return k.on("stdout",N),k.on("stderr",O),r=R=>k.sendStdin(R),p.signal.addEventListener("abort",()=>{this._processManager.kill(k.pid,"SIGINT")},{once:!0}),k.exec({type:"exec",filePath:"",args:[],cwd:this._cwd,isShell:!0,shellCommand:c,persistent:!0}),P=!0,new Promise(R=>{const S=()=>{k.removeListener("shell-done",F),k.removeListener("exit",g),k.removeListener("stdout",N),k.removeListener("stderr",O)},F=(_,w,E)=>{S();const b=h!==s;b||(r=null);const L=p.signal.aborted;if(!L&&!f&&!b){const W=String(w??""),H=String(E??"");(W||H)&&v(),W&&n._writeOutput(W),H&&n._writeOutput(H,!0)}t===p&&(t=null),!L&&!b&&(m||n.write(`\r
46658
+ `),n._setRunning(!1),n._writePrompt()),R()},g=(_,w,E)=>{S();const b=h!==s;b||(r=null);const L=p.signal.aborted;if(!L&&!f&&!b){const W=String(w??""),H=String(E??"");(W||H)&&v(),W&&n._writeOutput(W),H&&n._writeOutput(H,!0)}t===p&&(t=null),!L&&!b&&(m||n.write(`\r
46659
+ `),n._setRunning(!1),n._writePrompt()),R()};k.on("shell-done",F),k.on("exit",g)})},getSendStdin:()=>r,getIsStdinRaw:()=>a,getActiveAbort:()=>t,setActiveAbort:c=>{t=c}}),n}async setPreviewScript(e){this._proxy.setPreviewScript(e)}async clearPreviewScript(){this._proxy.setPreviewScript(null)}port(e){return this._proxy.activePorts().includes(e)?this._proxy.serverUrl(e):null}snapshot(e){const n=(e==null?void 0:e.shallow)??!0;return this._volume.toSnapshot(void 0,n?Ia.SHALLOW_EXCLUDE_DIRS:void 0)}async restore(e,n){const t=(n==null?void 0:n.autoInstall)??!0,r=hi.fromSnapshot(e);this._volume.tree=r.tree,t&&this._volume.existsSync("/package.json")&&await this._packages.installFromManifest()}teardown(){this._unwatchVFS&&(this._unwatchVFS(),this._unwatchVFS=null),this._processManager.teardown(),this._volume.dispose(),this._handler.destroy()}memoryStats(){const e=this._volume.getStats(),n={moduleCacheSize:0,transformCacheSize:0};let t=null;const r=typeof performance<"u"?performance:null;return r!=null&&r.memory&&(t={usedMB:Math.round(r.memory.usedJSHeapSize/1048576*10)/10,totalMB:Math.round(r.memory.totalJSHeapSize/1048576*10)/10,limitMB:Math.round(r.memory.jsHeapSizeLimit/1048576*10)/10}),{vfs:e,engine:n,heap:t}}get volume(){return this._volume}get engine(){throw new Error("[Nodepod] Main-thread engine removed for security. All code now runs in isolated Web Workers via spawn().")}get packages(){return this._packages}get proxy(){return this._proxy}get processManager(){return this._processManager}get cwd(){return this._cwd}},T(C,"SHALLOW_EXCLUDE_DIRS",new Set(["node_modules",".cache",".npm"])),C)})();const Ue="[CodeSandbox:Runtime]";class hy{constructor(x){this.nodepod=null,this.serverProcess=null,this.originalFiles={},this.currentFiles={},this.terminalOutput=[],this.status="initializing",this.error=null,this.previewUrl=null,this.errors=[],this.errorIdCounter=0,this.onProgress=null,this.onOutput=null,this.onServerReady=null,this.onSandboxError=null,this.config={workdir:"/app",port:3e3,...x},console.log(Ue,"constructor",{workdir:this.config.workdir,port:this.config.port,entryCommand:this.config.entryCommand,fileCount:Object.keys(this.config.files).length,files:Object.keys(this.config.files)})}setProgressCallback(x){this.onProgress=x}setOutputCallback(x){this.onOutput=x}setServerReadyCallback(x){this.onServerReady=x}setErrorCallback(x){this.onSandboxError=x}getPreviewUrl(){return this.previewUrl}getStatus(){return this.status}getTerminalOutput(){return[...this.terminalOutput]}getCurrentFiles(){return{...this.currentFiles}}getOriginalFiles(){return{...this.originalFiles}}getChangedFiles(){const x={};for(const[C,A]of Object.entries(this.currentFiles))this.originalFiles[C]!==A&&(x[C]=A);return x}getError(){return this.error}getErrors(){return[...this.errors]}async reportError(x){var C;x.filePath&&x.line&&!x.sourceContext&&(x.sourceContext=await this.getSourceContext(x.filePath,x.line)),this.errors.push(x),(C=this.onSandboxError)==null||C.call(this,x)}async boot(){const x=performance.now();console.log(Ue,"boot() started");try{this.emitProgress("initializing","Booting runtime environment...",5);const C=this.config.port??3e3;console.log(Ue,"boot: calling Nodepod.boot()",{swUrl:"/__sw__.js",workdir:this.config.workdir,port:C}),console.log(Ue,"boot: SharedArrayBuffer available?",typeof SharedArrayBuffer<"u"),console.log(Ue,"boot: Worker available?",typeof Worker<"u");const A=performance.now();this.nodepod=await Ia.boot({swUrl:"/__sw__.js",workdir:this.config.workdir,env:this.config.env,onServerReady:($,Y)=>{var V;console.log(Ue,"onServerReady fired!",{readyPort:$,url:Y,expectedPort:C}),$===C&&(this.previewUrl=this.rewritePreviewUrl(Y),console.log(Ue,"previewUrl set to:",this.previewUrl),this.emitProgress("ready","Application is running",100),(V=this.onServerReady)==null||V.call(this,$,this.previewUrl))}}),console.log(Ue,`boot: Nodepod.boot() completed in ${(performance.now()-A).toFixed(0)}ms`),this.emitProgress("initializing","Runtime environment ready",15),this.emitProgress("writing-files","Writing project files...",20);const B=performance.now();await this.writeFiles(this.config.files),console.log(Ue,`boot: writeFiles completed in ${(performance.now()-B).toFixed(0)}ms`),this.emitProgress("writing-files",`Wrote ${Object.keys(this.config.files).length} files`,35);try{const $=this.config.workdir??"/app",Y=Object.keys(this.config.files)[0];if(Y){const V=Y.startsWith("/")?Y:`${$}/${Y}`,K=await this.nodepod.fs.exists(V);if(console.log(Ue,`boot: verify file "${V}" exists:`,K),K){const ie=await this.nodepod.fs.readFile(V,"utf-8");console.log(Ue,`boot: verify file "${V}" has ${ie.length} chars`)}}}catch($){console.warn(Ue,"boot: file verification failed:",$)}if(this.config.files["package.json"]){this.emitProgress("installing","Installing dependencies...",40);const $=performance.now();await this.installDependencies(),console.log(Ue,`boot: installDependencies completed in ${(performance.now()-$).toFixed(0)}ms`),this.emitProgress("installing","Dependencies installed",70)}else console.log(Ue,"boot: no package.json found, skipping install");this.emitProgress("starting","Starting application...",75);const j=performance.now();await this.startServer(),console.log(Ue,`boot: startServer returned in ${(performance.now()-j).toFixed(0)}ms`),console.log(Ue,`boot: total elapsed ${(performance.now()-x).toFixed(0)}ms, status=${this.status}`);const U=[1e3,3e3,5e3,1e4];for(const $ of U)setTimeout(()=>{var Y,V,K;if(this.status==="starting"){const ie=(Y=this.nodepod)==null?void 0:Y.port(C);console.log(Ue,`boot: fallback check @${$}ms, port(${C}) =`,ie,"status =",this.status),ie?(this.previewUrl=this.rewritePreviewUrl(ie),console.log(Ue,"fallback: previewUrl set to:",this.previewUrl),this.emitProgress("ready","Application is running",100),(V=this.onServerReady)==null||V.call(this,C,this.previewUrl)):$===U[U.length-1]&&(console.error(Ue,"boot: server never became ready after 10s. Process state:",{processExited:(K=this.serverProcess)==null?void 0:K.exited,previewUrl:this.previewUrl,status:this.status}),this.appendOutput("[system] Server did not start within 10 seconds. Check the logs above for errors."))}},$)}catch(C){const A=C instanceof Error?C.message:String(C),B=C instanceof Error?C.stack:void 0;throw console.error(Ue,"boot: FATAL ERROR:",C),this.error=A,this.emitProgress("error",`Error: ${A}`,0),this.emitError("boot",A,{stack:B}),C}}async writeFile(x,C){if(!this.nodepod)throw new Error("Runtime not booted");const A=this.resolvePath(x);await this.nodepod.fs.writeFile(A,C),this.currentFiles[x]=C}async readFile(x){if(!this.nodepod)throw new Error("Runtime not booted");const C=this.resolvePath(x);return await this.nodepod.fs.readFile(C,"utf-8")}async restart(){this.serverProcess&&!this.serverProcess.exited&&(this.serverProcess.kill(),await this.serverProcess.completion.catch(()=>{})),this.previewUrl=null,this.emitProgress("starting","Restarting application...",75),await this.startServer()}teardown(){var x;this.serverProcess&&!this.serverProcess.exited&&this.serverProcess.kill(),(x=this.nodepod)==null||x.teardown(),this.nodepod=null,this.serverProcess=null,this.previewUrl=null,this.status="initializing",this.terminalOutput=[]}getNodepod(){return this.nodepod}rewritePreviewUrl(x){return x.replace("/__virtual__/","/__preview__/")}resolvePath(x){const C=this.config.workdir??"/app",A=x.replace(/^\.\//,"");return A.startsWith("/")?A:`${C}/${A}`}async writeFiles(x){if(!this.nodepod)return;this.originalFiles={...x},this.currentFiles={...x};const C=Object.entries(x),A=10;for(let B=0;B<C.length;B+=A){const j=C.slice(B,B+A);await Promise.all(j.map(([$,Y])=>{const V=this.resolvePath($);return this.nodepod.fs.writeFile(V,Y)}));const U=20+Math.round(B/C.length*15);this.emitProgress("writing-files",`Writing files... (${Math.min(B+A,C.length)}/${C.length})`,U)}}async installDependencies(){if(this.nodepod){this.config.workdir;try{const x=this.config.files["package.json"];if(!x)return;const C=JSON.parse(x),A={...C.dependencies||{},...C.devDependencies||{}},B=Object.keys(A);if(B.length===0)return;this.appendOutput(`Installing ${B.length} dependencies...`);for(let j=0;j<B.length;j++){const U=B[j],$=A[U],Y=$?`${U}@${$.replace(/[\^~>=<]/g,"")}`:U;try{await this.nodepod.packages.install(Y),this.appendOutput(` ✓ ${U}`)}catch(K){this.appendOutput(` ✗ ${U}: ${K instanceof Error?K.message:K}`)}const V=40+Math.round(j/B.length*30);this.emitProgress("installing",`Installing ${U}... (${j+1}/${B.length})`,V)}this.appendOutput("Dependencies installed.")}catch(x){this.appendOutput(`Warning: Could not parse package.json: ${x}`)}}}async startServer(){if(!this.nodepod)return;const x=this.config.workdir??"/app",C=this.config.entryCommand,A=C.split(/\s+/),B=A[0],j=A.slice(1);this.appendOutput(`
46660
+ $ ${C}`),this.serverProcess=await this.nodepod.spawn(B,j,{cwd:x}),this.serverProcess.on("output",U=>{this.appendOutput(U)}),this.serverProcess.on("error",U=>{this.appendOutput(`[stderr] ${U}`);const $=U.trim();$&&!this.isStderrNoise($)&&this.emitError("process-stderr",$)}),this.serverProcess.on("exit",U=>{this.appendOutput(`
46661
+ Process exited with code ${U}`),U!==0&&this.status!=="ready"&&(this.error=`Process exited with code ${U}`,this.emitProgress("error",`Process exited with code ${U}`,0),this.emitError("process-exit",`Process exited with code ${U}`,{stack:this.terminalOutput.slice(-20).join(`
46662
+ `)}))})}emitProgress(x,C,A){var j;this.status=x;const B={stage:x,message:C,percent:A};(j=this.onProgress)==null||j.call(this,B)}appendOutput(x){var C;this.terminalOutput.push(x),(C=this.onOutput)==null||C.call(this,x)}nextErrorId(){return`err_${++this.errorIdCounter}_${Date.now()}`}async emitError(x,C,A){var V;let B=A==null?void 0:A.filePath,j=A==null?void 0:A.line,U=A==null?void 0:A.column;if(!B){const K=this.parseErrorLocation(C+((A==null?void 0:A.stack)??""));B=K.filePath,j=K.line??j,U=K.column??U}let $=A==null?void 0:A.sourceContext;B&&j&&!$&&($=await this.getSourceContext(B,j));const Y={id:this.nextErrorId(),category:x,message:C,timestamp:new Date().toISOString(),...A,filePath:B,line:j,column:U,sourceContext:$};this.errors.push(Y),(V=this.onSandboxError)==null||V.call(this,Y)}isStderrNoise(x){return[/^DeprecationWarning:/,/^ExperimentalWarning:/,/^\(node:\d+\) /,/^npm WARN /,/^warn /i,/^Debugger listening/,/^Debugger attached/,/^Waiting for the debugger/].some(A=>A.test(x))}parseErrorLocation(x){const C=this.config.workdir??"/app",A=x.match(/\(?(\/[^:)]+):(\d+):(\d+)\)?/);if(A){const U=A[1];return{filePath:U.startsWith(C+"/")?U.slice(C.length+1):U,line:parseInt(A[2],10),column:parseInt(A[3],10)}}const B=x.match(/\(?(\/[^:)]+):(\d+)\)?/);if(B){const U=B[1];return{filePath:U.startsWith(C+"/")?U.slice(C.length+1):U,line:parseInt(B[2],10)}}const j=x.match(/(\/[^\s:]+)\s*:\s*[^(]*\((\d+):(\d+)\)/);if(j){const U=j[1];return{filePath:U.startsWith(C+"/")?U.slice(C.length+1):U,line:parseInt(j[2],10),column:parseInt(j[3],10)}}return{}}async getSourceContext(x,C,A=5){try{const B=this.currentFiles[x];if(!B){if(!this.nodepod)return;const j=this.resolvePath(x);if(!await this.nodepod.fs.exists(j))return;const $=await this.nodepod.fs.readFile(j,"utf-8");return this.formatSourceContext($,C,A)}return this.formatSourceContext(B,C,A)}catch{return}}formatSourceContext(x,C,A){const B=x.split(`
46663
+ `),j=Math.max(0,C-A-1),U=Math.min(B.length,C+A);return B.slice(j,U).map(($,Y)=>`${j+Y+1}: ${$}`).join(`
46664
+ `)}}const nx=`# .ranger — Project Manifest
46669
46665
  # This file provides context to the Ranger AI agent about project structure,
46670
46666
  # conventions, and schemas. Update this file when you add new files, routes,
46671
46667
  # or database tables.
@@ -46800,7 +46796,7 @@ To deploy to production with Postgres:
46800
46796
  4. Replace TEXT for timestamps → TIMESTAMP WITH TIME ZONE
46801
46797
  5. Add connection pooling config to config.js
46802
46798
  6. Everything else (repos, routes, middleware) stays the same
46803
- `,sN=`# =============================================================================
46799
+ `,tx=`# =============================================================================
46804
46800
  # Environment Configuration
46805
46801
  # Copy to .env and fill in values for your deployment
46806
46802
  # =============================================================================
@@ -46820,7 +46816,7 @@ JWT_EXPIRES_IN=24h
46820
46816
 
46821
46817
  # CORS
46822
46818
  CORS_ORIGIN=*
46823
- `,rN=`/**
46819
+ `,rx=`/**
46824
46820
  * config.js — Centralized configuration.
46825
46821
  *
46826
46822
  * Reads from process.env with sensible defaults for the sandbox.
@@ -46836,7 +46832,7 @@ var config = {
46836
46832
  };
46837
46833
 
46838
46834
  module.exports = config;
46839
- `,iN=`/**
46835
+ `,sx=`/**
46840
46836
  * db/database.js — SQLite database via sql.js (WASM).
46841
46837
  *
46842
46838
  * Provides a Postgres-compatible interface:
@@ -47016,7 +47012,7 @@ module.exports = {
47016
47012
  exec: exec,
47017
47013
  lastInsertRowId: lastInsertRowId,
47018
47014
  };
47019
- `,aN=`/**
47015
+ `,ix=`/**
47020
47016
  * Migration 001 — Initial schema.
47021
47017
  *
47022
47018
  * Creates the core tables with proper types, constraints, and indexes.
@@ -47083,7 +47079,7 @@ module.exports = [
47083
47079
  \`,
47084
47080
  },
47085
47081
  ];
47086
- `,oN=`/**
47082
+ `,ax=`/**
47087
47083
  * db/repositories/userRepository.js — User data access layer.
47088
47084
  *
47089
47085
  * All database queries for the users table. Uses parameterized SQL.
@@ -47175,7 +47171,7 @@ module.exports = {
47175
47171
  findAll: findAll,
47176
47172
  count: count,
47177
47173
  };
47178
- `,lN=`/**
47174
+ `,ox=`/**
47179
47175
  * db/repositories/itemRepository.js — Item data access layer.
47180
47176
  *
47181
47177
  * All database queries for the items table. Uses parameterized SQL.
@@ -47316,7 +47312,7 @@ module.exports = {
47316
47312
  remove: remove,
47317
47313
  getStats: getStats,
47318
47314
  };
47319
- `,cN=`/**
47315
+ `,lx=`/**
47320
47316
  * middleware/auth.js — JWT authentication.
47321
47317
  *
47322
47318
  * In the sandbox, JWT is a base64-encoded JSON payload (no crypto).
@@ -47429,7 +47425,7 @@ module.exports = {
47429
47425
  authenticate: authenticate,
47430
47426
  requireRole: requireRole,
47431
47427
  };
47432
- `,uN=`/**
47428
+ `,cx=`/**
47433
47429
  * middleware/errorHandler.js — Global error handling.
47434
47430
  *
47435
47431
  * - notFound: 404 handler that serves index.html for SPA routes
@@ -47477,7 +47473,7 @@ module.exports = {
47477
47473
  notFound: notFound,
47478
47474
  errorHandler: errorHandler,
47479
47475
  };
47480
- `,dN=`/**
47476
+ `,ux=`/**
47481
47477
  * middleware/staticFiles.js — Static file serving for Nodepod.
47482
47478
  *
47483
47479
  * Nodepod doesn't support express.static() or res.sendFile().
@@ -47535,7 +47531,7 @@ function serveStatic(req, res, next) {
47535
47531
  }
47536
47532
 
47537
47533
  module.exports = serveStatic;
47538
- `,hN=`/**
47534
+ `,dx=`/**
47539
47535
  * middleware/validate.js — Request validation helpers.
47540
47536
  *
47541
47537
  * Simple validation middleware factory. For production, consider
@@ -47586,7 +47582,7 @@ module.exports = {
47586
47582
  requireFields: requireFields,
47587
47583
  allowedValues: allowedValues,
47588
47584
  };
47589
- `,pN=`/**
47585
+ `,px=`/**
47590
47586
  * routes/auth.js — Authentication endpoints.
47591
47587
  *
47592
47588
  * POST /api/auth/register — Create new account
@@ -47687,7 +47683,7 @@ router.get('/me', auth.authenticate, function(req, res) {
47687
47683
  });
47688
47684
 
47689
47685
  module.exports = router;
47690
- `,fN=`/**
47686
+ `,hx=`/**
47691
47687
  * routes/items.js — Item CRUD endpoints.
47692
47688
  *
47693
47689
  * All routes require authentication (JWT).
@@ -47832,7 +47828,7 @@ router.delete('/:id', function(req, res) {
47832
47828
  });
47833
47829
 
47834
47830
  module.exports = router;
47835
- `,mN=`/**
47831
+ `,fx=`/**
47836
47832
  * server.js — Express application entry point.
47837
47833
  *
47838
47834
  * Middleware chain:
@@ -47920,7 +47916,7 @@ db.initialize().then(function() {
47920
47916
  console.error('[FATAL] Failed to initialize database:', err && err.message ? err.message : err);
47921
47917
  console.error('[FATAL] Stack:', err && err.stack ? err.stack : 'no stack');
47922
47918
  });
47923
- `,gN=`<!DOCTYPE html>
47919
+ `,mx=`<!DOCTYPE html>
47924
47920
  <html lang="en">
47925
47921
  <head>
47926
47922
  <meta charset="UTF-8">
@@ -47972,7 +47968,7 @@ db.initialize().then(function() {
47972
47968
  <!-- App (must be last) -->
47973
47969
  <script src="/App.js"><\/script>
47974
47970
  </body>
47975
- </html>`,yN=`/*
47971
+ </html>`,gx=`/*
47976
47972
  * Ranger Theme Variables — chart colors and design tokens.
47977
47973
  * HSL values stored WITHOUT hsl() wrapper; consume as: color: hsl(var(--chart-1));
47978
47974
  */
@@ -48077,7 +48073,7 @@ db.initialize().then(function() {
48077
48073
  from { opacity: 0; transform: translateY(-16px) scale(0.95); }
48078
48074
  to { opacity: 1; transform: translateY(0) scale(1); }
48079
48075
  }
48080
- `,_N=`/**
48076
+ `,_x=`/**
48081
48077
  * lib/api.js — API client.
48082
48078
  *
48083
48079
  * Wraps fetch() with:
@@ -48143,7 +48139,7 @@ window.ApiClient = (function() {
48143
48139
  del: function(path) { return request(path, { method: 'DELETE' }); },
48144
48140
  };
48145
48141
  })();
48146
- `,bN=`/**
48142
+ `,yx=`/**
48147
48143
  * store/AuthContext.js — Authentication state management.
48148
48144
  *
48149
48145
  * Provides:
@@ -48280,7 +48276,7 @@ window.useAuth = function useAuth() {
48280
48276
  if (!context) throw new Error('useAuth must be used within AuthProvider');
48281
48277
  return context;
48282
48278
  };
48283
- `,vN=`/**
48279
+ `,bx=`/**
48284
48280
  * store/AppContext.js — Application state management.
48285
48281
  *
48286
48282
  * Manages items, loading states, filters, and toasts.
@@ -48465,7 +48461,7 @@ window.useApp = function useApp() {
48465
48461
  if (!context) throw new Error('useApp must be used within AppProvider');
48466
48462
  return context;
48467
48463
  };
48468
- `,wN=`var h = React.createElement;
48464
+ `,vx=`var h = React.createElement;
48469
48465
 
48470
48466
  /**
48471
48467
  * Toast — Notification toast displayed at top-right.
@@ -48490,7 +48486,7 @@ window.Toast = function Toast(props) {
48490
48486
  })
48491
48487
  );
48492
48488
  };
48493
- `,SN=`var h = React.createElement;
48489
+ `,wx=`var h = React.createElement;
48494
48490
  var RR = ReactRouterDOM;
48495
48491
 
48496
48492
  /**
@@ -48546,7 +48542,7 @@ window.Navbar = function Navbar() {
48546
48542
  )
48547
48543
  );
48548
48544
  };
48549
- `,xN=`var h = React.createElement;
48545
+ `,Sx=`var h = React.createElement;
48550
48546
 
48551
48547
  var STATUS_STYLES = {
48552
48548
  todo: { bg: 'bg-gray-100', text: 'text-gray-600', label: 'To Do' },
@@ -48604,7 +48600,7 @@ window.ItemCard = function ItemCard(props) {
48604
48600
  )
48605
48601
  );
48606
48602
  };
48607
- `,EN=`var h = React.createElement;
48603
+ `,xx=`var h = React.createElement;
48608
48604
 
48609
48605
  /**
48610
48606
  * ItemForm — Create or edit an item.
@@ -48717,7 +48713,7 @@ window.ItemForm = function ItemForm(props) {
48717
48713
  )
48718
48714
  );
48719
48715
  };
48720
- `,kN=`var h = React.createElement;
48716
+ `,Ex=`var h = React.createElement;
48721
48717
  var RR = ReactRouterDOM;
48722
48718
 
48723
48719
  /**
@@ -48809,7 +48805,7 @@ function _featureCard(title, desc, icon) {
48809
48805
  h('p', { className: 'text-sm text-gray-500' }, desc)
48810
48806
  );
48811
48807
  }
48812
- `,CN=`var h = React.createElement;
48808
+ `,kx=`var h = React.createElement;
48813
48809
  var RR = ReactRouterDOM;
48814
48810
 
48815
48811
  /**
@@ -48891,7 +48887,7 @@ window.LoginPage = function LoginPage() {
48891
48887
  )
48892
48888
  );
48893
48889
  };
48894
- `,AN=`var h = React.createElement;
48890
+ `,Cx=`var h = React.createElement;
48895
48891
  var RR = ReactRouterDOM;
48896
48892
 
48897
48893
  /**
@@ -48985,7 +48981,7 @@ window.RegisterPage = function RegisterPage() {
48985
48981
  )
48986
48982
  );
48987
48983
  };
48988
- `,TN=`var h = React.createElement;
48984
+ `,Ax=`var h = React.createElement;
48989
48985
 
48990
48986
  /**
48991
48987
  * StatsChart — Renders a doughnut chart of item status distribution
@@ -49104,7 +49100,7 @@ window.StatsChart = function StatsChart(props) {
49104
49100
  )
49105
49101
  );
49106
49102
  };
49107
- `,IN=`var h = React.createElement;
49103
+ `,Tx=`var h = React.createElement;
49108
49104
  var RR = ReactRouterDOM;
49109
49105
 
49110
49106
  /**
@@ -49262,7 +49258,7 @@ function _filterSelect(label, value, options, onChange) {
49262
49258
  })
49263
49259
  );
49264
49260
  }
49265
- `,RN=`var h = React.createElement;
49261
+ `,Ix=`var h = React.createElement;
49266
49262
  var RR = ReactRouterDOM;
49267
49263
 
49268
49264
  /**
@@ -49342,7 +49338,7 @@ function App() {
49342
49338
 
49343
49339
  // Mount
49344
49340
  ReactDOM.createRoot(document.getElementById('root')).render(h(App));
49345
- `,PN=`# ===========================================================================
49341
+ `,Rx=`# ===========================================================================
49346
49342
  # Dockerfile — Production-ready multi-stage build
49347
49343
  #
49348
49344
  # Supports two modes:
@@ -49409,7 +49405,7 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \\
49409
49405
  CMD wget -qO- http://localhost:3000/api/health || exit 1
49410
49406
 
49411
49407
  CMD ["node", "server.js"]
49412
- `,DN=`node_modules
49408
+ `,Px=`node_modules
49413
49409
  npm-debug.log*
49414
49410
  .env
49415
49411
  .env.local
@@ -49419,7 +49415,7 @@ npm-debug.log*
49419
49415
  .DS_Store
49420
49416
  *.md
49421
49417
  !README.md
49422
- `,ON=`# docker-compose.yml — Local development and production deployment
49418
+ `,Dx=`# docker-compose.yml — Local development and production deployment
49423
49419
  #
49424
49420
  # Usage:
49425
49421
  # SQLite (default): docker compose up
@@ -49470,7 +49466,7 @@ services:
49470
49466
  volumes:
49471
49467
  app-data:
49472
49468
  pg-data:
49473
- `,NN=`# Starter App
49469
+ `,Ox=`# Starter App
49474
49470
 
49475
49471
  A production-ready full-stack application built with **Express.js** and **React**.
49476
49472
 
@@ -49701,7 +49697,7 @@ code changes** in your route/repository layer.
49701
49697
  ## License
49702
49698
 
49703
49699
  MIT
49704
- `,BN=`# Contributing
49700
+ `,Nx=`# Contributing
49705
49701
 
49706
49702
  Thank you for considering contributing to this project.
49707
49703
 
@@ -49861,7 +49857,7 @@ When adding new features:
49861
49857
  - [ ] New files are listed in \`.ranger\` manifest
49862
49858
  - [ ] Tests pass locally
49863
49859
  - [ ] No hardcoded secrets or credentials
49864
- `,LN=JSON.stringify({name:"starter-app",version:"1.0.0",description:"Full-stack Express + React starter with SQLite (sql.js)",dependencies:{express:"^4.18.0","sql.js":"^1.11.0"}},null,2),MN={entryCommand:"node server.js",port:3e3,files:{".ranger":nN,"package.json":LN,".env.example":sN,"config.js":rN,"server.js":mN,Dockerfile:PN,".dockerignore":DN,"docker-compose.yml":ON,"README.md":NN,"CONTRIBUTING.md":BN,"db/database.js":iN,"db/migrations/001_initial.js":aN,"db/repositories/userRepository.js":oN,"db/repositories/itemRepository.js":lN,"middleware/auth.js":cN,"middleware/errorHandler.js":uN,"middleware/staticFiles.js":dN,"middleware/validate.js":hN,"routes/auth.js":pN,"routes/items.js":fN,"public/index.html":gN,"public/styles.css":yN,"public/lib/api.js":_N,"public/store/AuthContext.js":bN,"public/store/AppContext.js":vN,"public/components/Toast.js":wN,"public/components/Navbar.js":SN,"public/components/ItemCard.js":xN,"public/components/ItemForm.js":EN,"public/components/StatsChart.js":TN,"public/pages/WelcomePage.js":kN,"public/pages/LoginPage.js":CN,"public/pages/RegisterPage.js":AN,"public/pages/DashboardPage.js":IN,"public/App.js":RN}},FN=`const express = require('express');
49860
+ `,Bx=JSON.stringify({name:"starter-app",version:"1.0.0",description:"Full-stack Express + React starter with SQLite (sql.js)",dependencies:{express:"^4.18.0","sql.js":"^1.11.0"}},null,2),Lx={entryCommand:"node server.js",port:3e3,files:{".ranger":nx,"package.json":Bx,".env.example":tx,"config.js":rx,"server.js":fx,Dockerfile:Rx,".dockerignore":Px,"docker-compose.yml":Dx,"README.md":Ox,"CONTRIBUTING.md":Nx,"db/database.js":sx,"db/migrations/001_initial.js":ix,"db/repositories/userRepository.js":ax,"db/repositories/itemRepository.js":ox,"middleware/auth.js":lx,"middleware/errorHandler.js":cx,"middleware/staticFiles.js":ux,"middleware/validate.js":dx,"routes/auth.js":px,"routes/items.js":hx,"public/index.html":mx,"public/styles.css":gx,"public/lib/api.js":_x,"public/store/AuthContext.js":yx,"public/store/AppContext.js":bx,"public/components/Toast.js":vx,"public/components/Navbar.js":wx,"public/components/ItemCard.js":Sx,"public/components/ItemForm.js":xx,"public/components/StatsChart.js":Ax,"public/pages/WelcomePage.js":Ex,"public/pages/LoginPage.js":kx,"public/pages/RegisterPage.js":Cx,"public/pages/DashboardPage.js":Tx,"public/App.js":Ix}},Fx=`const express = require('express');
49865
49861
  const fs = require('fs');
49866
49862
  const path = require('path');
49867
49863
  const app = express();
@@ -49973,7 +49969,7 @@ app.use(serveStatic);
49973
49969
  app.listen(PORT, function() {
49974
49970
  console.log('Server running on port ' + PORT);
49975
49971
  });
49976
- `,$N=`<!DOCTYPE html>
49972
+ `,Mx=`<!DOCTYPE html>
49977
49973
  <html lang="en">
49978
49974
  <head>
49979
49975
  <meta charset="UTF-8">
@@ -49994,7 +49990,7 @@ app.listen(PORT, function() {
49994
49990
  <script src="/components/UserDetail.js"><\/script>
49995
49991
  <script src="/App.js"><\/script>
49996
49992
  </body>
49997
- </html>`,UN=`.tab-active {
49993
+ </html>`,$x=`.tab-active {
49998
49994
  border-bottom: 2px solid #3b82f6;
49999
49995
  color: #3b82f6;
50000
49996
  }
@@ -50009,7 +50005,7 @@ app.listen(PORT, function() {
50009
50005
  from { opacity: 0; transform: translateY(8px); }
50010
50006
  to { opacity: 1; transform: translateY(0); }
50011
50007
  }
50012
- `,jN=`var e = React.createElement;
50008
+ `,Ux=`var e = React.createElement;
50013
50009
 
50014
50010
  /**
50015
50011
  * PostCard — Renders a single post as a clickable card.
@@ -50031,7 +50027,7 @@ window.PostCard = function PostCard(props) {
50031
50027
  e('p', { className: 'text-sm text-gray-500 line-clamp-2' }, post.body)
50032
50028
  );
50033
50029
  };
50034
- `,VN=`var e = React.createElement;
50030
+ `,jx=`var e = React.createElement;
50035
50031
 
50036
50032
  /**
50037
50033
  * UserCard — Renders a user profile card with avatar.
@@ -50059,7 +50055,7 @@ window.UserCard = function UserCard(props) {
50059
50055
  )
50060
50056
  );
50061
50057
  };
50062
- `,HN=`var e = React.createElement;
50058
+ `,Hx=`var e = React.createElement;
50063
50059
 
50064
50060
  /**
50065
50061
  * CommentCard — Renders a single comment.
@@ -50078,7 +50074,7 @@ window.CommentCard = function CommentCard(props) {
50078
50074
  e('p', { className: 'text-sm text-gray-600' }, c.body)
50079
50075
  );
50080
50076
  };
50081
- `,WN=`var e = React.createElement;
50077
+ `,Wx=`var e = React.createElement;
50082
50078
 
50083
50079
  /**
50084
50080
  * PostDetail — Full post view with comments.
@@ -50120,7 +50116,7 @@ window.PostDetail = function PostDetail(props) {
50120
50116
  : e('p', { className: 'text-gray-400 text-sm' }, 'No comments found.')
50121
50117
  );
50122
50118
  };
50123
- `,zN=`var e = React.createElement;
50119
+ `,Vx=`var e = React.createElement;
50124
50120
 
50125
50121
  /**
50126
50122
  * UserDetail — Full user profile with their posts.
@@ -50183,7 +50179,7 @@ window.UserDetail = function UserDetail(props) {
50183
50179
  : e('p', { className: 'text-gray-400 text-sm' }, 'No posts found.')
50184
50180
  );
50185
50181
  };
50186
- `,qN=`var e = React.createElement;
50182
+ `,qx=`var e = React.createElement;
50187
50183
 
50188
50184
  /**
50189
50185
  * App — Main application component.
@@ -50334,5 +50330,4 @@ function App() {
50334
50330
 
50335
50331
  // Mount
50336
50332
  ReactDOM.createRoot(document.getElementById('root')).render(e(App));
50337
- `,JS={"express-react":{entryCommand:"node server.js",port:3e3,files:{"package.json":JSON.stringify({name:"sandbox-app",version:"1.0.0",dependencies:{express:"^4.18.0"}},null,2),"server.js":FN,"public/index.html":$N,"public/styles.css":UN,"public/App.js":qN,"public/components/PostCard.js":jN,"public/components/UserCard.js":VN,"public/components/CommentCard.js":HN,"public/components/PostDetail.js":WN,"public/components/UserDetail.js":zN}},"fullstack-starter":MN};function QS(a){return JS[a]||null}function GN(){return Object.keys(JS)}const or="[CodeSandbox:useRuntime]",KN=new Set(["css","html","htm","svg","png","jpg","jpeg","gif","webp","ico","woff","woff2","ttf","eot"]);function YN(a){var l;const i=(l=a.split(".").pop())==null?void 0:l.toLowerCase();return i?KN.has(i):!1}function ZN(a,i){const l={};for(const u of Object.keys(i))u in a?a[u]!==i[u]&&(l[u]="modified"):l[u]="new";for(const u of Object.keys(a))u in i||(l[u]="deleted");return l}function ex(a){const{files:i,template:l,entryCommand:u,port:h,env:m,onFileChange:f,onServerReady:_,onProgress:b,onError:v,onSandboxError:w,onFilesUpdated:E}=a,A=q.useRef(null),R=q.useRef(!1),P=q.useRef(w);P.current=w;const j=q.useRef(E);j.current=E;const[M,B]=q.useState({status:"initializing",progress:{stage:"initializing",message:"Preparing...",percent:0},previewUrl:null,terminalOutput:[],files:{},originalFiles:{},fileChanges:{},previewReloadKey:0,error:null,errors:[]}),[Y,H]=q.useState(null),[Z,re]=q.useState([]),ge=q.useCallback(ee=>{var pe;B(De=>({...De,errors:[...De.errors,ee]})),(pe=P.current)==null||pe.call(P,ee)},[]),se=q.useCallback(async ee=>{const pe=A.current;pe&&await pe.reportError(ee),ge(ee)},[ge]),ae=q.useCallback(()=>{var ee;if(i&&Object.keys(i).length>0){let pe=u||"node server.js";if(!u&&i["package.json"])try{const De=JSON.parse(i["package.json"]);(ee=De.scripts)!=null&&ee.start&&(pe=De.scripts.start)}catch{}return{files:i,entryCommand:pe,port:h||3e3}}if(l){const pe=QS(l);if(pe)return{files:pe.files,entryCommand:u||pe.entryCommand,port:h||pe.port}}return null},[i,l,u,h]),xe=q.useCallback((ee,pe,De)=>{const be=new XS({files:ee,entryCommand:pe,port:De,env:m});A.current=be,B(Pe=>({...Pe,files:ee}));const Qe=Object.keys(ee),it=Qe.find(Pe=>Pe==="server.js")||Qe.find(Pe=>Pe==="index.js")||Qe.find(Pe=>Pe.endsWith(".js"))||Qe[0];return it&&(H(it),re([it])),be.setProgressCallback(Pe=>{B(fe=>({...fe,status:Pe.stage,progress:Pe,previewUrl:be.getPreviewUrl(),error:Pe.stage==="error"?Pe.message:fe.error})),b==null||b(Pe),Pe.stage==="error"&&(v==null||v(Pe.message))}),be.setOutputCallback(Pe=>{B(fe=>({...fe,terminalOutput:[...fe.terminalOutput,Pe]}))}),be.setServerReadyCallback((Pe,fe)=>{B(Ce=>({...Ce,previewUrl:fe,status:"ready"})),_==null||_(Pe,fe)}),be.setErrorCallback(ge),be.boot().catch(Pe=>{const fe=Pe instanceof Error?Pe.message:String(Pe);v==null||v(fe)}),be},[m,b,v,_,ge]),oe=q.useCallback(async(ee,pe)=>{var je,_e;const De=(pe==null?void 0:pe.restartServer)!==!1,be=A.current;if(!be){if(R.current){console.warn(or,"updateFiles called but runtime is gone (already torn down)");return}R.current=!0;let et=u||"node server.js";if(!u&&ee["package.json"])try{const tn=JSON.parse(ee["package.json"]);(je=tn.scripts)!=null&&je.start&&(et=tn.scripts.start)}catch{}xe(ee,et,h||3e3);return}const Qe=be.getCurrentFiles();let it=!1;const Pe=[];for(const[et,$t]of Object.entries(ee))if(Qe[et]!==$t)try{await be.writeFile(et,$t),it=!0,Pe.push(et),console.log(or,`updated file: ${et}`)}catch(tn){console.warn(or,`failed to write ${et}:`,tn)}const fe=ZN(Qe,ee),Ce=it&&Pe.length>0&&Pe.every(YN);if(it&&De)if(Ce)console.log(or,`hot reload: ${Pe.length} static file(s) changed — refreshing preview`),B(et=>({...et,originalFiles:Qe,files:ee,fileChanges:fe,previewReloadKey:et.previewReloadKey+1}));else{console.log(or,`cold restart: ${Pe.length} file(s) changed — restarting server`),B(et=>({...et,originalFiles:Qe,files:ee,fileChanges:fe}));try{await be.restart()}catch(et){console.error(or,"restart failed:",et)}}else B(et=>({...et,originalFiles:Qe,files:ee,fileChanges:fe}));(_e=j.current)==null||_e.call(j,fe)},[u,h,xe]),Fe=q.useCallback(async(ee,pe)=>{const De=A.current;if(!De){console.warn(or,"updateFile called but runtime not ready. Use updateFiles() for initial load.");return}try{await De.writeFile(ee,pe)}catch(be){console.error(`Failed to write file ${ee}:`,be)}B(be=>{const Qe={...be.files,[ee]:pe},it={...be.fileChanges};return ee in be.originalFiles?be.originalFiles[ee]!==pe?it[ee]="modified":delete it[ee]:it[ee]="new",{...be,files:Qe,fileChanges:it}})},[]);q.useEffect(()=>{if(R.current)return;const ee=ae();if(ee){if(R.current=!0,Object.keys(ee.files).length===0)return;xe(ee.files,ee.entryCommand,ee.port)}return()=>{var pe;(pe=A.current)==null||pe.teardown(),A.current=null}},[]);const ie=q.useCallback(async(ee,pe)=>{const De=A.current;if(De){try{await De.writeFile(ee,pe)}catch(be){console.error(`Failed to write file ${ee}:`,be)}B(be=>{const Qe={...be.files,[ee]:pe},it={...be.fileChanges};return ee in be.originalFiles?be.originalFiles[ee]!==pe?it[ee]="modified":delete it[ee]:it[ee]="new",{...be,files:Qe,fileChanges:it}}),f==null||f(ee,pe)}},[f]),Ee=q.useCallback(ee=>{H(ee),re(pe=>pe.includes(ee)?pe:[...pe,ee])},[]),Be=q.useCallback(ee=>{re(pe=>{const De=pe.filter(be=>be!==ee);return Y===ee&&H(De.length>0?De[De.length-1]:null),De})},[Y]),ke=q.useCallback(async()=>{const ee=A.current;ee&&await ee.restart()},[]),Ae=q.useCallback(()=>{var ee;return((ee=A.current)==null?void 0:ee.getCurrentFiles())??{}},[]),We=q.useCallback(()=>{var ee;return((ee=A.current)==null?void 0:ee.getChangedFiles())??{}},[]),Re=q.useCallback(()=>M.fileChanges,[M.fileChanges]),Je=q.useCallback(()=>M.errors,[M.errors]),vt=q.useCallback(()=>M,[M]);return{state:M,selectedFile:Y,openFiles:Z,handleFileChange:ie,handleSelectFile:Ee,handleCloseFile:Be,handleBrowserError:se,restart:ke,updateFiles:oe,updateFile:Fe,getFiles:Ae,getChangedFiles:We,getFileChanges:Re,getErrors:Je,getState:vt,runtime:A}}const tx=q.forwardRef(function(i,l){const{className:u="",height:h="100vh",port:m=3e3}=i,f=ex(i),{state:_,selectedFile:b,openFiles:v,handleFileChange:w,handleSelectFile:E,handleCloseFile:A,handleBrowserError:R,restart:P,updateFiles:j,updateFile:M,getFiles:B,getChangedFiles:Y,getFileChanges:H,getErrors:Z,getState:re}=f;q.useImperativeHandle(l,()=>({updateFiles:j,updateFile:M,restart:P,getFiles:B,getChangedFiles:Y,getFileChanges:H,getErrors:Z,getState:re}),[j,M,P,B,Y,H,Z,re]);const ge=q.useMemo(()=>WS(_.files),[_.files]),se=_.status!=="ready"&&_.status!=="error",[ae,xe]=q.useState("code"),oe=!!_.previewUrl;q.useEffect(()=>{oe&&xe("preview")},[oe]);const Fe=q.useCallback(ie=>{E(ie),xe("code")},[E]);return O.jsxs("div",{className:`sb-root relative w-full bg-sb-bg text-sb-text overflow-hidden flex flex-col ${u}`,style:{height:h},children:[se&&O.jsx(YS,{progress:_.progress}),O.jsx(JN,{activeView:ae,onViewChange:xe,previewUrl:_.previewUrl,port:m,onRefresh:P}),O.jsxs("div",{className:"flex-1 relative overflow-hidden min-h-0",children:[O.jsx(Ud.div,{className:"absolute inset-0",initial:!1,animate:{opacity:ae==="code"?1:0,pointerEvents:ae==="code"?"auto":"none"},transition:{duration:.15},children:O.jsx(e3,{fileTree:ge,files:_.files,originalFiles:_.originalFiles,fileChanges:_.fileChanges,selectedFile:b,openFiles:v,terminalOutput:_.terminalOutput,onSelectFile:Fe,onCloseFile:A,onFileChange:w})}),O.jsx(Ud.div,{className:"absolute inset-0",initial:!1,animate:{opacity:ae==="preview"?1:0,pointerEvents:ae==="preview"?"auto":"none"},transition:{duration:.15},children:O.jsx(KS,{url:_.previewUrl,onBrowserError:R,reloadKey:_.previewReloadKey})})]})]})});tx.displayName="CodeSandbox";function XN(a,i){if(!a)return"";const l=a.match(/\/__(?:preview|virtual)__\/\d+(\/.*)?$/),u=(l==null?void 0:l[1])??"/";return`localhost:${i}${u}`}function JN({activeView:a,onViewChange:i,previewUrl:l,port:u,onRefresh:h}){const m=XN(l,u);return O.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 bg-sb-bg-alt border-b border-sb-border min-h-[36px] shrink-0",children:[O.jsx(ZS,{selected:a,onSelect:i}),O.jsx("div",{className:"flex-1 min-w-0",children:a==="preview"?O.jsxs("div",{className:"flex items-center gap-1.5",children:[O.jsx("button",{className:"shrink-0 p-1 rounded text-sb-text-muted hover:text-sb-text-active hover:bg-sb-bg-hover transition-colors text-xs",onClick:h,title:"Refresh preview",children:O.jsx(QN,{})}),O.jsx("div",{className:"flex-1 min-w-0 bg-sb-bg rounded px-2 py-0.5 text-xs text-sb-text-muted font-mono truncate",children:l?m:"Waiting for server..."})]}):O.jsx("div",{className:"text-xs text-sb-text-muted px-1 truncate",children:"Editor"})})]})}function QN(){return O.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[O.jsx("polyline",{points:"23 4 23 10 17 10"}),O.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})}function e3({fileTree:a,files:i,originalFiles:l,fileChanges:u,selectedFile:h,openFiles:m,terminalOutput:f,onSelectFile:_,onCloseFile:b,onFileChange:v}){const[w,E]=q.useState(!1);return O.jsx("div",{className:"h-full w-full",children:O.jsxs(qu,{children:[O.jsx(qu.Pane,{preferredSize:200,minSize:120,maxSize:350,children:O.jsx(zS,{files:a,selectedFile:h,onSelectFile:_,fileChanges:u})}),O.jsx(qu.Pane,{children:O.jsxs("div",{className:"h-full flex flex-col",children:[O.jsx("div",{className:"flex-1 min-h-0",style:{height:w?"100%":"70%"},children:O.jsx("div",{className:"h-full",children:O.jsx(GS,{files:i,originalFiles:l,fileChanges:u,activeFile:h,openFiles:m,onSelectFile:_,onCloseFile:b,onFileChange:v})})}),w?O.jsx(jd,{output:f,minimized:!0,onToggleMinimize:()=>E(!1)}):O.jsx("div",{style:{height:"30%",minHeight:60},children:O.jsx(jd,{output:f,minimized:!1,onToggleMinimize:()=>E(!0)})})]})})]})})}exports.BootOverlay=YS;exports.CodeEditor=GS;exports.CodeSandbox=tx;exports.FileTree=zS;exports.NodepodRuntime=XS;exports.Preview=KS;exports.Terminal=jd;exports.ViewSlider=ZS;exports.buildFileTree=WS;exports.getTemplate=QS;exports.listTemplates=GN;exports.useRuntime=ex;
50338
- //# sourceMappingURL=index.cjs.map
50333
+ `,fy={"express-react":{entryCommand:"node server.js",port:3e3,files:{"package.json":JSON.stringify({name:"sandbox-app",version:"1.0.0",dependencies:{express:"^4.18.0"}},null,2),"server.js":Fx,"public/index.html":Mx,"public/styles.css":$x,"public/App.js":qx,"public/components/PostCard.js":Ux,"public/components/UserCard.js":jx,"public/components/CommentCard.js":Hx,"public/components/PostDetail.js":Wx,"public/components/UserDetail.js":Vx}},"fullstack-starter":Lx};function my(D){return fy[D]||null}function zx(){return Object.keys(fy)}const br="[CodeSandbox:useRuntime]",Gx=new Set(["css","html","htm","svg","png","jpg","jpeg","gif","webp","ico","woff","woff2","ttf","eot"]);function Kx(D){var C;const x=(C=D.split(".").pop())==null?void 0:C.toLowerCase();return x?Gx.has(x):!1}function Yx(D,x){const C={};for(const A of Object.keys(x))A in D?D[A]!==x[A]&&(C[A]="modified"):C[A]="new";for(const A of Object.keys(D))A in x||(C[A]="deleted");return C}function gy(D){const{files:x,template:C,entryCommand:A,port:B,env:j,onFileChange:U,onServerReady:$,onProgress:Y,onError:V,onSandboxError:K,onFilesUpdated:ie}=D,ce=J.useRef(null),Le=J.useRef(!1),sn=J.useRef(K);sn.current=K;const An=J.useRef(ie);An.current=ie;const[ye,Fe]=J.useState({status:"initializing",progress:{stage:"initializing",message:"Preparing...",percent:0},previewUrl:null,terminalOutput:[],files:{},originalFiles:{},fileChanges:{},previewReloadKey:0,error:null,errors:[]}),[Tn,we]=J.useState(null),[ze,In]=J.useState([]),pn=J.useCallback(q=>{var Q;Fe(Ee=>({...Ee,errors:[...Ee.errors,q]})),(Q=sn.current)==null||Q.call(sn,q)},[]),Zn=J.useCallback(async q=>{const Q=ce.current;Q&&await Q.reportError(q),pn(q)},[pn]),mt=J.useCallback(()=>{var q;if(x&&Object.keys(x).length>0){let Q=A||"node server.js";if(!A&&x["package.json"])try{const Ee=JSON.parse(x["package.json"]);(q=Ee.scripts)!=null&&q.start&&(Q=Ee.scripts.start)}catch{}return{files:x,entryCommand:Q,port:B||3e3}}if(C){const Q=my(C);if(Q)return{files:Q.files,entryCommand:A||Q.entryCommand,port:B||Q.port}}return null},[x,C,A,B]),Xn=J.useCallback((q,Q,Ee)=>{const ae=new hy({files:q,entryCommand:Q,port:Ee,env:j});ce.current=ae,Fe(ue=>({...ue,files:q}));const Ge=Object.keys(q),We=Ge.find(ue=>ue==="server.js")||Ge.find(ue=>ue==="index.js")||Ge.find(ue=>ue.endsWith(".js"))||Ge[0];return We&&(we(We),In([We])),ae.setProgressCallback(ue=>{Fe(Ke=>({...Ke,status:ue.stage,progress:ue,previewUrl:ae.getPreviewUrl(),error:ue.stage==="error"?ue.message:Ke.error})),Y==null||Y(ue),ue.stage==="error"&&(V==null||V(ue.message))}),ae.setOutputCallback(ue=>{Fe(Ke=>({...Ke,terminalOutput:[...Ke.terminalOutput,ue]}))}),ae.setServerReadyCallback((ue,Ke)=>{Fe(vr=>({...vr,previewUrl:Ke,status:"ready"})),$==null||$(ue,Ke)}),ae.setErrorCallback(pn),ae.boot().catch(ue=>{const Ke=ue instanceof Error?ue.message:String(ue);V==null||V(Ke)}),ae},[j,Y,V,$,pn]),an=J.useCallback(async(q,Q)=>{var Jn,ve;const Ee=(Q==null?void 0:Q.restartServer)!==!1,ae=ce.current;if(!ae){if(Le.current){console.warn(br,"updateFiles called but runtime is gone (already torn down)");return}Le.current=!0;let Te=A||"node server.js";if(!A&&q["package.json"])try{const Rn=JSON.parse(q["package.json"]);(Jn=Rn.scripts)!=null&&Jn.start&&(Te=Rn.scripts.start)}catch{}Xn(q,Te,B||3e3);return}const Ge=ae.getCurrentFiles();let We=!1;const ue=[];for(const[Te,hn]of Object.entries(q))if(Ge[Te]!==hn)try{await ae.writeFile(Te,hn),We=!0,ue.push(Te),console.log(br,`updated file: ${Te}`)}catch(Rn){console.warn(br,`failed to write ${Te}:`,Rn)}const Ke=Yx(Ge,q),vr=We&&ue.length>0&&ue.every(Kx);if(We&&Ee)if(vr)console.log(br,`hot reload: ${ue.length} static file(s) changed — refreshing preview`),Fe(Te=>({...Te,originalFiles:Ge,files:q,fileChanges:Ke,previewReloadKey:Te.previewReloadKey+1}));else{console.log(br,`cold restart: ${ue.length} file(s) changed — restarting server`),Fe(Te=>({...Te,originalFiles:Ge,files:q,fileChanges:Ke}));try{await ae.restart()}catch(Te){console.error(br,"restart failed:",Te)}}else Fe(Te=>({...Te,originalFiles:Ge,files:q,fileChanges:Ke}));(ve=An.current)==null||ve.call(An,Ke)},[A,B,Xn]),ls=J.useCallback(async(q,Q)=>{const Ee=ce.current;if(!Ee){console.warn(br,"updateFile called but runtime not ready. Use updateFiles() for initial load.");return}try{await Ee.writeFile(q,Q)}catch(ae){console.error(`Failed to write file ${q}:`,ae)}Fe(ae=>{const Ge={...ae.files,[q]:Q},We={...ae.fileChanges};return q in ae.originalFiles?ae.originalFiles[q]!==Q?We[q]="modified":delete We[q]:We[q]="new",{...ae,files:Ge,fileChanges:We}})},[]);J.useEffect(()=>{if(Le.current)return;const q=mt();if(q){if(Le.current=!0,Object.keys(q.files).length===0)return;Xn(q.files,q.entryCommand,q.port)}return()=>{var Q;(Q=ce.current)==null||Q.teardown(),ce.current=null}},[]);const me=J.useCallback(async(q,Q)=>{const Ee=ce.current;if(Ee){try{await Ee.writeFile(q,Q)}catch(ae){console.error(`Failed to write file ${q}:`,ae)}Fe(ae=>{const Ge={...ae.files,[q]:Q},We={...ae.fileChanges};return q in ae.originalFiles?ae.originalFiles[q]!==Q?We[q]="modified":delete We[q]:We[q]="new",{...ae,files:Ge,fileChanges:We}}),U==null||U(q,Q)}},[U]),Pa=J.useCallback(q=>{we(q),In(Q=>Q.includes(q)?Q:[...Q,q])},[]),Da=J.useCallback(q=>{In(Q=>{const Ee=Q.filter(ae=>ae!==q);return Tn===q&&we(Ee.length>0?Ee[Ee.length-1]:null),Ee})},[Tn]),Oa=J.useCallback(async()=>{const q=ce.current;q&&await q.restart()},[]),Na=J.useCallback(()=>{var q;return((q=ce.current)==null?void 0:q.getCurrentFiles())??{}},[]),Ba=J.useCallback(()=>{var q;return((q=ce.current)==null?void 0:q.getChangedFiles())??{}},[]),fi=J.useCallback(()=>ye.fileChanges,[ye.fileChanges]),mi=J.useCallback(()=>ye.errors,[ye.errors]),gi=J.useCallback(()=>ye,[ye]);return{state:ye,selectedFile:Tn,openFiles:ze,handleFileChange:me,handleSelectFile:Pa,handleCloseFile:Da,handleBrowserError:Zn,restart:Oa,updateFiles:an,updateFile:ls,getFiles:Na,getChangedFiles:Ba,getFileChanges:fi,getErrors:mi,getState:gi,runtime:ce}}const _y=J.forwardRef(function(x,C){const{className:A="",height:B="100vh",port:j=3e3}=x,U=gy(x),{state:$,selectedFile:Y,openFiles:V,handleFileChange:K,handleSelectFile:ie,handleCloseFile:ce,handleBrowserError:Le,restart:sn,updateFiles:An,updateFile:ye,getFiles:Fe,getChangedFiles:Tn,getFileChanges:we,getErrors:ze,getState:In}=U;J.useImperativeHandle(C,()=>({updateFiles:An,updateFile:ye,restart:sn,getFiles:Fe,getChangedFiles:Tn,getFileChanges:we,getErrors:ze,getState:In}),[An,ye,sn,Fe,Tn,we,ze,In]);const pn=J.useMemo(()=>ay($.files),[$.files]),Zn=$.status!=="ready"&&$.status!=="error",[mt,Xn]=J.useState("code"),an=!!$.previewUrl;J.useEffect(()=>{an&&Xn("preview")},[an]);const ls=J.useCallback(me=>{ie(me),Xn("code")},[ie]);return y.jsxs("div",{className:`sb-root relative w-full bg-sb-bg text-sb-text overflow-hidden flex flex-col ${A}`,style:{height:B},children:[Zn&&y.jsx(dy,{progress:$.progress}),y.jsx(Xx,{activeView:mt,onViewChange:Xn,previewUrl:$.previewUrl,port:j,onRefresh:sn}),y.jsxs("div",{className:"flex-1 relative overflow-hidden min-h-0",children:[y.jsx(uc.motion.div,{className:"absolute inset-0",initial:!1,animate:{opacity:mt==="code"?1:0,pointerEvents:mt==="code"?"auto":"none"},transition:{duration:.15},children:y.jsx(Qx,{fileTree:pn,files:$.files,originalFiles:$.originalFiles,fileChanges:$.fileChanges,selectedFile:Y,openFiles:V,terminalOutput:$.terminalOutput,onSelectFile:ls,onCloseFile:ce,onFileChange:K})}),y.jsx(uc.motion.div,{className:"absolute inset-0",initial:!1,animate:{opacity:mt==="preview"?1:0,pointerEvents:mt==="preview"?"auto":"none"},transition:{duration:.15},children:y.jsx(uy,{url:$.previewUrl,onBrowserError:Le,reloadKey:$.previewReloadKey})})]})]})});_y.displayName="CodeSandbox";function Zx(D,x){if(!D)return"";const C=D.match(/\/__(?:preview|virtual)__\/\d+(\/.*)?$/),A=(C==null?void 0:C[1])??"/";return`localhost:${x}${A}`}function Xx({activeView:D,onViewChange:x,previewUrl:C,port:A,onRefresh:B}){const j=Zx(C,A);return y.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 bg-sb-bg-alt border-b border-sb-border min-h-[36px] shrink-0",children:[y.jsx(py,{selected:D,onSelect:x}),y.jsx("div",{className:"flex-1 min-w-0",children:D==="preview"?y.jsxs("div",{className:"flex items-center gap-1.5",children:[y.jsx("button",{className:"shrink-0 p-1 rounded text-sb-text-muted hover:text-sb-text-active hover:bg-sb-bg-hover transition-colors text-xs",onClick:B,title:"Refresh preview",children:y.jsx(Jx,{})}),y.jsx("div",{className:"flex-1 min-w-0 bg-sb-bg rounded px-2 py-0.5 text-xs text-sb-text-muted font-mono truncate",children:C?j:"Waiting for server..."})]}):y.jsx("div",{className:"text-xs text-sb-text-muted px-1 truncate",children:"Editor"})})]})}function Jx(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("polyline",{points:"23 4 23 10 17 10"}),y.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})}function Qx({fileTree:D,files:x,originalFiles:C,fileChanges:A,selectedFile:B,openFiles:j,terminalOutput:U,onSelectFile:$,onCloseFile:Y,onFileChange:V}){const[K,ie]=J.useState(!1);return y.jsx("div",{className:"h-full w-full",children:y.jsxs(rc.Allotment,{children:[y.jsx(rc.Allotment.Pane,{preferredSize:200,minSize:120,maxSize:350,children:y.jsx(oy,{files:D,selectedFile:B,onSelectFile:$,fileChanges:A})}),y.jsx(rc.Allotment.Pane,{children:y.jsxs("div",{className:"h-full flex flex-col",children:[y.jsx("div",{className:"flex-1 min-h-0",style:{height:K?"100%":"70%"},children:y.jsx("div",{className:"h-full",children:y.jsx(cy,{files:x,originalFiles:C,fileChanges:A,activeFile:B,openFiles:j,onSelectFile:$,onCloseFile:Y,onFileChange:V})})}),K?y.jsx(dc,{output:U,minimized:!0,onToggleMinimize:()=>ie(!1)}):y.jsx("div",{style:{height:"30%",minHeight:60},children:y.jsx(dc,{output:U,minimized:!1,onToggleMinimize:()=>ie(!0)})})]})})]})})}exports.BootOverlay=dy;exports.CodeEditor=cy;exports.CodeSandbox=_y;exports.FileTree=oy;exports.NodepodRuntime=hy;exports.Preview=uy;exports.Terminal=dc;exports.ViewSlider=py;exports.buildFileTree=ay;exports.getTemplate=my;exports.listTemplates=zx;exports.useRuntime=gy;