@illuma-ai/code-sandbox 1.0.0 → 1.1.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,41 +1,103 @@
1
- "use strict";var HA=Object.create;var Bv=Object.defineProperty;var WA=Object.getOwnPropertyDescriptor;var zA=Object.getOwnPropertyNames;var qA=Object.getPrototypeOf,GA=Object.prototype.hasOwnProperty;var KA=(a,i,l,u)=>{if(i&&typeof i=="object"||typeof i=="function")for(let h of zA(i))!GA.call(a,h)&&h!==l&&Bv(a,h,{get:()=>i[h],enumerable:!(u=WA(i,h))||u.enumerable});return a};var YA=(a,i,l)=>(l=a!=null?HA(qA(a)):{},KA(i||!a||!a.__esModule?Bv(l,"default",{value:a,enumerable:!0}):l,a));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react/jsx-runtime"),K=require("react");function si(){return si=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},si.apply(null,arguments)}var Uo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Aa(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Lv,Mv={exports:{}};/*!
1
+ "use strict";var GA=Object.create;var Fv=Object.defineProperty;var KA=Object.getOwnPropertyDescriptor;var YA=Object.getOwnPropertyNames;var ZA=Object.getPrototypeOf,XA=Object.prototype.hasOwnProperty;var JA=(a,i,l,u)=>{if(i&&typeof i=="object"||typeof i=="function")for(let h of YA(i))!XA.call(a,h)&&h!==l&&Fv(a,h,{get:()=>i[h],enumerable:!(u=KA(i,h))||u.enumerable});return a};var QA=(a,i,l)=>(l=a!=null?GA(ZA(a)):{},JA(i||!a||!a.__esModule?Fv(l,"default",{value:a,enumerable:!0}):l,a));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("react/jsx-runtime"),K=require("react");function ii(){return ii=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},ii.apply(null,arguments)}var jo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ia(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var $v,Uv={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
5
- */var Mu,Fv,$v,ZA=(Lv||(Lv=1,Mu=Mv,(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}Mu.exports?(i.default=i,Mu.exports=i):window.classNames=i})()),Mv.exports),ad=Aa(ZA),Uv,jv,XA=($v||($v=1,Fv=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}),Fv),JA=Aa(XA),Vv,Hv,wn=Aa((function(){if(jv)return Uv;jv=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(k){return typeof k=="symbol"||(function(A){return!!A&&typeof A=="object"})(k)&&m.call(k)=="[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 Uv=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(k,A,R){return k==k&&(R!==void 0&&(k=k<=R?k:R),A!==void 0&&(k=k>=A?k:A)),k})(_(b),v,w)}})()),QA=Aa((function(){if(Hv)return Vv;Hv=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 Uo=="object"&&Uo&&Uo.Object===Object&&Uo,f=typeof self=="object"&&self&&self.Object===Object&&self,_=m||f||Function("return this")(),b=Object.prototype.toString,v=Math.max,w=Math.min,k=function(){return _.Date.now()};function A(I){var M=typeof I;return!!I&&(M=="object"||M=="function")}function R(I){if(typeof I=="number")return I;if((function(B){return typeof B=="symbol"||(function(z){return!!z&&typeof z=="object"})(B)&&b.call(B)=="[object Symbol]"})(I))return NaN;if(A(I)){var M=typeof I.valueOf=="function"?I.valueOf():I;I=A(M)?M+"":M}if(typeof I!="string")return I===0?I:+I;I=I.replace(a,"");var $=l.test(I);return $||u.test(I)?h(I.slice(2),$?2:8):i.test(I)?NaN:+I}return Vv=function(I,M,$){var B,z,G,Z,ae,_e,re=0,Q=!1,he=!1,ie=!0;if(typeof I!="function")throw new TypeError("Expected a function");function Se(ke){var Ue=B,Ae=z;return B=z=void 0,re=ke,Z=I.apply(Ae,Ue)}function ee(ke){var Ue=ke-_e;return _e===void 0||Ue>=M||Ue<0||he&&ke-re>=G}function pe(){var ke=k();if(ee(ke))return Pe(ke);ae=setTimeout(pe,(function(Ue){var Ae=M-(Ue-_e);return he?w(Ae,G-(Ue-re)):Ae})(ke))}function Pe(ke){return ae=void 0,ie&&B?Se(ke):(B=z=void 0,Z)}function xe(){var ke=k(),Ue=ee(ke);if(B=arguments,z=this,_e=ke,Ue){if(ae===void 0)return(function(Ae){return re=Ae,ae=setTimeout(pe,M),Q?Se(Ae):Z})(_e);if(he)return ae=setTimeout(pe,M),Se(_e)}return ae===void 0&&(ae=setTimeout(pe,M)),Z}return M=R(M)||0,A($)&&(Q=!!$.leading,G=(he="maxWait"in $)?v(R($.maxWait)||0,M):G,ie="trailing"in $?!!$.trailing:ie),xe.cancel=function(){ae!==void 0&&clearTimeout(ae),re=0,B=_e=z=ae=void 0},xe.flush=function(){return ae===void 0?Z:Pe(k())},xe}})()),Wv={width:void 0,height:void 0};function eT(a){const{ref:i,box:l="content-box"}=a,[{width:u,height:h},m]=K.useState(Wv),f=(function(){const v=K.useRef(!1);return K.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]),K.useCallback(()=>v.current,[])})(),_=K.useRef(si({},Wv)),b=K.useRef(void 0);return b.current=a.onResize,K.useEffect(()=>{if(!i.current||typeof window>"u"||!("ResizeObserver"in window))return;const v=new ResizeObserver(([w])=>{const k=l==="border-box"?"borderBoxSize":l==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",A=zv(w,k,"inlineSize"),R=zv(w,k,"blockSize");if(_.current.width!==A||_.current.height!==R){const I={width:A,height:R};_.current.width=A,_.current.height=R,b.current?b.current(I):f()&&m(I)}});return v.observe(i.current,{box:l}),()=>{v.disconnect()}},[l,i,f]),{width:u,height:h}}function zv(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 tT="allotment-module_splitView__L-yRc",nT="allotment-module_sashContainer__fzwJF",sT="allotment-module_splitViewContainer__rQnVa",M0="allotment-module_splitViewView__MGZ6O",rT="allotment-module_vertical__WSwwa",iT="allotment-module_horizontal__7doS8",aT="allotment-module_separatorBorder__x-rDS";let ha,F0=!1,$0=!1;typeof navigator=="object"&&(ha=navigator.userAgent,$0=ha.indexOf("Macintosh")>=0,F0=(ha.indexOf("Macintosh")>=0||ha.indexOf("iPad")>=0||ha.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0);const U0=F0,oT=$0,qv=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?K.useLayoutEffect:K.useEffect;class lT{constructor(){this._size=void 0}getSize(){return this._size}setSize(i){this._size=i}}function jo(a,i){const l=a.length,u=l-i.length;return u>=0&&a.slice(u,l)===i}var Gv,Kv={exports:{}},cT=(Gv||(Gv=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,k,A){if(typeof w!="function")throw new TypeError("The listener must be a function");var R=new h(w,k||b,A),I=l?l+v:v;return b._events[I]?b._events[I].fn?b._events[I]=[b._events[I],R]:b._events[I].push(R):(b._events[I]=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 k=0,A=w.length,R=new Array(A);k<A;k++)R[k]=w[k].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,k,A,R){var I=l?l+b:b;if(!this._events[I])return!1;var M,$,B=this._events[I],z=arguments.length;if(B.fn){switch(B.once&&this.removeListener(b,B.fn,void 0,!0),z){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,k),!0;case 5:return B.fn.call(B.context,v,w,k,A),!0;case 6:return B.fn.call(B.context,v,w,k,A,R),!0}for($=1,M=new Array(z-1);$<z;$++)M[$-1]=arguments[$];B.fn.apply(B.context,M)}else{var G,Z=B.length;for($=0;$<Z;$++)switch(B[$].once&&this.removeListener(b,B[$].fn,void 0,!0),z){case 1:B[$].fn.call(B[$].context);break;case 2:B[$].fn.call(B[$].context,v);break;case 3:B[$].fn.call(B[$].context,v,w);break;case 4:B[$].fn.call(B[$].context,v,w,k);break;default:if(!M)for(G=1,M=new Array(z-1);G<z;G++)M[G-1]=arguments[G];B[$].fn.apply(B[$].context,M)}}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,k){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||k&&!R.once||w&&R.context!==w||f(this,A);else{for(var I=0,M=[],$=R.length;I<$;I++)(R[I].fn!==v||k&&!R[I].once||w&&R[I].context!==w)&&M.push(R[I]);M.length?this._events[A]=M.length===1?M[0]:M: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=_})(Kv)),Kv.exports),Dd=Aa(cT);function Yv(a,i){const l=a.indexOf(i);l>-1&&(a.splice(l,1),a.unshift(i))}function Fu(a,i){const l=a.indexOf(i);l>-1&&(a.splice(l,1),a.push(i))}function on(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 uT="sash-module_sash__K-9lB",dT="sash-module_disabled__Hm-wx",hT="sash-module_mac__Jf6OJ",Zv="sash-module_vertical__pB-rs",pT="sash-module_minimum__-UKxp",fT="sash-module_maximum__TCWxD",Xv="sash-module_horizontal__kFbiw",$u="sash-module_hover__80W6I",Uu="sash-module_active__bJspD";let cn=(function(a){return a.Vertical="VERTICAL",a.Horizontal="HORIZONTAL",a})({}),qt=(function(a){return a.Disabled="DISABLED",a.Minimum="MINIMUM",a.Maximum="MAXIMUM",a.Enabled="ENABLED",a})({}),j0=U0?20:8;const V0=new Dd;class Jv extends Dd{get state(){return this._state}set state(i){this._state!==i&&(this.el.classList.toggle(dT,i===qt.Disabled),this.el.classList.toggle("sash-disabled",i===qt.Disabled),this.el.classList.toggle(pT,i===qt.Minimum),this.el.classList.toggle("sash-minimum",i===qt.Minimum),this.el.classList.toggle(fT,i===qt.Maximum),this.el.classList.toggle("sash-maximum",i===qt.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=QA(m=>m.classList.add("sash-hover",$u),this.hoverDelay),this._state=qt.Enabled,this.onPointerStart=m=>{const f=m.pageX,_=m.pageY,b={startX:f,currentX:f,startY:_,currentY:_};this.el.classList.add("sash-active",Uu),this.emit("start",b),this.el.setPointerCapture(m.pointerId);const v=k=>{k.preventDefault();const A={startX:f,currentX:k.pageX,startY:_,currentY:k.pageY};this.emit("change",A)},w=k=>{k.preventDefault(),this.el.classList.remove("sash-active",Uu),this.hoverDelayer.cancel(),this.emit("end"),this.el.releasePointerCapture(k.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(Uu)?(this.hoverDelayer.cancel(),this.el.classList.add("sash-hover",$u)):this.hoverDelayer(this.el)},this.onMouseLeave=()=>{this.hoverDelayer.cancel(),this.el.classList.remove("sash-hover",$u)},this.el=document.createElement("div"),this.el.classList.add("sash",uT),this.el.dataset.testid="sash",i.append(this.el),oT&&this.el.classList.add("sash-mac",hT),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===cn.Vertical?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=j0,V0.on("onDidChangeGlobalSize",m=>{this.size=m,this.layout()})),this.layoutProvider=l,this.orientation=(h=u.orientation)!=null?h:cn.Vertical,this.orientation===cn.Horizontal?(this.el.classList.add("sash-horizontal",Xv),this.el.classList.remove("sash-vertical",Zv)):(this.el.classList.remove("sash-horizontal",Xv),this.el.classList.add("sash-vertical",Zv)),this.layout()}layout(){if(this.orientation===cn.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 il;var ju;(ju=il||(il={})).Distribute={type:"distribute"},ju.Split=function(a){return{type:"split",index:a}},ju.Invisible=function(a){return{type:"invisible",cachedVisibleSize:a}};let ln=(function(a){return a.Normal="NORMAL",a.Low="LOW",a.High="HIGH",a})({});class H0{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",M0),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=wn(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 mT extends H0{layoutContainer(i){this.container.style.left=`${i}px`,this.container.style.width=`${this.size}px`}}class gT extends H0{layoutContainer(i){this.container.style.top=`${i}px`,this.container.style.height=`${this.size}px`}}class yT extends Dd{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:cn.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",nT),i.prepend(this.sashContainer),l.descriptor){this.size=l.descriptor.size;for(const[b,v]of l.descriptor.views.entries()){const w=v.size,k=v.container,A=v.view;this.addView(k,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===cn.Vertical?new gT(i,l,f):new mT(i,l,f);if(this.viewItems.splice(h,0,_),this.viewItems.length>1){const b=this.orientation===cn.Vertical?new Jv(this.sashContainer,{getHorizontalSashTop:k=>this.getSashPosition(k),getHorizontalSashWidth:this.getSashOrthogonalSize},{orientation:cn.Horizontal}):new Jv(this.sashContainer,{getVerticalSashLeft:k=>this.getSashPosition(k),getVerticalSashHeight:this.getSashOrthogonalSize},{orientation:cn.Vertical}),v=this.orientation===cn.Vertical?k=>({sash:b,start:k.startY,current:k.currentY}):k=>({sash:b,start:k.startX,current:k.currentX});b.on("start",k=>{var A;this.emit("sashDragStart"),this.onSashStart(v(k));const R=this.viewItems.map(I=>I.size);(A=this.onDidDragStart)==null||A.call(this,R)}),b.on("change",k=>this.onSashChange(v(k))),b.on("end",()=>{var k;this.emit("sashDragEnd"),this.onSashEnd(this.sashItems.findIndex(R=>R.sash===b));const A=this.viewItems.map(R=>R.size);(k=this.onDidDragEnd)==null||k.call(this,A)}),b.on("reset",()=>{const k=this.sashItems.findIndex($=>$.sash===b),A=on(k,-1,-1),R=on(k+1,this.viewItems.length),I=this.findFirstSnapIndex(A),M=this.findFirstSnapIndex(R);(typeof I!="number"||this.viewItems[I].visible)&&(typeof M!="number"||this.viewItems[M].visible)&&this.emit("sashreset",k)});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):il.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=wn(Math.round(this.proportions[u]*i),h.minimumSize,h.maximumSize)}else{const u=on(0,this.viewItems.length),h=u.filter(f=>this.viewItems[f].priority===ln.Low),m=u.filter(f=>this.viewItems[f].priority===ln.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=on(0,this.viewItems.length).filter(_=>_!==i),h=[...u.filter(_=>this.viewItems[_].priority===ln.Low),i],m=u.filter(_=>this.viewItems[_].priority===ln.High),f=this.viewItems[i];l=Math.round(l),l=wn(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=wn(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=wn(u,_.minimumSize,_.maximumSize);const h=on(0,this.viewItems.length),m=h.filter(_=>this.viewItems[_].priority===ln.Low),f=h.filter(_=>this.viewItems[_].priority===ln.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(z=>z.size);let f,_,b=Number.NEGATIVE_INFINITY,v=Number.POSITIVE_INFINITY;const w=on(u,-1,-1),k=on(u+1,this.viewItems.length),A=w.reduce((z,G)=>z+(this.viewItems[G].minimumSize-m[G]),0),R=w.reduce((z,G)=>z+(this.viewItems[G].viewMaximumSize-m[G]),0),I=k.length===0?Number.POSITIVE_INFINITY:k.reduce((z,G)=>z+(m[G]-this.viewItems[G].minimumSize),0),M=k.length===0?Number.NEGATIVE_INFINITY:k.reduce((z,G)=>z+(m[G]-this.viewItems[G].viewMaximumSize),0);b=Math.max(A,M),v=Math.min(I,R);const $=this.findFirstSnapIndex(w),B=this.findFirstSnapIndex(k);if(typeof $=="number"){const z=this.viewItems[$],G=Math.floor(z.viewMinimumSize/2);f={index:$,limitDelta:z.visible?b-G:b+G,size:z.size}}if(typeof B=="number"){const z=this.viewItems[B],G=Math.floor(z.viewMinimumSize/2);_={index:B,limitDelta:z.visible?v+G:v-G,size:z.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=on(i,-1,-1),k=on(i+1,this.viewItems.length);if(m)for(const re of m)Yv(w,re),Yv(k,re);if(h)for(const re of h)Fu(w,re),Fu(k,re);const A=w.map(re=>this.viewItems[re]),R=w.map(re=>u[re]),I=k.map(re=>this.viewItems[re]),M=k.map(re=>u[re]),$=w.reduce((re,Q)=>re+(this.viewItems[Q].minimumSize-u[Q]),0),B=w.reduce((re,Q)=>re+(this.viewItems[Q].maximumSize-u[Q]),0),z=k.length===0?Number.POSITIVE_INFINITY:k.reduce((re,Q)=>re+(u[Q]-this.viewItems[Q].minimumSize),0),G=k.length===0?Number.NEGATIVE_INFINITY:k.reduce((re,Q)=>re+(u[Q]-this.viewItems[Q].maximumSize),0),Z=Math.max($,G,f),ae=Math.min(z,B,_);let _e=!1;if(b){const re=this.viewItems[b.index],Q=l>=b.limitDelta;_e=Q!==re.visible,re.setVisible(Q,b.size)}if(!_e&&v){const re=this.viewItems[v.index],Q=l<v.limitDelta;_e=Q!==re.visible,re.setVisible(Q,v.size)}if(_e)return this.resize(i,l,u,h,m,f,_);for(let re=0,Q=l=wn(l,Z,ae);re<A.length;re++){const he=A[re],ie=wn(R[re]+Q,he.minimumSize,he.maximumSize);Q-=ie-R[re],he.size=ie}for(let re=0,Q=l;re<I.length;re++){const he=I[re],ie=wn(M[re]-Q,he.minimumSize,he.maximumSize);Q+=ie-M[re],he.size=ie}return l}distributeEmptySpace(i){const l=this.viewItems.reduce((v,w)=>v+w.size,0);let u=this.size-l;const h=on(0,this.viewItems.length),m=[],f=h.filter(v=>this.viewItems[v].priority===ln.Low),_=h.filter(v=>this.viewItems[v].priority===ln.Normal),b=h.filter(v=>this.viewItems[v].priority===ln.High);m.push(...b,..._,...f),typeof i=="number"&&Fu(m,i);for(let v=0;u!==0&&v<m.length;v++){const w=this.viewItems[m[v]],k=wn(w.size+u,w.minimumSize,w.maximumSize);u-=k-w.size,w.size=k}}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]),k=!(u[b]&&m[b+1]);if(w&&k){const A=on(b,-1,-1),R=on(b+1,this.viewItems.length),I=this.findFirstSnapIndex(A),M=this.findFirstSnapIndex(R),$=typeof I=="number"&&!this.viewItems[I].visible,B=typeof M=="number"&&!this.viewItems[M].visible;$&&m[b]&&(_>0||this.startSnappingEnabled)?v.state=qt.Minimum:B&&l[b]&&(_<this.contentSize||this.endSnappingEnabled)?v.state=qt.Maximum:v.state=qt.Disabled}else v.state=w&&!k?qt.Minimum:!w&&k?qt.Maximum:qt.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 Qv{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 Vo{getPreferredSize(){}}class e2{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(jo(l,"%")){const u=Number(l.slice(0,-1))/100;this.layoutStrategy=new Qv(u,this.layoutService)}else if(jo(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 Vo}else this.layoutStrategy=new Vo}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(jo(h,"%")){const m=Number(h.slice(0,-1))/100;this.layoutStrategy=new Qv(m,this.layoutService)}else if(jo(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 Vo}else this.layoutStrategy=new Vo;this.priority=(u=l.priority)!=null?u:ln.Normal,this.snap=typeof l.snap=="boolean"&&l.snap}layout(i){}}function t2(a){return a.minSize!==void 0||a.maxSize!==void 0||a.preferredSize!==void 0||a.priority!==void 0||a.visible!==void 0}const Od=K.forwardRef(({className:a,children:i},l)=>K.createElement("div",{ref:l,className:ad("split-view-view",M0,a)},i));Od.displayName="Allotment.Pane";const W0=K.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:k,onReset:A,onVisibleChange:R,onDragStart:I,onDragEnd:M},$)=>{const B=K.useRef(null),z=K.useRef([]),G=K.useRef(new Map),Z=K.useRef(null),ae=K.useRef(new Map),_e=K.useRef(new lT),re=K.useRef([]),[Q,he]=K.useState(!1);process.env.NODE_ENV!=="production"&&_&&console.warn("Prop sizes is deprecated. Please use defaultSizes instead.");const ie=K.useMemo(()=>K.Children.toArray(a).filter(K.isValidElement),[a]),Se=K.useCallback(ee=>{var pe,Pe;const xe=(pe=re.current)==null?void 0:pe[ee];return typeof(xe==null?void 0:xe.preferredSize)=="number"&&((Pe=Z.current)!=null&&Pe.resizeView(ee,Math.round(xe.preferredSize)),!0)},[]);return K.useImperativeHandle($,()=>({reset:()=>{if(A)A();else{var ee;(ee=Z.current)==null||ee.distributeViewSizes();for(let pe=0;pe<re.current.length;pe++)Se(pe)}},resize:ee=>{var pe;(pe=Z.current)==null||pe.resizeViews(ee)}})),qv(()=>{let ee=!0;b&&ae.current.size!==b.length&&(ee=!1,console.warn(`Expected ${b.length} children based on defaultSizes but found ${ae.current.size}`)),ee&&b&&(z.current=ie.map(xe=>xe.key));const pe=si({orientation:w?cn.Vertical:cn.Horizontal,proportionalLayout:m},ee&&b&&{descriptor:{size:b.reduce((xe,ke)=>xe+ke,0),views:b.map((xe,ke)=>{var Ue,Ae,Qe,yt;const We=G.current.get(z.current[ke]),_t=new e2(_e.current,si({element:document.createElement("div"),minimumSize:(Ue=We==null?void 0:We.minSize)!=null?Ue:h,maximumSize:(Ae=We==null?void 0:We.maxSize)!=null?Ae:u,priority:(Qe=We==null?void 0:We.priority)!=null?Qe:ln.Normal},(We==null?void 0:We.preferredSize)&&{preferredSize:We==null?void 0:We.preferredSize},{snap:(yt=We==null?void 0:We.snap)!=null?yt:v}));return re.current.push(_t),{container:[...ae.current.values()][ke],size:xe,view:_t}})}});Z.current=new yT(B.current,pe,k,I,M),Z.current.on("sashDragStart",()=>{var xe;(xe=B.current)==null||xe.classList.add("split-view-sash-dragging")}),Z.current.on("sashDragEnd",()=>{var xe;(xe=B.current)==null||xe.classList.remove("split-view-sash-dragging")}),Z.current.on("sashchange",xe=>{if(R&&Z.current){const ke=ie.map(Ue=>Ue.key);for(let Ue=0;Ue<ke.length;Ue++){const Ae=G.current.get(ke[Ue]);(Ae==null?void 0:Ae.visible)!==void 0&&Ae.visible!==Z.current.isViewVisible(Ue)&&R(Ue,Z.current.isViewVisible(Ue))}}}),Z.current.on("sashreset",xe=>{if(A)A();else{var ke;if(Se(xe)||Se(xe+1))return;(ke=Z.current)==null||ke.distributeViewSizes()}});const Pe=Z.current;return()=>{Pe.dispose()}},[]),qv(()=>{if(Q){const bt=ie.map(Te=>Te.key),Dt=[...z.current],is=bt.filter(Te=>!z.current.includes(Te)),Da=bt.filter(Te=>z.current.includes(Te)),Hn=z.current.map(Te=>!bt.includes(Te));for(let Te=Hn.length-1;Te>=0;Te--){var ee;Hn[Te]&&((ee=Z.current)!=null&&ee.removeView(Te),Dt.splice(Te,1),re.current.splice(Te,1))}for(const Te of is){var pe,Pe,xe,ke,Ue;const Ce=G.current.get(Te),$e=new e2(_e.current,si({element:document.createElement("div"),minimumSize:(pe=Ce==null?void 0:Ce.minSize)!=null?pe:h,maximumSize:(Pe=Ce==null?void 0:Ce.maxSize)!=null?Pe:u,priority:(xe=Ce==null?void 0:Ce.priority)!=null?xe:ln.Normal},(Ce==null?void 0:Ce.preferredSize)&&{preferredSize:Ce==null?void 0:Ce.preferredSize},{snap:(ke=Ce==null?void 0:Ce.snap)!=null?ke:v}));(Ue=Z.current)!=null&&Ue.addView(ae.current.get(Te),$e,il.Distribute,bt.findIndex(be=>be===Te)),Dt.splice(bt.findIndex(be=>be===Te),0,Te),re.current.splice(bt.findIndex(be=>be===Te),0,$e)}for(;!JA(bt,Dt);)for(const[Te,Ce]of bt.entries()){const $e=Dt.findIndex(be=>be===Ce);if($e!==Te){var Ae;(Ae=Z.current)==null||Ae.moveView(ae.current.get(Ce),$e,Te);const be=Dt[$e];Dt.splice($e,1),Dt.splice(Te,0,be);break}}for(const Te of is){var Qe;const Ce=bt.findIndex(be=>be===Te),$e=re.current[Ce].preferredSize;$e!==void 0&&((Qe=Z.current)==null||Qe.resizeView(Ce,$e))}for(const Te of[...is,...Da]){var yt,We;const Ce=G.current.get(Te),$e=bt.findIndex(be=>be===Te);Ce&&t2(Ce)&&Ce.visible!==void 0&&((yt=Z.current)==null?void 0:yt.isViewVisible($e))!==Ce.visible&&((We=Z.current)==null||We.setViewVisible($e,Ce.visible))}for(const Te of Da){const Ce=G.current.get(Te),$e=bt.findIndex(be=>be===Te);if(Ce&&t2(Ce)){var _t;Ce.preferredSize!==void 0&&re.current[$e].preferredSize!==Ce.preferredSize&&(re.current[$e].preferredSize=Ce.preferredSize);let be=!1;Ce.minSize!==void 0&&re.current[$e].minimumSize!==Ce.minSize&&(re.current[$e].minimumSize=Ce.minSize,be=!0),Ce.maxSize!==void 0&&re.current[$e].maximumSize!==Ce.maxSize&&(re.current[$e].maximumSize=Ce.maxSize,be=!0),be&&((_t=Z.current)==null||_t.layout())}}(is.length>0||Hn.length>0)&&(z.current=bt)}},[ie,Q,u,h,v]),K.useEffect(()=>{Z.current&&(Z.current.onDidChange=k)},[k]),K.useEffect(()=>{Z.current&&(Z.current.onDidDragStart=I)},[I]),K.useEffect(()=>{Z.current&&(Z.current.onDidDragEnd=M)},[M]),eT({ref:B,onResize:({width:ee,height:pe})=>{var Pe;ee&&pe&&((Pe=Z.current)!=null&&Pe.layout(w?pe:ee),_e.current.setSize(w?pe:ee),he(!0))}}),K.useEffect(()=>{U0&&_T(20)},[]),K.createElement("div",{ref:B,className:ad("split-view",w?"split-view-vertical":"split-view-horizontal",{"split-view-separator-border":f},tT,w?rT:iT,{[aT]:f},i),id:l},K.createElement("div",{className:ad("split-view-container",sT)},K.Children.toArray(a).map(ee=>{if(!K.isValidElement(ee))return null;const pe=ee.key;return ee.type.displayName==="Allotment.Pane"?(G.current.set(pe,ee.props),K.cloneElement(ee,{key:pe,ref:Pe=>{const xe=ee.ref;xe&&(xe.current=Pe),Pe?ae.current.set(pe,Pe):ae.current.delete(pe)}})):K.createElement(Od,{key:pe,ref:Pe=>{Pe?ae.current.set(pe,Pe):ae.current.delete(pe)}},ee)})))});function _T(a){const i=wn(a,4,20),l=wn(a,1,8);document.documentElement.style.setProperty("--sash-size",i+"px"),document.documentElement.style.setProperty("--sash-hover-size",l+"px"),(function(u){j0=u,V0.emit("onDidChangeGlobalSize",u)})(i)}W0.displayName="Allotment";var qr=Object.assign(W0,{Pane:Od});const z0=K.createContext({});function bT(a){const i=K.useRef(null);return i.current===null&&(i.current=a()),i.current}const vT=typeof window<"u",wT=vT?K.useLayoutEffect:K.useEffect,Nd=K.createContext(null);function Bd(a,i){a.indexOf(i)===-1&&a.push(i)}function al(a,i){const l=a.indexOf(i);l>-1&&a.splice(l,1)}const Vn=(a,i,l)=>l>i?i:l<a?a:l;function od(a,i){return i?`${a}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${i}`:a}let oi=()=>{},ss=()=>{};var L0;typeof process<"u"&&((L0=process.env)==null?void 0:L0.NODE_ENV)!=="production"&&(oi=(a,i,l)=>{!a&&typeof console<"u"&&console.warn(od(i,l))},ss=(a,i,l)=>{if(!a)throw new Error(od(i,l))});const rs={},q0=a=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(a);function G0(a){return typeof a=="object"&&a!==null}const K0=a=>/^0[^.\s]+$/u.test(a);function Y0(a){let i;return()=>(i===void 0&&(i=a()),i)}const dn=a=>a,ST=(a,i)=>l=>i(a(l)),Ta=(...a)=>a.reduce(ST),xa=(a,i,l)=>{const u=i-a;return u===0?1:(l-a)/u};class Ld{constructor(){this.subscriptions=[]}add(i){return Bd(this.subscriptions,i),()=>al(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 Mt=a=>a*1e3,un=a=>a/1e3;function Z0(a,i){return i?a*(1e3/i):0}const n2=new Set;function Md(a,i,l){a||n2.has(i)||(console.warn(od(i,l)),n2.add(i))}const X0=(a,i,l)=>(((1-3*l+3*i)*a+(3*l-6*i))*a+3*i)*a,xT=1e-7,ET=12;function kT(a,i,l,u,h){let m,f,_=0;do f=i+(l-i)/2,m=X0(f,u,h)-a,m>0?l=f:i=f;while(Math.abs(m)>xT&&++_<ET);return f}function Ia(a,i,l,u){if(a===i&&l===u)return dn;const h=m=>kT(m,0,1,a,l);return m=>m===0||m===1?m:X0(h(m),i,u)}const J0=a=>i=>i<=.5?a(2*i)/2:(2-a(2*(1-i)))/2,Q0=a=>i=>1-a(1-i),ew=Ia(.33,1.53,.69,.99),Fd=Q0(ew),tw=J0(Fd),nw=a=>(a*=2)<1?.5*Fd(a):.5*(2-Math.pow(2,-10*(a-1))),$d=a=>1-Math.sin(Math.acos(a)),sw=Q0($d),rw=J0($d),CT=Ia(.42,0,1,1),AT=Ia(0,0,.58,1),iw=Ia(.42,0,.58,1),TT=a=>Array.isArray(a)&&typeof a[0]!="number",aw=a=>Array.isArray(a)&&typeof a[0]=="number",s2={linear:dn,easeIn:CT,easeInOut:iw,easeOut:AT,circIn:$d,circInOut:rw,circOut:sw,backIn:Fd,backInOut:tw,backOut:ew,anticipate:nw},IT=a=>typeof a=="string",r2=a=>{if(aw(a)){ss(a.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[i,l,u,h]=a;return Ia(i,l,u,h)}else if(IT(a))return ss(s2[a]!==void 0,`Invalid easing type '${a}'`,"invalid-easing-type"),s2[a];return a},Ho=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function RT(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,k=!1,A=!1)=>{const I=A&&h?l:u;return k&&f.add(w),I.has(w)||I.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 PT=40;function ow(a,i){let l=!1,u=!0;const h={delta:0,timestamp:0,isProcessing:!1},m=()=>l=!0,f=Ho.reduce((G,Z)=>(G[Z]=RT(m),G),{}),{setup:_,read:b,resolveKeyframes:v,preUpdate:w,update:k,preRender:A,render:R,postRender:I}=f,M=()=>{const G=rs.useManualTiming?h.timestamp:performance.now();l=!1,rs.useManualTiming||(h.delta=u?1e3/60:Math.max(Math.min(G-h.timestamp,PT),1)),h.timestamp=G,h.isProcessing=!0,_.process(h),b.process(h),v.process(h),w.process(h),k.process(h),A.process(h),R.process(h),I.process(h),h.isProcessing=!1,l&&i&&(u=!1,a(M))},$=()=>{l=!0,u=!0,h.isProcessing||a(M)};return{schedule:Ho.reduce((G,Z)=>{const ae=f[Z];return G[Z]=(_e,re=!1,Q=!1)=>(l||$(),ae.schedule(_e,re,Q)),G},{}),cancel:G=>{for(let Z=0;Z<Ho.length;Z++)f[Ho[Z]].cancel(G)},state:h,steps:f}}const{schedule:je,cancel:Cs,state:gt,steps:Vu}=ow(typeof requestAnimationFrame<"u"?requestAnimationFrame:dn,!0);let Jo;function DT(){Jo=void 0}const Rt={now:()=>(Jo===void 0&&Rt.set(gt.isProcessing||rs.useManualTiming?gt.timestamp:performance.now()),Jo),set:a=>{Jo=a,queueMicrotask(DT)}},lw=a=>i=>typeof i=="string"&&i.startsWith(a),cw=lw("--"),OT=lw("var(--"),Ud=a=>OT(a)?NT.test(a.split("/*")[0].trim()):!1,NT=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function i2(a){return typeof a!="string"?!1:a.split("/*")[0].includes("var(--")}const li={test:a=>typeof a=="number",parse:parseFloat,transform:a=>a},Ea={...li,transform:a=>Vn(0,1,a)},Wo={...li,default:1},va=a=>Math.round(a*1e5)/1e5,jd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function BT(a){return a==null}const LT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Vd=(a,i)=>l=>!!(typeof l=="string"&&LT.test(l)&&l.startsWith(a)||i&&!BT(l)&&Object.prototype.hasOwnProperty.call(l,i)),uw=(a,i,l)=>u=>{if(typeof u!="string")return u;const[h,m,f,_]=u.match(jd);return{[a]:parseFloat(h),[i]:parseFloat(m),[l]:parseFloat(f),alpha:_!==void 0?parseFloat(_):1}},MT=a=>Vn(0,255,a),Hu={...li,transform:a=>Math.round(MT(a))},rr={test:Vd("rgb","red"),parse:uw("red","green","blue"),transform:({red:a,green:i,blue:l,alpha:u=1})=>"rgba("+Hu.transform(a)+", "+Hu.transform(i)+", "+Hu.transform(l)+", "+va(Ea.transform(u))+")"};function FT(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 ld={test:Vd("#"),parse:FT,transform:rr.transform},Ra=a=>({test:i=>typeof i=="string"&&i.endsWith(a)&&i.split(" ").length===1,parse:parseFloat,transform:i=>`${i}${a}`}),xs=Ra("deg"),jn=Ra("%"),ue=Ra("px"),$T=Ra("vh"),UT=Ra("vw"),a2={...jn,parse:a=>jn.parse(a)/100,transform:a=>jn.transform(a*100)},Zr={test:Vd("hsl","hue"),parse:uw("hue","saturation","lightness"),transform:({hue:a,saturation:i,lightness:l,alpha:u=1})=>"hsla("+Math.round(a)+", "+jn.transform(va(i))+", "+jn.transform(va(l))+", "+va(Ea.transform(u))+")"},ot={test:a=>rr.test(a)||ld.test(a)||Zr.test(a),parse:a=>rr.test(a)?rr.parse(a):Zr.test(a)?Zr.parse(a):ld.parse(a),transform:a=>typeof a=="string"?a:a.hasOwnProperty("red")?rr.transform(a):Zr.transform(a),getAnimatableNone:a=>{const i=ot.parse(a);return i.alpha=0,ot.transform(i)}},jT=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function VT(a){var i,l;return isNaN(a)&&typeof a=="string"&&(((i=a.match(jd))==null?void 0:i.length)||0)+(((l=a.match(jT))==null?void 0:l.length)||0)>0}const dw="number",hw="color",HT="var",WT="var(",o2="${}",zT=/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 ii(a){const i=a.toString(),l=[],u={color:[],number:[],var:[]},h=[];let m=0;const _=i.replace(zT,b=>(ot.test(b)?(u.color.push(m),h.push(hw),l.push(ot.parse(b))):b.startsWith(WT)?(u.var.push(m),h.push(HT),l.push(b)):(u.number.push(m),h.push(dw),l.push(parseFloat(b))),++m,o2)).split(o2);return{values:l,split:_,indexes:u,types:h}}function qT(a){return ii(a).values}function pw({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===dw?h+=va(u[m]):f===hw?h+=ot.transform(u[m]):h+=u[m]}return h}}function GT(a){return pw(ii(a))}const KT=a=>typeof a=="number"?0:ot.test(a)?ot.getAnimatableNone(a):a,YT=(a,i)=>typeof a=="number"?i!=null&&i.trim().endsWith("/")?a:0:KT(a);function ZT(a){const i=ii(a);return pw(i)(i.values.map((u,h)=>YT(u,i.split[h])))}const Sn={test:VT,parse:qT,createTransformer:GT,getAnimatableNone:ZT};function Wu(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 XT({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=Wu(b,_,a+1/3),m=Wu(b,_,a),f=Wu(b,_,a-1/3)}return{red:Math.round(h*255),green:Math.round(m*255),blue:Math.round(f*255),alpha:u}}function ol(a,i){return l=>l>0?i:a}const Xe=(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)},JT=[ld,rr,Zr],QT=a=>JT.find(i=>i.test(a));function l2(a){const i=QT(a);if(oi(!!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===Zr&&(l=XT(l)),l}const c2=(a,i)=>{const l=l2(a),u=l2(i);if(!l||!u)return ol(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=Xe(l.alpha,u.alpha,m),rr.transform(h))},cd=new Set(["none","hidden"]);function eI(a,i){return cd.has(a)?l=>l<=0?a:i:l=>l>=1?i:a}function tI(a,i){return l=>Xe(a,i,l)}function Hd(a){return typeof a=="number"?tI:typeof a=="string"?Ud(a)?ol:ot.test(a)?c2:rI:Array.isArray(a)?fw:typeof a=="object"?ot.test(a)?c2:nI:ol}function fw(a,i){const l=[...a],u=l.length,h=a.map((m,f)=>Hd(m)(m,i[f]));return m=>{for(let f=0;f<u;f++)l[f]=h[f](m);return l}}function nI(a,i){const l={...a,...i},u={};for(const h in l)a[h]!==void 0&&i[h]!==void 0&&(u[h]=Hd(a[h])(a[h],i[h]));return h=>{for(const m in u)l[m]=u[m](h);return l}}function sI(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 rI=(a,i)=>{const l=Sn.createTransformer(i),u=ii(a),h=ii(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?cd.has(a)&&!h.values.length||cd.has(i)&&!u.values.length?eI(a,i):Ta(fw(sI(u,h),h.values),l):(oi(!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"),ol(a,i))};function mw(a,i,l){return typeof a=="number"&&typeof i=="number"&&typeof l=="number"?Xe(a,i,l):Hd(a)(a,i)}const iI=a=>{const i=({timestamp:l})=>a(l);return{start:(l=!0)=>je.update(i,l),stop:()=>Cs(i),now:()=>gt.isProcessing?gt.timestamp:Rt.now()}},gw=(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)})`},ll=2e4;function Wd(a){let i=0;const l=50;let u=a.next(i);for(;!u.done&&i<ll;)i+=l,u=a.next(i);return i>=ll?1/0:i}function aI(a,i=100,l){const u=l({...a,keyframes:[0,i]}),h=Math.min(Wd(u),ll);return{type:"keyframes",ease:m=>u.next(h*m).value/i,duration:un(h)}}const Ze={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 ud(a,i){return a*Math.sqrt(1-i*i)}const oI=12;function lI(a,i,l){let u=l;for(let h=1;h<oI;h++)u=u-a(u)/i(u);return u}const qu=.001;function cI({duration:a=Ze.duration,bounce:i=Ze.bounce,velocity:l=Ze.velocity,mass:u=Ze.mass}){let h,m;oi(a<=Mt(Ze.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let f=1-i;f=Vn(Ze.minDamping,Ze.maxDamping,f),a=Vn(Ze.minDuration,Ze.maxDuration,un(a)),f<1?(h=v=>{const w=v*f,k=w*a,A=w-l,R=ud(v,f),I=Math.exp(-k);return qu-A/R*I},m=v=>{const k=v*f*a,A=k*l+l,R=Math.pow(f,2)*Math.pow(v,2)*a,I=Math.exp(-k),M=ud(Math.pow(v,2),f);return(-h(v)+qu>0?-1:1)*((A-R)*I)/M}):(h=v=>{const w=Math.exp(-v*a),k=(v-l)*a+1;return-qu+w*k},m=v=>{const w=Math.exp(-v*a),k=(l-v)*(a*a);return w*k});const _=5/a,b=lI(h,m,_);if(a=Mt(a),isNaN(b))return{stiffness:Ze.stiffness,damping:Ze.damping,duration:a};{const v=Math.pow(b,2)*u;return{stiffness:v,damping:f*2*Math.sqrt(u*v),duration:a}}}const uI=["duration","bounce"],dI=["stiffness","damping","mass"];function u2(a,i){return i.some(l=>a[l]!==void 0)}function hI(a){let i={velocity:Ze.velocity,stiffness:Ze.stiffness,damping:Ze.damping,mass:Ze.mass,isResolvedFromDuration:!1,...a};if(!u2(a,dI)&&u2(a,uI))if(i.velocity=0,a.visualDuration){const l=a.visualDuration,u=2*Math.PI/(l*1.2),h=u*u,m=2*Vn(.05,1,1-(a.bounce||0))*Math.sqrt(h);i={...i,mass:Ze.mass,stiffness:h,damping:m}}else{const l=cI({...a,velocity:0});i={...i,...l,mass:Ze.mass},i.isResolvedFromDuration=!0}return i}function cl(a=Ze.visualDuration,i=Ze.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:k,velocity:A,isResolvedFromDuration:R}=hI({...l,velocity:-un(l.velocity||0)}),I=A||0,M=v/(2*Math.sqrt(b*w)),$=f-m,B=un(Math.sqrt(b/w)),z=Math.abs($)<5;u||(u=z?Ze.restSpeed.granular:Ze.restSpeed.default),h||(h=z?Ze.restDelta.granular:Ze.restDelta.default);let G,Z,ae,_e,re,Q;if(M<1)ae=ud(B,M),_e=(I+M*B*$)/ae,G=ie=>{const Se=Math.exp(-M*B*ie);return f-Se*(_e*Math.sin(ae*ie)+$*Math.cos(ae*ie))},re=M*B*_e+$*ae,Q=M*B*$-_e*ae,Z=ie=>Math.exp(-M*B*ie)*(re*Math.sin(ae*ie)+Q*Math.cos(ae*ie));else if(M===1){G=Se=>f-Math.exp(-B*Se)*($+(I+B*$)*Se);const ie=I+B*$;Z=Se=>Math.exp(-B*Se)*(B*ie*Se-I)}else{const ie=B*Math.sqrt(M*M-1);G=Pe=>{const xe=Math.exp(-M*B*Pe),ke=Math.min(ie*Pe,300);return f-xe*((I+M*B*$)*Math.sinh(ke)+ie*$*Math.cosh(ke))/ie};const Se=(I+M*B*$)/ie,ee=M*B*Se-$*ie,pe=M*B*$-Se*ie;Z=Pe=>{const xe=Math.exp(-M*B*Pe),ke=Math.min(ie*Pe,300);return xe*(ee*Math.sinh(ke)+pe*Math.cosh(ke))}}const he={calculatedDuration:R&&k||null,velocity:ie=>Mt(Z(ie)),next:ie=>{if(!R&&M<1){const ee=Math.exp(-M*B*ie),pe=Math.sin(ae*ie),Pe=Math.cos(ae*ie),xe=f-ee*(_e*pe+$*Pe),ke=Mt(ee*(re*pe+Q*Pe));return _.done=Math.abs(ke)<=u&&Math.abs(f-xe)<=h,_.value=_.done?f:xe,_}const Se=G(ie);if(R)_.done=ie>=k;else{const ee=Mt(Z(ie));_.done=Math.abs(ee)<=u&&Math.abs(f-Se)<=h}return _.value=_.done?f:Se,_},toString:()=>{const ie=Math.min(Wd(he),ll),Se=gw(ee=>he.next(ie*ee).value,ie,30);return ie+"ms "+Se},toTransition:()=>{}};return he}cl.applyToOptions=a=>{const i=aI(a,100,cl);return a.ease=i.ease,a.duration=Mt(i.duration),a.type="keyframes",a};const pI=5;function yw(a,i,l){const u=Math.max(i-pI,0);return Z0(l-a(u),i-u)}function dd({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 k=a[0],A={done:!1,value:k},R=Q=>_!==void 0&&Q<_||b!==void 0&&Q>b,I=Q=>_===void 0?b:b===void 0||Math.abs(_-Q)<Math.abs(b-Q)?_:b;let M=l*i;const $=k+M,B=f===void 0?$:f($);B!==$&&(M=B-k);const z=Q=>-M*Math.exp(-Q/u),G=Q=>B+z(Q),Z=Q=>{const he=z(Q),ie=G(Q);A.done=Math.abs(he)<=v,A.value=A.done?B:ie};let ae,_e;const re=Q=>{R(A.value)&&(ae=Q,_e=cl({keyframes:[A.value,I(A.value)],velocity:yw(G,Q,A.value),damping:h,stiffness:m,restDelta:v,restSpeed:w}))};return re(0),{calculatedDuration:null,next:Q=>{let he=!1;return!_e&&ae===void 0&&(he=!0,Z(Q),re(Q)),ae!==void 0&&Q>=ae?_e.next(Q-ae):(!he&&Z(Q),A)}}}function fI(a,i,l){const u=[],h=l||rs.mix||mw,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]||dn:i;_=Ta(b,_)}u.push(_)}return u}function mI(a,i,{clamp:l=!0,ease:u,mixer:h}={}){const m=a.length;if(ss(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 _=fI(i,u,h),b=_.length,v=w=>{if(f&&w<a[0])return i[0];let k=0;if(b>1)for(;k<a.length-2&&!(w<a[k+1]);k++);const A=xa(a[k],a[k+1],w);return _[k](A)};return l?w=>v(Vn(a[0],a[m-1],w)):v}function gI(a,i){const l=a[a.length-1];for(let u=1;u<=i;u++){const h=xa(0,i,u);a.push(Xe(l,1,h))}}function yI(a){const i=[0];return gI(i,a.length-1),i}function _I(a,i){return a.map(l=>l*i)}function bI(a,i){return a.map(()=>i||iw).splice(0,a.length-1)}function Xr({duration:a=300,keyframes:i,times:l,ease:u="easeInOut"}){const h=TT(u)?u.map(r2):r2(u),m={done:!1,value:i[0]},f=_I(l&&l.length===i.length?l:yI(i),a),_=mI(f,i,{ease:Array.isArray(h)?h:bI(i,h)});return{calculatedDuration:a,next:b=>(m.value=_(b),m.done=b>=a,m)}}const vI=a=>a!==null;function zd(a,{repeat:i,repeatType:l="loop"},u,h=1){const m=a.filter(vI),_=h<0||i&&l!=="loop"&&i%2===1?0:m.length-1;return!_||u===void 0?m[_]:u}const wI={decay:dd,inertia:dd,tween:Xr,keyframes:Xr,spring:cl};function _w(a){typeof a.type=="string"&&(a.type=wI[a.type])}class qd{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 SI=a=>a/100;class Gd extends qd{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!==Rt.now()&&this.tick(Rt.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;_w(i);const{type:l=Xr,repeat:u=0,repeatDelay:h=0,repeatType:m,velocity:f=0}=i;let{keyframes:_}=i;const b=l||Xr;process.env.NODE_ENV!=="production"&&b!==Xr&&ss(_.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${_}`,"spring-two-frames"),b!==Xr&&typeof _[0]!="number"&&(this.mixKeyframes=Ta(SI,mw(_[0],_[1])),_=[0,100]);const v=b({...i,keyframes:_});m==="mirror"&&(this.mirroredGenerator=b({...i,keyframes:[..._].reverse(),velocity:-f})),v.calculatedDuration===null&&(v.calculatedDuration=Wd(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:k,repeatType:A,repeatDelay:R,type:I,onUpdate:M,finalKeyframe:$}=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),z=this.playbackSpeed>=0?B<0:B>h;this.currentTime=Math.max(B,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=h);let G=this.currentTime,Z=u;if(k){const Q=Math.min(this.currentTime,h)/_;let he=Math.floor(Q),ie=Q%1;!ie&&Q>=1&&(ie=1),ie===1&&he--,he=Math.min(he,k+1),!!(he%2)&&(A==="reverse"?(ie=1-ie,R&&(ie-=R/_)):A==="mirror"&&(Z=f)),G=Vn(0,1,ie)*_}const ae=z?{done:!1,value:w[0]}:Z.next(G);m&&!z&&(ae.value=m(ae.value));let{done:_e}=ae;!z&&b!==null&&(_e=this.playbackSpeed>=0?this.currentTime>=h:this.currentTime<=0);const re=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_e);return re&&I!==dd&&(ae.value=zd(w,this.options,$,this.speed)),M&&M(ae.value),re&&this.finish(),ae}then(i,l){return this.finished.then(i,l)}get duration(){return un(this.calculatedDuration)}get iterationDuration(){const{delay:i=0}=this.options||{};return this.duration+un(i)}get time(){return un(this.currentTime)}set time(i){i=Mt(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 yw(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(Rt.now()),this.playbackSpeed=i,l&&this.driver&&(this.time=un(this.currentTime))}play(){var h,m;if(this.isStopped)return;const{driver:i=iI,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(Rt.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 xI(a){for(let i=1;i<a.length;i++)a[i]??(a[i]=a[i-1])}const ir=a=>a*180/Math.PI,hd=a=>{const i=ir(Math.atan2(a[1],a[0]));return pd(i)},EI={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:a=>(Math.abs(a[0])+Math.abs(a[3]))/2,rotate:hd,rotateZ:hd,skewX:a=>ir(Math.atan(a[1])),skewY:a=>ir(Math.atan(a[2])),skew:a=>(Math.abs(a[1])+Math.abs(a[2]))/2},pd=a=>(a=a%360,a<0&&(a+=360),a),d2=hd,h2=a=>Math.sqrt(a[0]*a[0]+a[1]*a[1]),p2=a=>Math.sqrt(a[4]*a[4]+a[5]*a[5]),kI={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:h2,scaleY:p2,scale:a=>(h2(a)+p2(a))/2,rotateX:a=>pd(ir(Math.atan2(a[6],a[5]))),rotateY:a=>pd(ir(Math.atan2(-a[2],a[0]))),rotateZ:d2,rotate:d2,skewX:a=>ir(Math.atan(a[4])),skewY:a=>ir(Math.atan(a[1])),skew:a=>(Math.abs(a[1])+Math.abs(a[4]))/2};function fd(a){return a.includes("scale")?1:0}function md(a,i){if(!a||a==="none")return fd(i);const l=a.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let u,h;if(l)u=kI,h=l;else{const _=a.match(/^matrix\(([-\d.e\s,]+)\)$/u);u=EI,h=_}if(!h)return fd(i);const m=u[i],f=h[1].split(",").map(AI);return typeof m=="function"?m(f):f[m]}const CI=(a,i)=>{const{transform:l="none"}=getComputedStyle(a);return md(l,i)};function AI(a){return parseFloat(a.trim())}const ci=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ui=new Set(ci),f2=a=>a===li||a===ue,TI=new Set(["x","y","z"]),II=ci.filter(a=>!TI.has(a));function RI(a){const i=[];return II.forEach(l=>{const u=a.getValue(l);u!==void 0&&(i.push([l,u.get()]),u.set(l.startsWith("scale")?1:0))}),i}const ks={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})=>md(i,"x"),y:(a,{transform:i})=>md(i,"y")};ks.translateX=ks.x;ks.translateY=ks.y;const ar=new Set;let gd=!1,yd=!1,_d=!1;function bw(){if(yd){const a=Array.from(ar).filter(u=>u.needsMeasurement),i=new Set(a.map(u=>u.element)),l=new Map;i.forEach(u=>{const h=RI(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)})}yd=!1,gd=!1,ar.forEach(a=>a.complete(_d)),ar.clear()}function vw(){ar.forEach(a=>{a.readKeyframes(),a.needsMeasurement&&(yd=!0)})}function PI(){_d=!0,vw(),bw(),_d=!1}class Kd{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?(ar.add(this),gd||(gd=!0,je.read(vw),je.resolveKeyframes(bw))):(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])}xI(i)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(i=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,i),ar.delete(this)}cancel(){this.state==="scheduled"&&(ar.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const DI=a=>a.startsWith("--");function ww(a,i,l){DI(i)?a.style.setProperty(i,l):a.style[i]=l}const OI={};function Sw(a,i){const l=Y0(a);return()=>OI[i]??l()}const NI=Sw(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),xw=Sw(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ba=([a,i,l,u])=>`cubic-bezier(${a}, ${i}, ${l}, ${u})`,m2={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ba([0,.65,.55,1]),circOut:ba([.55,0,1,.45]),backIn:ba([.31,.01,.66,-.59]),backOut:ba([.33,1.53,.69,.99])};function Ew(a,i){if(a)return typeof a=="function"?xw()?gw(a,i):"ease-out":aw(a)?ba(a):Array.isArray(a)?a.map(l=>Ew(l,i)||m2.easeOut):m2[a]}function BI(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 k=Ew(_,h);Array.isArray(k)&&(w.easing=k);const A={delay:u,duration:h,easing:Array.isArray(k)?"linear":k,fill:"both",iterations:m+1,direction:f==="reverse"?"alternate":"normal"};return v&&(A.pseudoElement=v),a.animate(w,A)}function kw(a){return typeof a=="function"&&"applyToOptions"in a}function LI({type:a,...i}){return kw(a)&&xw()?a.applyToOptions(i):(i.duration??(i.duration=300),i.ease??(i.ease="easeOut"),i)}class Cw extends qd{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,ss(typeof i.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const v=LI(i);this.animation=BI(l,u,h,v,m),v.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!m){const w=zd(h,this.options,_,this.speed);this.updateMotionValue&&this.updateMotionValue(w),ww(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 un(Number(i))}get iterationDuration(){const{delay:i=0}=this.options||{};return this.duration+un(i)}get time(){return un(Number(this.animation.currentTime)||0)}set time(i){const l=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Mt(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&&NI()?(this.animation.timeline=i,l&&(this.animation.rangeStart=l),u&&(this.animation.rangeEnd=u),dn):h(this)}}const Aw={anticipate:nw,backInOut:tw,circInOut:rw};function MI(a){return a in Aw}function FI(a){typeof a.ease=="string"&&MI(a.ease)&&(a.ease=Aw[a.ease])}const Gu=10;class $I extends Cw{constructor(i){FI(i),_w(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 Gd({...f,autoplay:!1}),b=Math.max(Gu,Rt.now()-this.startTime),v=Vn(0,Gu,b-Gu),w=_.sample(b).value,{name:k}=this.options;m&&k&&ww(m,k,w),l.setWithVelocity(_.sample(Math.max(0,b-v)).value,w,v),_.stop()}}const g2=(a,i)=>i==="zIndex"?!1:!!(typeof a=="number"||Array.isArray(a)||typeof a=="string"&&(Sn.test(a)||a==="0")&&!a.startsWith("url("));function UI(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 jI(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=g2(h,i),_=g2(m,i);return oi(f===_,`You are trying to animate ${i} from "${h}" to "${m}". "${f?m:h}" is not an animatable value.`,"value-not-animatable"),!f||!_?!1:UI(a)||(l==="spring"||kw(l))&&u}function bd(a){a.duration=0,a.type="keyframes"}const VI=new Set(["opacity","clipPath","filter","transform"]),HI=Y0(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function WI(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 HI()&&l&&VI.has(l)&&(l!=="transform"||!v)&&!b&&!u&&h!=="mirror"&&m!==0&&f!=="inertia"}const zI=40;class qI extends qd{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,...k}){var I;super(),this.stop=()=>{var M,$;this._animation&&(this._animation.stop(),(M=this.stopTimeline)==null||M.call(this)),($=this.keyframeResolver)==null||$.cancel()},this.createdAt=Rt.now();const A={autoplay:i,delay:l,type:u,repeat:h,repeatDelay:m,repeatType:f,name:b,motionValue:v,element:w,...k},R=(w==null?void 0:w.KeyframeResolver)||Kd;this.keyframeResolver=new R(_,(M,$,B)=>this.onKeyframesResolved(M,$,A,!B),b,v,w),(I=this.keyframeResolver)==null||I.scheduleResolve()}onKeyframesResolved(i,l,u,h){var $,B;this.keyframeResolver=void 0;const{name:m,type:f,velocity:_,delay:b,isHandoff:v,onUpdate:w}=u;this.resolvedAt=Rt.now(),jI(i,m,f,_)||((rs.instantAnimations||!b)&&(w==null||w(zd(i,u,l))),i[0]=i[i.length-1],bd(u),u.repeat=0);const A={startTime:h?this.resolvedAt?this.resolvedAt-this.createdAt>zI?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:l,...u,keyframes:i},R=!v&&WI(A),I=(B=($=A.motionValue)==null?void 0:$.owner)==null?void 0:B.current,M=R?new $I({...A,element:I}):new Gd(A);M.finished.then(()=>{this.notifyFinished()}).catch(dn),this.pendingTimeline&&(this.stopTimeline=M.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=M}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(),PI()),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 Tw(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 GI=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function KI(a){const i=GI.exec(a);if(!i)return[,];const[,l,u,h]=i;return[`--${l??u}`,h]}const YI=4;function Iw(a,i,l=1){ss(l<=YI,`Max CSS variable fallback depth detected in property "${a}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[u,h]=KI(a);if(!u)return;const m=window.getComputedStyle(i).getPropertyValue(u);if(m){const f=m.trim();return q0(f)?parseFloat(f):f}return Ud(h)?Iw(h,i,l+1):h}const ZI={type:"spring",stiffness:500,damping:25,restSpeed:10},XI=a=>({type:"spring",stiffness:550,damping:a===0?2*Math.sqrt(550):30,restSpeed:10}),JI={type:"keyframes",duration:.8},QI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},eR=(a,{keyframes:i})=>i.length>2?JI:ui.has(a)?a.startsWith("scale")?XI(i[1]):ZI:QI,tR=a=>a!==null;function nR(a,{repeat:i,repeatType:l="loop"},u){const h=a.filter(tR),m=i&&l!=="loop"&&i%2===1?0:h.length-1;return h[m]}function Rw(a,i){if(a!=null&&a.inherit&&i){const{inherit:l,...u}=a;return{...i,...u}}return a}function Yd(a,i){const l=(a==null?void 0:a[i])??(a==null?void 0:a.default)??a;return l!==a?Rw(l,a):l}function sR({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 Zd=(a,i,l,u={},h,m)=>f=>{const _=Yd(u,a)||{},b=_.delay||u.delay||0;let{elapsed:v=0}=u;v=v-Mt(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};sR(_)||Object.assign(w,eR(a,w)),w.duration&&(w.duration=Mt(w.duration)),w.repeatDelay&&(w.repeatDelay=Mt(w.repeatDelay)),w.from!==void 0&&(w.keyframes[0]=w.from);let k=!1;if((w.type===!1||w.duration===0&&!w.repeatDelay)&&(bd(w),w.delay===0&&(k=!0)),(rs.instantAnimations||rs.skipAnimations||h!=null&&h.shouldSkipAnimations)&&(k=!0,bd(w),w.delay=0),w.allowFlatten=!_.type&&!_.ease,k&&!m&&i.get()!==void 0){const A=nR(w.keyframes,_);if(A!==void 0){je.update(()=>{w.onUpdate(A),w.onComplete()});return}}return _.isSync?new Gd(w):new qI(w)};function y2(a){const i=[{},{}];return a==null||a.values.forEach((l,u)=>{i[0][u]=l.get(),i[1][u]=l.getVelocity()}),i}function Xd(a,i,l,u){if(typeof i=="function"){const[h,m]=y2(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]=y2(u);i=i(l!==void 0?l:a.custom,h,m)}return i}function ri(a,i,l){const u=a.getProps();return Xd(u,i,l!==void 0?l:u.custom,a)}const Pw=new Set(["width","height","top","left","right","bottom",...ci]),_2=30,rR=a=>!isNaN(parseFloat(a));class iR{constructor(i,l={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=u=>{var m;const h=Rt.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=Rt.now(),this.canTrackVelocity===null&&i!==void 0&&(this.canTrackVelocity=rR(this.current))}setPrevFrameValue(i=this.current){this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt}onChange(i){return process.env.NODE_ENV!=="production"&&Md(!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 Ld);const u=this.events[i].add(l);return i==="change"?()=>{u(),je.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=Rt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||i-this.updatedAt>_2)return 0;const l=Math.min(this.updatedAt-this.prevUpdatedAt,_2);return Z0(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 ai(a,i){return new iR(a,i)}const vd=a=>Array.isArray(a);function aR(a,i,l){a.hasValue(i)?a.getValue(i).set(l):a.addValue(i,ai(l))}function oR(a){return vd(a)?a[a.length-1]||0:a}function lR(a,i){const l=ri(a,i);let{transitionEnd:u={},transition:h={},...m}=l||{};m={...m,...u};for(const f in m){const _=oR(m[f]);aR(a,f,_)}}const Et=a=>!!(a&&a.getVelocity);function cR(a){return!!(Et(a)&&a.add)}function wd(a,i){const l=a.getValue("willChange");if(cR(l))return l.add(i);if(!l&&rs.WillChange){const u=new rs.WillChange("auto");a.addValue("willChange",u),u.add(i)}}function Jd(a){return a.replace(/([A-Z])/g,i=>`-${i.toLowerCase()}`)}const uR="framerAppearId",Dw="data-"+Jd(uR);function Ow(a){return a.props[Dw]}function dR({protectedKeys:a,needsAnimating:i},l){const u=a.hasOwnProperty(l)&&i[l]!==!0;return i[l]=!1,u}function Nw(a,i,{delay:l=0,transitionOverride:u,type:h}={}){let{transition:m,transitionEnd:f,..._}=i;const b=a.getDefaultTransition();m=m?Rw(m,b):b;const v=m==null?void 0:m.reduceMotion;u&&(m=u);const w=[],k=h&&a.animationState&&a.animationState.getState()[h];for(const A in _){const R=a.getValue(A,a.latestValues[A]??null),I=_[A];if(I===void 0||k&&dR(k,A))continue;const M={delay:l,...Yd(m||{},A)},$=R.get();if($!==void 0&&!R.isAnimating&&!Array.isArray(I)&&I===$&&!M.velocity)continue;let B=!1;if(window.MotionHandoffAnimation){const Z=Ow(a);if(Z){const ae=window.MotionHandoffAnimation(Z,A,je);ae!==null&&(M.startTime=ae,B=!0)}}wd(a,A);const z=v??a.shouldReduceMotion;R.start(Zd(A,R,I,z&&Pw.has(A)?{type:!1}:M,a,B));const G=R.animation;G&&w.push(G)}if(f){const A=()=>je.update(()=>{f&&lR(a,f)});w.length?Promise.all(w).then(A):A()}return w}function Sd(a,i,l={}){var b;const u=ri(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(Nw(a,u,l)):()=>Promise.resolve(),f=a.variantChildren&&a.variantChildren.size?(v=0)=>{const{delayChildren:w=0,staggerChildren:k,staggerDirection:A}=h;return hR(a,i,v,w,k,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 hR(a,i,l=0,u=0,h=0,m=1,f){const _=[];for(const b of a.variantChildren)b.notify("AnimationStart",i),_.push(Sd(b,i,{...f,delay:l+(typeof u=="function"?0:u)+Tw(a.variantChildren,b,u,h,m)}).then(()=>b.notify("AnimationComplete",i)));return Promise.all(_)}function pR(a,i,l={}){a.notify("AnimationStart",i);let u;if(Array.isArray(i)){const h=i.map(m=>Sd(a,m,l));u=Promise.all(h)}else if(typeof i=="string")u=Sd(a,i,l);else{const h=typeof i=="function"?ri(a,i,l.custom):i;u=Promise.all(Nw(a,h,l))}return u.then(()=>{a.notify("AnimationComplete",i)})}const fR={test:a=>a==="auto",parse:a=>a},Bw=a=>i=>i.test(a),Lw=[li,ue,jn,xs,UT,$T,fR],b2=a=>Lw.find(Bw(a));function mR(a){return typeof a=="number"?a===0:a!==null?a==="none"||a==="0"||K0(a):!0}const gR=new Set(["brightness","contrast","saturate","opacity"]);function yR(a){const[i,l]=a.slice(0,-1).split("(");if(i==="drop-shadow")return a;const[u]=l.match(jd)||[];if(!u)return a;const h=l.replace(u,"");let m=gR.has(i)?1:0;return u!==l&&(m*=100),i+"("+m+h+")"}const _R=/\b([a-z-]*)\(.*?\)/gu,xd={...Sn,getAnimatableNone:a=>{const i=a.match(_R);return i?i.map(yR).join(" "):a}},Ed={...Sn,getAnimatableNone:a=>{const i=Sn.parse(a);return Sn.createTransformer(a)(i.map(u=>typeof u=="number"?0:typeof u=="object"?{...u,alpha:1}:u))}},v2={...li,transform:Math.round},bR={rotate:xs,rotateX:xs,rotateY:xs,rotateZ:xs,scale:Wo,scaleX:Wo,scaleY:Wo,scaleZ:Wo,skew:xs,skewX:xs,skewY:xs,distance:ue,translateX:ue,translateY:ue,translateZ:ue,x:ue,y:ue,z:ue,perspective:ue,transformPerspective:ue,opacity:Ea,originX:a2,originY:a2,originZ:ue},Qd={borderWidth:ue,borderTopWidth:ue,borderRightWidth:ue,borderBottomWidth:ue,borderLeftWidth:ue,borderRadius:ue,borderTopLeftRadius:ue,borderTopRightRadius:ue,borderBottomRightRadius:ue,borderBottomLeftRadius:ue,width:ue,maxWidth:ue,height:ue,maxHeight:ue,top:ue,right:ue,bottom:ue,left:ue,inset:ue,insetBlock:ue,insetBlockStart:ue,insetBlockEnd:ue,insetInline:ue,insetInlineStart:ue,insetInlineEnd:ue,padding:ue,paddingTop:ue,paddingRight:ue,paddingBottom:ue,paddingLeft:ue,paddingBlock:ue,paddingBlockStart:ue,paddingBlockEnd:ue,paddingInline:ue,paddingInlineStart:ue,paddingInlineEnd:ue,margin:ue,marginTop:ue,marginRight:ue,marginBottom:ue,marginLeft:ue,marginBlock:ue,marginBlockStart:ue,marginBlockEnd:ue,marginInline:ue,marginInlineStart:ue,marginInlineEnd:ue,fontSize:ue,backgroundPositionX:ue,backgroundPositionY:ue,...bR,zIndex:v2,fillOpacity:Ea,strokeOpacity:Ea,numOctaves:v2},vR={...Qd,color:ot,backgroundColor:ot,outlineColor:ot,fill:ot,stroke:ot,borderColor:ot,borderTopColor:ot,borderRightColor:ot,borderBottomColor:ot,borderLeftColor:ot,filter:xd,WebkitFilter:xd,mask:Ed,WebkitMask:Ed},Mw=a=>vR[a],wR=new Set([xd,Ed]);function Fw(a,i){let l=Mw(a);return wR.has(l)||(l=Sn),l.getAnimatableNone?l.getAnimatableNone(i):void 0}const SR=new Set(["auto","none","0"]);function xR(a,i,l){let u=0,h;for(;u<a.length&&!h;){const m=a[u];typeof m=="string"&&!SR.has(m)&&ii(m).values.length&&(h=a[u]),u++}if(h&&l)for(const m of i)a[m]=Fw(l,h)}class ER extends Kd{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 k=i[w];if(typeof k=="string"&&(k=k.trim(),Ud(k))){const A=Iw(k,l.current);A!==void 0&&(i[w]=A),w===i.length-1&&(this.finalKeyframe=k)}}if(this.resolveNoneKeyframes(),!Pw.has(u)||i.length!==2)return;const[h,m]=i,f=b2(h),_=b2(m),b=i2(h),v=i2(m);if(b!==v&&ks[u]){this.needsMeasurement=!0;return}if(f!==_)if(f2(f)&&f2(_))for(let w=0;w<i.length;w++){const k=i[w];typeof k=="string"&&(i[w]=parseFloat(k))}else ks[u]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:i,name:l}=this,u=[];for(let h=0;h<i.length;h++)(i[h]===null||mR(i[h]))&&u.push(h);u.length&&xR(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=ks[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]=ks[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 kR=new Set(["opacity","clipPath","filter","transform"]);function $w(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 Uw=(a,i)=>i&&typeof a=="number"?i.transform(a):a;function CR(a){return G0(a)&&"offsetHeight"in a}const{schedule:eh}=ow(queueMicrotask,!1),vn={x:!1,y:!1};function jw(){return vn.x||vn.y}function AR(a){return a==="x"||a==="y"?vn[a]?null:(vn[a]=!0,()=>{vn[a]=!1}):vn.x||vn.y?null:(vn.x=vn.y=!0,()=>{vn.x=vn.y=!1})}function Vw(a,i){const l=$w(a),u=new AbortController,h={passive:!0,...i,signal:u.signal};return[l,h,()=>u.abort()]}function TR(a){return!(a.pointerType==="touch"||jw())}function IR(a,i,l={}){const[u,h,m]=Vw(a,l);return u.forEach(f=>{let _=!1,b=!1,v;const w=()=>{f.removeEventListener("pointerleave",I)},k=$=>{v&&(v($),v=void 0),w()},A=$=>{_=!1,window.removeEventListener("pointerup",A),window.removeEventListener("pointercancel",A),b&&(b=!1,k($))},R=()=>{_=!0,window.addEventListener("pointerup",A,h),window.addEventListener("pointercancel",A,h)},I=$=>{if($.pointerType!=="touch"){if(_){b=!0;return}k($)}},M=$=>{if(!TR($))return;b=!1;const B=i(f,$);typeof B=="function"&&(v=B,f.addEventListener("pointerleave",I,h))};f.addEventListener("pointerenter",M,h),f.addEventListener("pointerdown",R,h)}),m}const Hw=(a,i)=>i?a===i?!0:Hw(a,i.parentElement):!1,th=a=>a.pointerType==="mouse"?typeof a.button!="number"||a.button<=0:a.isPrimary!==!1,RR=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function PR(a){return RR.has(a.tagName)||a.isContentEditable===!0}const DR=new Set(["INPUT","SELECT","TEXTAREA"]);function OR(a){return DR.has(a.tagName)||a.isContentEditable===!0}const Qo=new WeakSet;function w2(a){return i=>{i.key==="Enter"&&a(i)}}function Ku(a,i){a.dispatchEvent(new PointerEvent("pointer"+i,{isPrimary:!0,bubbles:!0}))}const NR=(a,i)=>{const l=a.currentTarget;if(!l)return;const u=w2(()=>{if(Qo.has(l))return;Ku(l,"down");const h=w2(()=>{Ku(l,"up")}),m=()=>Ku(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 S2(a){return th(a)&&!jw()}const x2=new WeakSet;function BR(a,i,l={}){const[u,h,m]=Vw(a,l),f=_=>{const b=_.currentTarget;if(!S2(_)||x2.has(_))return;Qo.add(b),l.stopPropagation&&x2.add(_);const v=i(b,_),w=(R,I)=>{window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",A),Qo.has(b)&&Qo.delete(b),S2(R)&&typeof v=="function"&&v(R,{success:I})},k=R=>{w(R,b===window||b===document||l.useGlobalTarget||Hw(b,R.target))},A=R=>{w(R,!1)};window.addEventListener("pointerup",k,h),window.addEventListener("pointercancel",A,h)};return u.forEach(_=>{(l.useGlobalTarget?window:_).addEventListener("pointerdown",f,h),CR(_)&&(_.addEventListener("focus",v=>NR(v,h)),!PR(_)&&!_.hasAttribute("tabindex")&&(_.tabIndex=0))}),m}function nh(a){return G0(a)&&"ownerSVGElement"in a}const el=new WeakMap;let Es;const Ww=(a,i,l)=>(u,h)=>h&&h[0]?h[0][a+"Size"]:nh(u)&&"getBBox"in u?u.getBBox()[i]:u[l],LR=Ww("inline","width","offsetWidth"),MR=Ww("block","height","offsetHeight");function FR({target:a,borderBoxSize:i}){var l;(l=el.get(a))==null||l.forEach(u=>{u(a,{get width(){return LR(a,i)},get height(){return MR(a,i)}})})}function $R(a){a.forEach(FR)}function UR(){typeof ResizeObserver>"u"||(Es=new ResizeObserver($R))}function jR(a,i){Es||UR();const l=$w(a);return l.forEach(u=>{let h=el.get(u);h||(h=new Set,el.set(u,h)),h.add(i),Es==null||Es.observe(u)}),()=>{l.forEach(u=>{const h=el.get(u);h==null||h.delete(i),h!=null&&h.size||Es==null||Es.unobserve(u)})}}const tl=new Set;let Jr;function VR(){Jr=()=>{const a={get width(){return window.innerWidth},get height(){return window.innerHeight}};tl.forEach(i=>i(a))},window.addEventListener("resize",Jr)}function HR(a){return tl.add(a),Jr||VR(),()=>{tl.delete(a),!tl.size&&typeof Jr=="function"&&(window.removeEventListener("resize",Jr),Jr=void 0)}}function E2(a,i){return typeof a=="function"?HR(a):jR(a,i)}function WR(a){return nh(a)&&a.tagName==="svg"}const zR=[...Lw,ot,Sn],qR=a=>zR.find(Bw(a)),k2=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qr=()=>({x:k2(),y:k2()}),C2=()=>({min:0,max:0}),ut=()=>({x:C2(),y:C2()}),GR=new WeakMap;function fl(a){return a!==null&&typeof a=="object"&&typeof a.start=="function"}function ka(a){return typeof a=="string"||Array.isArray(a)}const sh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],rh=["initial",...sh];function ml(a){return fl(a.animate)||rh.some(i=>ka(a[i]))}function zw(a){return!!(ml(a)||a.variants)}function KR(a,i,l){for(const u in i){const h=i[u],m=l[u];if(Et(h))a.addValue(u,h);else if(Et(m))a.addValue(u,ai(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,ai(f!==void 0?f:h,{owner:a}))}}for(const u in l)i[u]===void 0&&a.removeValue(u);return i}const kd={current:null},qw={current:!1},YR=typeof window<"u";function ZR(){if(qw.current=!0,!!YR)if(window.matchMedia){const a=window.matchMedia("(prefers-reduced-motion)"),i=()=>kd.current=a.matches;a.addEventListener("change",i),i()}else kd.current=!1}const A2=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ul={};function Gw(a){ul=a}function XR(){return ul}class JR{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=Kd,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=Rt.now();this.renderScheduledAt<R&&(this.renderScheduledAt=R,je.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=ml(l),this.isVariantNode=zw(l),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(i&&i.current);const{willChange:k,...A}=this.scrapeMotionValuesFromProps(l,{},this);for(const R in A){const I=A[R];v[R]!==void 0&&Et(I)&&I.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,GR.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:(qw.current||ZR(),this.shouldReduceMotion=kd.current),process.env.NODE_ENV!=="production"&&Md(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(),Cs(this.notifyUpdate),Cs(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&&kR.has(i)&&this.current instanceof HTMLElement){const{factory:f,keyframes:_,times:b,ease:v,duration:w}=l.accelerate,k=new Cw({element:this.current,name:i,keyframes:_,times:b,ease:v,duration:Mt(w)}),A=f(k);this.valueSubscriptions.set(i,()=>{A(),k.cancel()});return}const u=ui.has(i);u&&this.onBindTransform&&this.onBindTransform();const h=l.on("change",f=>{this.latestValues[i]=f,this.props.onUpdate&&je.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 ul){const l=ul[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):ut()}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<A2.length;u++){const h=A2[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=KR(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=ai(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"&&(q0(u)||K0(u))?u=parseFloat(u):!qR(u)&&Sn.test(l)&&(u=Fw(i,l)),this.setBaseTarget(i,Et(u)?u.get():u)),Et(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=Xd(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&&!Et(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 Ld),this.events[i].add(l)}notify(i,...l){this.events[i]&&this.events[i].notify(...l)}scheduleRenderMicrotask(){eh.render(this.render)}}class Kw extends JR{constructor(){super(...arguments),this.KeyframeResolver=ER}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;Et(i)&&(this.childSubscription=i.on("change",l=>{this.current&&(this.current.textContent=`${l}`)}))}}class As{constructor(i){this.isMounted=!1,this.node=i}update(){}}function Yw({top:a,left:i,right:l,bottom:u}){return{x:{min:i,max:l},y:{min:a,max:u}}}function QR({x:a,y:i}){return{top:i.min,right:a.max,bottom:i.max,left:a.min}}function eP(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 Yu(a){return a===void 0||a===1}function Cd({scale:a,scaleX:i,scaleY:l}){return!Yu(a)||!Yu(i)||!Yu(l)}function sr(a){return Cd(a)||Zw(a)||a.z||a.rotate||a.rotateX||a.rotateY||a.skewX||a.skewY}function Zw(a){return T2(a.x)||T2(a.y)}function T2(a){return a&&a!=="0%"}function dl(a,i,l){const u=a-l,h=i*u;return l+h}function I2(a,i,l,u,h){return h!==void 0&&(a=dl(a,h,u)),dl(a,l,u)+i}function Ad(a,i=0,l=1,u,h){a.min=I2(a.min,i,l,u,h),a.max=I2(a.max,i,l,u,h)}function Xw(a,{x:i,y:l}){Ad(a.x,i.translate,i.scale,i.originPoint),Ad(a.y,l.translate,l.scale,l.originPoint)}const R2=.999999999999,P2=1.0000000000001;function tP(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&&ti(a,{x:-m.scroll.offset.x,y:-m.scroll.offset.y}),f&&(i.x*=f.x.scale,i.y*=f.y.scale,Xw(a,f)),u&&sr(m.latestValues)&&ti(a,m.latestValues,(_=m.layout)==null?void 0:_.layoutBox))}i.x<P2&&i.x>R2&&(i.x=1),i.y<P2&&i.y>R2&&(i.y=1)}function ei(a,i){a.min=a.min+i,a.max=a.max+i}function D2(a,i,l,u,h=.5){const m=Xe(a.min,a.max,h);Ad(a,i,l,m,u)}function O2(a,i){return typeof a=="string"?parseFloat(a)/100*(i.max-i.min):a}function ti(a,i,l){const u=l??a;D2(a.x,O2(i.x,u.x),i.scaleX,i.scale,i.originX),D2(a.y,O2(i.y,u.y),i.scaleY,i.scale,i.originY)}function Jw(a,i){return Yw(eP(a.getBoundingClientRect(),i))}function nP(a,i,l){const u=Jw(a,l),{scroll:h}=i;return h&&(ei(u.x,h.offset.x),ei(u.y,h.offset.y)),u}const sP={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},rP=ci.length;function iP(a,i,l){let u="",h=!0;for(let m=0;m<rP;m++){const f=ci[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=Uw(_,Qd[f]);if(!b){h=!1;const w=sP[f]||f;u+=`${w}(${v}) `}l&&(i[f]=v)}}return u=u.trim(),l?u=l(i,h?"":u):h&&(u="none"),u}function ih(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(ui.has(b)){f=!0;continue}else if(cw(b)){h[b]=v;continue}else{const w=Uw(v,Qd[b]);b.startsWith("origin")?(_=!0,m[b]=w):u[b]=w}}if(i.transform||(f||l?u.transform=iP(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 Qw(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 N2(a,i){return i.max===i.min?0:a/(i.max-i.min)*100}const pa={correct:(a,i)=>{if(!i.target)return a;if(typeof a=="string")if(ue.test(a))a=parseFloat(a);else return a;const l=N2(a,i.target.x),u=N2(a,i.target.y);return`${l}% ${u}%`}},aP={correct:(a,{treeScale:i,projectionDelta:l})=>{const u=a,h=Sn.parse(a);if(h.length>5)return u;const m=Sn.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=Xe(_,b,.5);return typeof h[2+f]=="number"&&(h[2+f]/=v),typeof h[3+f]=="number"&&(h[3+f]/=v),m(h)}},Td={borderRadius:{...pa,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:pa,borderTopRightRadius:pa,borderBottomLeftRadius:pa,borderBottomRightRadius:pa,boxShadow:aP};function eS(a,{layout:i,layoutId:l}){return ui.has(a)||a.startsWith("origin")||(i||l!==void 0)&&(!!Td[a]||a==="opacity")}function ah(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)(Et(u[_])||h&&Et(h[_])||eS(_,a)||((f=l==null?void 0:l.getValue(_))==null?void 0:f.liveStyle)!==void 0)&&(m[_]=u[_]);return m}function oP(a){return window.getComputedStyle(a)}class lP extends Kw{constructor(){super(...arguments),this.type="html",this.renderInstance=Qw}readValueFromInstance(i,l){var u;if(ui.has(l))return(u=this.projection)!=null&&u.isProjecting?fd(l):CI(i,l);{const h=oP(i),m=(cw(l)?h.getPropertyValue(l):h[l])||0;return typeof m=="string"?m.trim():m}}measureInstanceViewportBox(i,{transformPagePoint:l}){return Jw(i,l)}build(i,l,u){ih(i,l,u.transformTemplate)}scrapeMotionValuesFromProps(i,l,u){return ah(i,l,u)}}const cP={offset:"stroke-dashoffset",array:"stroke-dasharray"},uP={offset:"strokeDashoffset",array:"strokeDasharray"};function dP(a,i,l=1,u=0,h=!0){a.pathLength=1;const m=h?cP:uP;a[m.offset]=`${-u}`,a[m.array]=`${i} ${l}`}const hP=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function tS(a,{attrX:i,attrY:l,attrScale:u,pathLength:h,pathSpacing:m=1,pathOffset:f=0,..._},b,v,w){if(ih(a,_,v),b){a.style.viewBox&&(a.attrs.viewBox=a.style.viewBox);return}a.attrs=a.style,a.style={};const{attrs:k,style:A}=a;k.transform&&(A.transform=k.transform,delete k.transform),(A.transform||k.transformOrigin)&&(A.transformOrigin=k.transformOrigin??"50% 50%",delete k.transformOrigin),A.transform&&(A.transformBox=(w==null?void 0:w.transformBox)??"fill-box",delete k.transformBox);for(const R of hP)k[R]!==void 0&&(A[R]=k[R],delete k[R]);i!==void 0&&(k.x=i),l!==void 0&&(k.y=l),u!==void 0&&(k.scale=u),h!==void 0&&dP(k,h,m,f,!1)}const nS=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"]),sS=a=>typeof a=="string"&&a.toLowerCase()==="svg";function pP(a,i,l,u){Qw(a,i,void 0,u);for(const h in i.attrs)a.setAttribute(nS.has(h)?h:Jd(h),i.attrs[h])}function rS(a,i,l){const u=ah(a,i,l);for(const h in a)if(Et(a[h])||Et(i[h])){const m=ci.indexOf(h)!==-1?"attr"+h.charAt(0).toUpperCase()+h.substring(1):h;u[m]=a[h]}return u}class fP extends Kw{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ut}getBaseTargetFromProps(i,l){return i[l]}readValueFromInstance(i,l){if(ui.has(l)){const u=Mw(l);return u&&u.default||0}return l=nS.has(l)?l:Jd(l),i.getAttribute(l)}scrapeMotionValuesFromProps(i,l,u){return rS(i,l,u)}build(i,l,u){tS(i,l,this.isSVGTag,u.transformTemplate,u.style)}renderInstance(i,l,u,h){pP(i,l,u,h)}mount(i){this.isSVGTag=sS(i.tagName),super.mount(i)}}const mP=rh.length;function iS(a){if(!a)return;if(!a.isControllingVariants){const l=a.parent?iS(a.parent)||{}:{};return a.props.initial!==void 0&&(l.initial=a.props.initial),l}const i={};for(let l=0;l<mP;l++){const u=rh[l],h=a.props[u];(ka(h)||h===!1)&&(i[u]=h)}return i}function aS(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 gP=[...sh].reverse(),yP=sh.length;function _P(a){return i=>Promise.all(i.map(({animation:l,options:u})=>pR(a,l,u)))}function bP(a){let i=_P(a),l=B2(),u=!0,h=!1;const m=v=>(w,k)=>{var R;const A=ri(a,k,v==="exit"?(R=a.presenceContext)==null?void 0:R.custom:void 0);if(A){const{transition:I,transitionEnd:M,...$}=A;w={...w,...$,...M}}return w};function f(v){i=v(a)}function _(v){const{props:w}=a,k=iS(a.parent)||{},A=[],R=new Set;let I={},M=1/0;for(let B=0;B<yP;B++){const z=gP[B],G=l[z],Z=w[z]!==void 0?w[z]:k[z],ae=ka(Z),_e=z===v?G.isActive:null;_e===!1&&(M=B);let re=Z===k[z]&&Z!==w[z]&&ae;if(re&&(u||h)&&a.manuallyAnimateOnMount&&(re=!1),G.protectedKeys={...I},!G.isActive&&_e===null||!Z&&!G.prevProp||fl(Z)||typeof Z=="boolean")continue;if(z==="exit"&&G.isActive&&_e!==!0){G.prevResolvedValues&&(I={...I,...G.prevResolvedValues});continue}const Q=vP(G.prevProp,Z);let he=Q||z===v&&G.isActive&&!re&&ae||B>M&&ae,ie=!1;const Se=Array.isArray(Z)?Z:[Z];let ee=Se.reduce(m(z),{});_e===!1&&(ee={});const{prevResolvedValues:pe={}}=G,Pe={...pe,...ee},xe=Ae=>{he=!0,R.has(Ae)&&(ie=!0,R.delete(Ae)),G.needsAnimating[Ae]=!0;const Qe=a.getValue(Ae);Qe&&(Qe.liveStyle=!1)};for(const Ae in Pe){const Qe=ee[Ae],yt=pe[Ae];if(I.hasOwnProperty(Ae))continue;let We=!1;vd(Qe)&&vd(yt)?We=!aS(Qe,yt):We=Qe!==yt,We?Qe!=null?xe(Ae):R.add(Ae):Qe!==void 0&&R.has(Ae)?xe(Ae):G.protectedKeys[Ae]=!0}G.prevProp=Z,G.prevResolvedValues=ee,G.isActive&&(I={...I,...ee}),(u||h)&&a.blockInitialAnimation&&(he=!1);const ke=re&&Q;he&&(!ke||ie)&&A.push(...Se.map(Ae=>{const Qe={type:z};if(typeof Ae=="string"&&(u||h)&&!ke&&a.manuallyAnimateOnMount&&a.parent){const{parent:yt}=a,We=ri(yt,Ae);if(yt.enteringChildren&&We){const{delayChildren:_t}=We.transition||{};Qe.delay=Tw(yt.enteringChildren,a,_t)}}return{animation:Ae,options:Qe}}))}if(R.size){const B={};if(typeof w.initial!="boolean"){const z=ri(a,Array.isArray(w.initial)?w.initial[0]:w.initial);z&&z.transition&&(B.transition=z.transition)}R.forEach(z=>{const G=a.getBaseTarget(z),Z=a.getValue(z);Z&&(Z.liveStyle=!0),B[z]=G??null}),A.push({animation:B})}let $=!!A.length;return u&&(w.initial===!1||w.initial===w.animate)&&!a.manuallyAnimateOnMount&&($=!1),u=!1,h=!1,$?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 I;return(I=R.animationState)==null?void 0:I.setActive(v,w)}),l[v].isActive=w;const k=_(v);for(const R in l)l[R].protectedKeys={};return k}return{animateChanges:_,setActive:b,setAnimateFunction:f,getState:()=>l,reset:()=>{l=B2(),h=!0}}}function vP(a,i){return typeof i=="string"?i!==a:Array.isArray(i)?!aS(i,a):!1}function Qs(a=!1){return{isActive:a,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function B2(){return{animate:Qs(!0),whileInView:Qs(),whileHover:Qs(),whileTap:Qs(),whileDrag:Qs(),whileFocus:Qs(),exit:Qs()}}function L2(a,i){a.min=i.min,a.max=i.max}function gn(a,i){L2(a.x,i.x),L2(a.y,i.y)}function M2(a,i){a.translate=i.translate,a.scale=i.scale,a.originPoint=i.originPoint,a.origin=i.origin}const oS=1e-4,wP=1-oS,SP=1+oS,lS=.01,xP=0-lS,EP=0+lS;function Pt(a){return a.max-a.min}function kP(a,i,l){return Math.abs(a-i)<=l}function F2(a,i,l,u=.5){a.origin=u,a.originPoint=Xe(i.min,i.max,a.origin),a.scale=Pt(l)/Pt(i),a.translate=Xe(l.min,l.max,a.origin)-a.originPoint,(a.scale>=wP&&a.scale<=SP||isNaN(a.scale))&&(a.scale=1),(a.translate>=xP&&a.translate<=EP||isNaN(a.translate))&&(a.translate=0)}function wa(a,i,l,u){F2(a.x,i.x,l.x,u?u.originX:void 0),F2(a.y,i.y,l.y,u?u.originY:void 0)}function $2(a,i,l){a.min=l.min+i.min,a.max=a.min+Pt(i)}function CP(a,i,l){$2(a.x,i.x,l.x),$2(a.y,i.y,l.y)}function U2(a,i,l){a.min=i.min-l.min,a.max=a.min+Pt(i)}function hl(a,i,l){U2(a.x,i.x,l.x),U2(a.y,i.y,l.y)}function j2(a,i,l,u,h){return a-=i,a=dl(a,1/l,u),h!==void 0&&(a=dl(a,1/h,u)),a}function AP(a,i=0,l=1,u=.5,h,m=a,f=a){if(jn.test(i)&&(i=parseFloat(i),i=Xe(f.min,f.max,i/100)-f.min),typeof i!="number")return;let _=Xe(m.min,m.max,u);a===m&&(_-=i),a.min=j2(a.min,i,l,_,h),a.max=j2(a.max,i,l,_,h)}function V2(a,i,[l,u,h],m,f){AP(a,i[l],i[u],i[h],i.scale,m,f)}const TP=["x","scaleX","originX"],IP=["y","scaleY","originY"];function H2(a,i,l,u){V2(a.x,i,TP,l?l.x:void 0,u?u.x:void 0),V2(a.y,i,IP,l?l.y:void 0,u?u.y:void 0)}function W2(a){return a.translate===0&&a.scale===1}function cS(a){return W2(a.x)&&W2(a.y)}function z2(a,i){return a.min===i.min&&a.max===i.max}function RP(a,i){return z2(a.x,i.x)&&z2(a.y,i.y)}function q2(a,i){return Math.round(a.min)===Math.round(i.min)&&Math.round(a.max)===Math.round(i.max)}function uS(a,i){return q2(a.x,i.x)&&q2(a.y,i.y)}function G2(a){return Pt(a.x)/Pt(a.y)}function K2(a,i){return a.translate===i.translate&&a.scale===i.scale&&a.originPoint===i.originPoint}function Un(a){return[a("x"),a("y")]}function PP(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:k,rotateY:A,skewX:R,skewY:I}=l;v&&(u=`perspective(${v}px) ${u}`),w&&(u+=`rotate(${w}deg) `),k&&(u+=`rotateX(${k}deg) `),A&&(u+=`rotateY(${A}deg) `),R&&(u+=`skewX(${R}deg) `),I&&(u+=`skewY(${I}deg) `)}const _=a.x.scale*i.x,b=a.y.scale*i.y;return(_!==1||b!==1)&&(u+=`scale(${_}, ${b})`),u||"none"}const dS=["TopLeft","TopRight","BottomLeft","BottomRight"],DP=dS.length,Y2=a=>typeof a=="string"?parseFloat(a):a,Z2=a=>typeof a=="number"||ue.test(a);function OP(a,i,l,u,h,m){h?(a.opacity=Xe(0,l.opacity??1,NP(u)),a.opacityExit=Xe(i.opacity??1,0,BP(u))):m&&(a.opacity=Xe(i.opacity??1,l.opacity??1,u));for(let f=0;f<DP;f++){const _=`border${dS[f]}Radius`;let b=X2(i,_),v=X2(l,_);if(b===void 0&&v===void 0)continue;b||(b=0),v||(v=0),b===0||v===0||Z2(b)===Z2(v)?(a[_]=Math.max(Xe(Y2(b),Y2(v),u),0),(jn.test(v)||jn.test(b))&&(a[_]+="%")):a[_]=v}(i.rotate||l.rotate)&&(a.rotate=Xe(i.rotate||0,l.rotate||0,u))}function X2(a,i){return a[i]!==void 0?a[i]:a.borderRadius}const NP=hS(0,.5,sw),BP=hS(.5,.95,dn);function hS(a,i,l){return u=>u<a?0:u>i?1:l(xa(a,i,u))}function LP(a,i,l){const u=Et(a)?a:ai(a);return u.start(Zd("",u,i,l)),u.animation}function Ca(a,i,l,u={passive:!0}){return a.addEventListener(i,l,u),()=>a.removeEventListener(i,l)}const MP=(a,i)=>a.depth-i.depth;class FP{constructor(){this.children=[],this.isDirty=!1}add(i){Bd(this.children,i),this.isDirty=!0}remove(i){al(this.children,i),this.isDirty=!0}forEach(i){this.isDirty&&this.children.sort(MP),this.isDirty=!1,this.children.forEach(i)}}function $P(a,i){const l=Rt.now(),u=({timestamp:h})=>{const m=h-l;m>=i&&(Cs(u),a(m-i))};return je.setup(u,!0),()=>Cs(u)}function nl(a){return Et(a)?a.get():a}class UP{constructor(){this.members=[]}add(i){Bd(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&&(al(this.members,u),u.unmount())}i.scheduleRender()}remove(i){if(al(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 sl={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Zu=["","X","Y","Z"],jP=1e3;let VP=0;function Xu(a,i,l,u){const{latestValues:h}=i;h[a]&&(l[a]=h[a],i.setStaticValue(a,0),u&&(u[a]=0))}function pS(a){if(a.hasCheckedOptimisedAppear=!0,a.root===a)return;const{visualElement:i}=a.options;if(!i)return;const l=Ow(i);if(window.MotionHasOptimisedAnimation(l,"transform")){const{layout:h,layoutId:m}=a.options;window.MotionCancelOptimisedAnimation(l,"transform",je,!(h||m))}const{parent:u}=a;u&&!u.hasCheckedOptimisedAppear&&pS(u)}function fS({attachResizeListener:a,defaultParent:i,measureScroll:l,checkIsScrollRoot:u,resetTransform:h}){return class{constructor(f={},_=i==null?void 0:i()){this.id=VP++,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(zP),this.nodes.forEach(YP),this.nodes.forEach(ZP),this.nodes.forEach(qP)},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 FP)}addEventListener(f,_){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new Ld),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=nh(f)&&!WR(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,k=0;const A=()=>this.root.updateBlockedByResize=!1;je.read(()=>{k=window.innerWidth}),a(f,()=>{const R=window.innerWidth;R!==k&&(k=R,this.root.updateBlockedByResize=!0,w&&w(),w=$P(A,250),sl.hasAnimatedSinceResize&&(sl.hasAnimatedSinceResize=!1,this.nodes.forEach(e0)))})}_&&this.root.registerSharedNode(_,this),this.options.animate!==!1&&v&&(_||b)&&this.addEventListener("didUpdate",({delta:w,hasLayoutChanged:k,hasRelativeLayoutChanged:A,layout:R})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const I=this.options.transition||v.getDefaultTransition()||tD,{onLayoutAnimationStart:M,onLayoutAnimationComplete:$}=v.getProps(),B=!this.targetLayout||!uS(this.targetLayout,R),z=!k&&A;if(this.options.layoutRoot||this.resumeFrom||z||k&&(B||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const G={...Yd(I,"layout"),onPlay:M,onComplete:$};(v.shouldReduceMotion||this.options.layoutRoot)&&(G.delay=0,G.type=!1),this.startAnimation(G),this.setAnimationOrigin(w,z)}else k||e0(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(),Cs(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(XP),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&&pS(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let w=0;w<this.path.length;w++){const k=this.path[w];k.shouldResetTransform=!0,(typeof k.latestValues.x=="string"||typeof k.latestValues.y=="string")&&(k.isLayoutDirty=!0),k.updateScroll("snapshot"),k.options.layoutRoot&&k.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(J2);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Q2);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(KP),this.nodes.forEach(HP),this.nodes.forEach(WP)):this.nodes.forEach(Q2),this.clearAllSnapshots();const _=Rt.now();gt.delta=Vn(0,1e3/60,_-gt.timestamp),gt.timestamp=_,gt.isProcessing=!0,Vu.update.process(gt),Vu.preRender.process(gt),Vu.render.process(gt),gt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,eh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(GP),this.sharedNodes.forEach(JP)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,je.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){je.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Pt(this.snapshot.measuredBox.x)&&!Pt(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=ut(),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&&!cS(this.projectionDelta),b=this.getTransformTemplate(),v=b?b(this.latestValues,""):void 0,w=v!==this.prevTransformTemplateValue;f&&this.instance&&(_||sr(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)),nD(b),{animationId:this.root.animationId,measuredBox:_,layoutBox:b,latestValues:{},source:this.id}}measurePageBox(){var v;const{visualElement:f}=this.options;if(!f)return ut();const _=f.measureViewportBox();if(!(((v=this.scroll)==null?void 0:v.wasRoot)||this.path.some(sD))){const{scroll:w}=this.root;w&&(ei(_.x,w.offset.x),ei(_.y,w.offset.y))}return _}removeElementScroll(f){var b;const _=ut();if(gn(_,f),(b=this.scroll)!=null&&b.wasRoot)return _;for(let v=0;v<this.path.length;v++){const w=this.path[v],{scroll:k,options:A}=w;w!==this.root&&k&&A.layoutScroll&&(k.wasRoot&&gn(_,f),ei(_.x,k.offset.x),ei(_.y,k.offset.y))}return _}applyTransform(f,_=!1){var v,w;const b=ut();gn(b,f);for(let k=0;k<this.path.length;k++){const A=this.path[k];!_&&A.options.layoutScroll&&A.scroll&&A!==A.root&&ti(b,{x:-A.scroll.offset.x,y:-A.scroll.offset.y}),sr(A.latestValues)&&ti(b,A.latestValues,(v=A.layout)==null?void 0:v.layoutBox)}return sr(this.latestValues)&&ti(b,this.latestValues,(w=this.layout)==null?void 0:w.layoutBox),b}removeTransform(f){var b;const _=ut();gn(_,f);for(let v=0;v<this.path.length;v++){const w=this.path[v];if(!sr(w.latestValues))continue;let k;w.instance&&(Cd(w.latestValues)&&w.updateSnapshot(),k=ut(),gn(k,w.measurePageBox())),H2(_,w.latestValues,(b=w.snapshot)==null?void 0:b.layoutBox,k)}return sr(this.latestValues)&&H2(_,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!==gt.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:k}=this.options;if(!this.layout||!(w||k))return;this.resolvedRelativeTargetAt=gt.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=ut(),this.targetWithTransforms=ut()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),CP(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):gn(this.target,this.layout.layoutBox),Xw(this.target,this.targetDelta)):gn(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||Cd(this.parent.latestValues)||Zw(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=ut(),this.relativeTargetOrigin=ut(),hl(this.relativeTargetOrigin,_,b),gn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var I;const f=this.getLead(),_=!!this.resumingFrom||this!==f;let b=!0;if((this.isProjectionDirty||(I=this.parent)!=null&&I.isProjectionDirty)&&(b=!1),_&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(b=!1),this.resolvedRelativeTargetAt===gt.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;gn(this.layoutCorrected,this.layout.layoutBox);const k=this.treeScale.x,A=this.treeScale.y;tP(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=ut());const{target:R}=f;if(!R){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(M2(this.prevProjectionDelta.x,this.projectionDelta.x),M2(this.prevProjectionDelta.y,this.projectionDelta.y)),wa(this.projectionDelta,this.layoutCorrected,R,this.latestValues),(this.treeScale.x!==k||this.treeScale.y!==A||!K2(this.projectionDelta.x,this.prevProjectionDelta.x)||!K2(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=Qr(),this.projectionDelta=Qr(),this.projectionDeltaWithTransform=Qr()}setAnimationOrigin(f,_=!1){const b=this.snapshot,v=b?b.latestValues:{},w={...this.latestValues},k=Qr();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!_;const A=ut(),R=b?b.source:void 0,I=this.layout?this.layout.source:void 0,M=R!==I,$=this.getStack(),B=!$||$.members.length<=1,z=!!(M&&!B&&this.options.crossfade===!0&&!this.path.some(eD));this.animationProgress=0;let G;this.mixTargetDelta=Z=>{const ae=Z/1e3;t0(k.x,f.x,ae),t0(k.y,f.y,ae),this.setTargetDelta(k),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(hl(A,this.layout.layoutBox,this.relativeParent.layout.layoutBox),QP(this.relativeTarget,this.relativeTargetOrigin,A,ae),G&&RP(this.relativeTarget,G)&&(this.isProjectionDirty=!1),G||(G=ut()),gn(G,this.relativeTarget)),M&&(this.animationValues=w,OP(w,v,this.latestValues,ae,z,B)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=ae},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&&(Cs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=je.update(()=>{sl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ai(0)),this.motionValue.jump(0,!1),this.currentAnimation=LP(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(jP),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&&mS(this.options.animationType,this.layout.layoutBox,v.layoutBox)){b=this.target||ut();const k=Pt(this.layout.layoutBox.x);b.x.min=f.target.x.min,b.x.max=b.x.min+k;const A=Pt(this.layout.layoutBox.y);b.y.min=f.target.y.min,b.y.max=b.y.min+A}gn(_,b),ti(_,w),wa(this.projectionDeltaWithTransform,this.layoutCorrected,_,w)}}registerSharedNode(f,_){this.sharedNodes.has(f)||this.sharedNodes.set(f,new UP),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&&Xu("z",f,v,this.animationValues);for(let w=0;w<Zu.length;w++)Xu(`rotate${Zu[w]}`,f,v,this.animationValues),Xu(`skew${Zu[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=nl(_==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=nl(_==null?void 0:_.pointerEvents)||""),this.hasProjected&&!sr(this.latestValues)&&(f.transform=b?b({},""):"none",this.hasProjected=!1);return}f.visibility="";const w=v.animationValues||v.latestValues;this.applyTransformsToTarget();let k=PP(this.projectionDeltaWithTransform,this.treeScale,w);b&&(k=b(w,k)),f.transform=k;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 I in Td){if(w[I]===void 0)continue;const{correct:M,applyTo:$,isCSSVariable:B}=Td[I],z=k==="none"?w[I]:M(w[I],v);if($){const G=$.length;for(let Z=0;Z<G;Z++)f[$[Z]]=z}else B?this.options.visualElement.renderState.vars[I]=z:f[I]=z}this.options.layoutId&&(f.pointerEvents=v===this?nl(_==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(J2),this.root.sharedNodes.clear()}}}function HP(a){a.updateLayout()}function WP(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"?Un(k=>{const A=f?i.measuredBox[k]:i.layoutBox[k],R=Pt(A);A.min=u[k].min,A.max=A.min+R}):mS(m,i.layoutBox,u)&&Un(k=>{const A=f?i.measuredBox[k]:i.layoutBox[k],R=Pt(u[k]);A.max=A.min+R,a.relativeTarget&&!a.currentAnimation&&(a.isProjectionDirty=!0,a.relativeTarget[k].max=a.relativeTarget[k].min+R)});const _=Qr();wa(_,u,i.layoutBox);const b=Qr();f?wa(b,a.applyTransform(h,!0),i.measuredBox):wa(b,u,i.layoutBox);const v=!cS(_);let w=!1;if(!a.resumeFrom){const k=a.getClosestProjectingParent();if(k&&!k.resumeFrom){const{snapshot:A,layout:R}=k;if(A&&R){const I=ut();hl(I,i.layoutBox,A.layoutBox);const M=ut();hl(M,u,R.layoutBox),uS(I,M)||(w=!0),k.options.layoutRoot&&(a.relativeTarget=M,a.relativeTargetOrigin=I,a.relativeParent=k)}}}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 zP(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 qP(a){a.isProjectionDirty=a.isSharedProjectionDirty=a.isTransformDirty=!1}function GP(a){a.clearSnapshot()}function J2(a){a.clearMeasurements()}function Q2(a){a.isLayoutDirty=!1}function KP(a){const{visualElement:i}=a.options;i&&i.getProps().onBeforeLayoutMeasure&&i.notify("BeforeLayoutMeasure"),a.resetTransform()}function e0(a){a.finishAnimation(),a.targetDelta=a.relativeTarget=a.target=void 0,a.isProjectionDirty=!0}function YP(a){a.resolveTargetDelta()}function ZP(a){a.calcProjection()}function XP(a){a.resetSkewAndRotation()}function JP(a){a.removeLeadSnapshot()}function t0(a,i,l){a.translate=Xe(i.translate,0,l),a.scale=Xe(i.scale,1,l),a.origin=i.origin,a.originPoint=i.originPoint}function n0(a,i,l,u){a.min=Xe(i.min,l.min,u),a.max=Xe(i.max,l.max,u)}function QP(a,i,l,u){n0(a.x,i.x,l.x,u),n0(a.y,i.y,l.y,u)}function eD(a){return a.animationValues&&a.animationValues.opacityExit!==void 0}const tD={duration:.45,ease:[.4,0,.1,1]},s0=a=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(a),r0=s0("applewebkit/")&&!s0("chrome/")?Math.round:dn;function i0(a){a.min=r0(a.min),a.max=r0(a.max)}function nD(a){i0(a.x),i0(a.y)}function mS(a,i,l){return a==="position"||a==="preserve-aspect"&&!kP(G2(i),G2(l),.2)}function sD(a){var i;return a!==a.root&&((i=a.scroll)==null?void 0:i.wasRoot)}const rD=fS({attachResizeListener:(a,i)=>Ca(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}),Ju={current:void 0},gS=fS({measureScroll:a=>({x:a.scrollLeft,y:a.scrollTop}),defaultParent:()=>{if(!Ju.current){const a=new rD({});a.mount(window),a.setOptions({layoutScroll:!0}),Ju.current=a}return Ju.current},resetTransform:(a,i)=>{a.style.transform=i!==void 0?i:"none"},checkIsScrollRoot:a=>window.getComputedStyle(a).position==="fixed"}),yS=K.createContext({transformPagePoint:a=>a,isStatic:!1,reducedMotion:"never"});function iD(a=!0){const i=K.useContext(Nd);if(i===null)return[!0,null];const{isPresent:l,onExitComplete:u,register:h}=i,m=K.useId();K.useEffect(()=>{if(a)return h(m)},[a]);const f=K.useCallback(()=>a&&u&&u(m),[m,u,a]);return!l&&u?[!1,f]:[!0]}const _S=K.createContext({strict:!1}),a0={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 o0=!1;function aD(){if(o0)return;const a={};for(const i in a0)a[i]={isEnabled:l=>a0[i].some(u=>!!l[u])};Gw(a),o0=!0}function bS(){return aD(),XR()}function oD(a){const i=bS();for(const l in a)i[l]={...i[l],...a[l]};Gw(i)}const lD=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 pl(a){return a.startsWith("while")||a.startsWith("drag")&&a!=="draggable"||a.startsWith("layout")||a.startsWith("onTap")||a.startsWith("onPan")||a.startsWith("onLayout")||lD.has(a)}let vS=a=>!pl(a);function cD(a){typeof a=="function"&&(vS=i=>i.startsWith("on")?!pl(i):a(i))}try{cD(require("@emotion/is-prop-valid").default)}catch{}function uD(a,i,l){const u={};for(const h in a)h==="values"&&typeof a.values=="object"||(vS(h)||l===!0&&pl(h)||!i&&!pl(h)||a.draggable&&h.startsWith("onDrag"))&&(u[h]=a[h]);return u}const gl=K.createContext({});function dD(a,i){if(ml(a)){const{initial:l,animate:u}=a;return{initial:l===!1||ka(l)?l:void 0,animate:ka(u)?u:void 0}}return a.inherit!==!1?i:{}}function hD(a){const{initial:i,animate:l}=dD(a,K.useContext(gl));return K.useMemo(()=>({initial:i,animate:l}),[l0(i),l0(l)])}function l0(a){return Array.isArray(a)?a.join(" "):a}const oh=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function wS(a,i,l){for(const u in i)!Et(i[u])&&!eS(u,l)&&(a[u]=i[u])}function pD({transformTemplate:a},i){return K.useMemo(()=>{const l=oh();return ih(l,i,a),Object.assign({},l.vars,l.style)},[i])}function fD(a,i){const l=a.style||{},u={};return wS(u,l,a),Object.assign(u,pD(a,i)),u}function mD(a,i){const l={},u=fD(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 SS=()=>({...oh(),attrs:{}});function gD(a,i,l,u){const h=K.useMemo(()=>{const m=SS();return tS(m,i,sS(u),a.transformTemplate,a.style),{...m.attrs,style:{...m.style}}},[i]);if(a.style){const m={};wS(m,a.style,a),h.style={...m,...h.style}}return h}const yD=["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 lh(a){return typeof a!="string"||a.includes("-")?!1:!!(yD.indexOf(a)>-1||/[A-Z]/u.test(a))}function _D(a,i,l,{latestValues:u},h,m=!1,f){const b=(f??lh(a)?gD:mD)(i,u,h,a),v=uD(i,typeof a=="string",m),w=a!==K.Fragment?{...v,...b,ref:l}:{},{children:k}=i,A=K.useMemo(()=>Et(k)?k.get():k,[k]);return K.createElement(a,{...w,children:A})}function bD({scrapeMotionValuesFromProps:a,createRenderState:i},l,u,h){return{latestValues:vD(l,u,h,a),renderState:i()}}function vD(a,i,l,u){const h={},m=u(a,{});for(const A in m)h[A]=nl(m[A]);let{initial:f,animate:_}=a;const b=ml(a),v=zw(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 k=w?_:f;if(k&&typeof k!="boolean"&&!fl(k)){const A=Array.isArray(k)?k:[k];for(let R=0;R<A.length;R++){const I=Xd(a,A[R]);if(I){const{transitionEnd:M,transition:$,...B}=I;for(const z in B){let G=B[z];if(Array.isArray(G)){const Z=w?G.length-1:0;G=G[Z]}G!==null&&(h[z]=G)}for(const z in M)h[z]=M[z]}}}return h}const xS=a=>(i,l)=>{const u=K.useContext(gl),h=K.useContext(Nd),m=()=>bD(a,i,u,h);return l?m():bT(m)},wD=xS({scrapeMotionValuesFromProps:ah,createRenderState:oh}),SD=xS({scrapeMotionValuesFromProps:rS,createRenderState:SS}),xD=Symbol.for("motionComponentSymbol");function ED(a,i,l){const u=K.useRef(l);K.useInsertionEffect(()=>{u.current=l});const h=K.useRef(null);return K.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 ES=K.createContext({});function Yr(a){return a&&typeof a=="object"&&Object.prototype.hasOwnProperty.call(a,"current")}function kD(a,i,l,u,h,m){var G,Z;const{visualElement:f}=K.useContext(gl),_=K.useContext(_S),b=K.useContext(Nd),v=K.useContext(yS),w=v.reducedMotion,k=v.skipAnimations,A=K.useRef(null),R=K.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:k,isSVG:m}),R.current&&A.current&&(A.current.manuallyAnimateOnMount=!0));const I=A.current,M=K.useContext(ES);I&&!I.projection&&h&&(I.type==="html"||I.type==="svg")&&CD(A.current,l,h,M);const $=K.useRef(!1);K.useInsertionEffect(()=>{I&&$.current&&I.update(l,b)});const B=l[Dw],z=K.useRef(!!B&&typeof window<"u"&&!((G=window.MotionHandoffIsComplete)!=null&&G.call(window,B))&&((Z=window.MotionHasOptimisedAnimation)==null?void 0:Z.call(window,B)));return wT(()=>{R.current=!0,I&&($.current=!0,window.MotionIsMounted=!0,I.updateFeatures(),I.scheduleRenderMicrotask(),z.current&&I.animationState&&I.animationState.animateChanges())}),K.useEffect(()=>{I&&(!z.current&&I.animationState&&I.animationState.animateChanges(),z.current&&(queueMicrotask(()=>{var ae;(ae=window.MotionHandoffMarkAsComplete)==null||ae.call(window,B)}),z.current=!1),I.enteringChildren=void 0)}),I}function CD(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:kS(a.parent)),a.projection.setOptions({layoutId:h,layout:m,alwaysMeasureLayout:!!f||_&&Yr(_),visualElement:a,animationType:typeof m=="string"?m:"both",initialPromotionConfig:u,crossfade:w,layoutScroll:b,layoutRoot:v})}function kS(a){if(a)return a.options.allowProjection!==!1?a.projection:kS(a.parent)}function Qu(a,{forwardMotionProps:i=!1,type:l}={},u,h){u&&oD(u);const m=l?l==="svg":lh(a),f=m?SD:wD;function _(v,w){let k;const A={...K.useContext(yS),...v,layoutId:AD(v)},{isStatic:R}=A,I=hD(v),M=f(v,R);if(!R&&typeof window<"u"){TD(A,u);const $=ID(A);k=$.MeasureLayout,I.visualElement=kD(a,M,A,h,$.ProjectionNode,m)}return X.jsxs(gl.Provider,{value:I,children:[k&&I.visualElement?X.jsx(k,{visualElement:I.visualElement,...A}):null,_D(a,v,ED(M,I.visualElement,w),M,R,i,m)]})}_.displayName=`motion.${typeof a=="string"?a:`create(${a.displayName??a.name??""})`}`;const b=K.forwardRef(_);return b[xD]=a,b}function AD({layoutId:a}){const i=K.useContext(z0).id;return i&&a!==void 0?i+"-"+a:a}function TD(a,i){const l=K.useContext(_S).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?oi(!1,u,"lazy-strict-mode"):ss(!1,u,"lazy-strict-mode")}}function ID(a){const i=bS(),{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 RD(a,i){if(typeof Proxy>"u")return Qu;const l=new Map,u=(m,f)=>Qu(m,f,a,i),h=(m,f)=>(process.env.NODE_ENV!=="production"&&Md(!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,Qu(f,void 0,a,i)),l.get(f))})}const PD=(a,i)=>i.isSVG??lh(a)?new fP(i):new lP(i,{allowProjection:a!==K.Fragment});class DD extends As{constructor(i){super(i),i.animationState||(i.animationState=bP(i))}updateAnimationControlsSubscription(){const{animate:i}=this.node.getProps();fl(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 OD=0;class ND extends As{constructor(){super(...arguments),this.id=OD++}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 BD={animation:{Feature:DD},exit:{Feature:ND}};function Pa(a){return{point:{x:a.pageX,y:a.pageY}}}const LD=a=>i=>th(i)&&a(i,Pa(i));function Sa(a,i,l,u){return Ca(a,i,LD(l),u)}const CS=({current:a})=>a?a.ownerDocument.defaultView:null,c0=(a,i)=>Math.abs(a-i);function MD(a,i){const l=c0(a.x,i.x),u=c0(a.y,i.y);return Math.sqrt(l**2+u**2)}const u0=new Set(["auto","scroll"]);class AS{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=zo(this.lastRawMoveEventInfo,this.transformPagePoint));const R=ed(this.lastMoveEventInfo,this.history),I=this.startEvent!==null,M=MD(R.offset,{x:0,y:0})>=this.distanceThreshold;if(!I&&!M)return;const{point:$}=R,{timestamp:B}=gt;this.history.push({...$,timestamp:B});const{onStart:z,onMove:G}=this.handlers;I||(z&&z(this.lastMoveEvent,R),this.startEvent=this.lastMoveEvent),G&&G(this.lastMoveEvent,R)},this.handlePointerMove=(R,I)=>{this.lastMoveEvent=R,this.lastRawMoveEventInfo=I,this.lastMoveEventInfo=zo(I,this.transformPagePoint),je.update(this.updatePoint,!0)},this.handlePointerUp=(R,I)=>{this.end();const{onEnd:M,onSessionEnd:$,resumeAnimation:B}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&B&&B(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const z=ed(R.type==="pointercancel"?this.lastMoveEventInfo:zo(I,this.transformPagePoint),this.history);this.startEvent&&M&&M(R,z),$&&$(R,z)},!th(i))return;this.dragSnapToOrigin=m,this.handlers=l,this.transformPagePoint=u,this.distanceThreshold=f,this.contextWindow=h||window;const b=Pa(i),v=zo(b,this.transformPagePoint),{point:w}=v,{timestamp:k}=gt;this.history=[{...w,timestamp:k}];const{onSessionStart:A}=l;A&&A(i,ed(v,this.history)),this.removeListeners=Ta(Sa(this.contextWindow,"pointermove",this.handlePointerMove),Sa(this.contextWindow,"pointerup",this.handlePointerUp),Sa(this.contextWindow,"pointercancel",this.handlePointerUp)),_&&this.startScrollTracking(_)}startScrollTracking(i){let l=i.parentElement;for(;l;){const u=getComputedStyle(l);(u0.has(u.overflowX)||u0.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),je.update(this.updatePoint,!0))}updateHandlers(i){this.handlers=i}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Cs(this.updatePoint)}}function zo(a,i){return i?{point:i(a.point)}:a}function d0(a,i){return{x:a.x-i.x,y:a.y-i.y}}function ed({point:a},i){return{point:a,delta:d0(a,TS(i)),offset:d0(a,FD(i)),velocity:$D(i,.1)}}function FD(a){return a[0]}function TS(a){return a[a.length-1]}function $D(a,i){if(a.length<2)return{x:0,y:0};let l=a.length-1,u=null;const h=TS(a);for(;l>=0&&(u=a[l],!(h.timestamp-u.timestamp>Mt(i)));)l--;if(!u)return{x:0,y:0};u===a[0]&&a.length>2&&h.timestamp-u.timestamp>Mt(i)*2&&(u=a[1]);const m=un(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 UD(a,{min:i,max:l},u){return i!==void 0&&a<i?a=u?Xe(i,a,u.min):Math.max(a,i):l!==void 0&&a>l&&(a=u?Xe(l,a,u.max):Math.min(a,l)),a}function h0(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 jD(a,{top:i,left:l,bottom:u,right:h}){return{x:h0(a.x,l,h),y:h0(a.y,i,u)}}function p0(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 VD(a,i){return{x:p0(a.x,i.x),y:p0(a.y,i.y)}}function HD(a,i){let l=.5;const u=Pt(a),h=Pt(i);return h>u?l=xa(i.min,i.max-u,a.min):u>h&&(l=xa(a.min,a.max-h,i.min)),Vn(0,1,l)}function WD(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 Id=.35;function zD(a=Id){return a===!1?a=0:a===!0&&(a=Id),{x:f0(a,"left","right"),y:f0(a,"top","bottom")}}function f0(a,i,l){return{min:m0(a,i),max:m0(a,l)}}function m0(a,i){return typeof a=="number"?a:a[i]||0}const qD=new WeakMap;class GD{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=ut(),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=k=>{l&&this.snapToCursor(Pa(k).point),this.stopAnimation()},f=(k,A)=>{const{drag:R,dragPropagation:I,onDragStart:M}=this.getProps();if(R&&!I&&(this.openDragLock&&this.openDragLock(),this.openDragLock=AR(R),!this.openDragLock))return;this.latestPointerEvent=k,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),Un(B=>{let z=this.getAxisMotionValue(B).get()||0;if(jn.test(z)){const{projection:G}=this.visualElement;if(G&&G.layout){const Z=G.layout.layoutBox[B];Z&&(z=Pt(Z)*(parseFloat(z)/100))}}this.originPoint[B]=z}),M&&je.update(()=>M(k,A),!1,!0),wd(this.visualElement,"transform");const{animationState:$}=this.visualElement;$&&$.setActive("whileDrag",!0)},_=(k,A)=>{this.latestPointerEvent=k,this.latestPanInfo=A;const{dragPropagation:R,dragDirectionLock:I,onDirectionLock:M,onDrag:$}=this.getProps();if(!R&&!this.openDragLock)return;const{offset:B}=A;if(I&&this.currentDirection===null){this.currentDirection=YD(B),this.currentDirection!==null&&M&&M(this.currentDirection);return}this.updateAxis("x",A.point,B),this.updateAxis("y",A.point,B),this.visualElement.render(),$&&je.update(()=>$(k,A),!1,!0)},b=(k,A)=>{this.latestPointerEvent=k,this.latestPanInfo=A,this.stop(k,A),this.latestPointerEvent=null,this.latestPanInfo=null},v=()=>{const{dragSnapToOrigin:k}=this.getProps();(k||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:w}=this.getProps();this.panSession=new AS(i,{onSessionStart:m,onStart:f,onMove:_,onSessionEnd:b,resumeAnimation:v},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:w,distanceThreshold:u,contextWindow:CS(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();_&&je.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||!qo(i,h,this.currentDirection))return;const m=this.getAxisMotionValue(i);let f=this.originPoint[i]+u[i];this.constraints&&this.constraints[i]&&(f=UD(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&&Yr(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&u?this.constraints=jD(u.layoutBox,i):this.constraints=!1,this.elastic=zD(l),h!==this.constraints&&!Yr(i)&&u&&this.constraints&&!this.hasMutatedConstraints&&Un(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=WD(u.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:i,onMeasureDragConstraints:l}=this.getProps();if(!i||!Yr(i))return!1;const u=i.current;ss(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=nP(u,h.root,this.visualElement.getTransformPagePoint());let f=VD(h.layout.layoutBox,m);if(l){const _=l(QR(f));this.hasMutatedConstraints=!!_,_&&(f=Yw(_))}return f}startAnimation(i){const{drag:l,dragMomentum:u,dragElastic:h,dragTransition:m,dragSnapToOrigin:f,onDragTransitionEnd:_}=this.getProps(),b=this.constraints||{},v=Un(w=>{if(!qo(w,l,this.currentDirection))return;let k=b&&b[w]||{};f&&(k={min:0,max:0});const A=h?200:1e6,R=h?40:1e7,I={type:"inertia",velocity:u?i[w]:0,bounceStiffness:A,bounceDamping:R,timeConstant:750,restDelta:1,restSpeed:10,...m,...k};return this.startAxisValueAnimation(w,I)});return Promise.all(v).then(_)}startAxisValueAnimation(i,l){const u=this.getAxisMotionValue(i);return wd(this.visualElement,i),u.start(Zd(i,u,0,l,this.visualElement,!1))}stopAnimation(){Un(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){Un(l=>{const{drag:u}=this.getProps();if(!qo(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]-Xe(f,_,.5)+b)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:i,dragConstraints:l}=this.getProps(),{projection:u}=this.visualElement;if(!Yr(l)||!u||!this.constraints)return;this.stopAnimation();const h={x:0,y:0};Un(f=>{const _=this.getAxisMotionValue(f);if(_&&this.constraints!==!1){const b=_.get();h[f]=HD({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(),Un(f=>{if(!qo(f,i,null))return;const _=this.getAxisMotionValue(f),{min:b,max:v}=this.constraints[f];_.set(Xe(b,v,h[f]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;qD.set(this.visualElement,this);const i=this.visualElement.current,l=Sa(i,"pointerdown",v=>{const{drag:w,dragListener:k=!0}=this.getProps(),A=v.target,R=A!==i&&OR(A);w&&k&&!R&&this.start(v)});let u;const h=()=>{const{dragConstraints:v}=this.getProps();Yr(v)&&v.current&&(this.constraints=this.resolveRefConstraints(),u||(u=KD(i,v.current,()=>this.scalePositionWithinConstraints())))},{projection:m}=this.visualElement,f=m.addEventListener("measure",h);m&&!m.layout&&(m.root&&m.root.updateScroll(),m.updateLayout()),je.read(h);const _=Ca(window,"resize",()=>this.scalePositionWithinConstraints()),b=m.addEventListener("didUpdate",(({delta:v,hasLayoutChanged:w})=>{this.isDragging&&w&&(Un(k=>{const A=this.getAxisMotionValue(k);A&&(this.originPoint[k]+=v[k].translate,A.set(A.get()+v[k].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=Id,dragMomentum:_=!0}=i;return{...i,drag:l,dragDirectionLock:u,dragPropagation:h,dragConstraints:m,dragElastic:f,dragMomentum:_}}}function g0(a){let i=!0;return()=>{if(i){i=!1;return}a()}}function KD(a,i,l){const u=E2(a,g0(l)),h=E2(i,g0(l));return()=>{u(),h()}}function qo(a,i,l){return(i===!0||i===a)&&(l===null||l===a)}function YD(a,i=10){let l=null;return Math.abs(a.y)>i?l="y":Math.abs(a.x)>i&&(l="x"),l}class ZD extends As{constructor(i){super(i),this.removeGroupControls=dn,this.removeListeners=dn,this.controls=new GD(i)}mount(){const{dragControls:i}=this.node.getProps();i&&(this.removeGroupControls=i.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||dn}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 td=a=>(i,l)=>{a&&je.update(()=>a(i,l),!1,!0)};class XD extends As{constructor(){super(...arguments),this.removePointerDownListener=dn}onPointerDown(i){this.session=new AS(i,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:CS(this.node)})}createPanHandlers(){const{onPanSessionStart:i,onPanStart:l,onPan:u,onPanEnd:h}=this.node.getProps();return{onSessionStart:td(i),onStart:td(l),onMove:td(u),onEnd:(m,f)=>{delete this.session,h&&je.postRender(()=>h(m,f))}}}mount(){this.removePointerDownListener=Sa(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 nd=!1;class JD extends K.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),nd&&m.root.didUpdate(),m.addEventListener("animationComplete",()=>{this.safeToRemove()}),m.setOptions({...m.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),sl.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}),nd=!0,h||i.layoutDependency!==l||l===void 0||i.isPresent!==m?f.willUpdate():this.safeToRemove(),i.isPresent!==m&&(m?f.promote():f.relegate()||je.postRender(()=>{const _=f.getStack();(!_||!_.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:i}=this.props.visualElement;i&&(i.root.didUpdate(),eh.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:i,layoutGroup:l,switchLayoutGroup:u}=this.props,{projection:h}=i;nd=!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 IS(a){const[i,l]=iD(),u=K.useContext(z0);return X.jsx(JD,{...a,layoutGroup:u,switchLayoutGroup:K.useContext(ES),isPresent:i,safeToRemove:l})}const QD={pan:{Feature:XD},drag:{Feature:ZD,ProjectionNode:gS,MeasureLayout:IS}};function y0(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&&je.postRender(()=>m(i,Pa(i)))}class eO extends As{mount(){const{current:i}=this.node;i&&(this.unmount=IR(i,(l,u)=>(y0(this.node,u,"Start"),h=>y0(this.node,h,"End"))))}unmount(){}}class tO extends As{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=Ta(Ca(this.node.current,"focus",()=>this.onFocus()),Ca(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function _0(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&&je.postRender(()=>m(i,Pa(i)))}class nO extends As{mount(){const{current:i}=this.node;if(!i)return;const{globalTapTarget:l,propagate:u}=this.node.props;this.unmount=BR(i,(h,m)=>(_0(this.node,m,"Start"),(f,{success:_})=>_0(this.node,f,_?"End":"Cancel")),{useGlobalTarget:l,stopPropagation:(u==null?void 0:u.tap)===!1})}unmount(){}}const Rd=new WeakMap,sd=new WeakMap,sO=a=>{const i=Rd.get(a.target);i&&i(a)},rO=a=>{a.forEach(sO)};function iO({root:a,...i}){const l=a||document;sd.has(l)||sd.set(l,{});const u=sd.get(l),h=JSON.stringify(i);return u[h]||(u[h]=new IntersectionObserver(rO,{root:a,...i})),u[h]}function aO(a,i,l){const u=iO(i);return Rd.set(a,l),u.observe(a),()=>{Rd.delete(a),u.unobserve(a)}}const oO={some:0,all:1};class lO extends As{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:oO[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:k}=this.node.getProps(),A=v?w:k;A&&A(b)};return aO(this.node.current,f,_)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:i,prevProps:l}=this.node;["amount","margin","root"].some(cO(i,l))&&this.startObserver()}unmount(){}}function cO({viewport:a={}},{viewport:i={}}={}){return l=>a[l]!==i[l]}const uO={inView:{Feature:lO},tap:{Feature:nO},focus:{Feature:tO},hover:{Feature:eO}},dO={layout:{ProjectionNode:gS,MeasureLayout:IS}},hO={...BD,...uO,...QD,...dO},Pd=RD(hO,PD);function RS(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 k=w<b.length-1,A=w<v.length-1;return k&&!A?-1:!k&&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 k={name:_[v],path:w,type:"directory",children:[]};if(l.set(w,k),v===0)i.push(k);else{const A=_.slice(0,v).join("/"),R=l.get(A);(h=R==null?void 0:R.children)==null||h.push(k)}}}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 pO({expanded:a}){return X.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:X.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function fO({open:a}){return a?X.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"shrink-0",children:[X.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"}),X.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"})]}):X.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"shrink-0",children:X.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 mO(a){var u;const i=((u=a.split(".").pop())==null?void 0:u.toLowerCase())||"";return{js:"#f0db4f",jsx:"#61dafb",ts:"#3178c6",tsx:"#61dafb",json:"#a8b065",html:"#e44d26",css:"#264de4",scss:"#cd6799",md:"#ffffff",py:"#3776ab",rb:"#cc342d",go:"#00add8",rs:"#dea584",yml:"#cb171e",yaml:"#cb171e",env:"#ecd53f",sh:"#89e051",sql:"#e38c00",svg:"#ffb13b"}[i]||"#8c8c8c"}function gO({name:a}){const i=mO(a);return X.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"shrink-0",children:[X.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:i,opacity:"0.2"}),X.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:i,strokeWidth:"1"}),X.jsx("path",{d:"M9.5 1.5V5H13",stroke:i,strokeWidth:"1"})]})}function PS({files:a,selectedFile:i,onSelectFile:l}){return X.jsxs("div",{className:"h-full overflow-auto bg-sb-sidebar text-sm select-none",children:[X.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"}),X.jsx("div",{className:"py-1",children:a.map(u=>X.jsx(DS,{node:u,depth:0,selectedFile:i,onSelectFile:l},u.path))})]})}function DS({node:a,depth:i,selectedFile:l,onSelectFile:u}){const[h,m]=K.useState(i<2),f=a.path===l,_=8+i*16;return a.type==="directory"?X.jsxs("div",{children:[X.jsxs("button",{className:`w-full flex items-center gap-1 py-[3px] text-left hover:bg-sb-bg-hover transition-colors ${f?"bg-sb-bg-active text-sb-text-active":"text-sb-text"}`,style:{paddingLeft:_},onClick:()=>m(!h),children:[X.jsx(pO,{expanded:h}),X.jsx(fO,{open:h}),X.jsx("span",{className:"truncate ml-0.5",children:a.name})]}),h&&a.children&&X.jsx("div",{children:a.children.map(b=>X.jsx(DS,{node:b,depth:i+1,selectedFile:l,onSelectFile:u},b.path))})]}):X.jsxs("button",{className:`w-full flex items-center gap-1 py-[3px] text-left hover:bg-sb-bg-hover transition-colors ${f?"bg-sb-bg-active text-sb-text-active":"text-sb-text"}`,style:{paddingLeft:_+20},onClick:()=>u(a.path),children:[X.jsx(gO,{name:a.name}),X.jsx("span",{className:"truncate ml-0.5",children:a.name})]})}let ni=null,Go=null;function yO(){return ni?Promise.resolve():Go||(Go=import("@monaco-editor/react").then(a=>{ni=a.default||a.Editor}),Go)}function _O(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"}function OS({files:a,activeFile:i,openFiles:l,onSelectFile:u,onCloseFile:h,onFileChange:m,readOnly:f=!1}){const[_,b]=K.useState(!!ni);K.useEffect(()=>{ni||yO().then(()=>b(!0))},[]);const v=i&&a[i]||"",w=i?_O(i):"plaintext",k=K.useCallback(A=>{i&&A!==void 0&&m(i,A)},[i,m]);return X.jsxs("div",{className:"flex flex-col h-full bg-sb-editor",children:[X.jsx("div",{className:"flex items-center bg-sb-bg-alt border-b border-sb-border overflow-x-auto",children:l.map(A=>{const R=A.split("/").pop()||A,I=A===i;return X.jsxs("div",{className:`group flex items-center gap-2 px-3 py-1.5 text-xs cursor-pointer border-r border-sb-border
6
- ${I?"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:()=>u(A),children:[X.jsx("span",{className:"truncate max-w-[120px]",children:R}),X.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:text-sb-text-active ml-1 text-[10px]",onClick:M=>{M.stopPropagation(),h(A)},title:"Close",children:"✕"})]},A)})}),X.jsxs("div",{className:"flex-1 overflow-hidden",children:[!i&&X.jsx("div",{className:"flex items-center justify-center h-full text-sb-text-muted text-sm",children:"Select a file to edit"}),i&&_&&ni&&X.jsx(ni,{height:"100%",language:w,value:v,onChange:k,theme:"vs-dark",options:{readOnly:f,minimap:{enabled:!1},fontSize:13,lineNumbers:"on",wordWrap:"on",scrollBeyondLastLine:!1,padding:{top:8},renderWhitespace:"selection",automaticLayout:!0,tabSize:2}}),i&&!_&&X.jsx("div",{className:"flex items-center justify-center h-full text-sb-text-muted text-sm",children:"Loading editor..."})]})]})}function NS({output:a,className:i=""}){const l=K.useRef(null);return K.useEffect(()=>{const u=l.current;u&&(u.scrollTop=u.scrollHeight)},[a.length]),X.jsxs("div",{className:`flex flex-col h-full bg-sb-terminal ${i}`,children:[X.jsx("div",{className:"flex items-center px-3 py-1 bg-sb-bg-alt border-b border-sb-border",children:X.jsx("span",{className:"text-xs font-medium text-sb-text-muted uppercase tracking-wider",children:"Terminal"})}),X.jsx("div",{ref:l,className:"flex-1 overflow-auto p-3 font-mono text-xs leading-relaxed",children:a.length===0?X.jsx("span",{className:"text-sb-text-muted",children:"Waiting for output..."}):a.map((u,h)=>X.jsx("div",{className:`whitespace-pre-wrap ${u.startsWith("[stderr]")?"text-sb-error":u.startsWith("$")||u.startsWith(" ✓")?"text-sb-success":u.startsWith(" ✗")?"text-sb-error":"text-sb-text"}`,children:u},h))})]})}function BS({url:a,className:i=""}){const l=K.useRef(null);return K.useEffect(()=>{l.current&&a&&(l.current.src=a)},[a]),X.jsx("div",{className:`h-full w-full bg-white ${i}`,children:a?X.jsx("iframe",{ref:l,src:a,className:"w-full h-full border-none",title:"Preview",sandbox:"allow-scripts allow-forms allow-same-origin allow-popups allow-modals"}):X.jsx("div",{className:"flex items-center justify-center h-full bg-sb-bg",children:X.jsxs("div",{className:"text-center px-4",children:[X.jsx("div",{className:"w-10 h-10 mx-auto mb-3 border-2 border-sb-accent border-t-transparent rounded-full animate-spin"}),X.jsx("p",{className:"text-sb-text-muted text-sm",children:"Waiting for dev server to start..."})]})})})}const b0={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 LS({progress:a,className:i=""}){const l=b0[a.stage]||b0.initializing;return a.stage==="ready"?null:X.jsx("div",{className:`absolute inset-0 z-50 flex items-center justify-center bg-sb-bg/95 backdrop-blur-sm ${i}`,children:X.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-md px-8",children:[X.jsx("div",{className:"text-5xl animate-bounce",children:l.icon}),X.jsxs("h2",{className:`text-xl font-semibold ${l.color}`,children:[l.label,a.stage!=="error"&&X.jsx(vO,{})]}),X.jsx("div",{className:"w-64 h-2 bg-sb-bg-active rounded-full overflow-hidden",children:X.jsx("div",{className:"h-full bg-sb-accent rounded-full transition-all duration-500 ease-out",style:{width:`${a.percent}%`}})}),X.jsx("p",{className:"text-sm text-sb-text-muted text-center",children:a.message}),X.jsx("div",{className:"flex items-center gap-2 mt-4",children:["initializing","writing-files","installing","starting"].map((u,h)=>{const m=bO(a.stage)>h,f=a.stage===u;return X.jsxs(K.Fragment,{children:[X.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&&X.jsx("div",{className:`w-8 h-0.5 transition-colors duration-300 ${m?"bg-sb-success":"bg-sb-bg-active"}`})]},u)})})]})})}function bO(a){return["initializing","writing-files","installing","starting","ready"].indexOf(a)}function vO(){return X.jsxs("span",{className:"inline-flex ml-1",children:[X.jsx("span",{className:"animate-pulse",style:{animationDelay:"0ms"},children:"."}),X.jsx("span",{className:"animate-pulse",style:{animationDelay:"200ms"},children:"."}),X.jsx("span",{className:"animate-pulse",style:{animationDelay:"400ms"},children:"."})]})}const wO=[.4,0,.2,1],v0=K.memo(function({selected:i,children:l,onClick:u}){return X.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:[X.jsx("span",{className:"relative z-10",children:l}),i&&X.jsx(Pd.span,{layoutId:"view-slider-pill",transition:{duration:.2,ease:wO},className:"absolute inset-0 z-0 bg-sb-accent rounded-full"})]})}),MS=K.memo(function({selected:i,onSelect:l}){return X.jsxs("div",{className:"flex items-center gap-0.5 bg-sb-bg rounded-full p-0.5 border border-sb-border",children:[X.jsx(v0,{selected:i==="code",onClick:()=>l("code"),children:"Code"}),X.jsx(v0,{selected:i==="preview",onClick:()=>l("preview"),children:"Preview"})]})});var SO=Object.defineProperty,xO=(a,i,l)=>i in a?SO(a,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[i]=l,V=(a,i,l)=>xO(a,typeof i!="symbol"?i+"":i,l);let w0,fa,H,yn,se,rd,S0,x0,E0,k0,ve,Ss,ma,He,ga,C0,A0,T0,I0,Ko,er,Gr,tr,Kr,id,ya,ns,R0,P0,Yo,$n,Zo,nr,Xo,D0,_n,_a,rl,O0,N0,B0;(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"}));ma={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:ma.NODE_BARE,v8:"11.3.244.8",uv:"1.44.2",modules:"115",openssl:"3.0.13",napi:"9",webcontainer:"1.0.0"},k="https://registry.npmjs.org",R="https://esm.sh/pako@2.1.0",I=[".js",".ts",".jsx",".tsx",".mjs",".cjs",".json"],M={".ts":"ts",".tsx":"tsx",".js":"js",".mjs":"js",".cjs":"js",".jsx":"jsx",".json":"json",".css":"css",".map":"json",".txt":"text",".wasm":"file"},$={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},z={BLOCK_SIZE:4096,BLOCK_CALC_SIZE:512},G={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},ae=[.5,.5,.5],_e={COLUMNS:80,ROWS:24,FONT_SIZE:13},re={PID:1,PPID:0,TITLE:"node",EXEC_PATH:"/usr/local/bin/node"};yn={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/${ma.NPM} node/${ma.NODE} linux x64 workspaces/false`,npm_execpath:"/usr/local/lib/node_modules/npm/bin/npm-cli.js",npm_node_execpath:"/usr/local/bin/node"},Ss={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 Q={MAX_WORKERS_CAP:6},he={BASE:3e3,RANGE:1e3},ie={TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10};class Se{constructor(t){V(this,"_listeners",new Map),V(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 ee(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}_a=class{constructor(e){V(this,"tree"),V(this,"textEncoder",new TextEncoder),V(this,"textDecoder",new TextDecoder),V(this,"activeWatchers",new Map),V(this,"subscribers",new Map),V(this,"_handler"),V(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 _a,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 _a,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 ee("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:z.BLOCK_SIZE,blocks:Math.ceil(r/z.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 ee("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:z.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 ee("ENOENT","open",e);if(s.kind!=="file")throw ee("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 ee("ENOENT","mkdir",s);if(o.kind!=="directory")throw ee("ENOTDIR","mkdir",s);if(o.children.has(r))throw ee("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 ee("ENOENT","scandir",e);if(n.kind!=="directory")throw ee("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 ee("ENOENT","unlink",e);const o=r.children.get(s);if(!o)throw ee("ENOENT","unlink",e);if(o.kind!=="file")throw ee("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 ee("ENOENT","rmdir",e);const o=r.children.get(s);if(!o)throw ee("ENOENT","rmdir",e);if(o.kind!=="directory")throw ee("ENOTDIR","rmdir",e);if(o.children.size>0)throw ee("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 ee("ENOENT","rename",e);const o=this.nameOf(n),c=r.children.get(o);if(!c)throw ee("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 ee("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 ee("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 ee("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 ee("ENOENT","link",e);if(n.kind!=="file")throw ee("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 ee("ENOENT","chmod",e)}chownSync(e,t,n){const s=this.normalize(e);if(!this.locate(s))throw ee("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 ee("ENOENT","truncate",e);if(s.kind!=="file")throw ee("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 Se(()=>{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 E of y)if(E.active&&(E.recursive||d===o))try{E.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,E)=>x+E.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 pe(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)}Xo=class{constructor(e){V(this,"_map",new Map),V(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 Pe={pathNormCacheSize:2048,statCacheSize:512,resolveCacheSize:4096,manifestCacheSize:256,transformCacheSize:512,moduleSoftCacheSize:512,heapWarnThresholdMB:350,monitorIntervalMs:3e4,maxProcessOutputBytes:4194304};D0=class{constructor(e){V(this,"options"),V(this,"pathNormCache"),V(this,"statCache"),V(this,"transformCache"),V(this,"_monitorTimer",null),V(this,"_pressureCallbacks",[]),V(this,"_destroyed",!1),this.options={...Pe,...e},this.pathNormCache=new Xo(this.options.pathNormCacheSize),this.statCache=new Xo(this.options.statCacheSize),this.transformCache=new Xo(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 xe=null;Yo=function(){return xe};const ke=new Set;function Ue(){const e=Yo();if(e)for(const t of e.drainListeners)t();for(const t of ke)t()}ns=function(){const e=Yo();e&&e.refCount++},_n=function(){const e=Yo();e&&e.refCount>0&&e.refCount--,Ue()};const Ae=10,Qe=new WeakSet,yt=new Set;function We(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(),yt.delete(o)};yt.add(o)}function _t(e){return e._registry||(e._registry=new Map),e._registry}function bt(e,t){const n=_t(e);let s=n.get(t);return s||(s=[],n.set(t,s)),s}se=function(){this&&!this._registry&&(this._registry=new Map),this&&this._ceiling===void 0&&(this._ceiling=Ae)},se.prototype.addListener=function(t,n){return bt(this,t).push(n),t==="change"&&!Qe.has(this)&&this._watched instanceof Map&&(Qe.add(this),We(this)),this},se.prototype.on=se.prototype.addListener,se.prototype.once=function(t,n){const s=this,r=function(...c){s.removeListener(t,r),n.apply(s,c)};return bt(this,t).push(r),this},se.prototype.removeListener=function(t,n){const s=_t(this).get(t);if(s){const r=s.indexOf(n);r!==-1&&s.splice(r,1)}return this},se.prototype.off=se.prototype.removeListener,se.prototype.removeAllListeners=function(t){return t!==void 0?_t(this).delete(t):_t(this).clear(),this},se.prototype.emit=function(t,...n){const s=_t(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"&&(ns(),c.then(()=>_n(),()=>_n()))};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},se.prototype.listeners=function(t){const n=_t(this).get(t);return n?n.slice():[]},se.prototype.rawListeners=function(t){return this.listeners(t)},se.prototype.listenerCount=function(t){const n=_t(this).get(t);return n?n.length:0},se.prototype.eventNames=function(){return Array.from(_t(this).keys())},se.prototype.setMaxListeners=function(t){return this._ceiling=t,this},se.prototype.getMaxListeners=function(){return this._ceiling??Ae},se.prototype.prependListener=function(t,n){return bt(this,t).unshift(n),this},se.prototype.prependOnceListener=function(t,n){const s=this,r=function(...o){s.removeListener(t,r),n.apply(s,o)};return this.prependListener(t,r)},se.listenerCount=function(e,t){return e.listenerCount(t)};const Dt=se;Dt.EventEmitter=se,Dt.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)}),Dt.on=(e,t)=>({async next(){return new Promise(s=>{e.once(t,(...r)=>s({value:r,done:!1}))})},[Symbol.asyncIterator](){return this}}),Dt.getEventListeners=(e,t)=>e.listeners(t),Dt.listenerCount=(e,t)=>e.listenerCount(t),Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:se,default:Dt},Symbol.toStringTag,{value:"Module"}));const is=new TextEncoder,Da=new TextDecoder("utf-8"),Hn=new Uint8Array(128);for(let e=0;e<10;e++)Hn[48+e]=e;for(let e=0;e<6;e++)Hn[65+e]=10+e,Hn[97+e]=10+e;const Te=class mt extends Uint8Array{static from(t,n,s){if(typeof n=="function"){const o=Array.from(t,n,s);return new mt(o)}const r=n;if(Array.isArray(t))return new mt(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 mt(m(c))}if(o==="hex"){const c=new Uint8Array(t.length>>>1);for(let d=0;d<t.length;d+=2)c[d>>>1]=Hn[t.charCodeAt(d)]<<4|Hn[t.charCodeAt(d+1)];return new mt(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 mt(c)}return new mt(is.encode(t))}return t instanceof ArrayBuffer?new mt(t):new mt(t)}static alloc(t,n){const s=new mt(t);return n!==void 0&&s.fill(n),s}static allocUnsafe(t){return new mt(t)}static allocUnsafeSlow(t){return new mt(t)}static concat(t){let n=0;for(const o of t)n+=o.length;const s=new mt(n);let r=0;for(const o of t)s.set(o,r),r+=o.length;return s}static isBuffer(t){return t instanceof mt||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:is.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):Da.decode(this)}slice(t,n){return new mt(super.slice(t,n))}subarray(t,n){return new mt(super.subarray(t,n))}write(t,n,s,r){const o=typeof n=="number"?n:0,c=is.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"?mt.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}};V(Te,"BYTES_PER_ELEMENT",1);let Ce=Te;H=new Proxy(Ce,{apply(e,t,n){return Ce.from(...n)}}),typeof globalThis.Buffer>"u"&&(globalThis.Buffer=H);function $e(e){return e instanceof Uint8Array?e.byteLength:typeof e=="string"?H.byteLength(e):0}ve=function(t){if(!this)return;se.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(ve.prototype,se.prototype),ve.prototype._read=function(t){},ve.prototype._destroy=function(t,n){n(t)},ve.prototype._rawBind=function(t,n){return se.prototype.addListener.call(this,t,n),this},ve.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},ve.prototype.addListener=function(t,n){return this.on(t,n)},ve.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,se.prototype.once.call(this,t,n),queueMicrotask(()=>{this._endEmitted=!0,this.emit("end"),this._autoDestroy&&this.destroy()}),this):t==="data"&&!this._active?(se.prototype.once.call(this,t,n),this.resume(),this):se.prototype.once.call(this,t,n)},ve.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"?H.from(t):t;this._readableByteLength+=$e(n),this._queue.push(n)}return this._active&&this._drain(),this._queue.length<this._highWaterMark},ve.prototype.unshift=function(t){if(t!==null)if(this._objectMode)this._queue.unshift(t);else{const n=typeof t=="string"?H.from(t):t;this._readableByteLength+=$e(n),this._queue.unshift(n)}},ve.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-=$e(t)),this.readableDidRead=!0,this._encoding&&t instanceof Uint8Array?this.emit("data",H.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)}))}},ve.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=H.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?H.concat(n):null},ve.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},ve.prototype.pause=function(){return this._active=!1,this.readableFlowing=!1,this},ve.prototype.isPaused=function(){return!this._active},ve.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},ve.prototype.unpipe=function(t){return this.removeAllListeners("data"),this.removeAllListeners("end"),this},ve.prototype.setEncoding=function(t){return this._encoding=t,this},ve.prototype.close=function(t){this.destroy(),t&&t(null)},ve.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)},ve.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},ve.prototype[Symbol.asyncIterator]=function(){const t=this,n=[];let s=!1,r=null,o=null,c=null;const d=x=>{if(o){const E=o;o=null,c=null,E({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 E=c;o=null,c=null,E(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,E)=>{o=x,c=E})},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(ve.prototype,"readableLength",{get:function(){return this._objectMode?this._queue.length:this._readableByteLength},configurable:!0}),Object.defineProperty(ve.prototype,"readableEncoding",{get:function(){return this._encoding},configurable:!0}),ve.toWeb=function(t){return new ReadableStream({start(n){t.on("data",s=>{const r=s instanceof Uint8Array?s:H.from(String(s));n.enqueue(r)}),t.on("end",()=>{n.close()}),t.on("error",s=>{n.error(s)}),t.resume()},cancel(){t.destroy()}})},ve.fromWeb=function(t,n){const s=t.getReader(),r=new ve({...n,read(){s.read().then(({value:o,done:c})=>{c?r.push(null):r.push(o)},o=>{r.destroy(o)})}});return r},ve.from=function(t,n){const s=new ve(n);return(async()=>{try{for await(const r of t)if(r!=null){const o=typeof r=="string"?H.from(r):r;s.push(o)}s.push(null)}catch(r){s.destroy(r)}})(),s},He=function(t){if(!this)return;se.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(He.prototype,se.prototype),He.prototype._write=function(t,n,s){s(null)},He.prototype._final=function(t){t(null)},He.prototype._destroy=function(t,n){n(t)},He.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"?H.from(t):t;if(this._parts.push(c),this._writableByteLength+=$e(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-=$e(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},He.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},He.prototype.getBuffer=function(){return H.concat(this._parts)},He.prototype.getBufferAsString=function(t){return this.getBuffer().toString(t||"utf8")},He.prototype.close=function(t){this.destroy(),t&&t(null)},He.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)},He.prototype.cork=function(){this._corked++,this.writableCorked=this._corked},He.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)})}},He.prototype.setDefaultEncoding=function(t){return this},Object.defineProperty(He.prototype,"writableLength",{get:function(){return this._objectMode?this._parts.length:this._writableByteLength},configurable:!0}),He.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)))}})},He.fromWeb=function(t,n){const s=t.getWriter();return new He({...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 be=function(t){if(!this)return;ve.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(be.prototype,ve.prototype),be.prototype._write=function(t,n,s){s(null)},be.prototype._final=function(t){t(null)},be.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"?H.from(t):t;if(this._writeParts.push(c),this._writableByteLen+=$e(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-=$e(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},be.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},be.prototype.cork=function(){this._duplexCorked++,this.writableCorked=this._duplexCorked},be.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)})}},be.prototype.setDefaultEncoding=function(t){return this},Object.defineProperty(be.prototype,"writableLength",{get:function(){return this._writeObjectMode?this._writeParts.length:this._writableByteLen},configurable:!0}),be.from=function(t,n){const s=new be;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"?H.from(r):r;s.push(o)}s.push(null)}catch(r){s.destroy(r)}})();return s},be.toWeb=function(t){if(t instanceof be){const n=ve.toWeb(t),s=He.toWeb(t);return{readable:n,writable:s}}return ve.toWeb(t)},be.fromWeb=function(t,n){if(t instanceof ReadableStream)return ve.fromWeb(t,n);const s=t,r=new be,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 di=function(t){this&&be.call(this,t)};Object.setPrototypeOf(di.prototype,be.prototype),di.prototype.write=function(t,n,s){const r=typeof t=="string"?H.from(t):t;this.push(r);const o=typeof n=="function"?n:s;return o&&queueMicrotask(()=>o(null)),!0};const xn=function(t){this&&(be.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(xn.prototype,be.prototype),xn.prototype._transform=function(t,n,s){s(null,t)},xn.prototype._flush=function(t){t(null)},xn.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()})},xn.prototype.write=function(t,n,s){const r=typeof t=="string"?H.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},xn.prototype.end=function(t,n,s){return this._flushed||(this._flushed=!0,this._flush((r,o)=>{o&&this.push(o)})),be.prototype.end.call(this,t,n,s)};const Ts=function(){this&&se.call(this)};Object.setPrototypeOf(Ts.prototype,se.prototype),Ts.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},Ts.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 ch(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 dt=Ts;dt.Readable=ve,dt.Writable=He,dt.Duplex=be,dt.Transform=xn,dt.PassThrough=di,dt.Stream=Ts,dt.from=ve.from,dt.addAbortSignal=ch;function yl(...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]=ve.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 ve?o.on("end",c):o.on("finish",c)}return o}function _l(e,t,n){const s=typeof t=="function"?t:n,r=e;let o=!1;const c=E=>{o||(o=!0,s&&s(E))},d=()=>{r.removeListener("end",p),r.removeListener("finish",y),r.removeListener("error",g),r.removeListener("close",x)},p=()=>{d(),c()},y=()=>{d(),c()},g=E=>{d(),c(E)},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 uh=16384,dh=16;function hh(e){return e?dh:uh}function ph(e,t){e?dh=t:uh=t}const fh={pipeline:async(...e)=>new Promise((t,n)=>{yl(...e,s=>{s?n(s):t()})}),finished:async(e,t)=>new Promise((n,s)=>{_l(e,t,r=>{r?s(r):n()})})};dt.pipeline=yl,dt.finished=_l,dt.promises=fh,dt.getDefaultHighWaterMark=hh,dt.setDefaultHighWaterMark=ph;function mh(...e){return new di}function bl(e){if(!e||typeof e!="object")return!1;const t=e;return!(typeof t.read!="function"||t.destroyed||t.readableEnded||t._terminated)}function gh(e){if(!e||typeof e!="object")return!1;const t=e;return!(typeof t.write!="function"||t.destroyed||t.writableEnded||t.writableFinished)}function vl(e){if(!e||typeof e!="object")return!1;const t=e;return!!t.readableDidRead||!!t._reading}function yh(e){return!e||typeof e!="object"?!1:e.errored!=null}dt.compose=mh,dt.isReadable=bl,dt.isWritable=gh,dt.isDisturbed=vl,dt.isErrored=yh,ve.isDisturbed=vl,ve.isReadable=bl,Object.freeze(Object.defineProperty({__proto__:null,Duplex:be,PassThrough:di,Readable:ve,Stream:Ts,Transform:xn,Writable:He,addAbortSignal:ch,compose:mh,default:Ts,finished:_l,getDefaultHighWaterMark:hh,isDisturbed:vl,isErrored:yh,isReadable:bl,isWritable:gh,pipeline:yl,promises:fh,setDefaultHighWaterMark:ph},Symbol.toStringTag,{value:"Module"})),new TextDecoder,new TextEncoder;const hi=function(t,n){this&&(this.path=t,this._entries=n,this._pos=0,this._closed=!1)};hi.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++]},hi.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)}})},hi.prototype.closeSync=function(){this._closed=!0},hi.prototype.close=function(t){if(this._closed=!0,t){queueMicrotask(()=>t(null));return}return Promise.resolve()},hi.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 wl="/",Sl=":";$n=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 lt(...e){if(e.length===0)return".";const t=e.filter(n=>n!=="").join("/");return $n(t)}nr=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:"")),$n(t)};function pi(e){return e.charAt(0)==="/"}tr=function(e){if(!e)return".";const t=$n(e),n=t.lastIndexOf("/");return n<0?".":n===0?"/":t.substring(0,n)},er=function(e,t){if(!e)return"";const n=$n(e);let s=n.substring(n.lastIndexOf("/")+1);return t&&s.endsWith(t)&&(s=s.substring(0,s.length-t.length)),s},Kr=function(e){const t=er(e),n=t.lastIndexOf(".");return n<=0?"":t.substring(n)},ga=function(e,t){const n=nr(e),s=nr(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 Oa(e){const t=$n(e),n=pi(t),s=tr(t),r=er(t),o=Kr(t),c=r.substring(0,r.length-o.length);return{root:n?"/":"",dir:s,base:r,ext:o,name:c}}function Na(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 _h={sep:wl,delimiter:Sl,normalize:$n,join:lt,resolve:nr,isAbsolute:pi,dirname:tr,basename:er,extname:Kr,relative:ga,parse:Oa,format:Na},bh={sep:"\\",delimiter:";",normalize:$n,join:lt,resolve:nr,isAbsolute:pi,dirname:tr,basename:er,extname:Kr,relative:ga,parse:Oa,format:Na};Object.freeze(Object.defineProperty({__proto__:null,basename:er,default:{sep:wl,delimiter:Sl,normalize:$n,join:lt,resolve:nr,isAbsolute:pi,dirname:tr,basename:er,extname:Kr,relative:ga,parse:Oa,format:Na,posix:_h,win32:bh},delimiter:Sl,dirname:tr,extname:Kr,format:Na,isAbsolute:pi,join:lt,normalize:$n,parse:Oa,posix:_h,relative:ga,resolve:nr,sep:wl,win32:bh},Symbol.toStringTag,{value:"Module"}));const vh=console;function xl(e,t){const n=new se,s=o=>{t&&t(o)},r={isTTY:!1,columns:_e.COLUMNS,rows:_e.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}w0=function(e){let t=(e==null?void 0:e.cwd)||"/",n=18;const s=Date.now(),r=new se,o={NODE_ENV:yn.NODE_ENV,PATH:yn.PATH,HOME:yn.HOME,SHELL:yn.SHELL,TERM:yn.TERM,COLORTERM:yn.COLORTERM,REQUIRES_WASM:yn.REQUIRES_WASM,npm_config_user_agent:yn.npm_config_user_agent,npm_execpath:yn.npm_execpath,npm_node_execpath:yn.npm_node_execpath,NAPI_RS_FORCE_WASM:"1",NEXT_TELEMETRY_DISABLED:"1",DO_NOT_TRACK:"1",...e==null?void 0:e.env},c=xl(!0,x=>(e!=null&&e.onStdout?e.onStdout(x):vh.log(x),!0)),d=xl(!0,x=>(e!=null&&e.onStderr?e.onStderr(x):vh.error(x),!0)),p=xl(!1),y=function(E){const C=performance.now(),T=Math.floor(C/1e3),N=Math.floor(C%1e3*1e6);return E?[T-E[0],N-E[1]]:[T,N]};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:$.PLATFORM,arch:$.ARCH,title:re.TITLE,version:ma.NODE,versions:{...w},argv:["node","/index.js"],argv0:"node",execPath:re.EXEC_PATH,execArgv:[],pid:(e==null?void 0:e.pid)??re.PID,ppid:(e==null?void 0:e.ppid)??re.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,...E){queueMicrotask(()=>x(...E))},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,E){const C=typeof E=="string"?E:"SIGTERM";return r.emit(C),!0},umask(x){const E=n;return x!==void 0&&(n=x),E},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,E,C){throw new Error("process.dlopen is not supported in browser environment")},reallyExit(x){},_getActiveRequests(){return[]},_getActiveHandles(){return[]},emitWarning(x,E,C){const T=typeof x=="string"?x:x.message,N=typeof E=="string"?E:(E==null?void 0:E.type)??"Warning";r.emit("warning",{name:N,message:T,code:C})},hasUncaughtExceptionCaptureCallback(){return!1},setUncaughtExceptionCaptureCallback(x){},sourceMapsEnabled:!1,setSourceMapsEnabled(x){},constrainedMemory(){return 0},availableMemory(){return 512*1024*1024},on(x,E){return r.on(x,E),g},once(x,E){return r.once(x,E),g},off(x,E){return r.off(x,E),g},emit(x,...E){return r.emit(x,...E)},addListener(x,E){return r.addListener(x,E),g},removeListener(x,E){return r.removeListener(x,E),g},removeAllListeners(x){return r.removeAllListeners(x),g},listeners(x){return r.listeners(x)},listenerCount(x){return r.listenerCount(x)},prependListener(x,E){return r.prependListener(x,E),g},prependOnceListener(x,E){return r.prependOnceListener(x,E),g},eventNames(){return r.eventNames()},setMaxListeners(x){return r.setMaxListeners(x),g},getMaxListeners(){return r.getMaxListeners()}};return g},w0();const et=function(t){this&&(be.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(et.prototype,be.prototype),et.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},et.prototype.address=function(){return this._isConnected?{address:this._selfAddr,family:"IPv4",port:this._selfPort}:null},et.prototype.setEncoding=function(t){return this},et.prototype.setTimeout=function(t,n){return n&&this.once("timeout",n),this},et.prototype.setNoDelay=function(t){return this},et.prototype.setKeepAlive=function(t,n){return this},et.prototype.ref=function(){return this},et.prototype.unref=function(){return this},et.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},et.prototype._feedData=function(t){const n=typeof t=="string"?H.from(t):t;this.push(n)},et.prototype._feedEnd=function(){this.push(null)};const Gt=function(t,n){if(!this)return;se.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(Gt.prototype,se.prototype),Gt.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=he.BASE+Math.floor(Math.random()*he.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},Gt.prototype.address=function(){return this._addr?{...this._addr,host:this._addr.address}:null},Gt.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},Gt.prototype.getConnections=function(t){typeof t=="function"&&t(null,this._peers.size)},Gt.prototype.ref=function(){return this},Gt.prototype.unref=function(){return this},Gt.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 wh(e,t){return new Gt(e,t)}function El(e,t,n){return new et().connect(e,t,n)}const Sh=El;function Ba(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 xh(e){return Ba(e)===4}function Eh(e){return Ba(e)===6}Object.freeze(Object.defineProperty({__proto__:null,TcpServer:Gt,TcpSocket:et,connect:Sh,createConnection:El,createServer:wh,default:{Socket:et,Server:Gt,createServer:wh,createConnection:El,connect:Sh,isIP:Ba,isIPv4:xh,isIPv6:Eh},isIP:Ba,isIPv4:xh,isIPv6:Eh},Symbol.toStringTag,{value:"Module"}));function La(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 kh(e){return e.includes("512")?64:e.includes("384")?48:e.includes("1")||e==="SHA-1"?20:32}function kl(e,t){const n=kh(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 Cl(e,t,n){const s=new Uint8Array(t.length+e.length);return s.set(t,0),s.set(e,t.length),kl(s,n)}function or(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 Ma(e,t){return t==="hex"?Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join(""):t==="base64"?btoa(String.fromCharCode(...e)):H.from(e)}function kt(e){const t=new Uint8Array(e);return crypto.getRandomValues(t),H.from(t)}function Al(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 Ch(){return crypto.randomUUID()}function Ah(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 Th(e){return crypto.getRandomValues(e)}const lr=function(t){this&&(this._alg=La(t),this._parts=[])};lr.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"?H.from(atob(t)):H.from(t):s=H.from(t),this._parts.push(s),this},lr.prototype.digestAsync=async function(t){const n=or(this._parts),s=new Uint8Array(n).buffer,r=await crypto.subtle.digest(this._alg,s);return Ma(new Uint8Array(r),t)},lr.prototype.digest=function(t){const n=or(this._parts),s=kl(n,this._alg);return Ma(s,t)},Gr=function(e){return new lr(e)};function Ih(e,t,n){const s=Gr(e);return s.update(t),s.digest(n)}const cr=function(t,n){this&&(this._alg=La(t),this._key=typeof n=="string"?H.from(n):n,this._parts=[])};cr.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"?H.from(t):t;return this._parts.push(s),this},cr.prototype.digestAsync=async function(t){const n=or(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 Ma(new Uint8Array(c),t)},cr.prototype.digest=function(t){const n=or(this._parts),s=Cl(n,this._key,this._alg);return Ma(s,t)};function Fa(e,t){return new cr(e,t)}function Rh(e,t,n,s,r,o){VS(e,t,n,s,r).then(c=>o(null,c)).catch(c=>o(c,H.alloc(0)))}async function VS(e,t,n,s,r){const o=typeof e=="string"?H.from(e):e,c=typeof t=="string"?H.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:La(r)},y,s*8);return H.from(g)}function Tl(e,t,n,s,r){const o=typeof e=="string"?H.from(e):e,c=typeof t=="string"?H.from(t):t,d=La(r),p=kh(d),y=Math.ceil(s/p),g=new Uint8Array(y*p);for(let x=1;x<=y;x++){const E=new Uint8Array(4);E[0]=x>>>24&255,E[1]=x>>>16&255,E[2]=x>>>8&255,E[3]=x&255;const C=new Uint8Array(c.length+4);C.set(c),C.set(E,c.length);let T=Cl(C,o,d);const N=new Uint8Array(T);for(let j=1;j<n;j++){T=Cl(T,o,d);for(let q=0;q<N.length;q++)N[q]^=T[q]}g.set(N,(x-1)*p)}return H.from(g.slice(0,s))}function Ph(e,t,n,s,r){try{const o=Il(e,t,n);setTimeout(()=>r(null,o),0)}catch(o){setTimeout(()=>r(o,H.alloc(0)),0)}}function Il(e,t,n,s){return Tl(e,t,16384,n,"sha256")}function Is(e){if(e instanceof Kt)return{raw:e._data,alg:e._alg,kind:e._kind,fmt:"raw"};if(typeof e=="object"&&"key"in e)return Is(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=H.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"?H.from(e):e,kind:"secret",fmt:"raw"}}function $a(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),H.from(kl(r,e))}function Rl(e,t,n,s){const r=$a(e,t,n);return Dl(H.from(s),r)}function Dh(e,t,n,s){const r=Is(n),o=e||r.alg||"SHA-256";if(s){try{s(null,$a(o,t,r))}catch(c){s(c,null)}return}return $a(o,t,r)}function Oh(e,t,n,s,r){const o=Is(n),c=e||o.alg||"SHA-256";if(r){try{r(null,Rl(c,t,o,s))}catch(d){r(d,!1)}return}return Rl(c,t,o,s)}const fi=function(t){this&&(se.call(this),this._alg=t,this._parts=[])};Object.setPrototypeOf(fi.prototype,se.prototype),fi.prototype.update=function(t,n){return this._parts.push(typeof t=="string"?H.from(t):t),this},fi.prototype.sign=function(t,n){const s=or(this._parts),r=Is(t),o=$a(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 mi=function(t){this&&(se.call(this),this._alg=t,this._parts=[])};Object.setPrototypeOf(mi.prototype,se.prototype),mi.prototype.update=function(t,n){return this._parts.push(typeof t=="string"?H.from(t):t),this},mi.prototype.verify=function(t,n,s){const r=or(this._parts),o=Is(t);let c;return typeof n=="string"?s==="base64"?c=H.from(atob(n)):s==="hex"?c=H.from(n.match(/.{2}/g).map(d=>parseInt(d,16))):c=H.from(n):c=n,Rl(this._alg,r,o,c)};function Nh(e){return new fi(e)}function Bh(e){return new mi(e)}function Lh(e,t,n){throw new Error("createCipheriv is not supported in the browser polyfill")}function Mh(e,t,n){throw new Error("createDecipheriv is not supported in the browser polyfill")}const Kt=function(t,n,s){this&&(this._kind=t,this._data=n,this._alg=s)};Object.defineProperty(Kt.prototype,"type",{get:function(){return this._kind},configurable:!0}),Object.defineProperty(Kt.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(Kt.prototype,"symmetricKeySize",{get:function(){if(this._kind==="secret")return this._data instanceof Uint8Array?this._data.length*8:void 0},configurable:!0}),Kt.prototype.export=function(t){if(this._data instanceof Uint8Array)return H.from(this._data);throw new Error("Cannot synchronously export a CryptoKey")};function Pl(e,t){const n=typeof e=="string"?H.from(e,t):e;return new Kt("secret",n)}function Fh(e){const t=Is(e);return new Kt("public",t.raw,t.alg)}function $h(e){const t=Is(e);return new Kt("private",t.raw,t.alg)}function Dl(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 Uh(){return["aes-128-cbc","aes-256-cbc","aes-128-gcm","aes-256-gcm"]}function jh(){return["sha1","sha256","sha384","sha512"]}const Vh={SSL_OP_ALL:0,RSA_PKCS1_PADDING:1,RSA_PKCS1_OAEP_PADDING:4,RSA_PKCS1_PSS_PADDING:6};function Hh(e,t){const n=(t==null?void 0:t.length)||32,s=kt(n);return Pl(s)}function Wh(e,t){const n=((t==null?void 0:t.modulusLength)||2048)/8,s=kt(n),r=kt(n),o=new Kt("private",s,e),c=new Kt("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-----
5
+ */var $u,jv,Vv,eT=($v||($v=1,$u=Uv,(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}$u.exports?(i.default=i,$u.exports=i):window.classNames=i})()),Uv.exports),ld=Ia(eT),Hv,Wv,tT=(Vv||(Vv=1,jv=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}),jv),nT=Ia(tT),zv,qv,En=Ia((function(){if(Wv)return Hv;Wv=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 Hv=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)}})()),sT=Ia((function(){if(qv)return zv;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 jo=="object"&&jo&&jo.Object===Object&&jo,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(I){var M=typeof I;return!!I&&(M=="object"||M=="function")}function R(I){if(typeof I=="number")return I;if((function(N){return typeof N=="symbol"||(function(z){return!!z&&typeof z=="object"})(N)&&b.call(N)=="[object Symbol]"})(I))return NaN;if(A(I)){var M=typeof I.valueOf=="function"?I.valueOf():I;I=A(M)?M+"":M}if(typeof I!="string")return I===0?I:+I;I=I.replace(a,"");var B=l.test(I);return B||u.test(I)?h(I.slice(2),B?2:8):i.test(I)?NaN:+I}return zv=function(I,M,B){var N,z,U,Y,se,ge,ee=0,ae=!1,Oe=!1,oe=!0;if(typeof I!="function")throw new TypeError("Expected a function");function je(Ce){var ze=N,Re=z;return N=z=void 0,ee=Ce,Y=I.apply(Re,ze)}function re(Ce){var ze=Ce-ge;return ge===void 0||ze>=M||ze<0||Oe&&Ce-ee>=U}function be(){var Ce=E();if(re(Ce))return Me(Ce);se=setTimeout(be,(function(ze){var Re=M-(ze-ge);return Oe?w(Re,U-(ze-ee)):Re})(Ce))}function Me(Ce){return se=void 0,oe&&N?je(Ce):(N=z=void 0,Y)}function xe(){var Ce=E(),ze=re(Ce);if(N=arguments,z=this,ge=Ce,ze){if(se===void 0)return(function(Re){return ee=Re,se=setTimeout(be,M),ae?je(Re):Y})(ge);if(Oe)return se=setTimeout(be,M),je(ge)}return se===void 0&&(se=setTimeout(be,M)),Y}return M=R(M)||0,A(B)&&(ae=!!B.leading,U=(Oe="maxWait"in B)?v(R(B.maxWait)||0,M):U,oe="trailing"in B?!!B.trailing:oe),xe.cancel=function(){se!==void 0&&clearTimeout(se),ee=0,N=ge=z=se=void 0},xe.flush=function(){return se===void 0?Y:Me(E())},xe}})()),Gv={width:void 0,height:void 0};function rT(a){const{ref:i,box:l="content-box"}=a,[{width:u,height:h},m]=K.useState(Gv),f=(function(){const v=K.useRef(!1);return K.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]),K.useCallback(()=>v.current,[])})(),_=K.useRef(ii({},Gv)),b=K.useRef(void 0);return b.current=a.onResize,K.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=Kv(w,E,"inlineSize"),R=Kv(w,E,"blockSize");if(_.current.width!==A||_.current.height!==R){const I={width:A,height:R};_.current.width=A,_.current.height=R,b.current?b.current(I):f()&&m(I)}});return v.observe(i.current,{box:l}),()=>{v.disconnect()}},[l,i,f]),{width:u,height:h}}function Kv(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 iT="allotment-module_splitView__L-yRc",aT="allotment-module_sashContainer__fzwJF",oT="allotment-module_splitViewContainer__rQnVa",j0="allotment-module_splitViewView__MGZ6O",lT="allotment-module_vertical__WSwwa",cT="allotment-module_horizontal__7doS8",uT="allotment-module_separatorBorder__x-rDS";let fa,V0=!1,H0=!1;typeof navigator=="object"&&(fa=navigator.userAgent,H0=fa.indexOf("Macintosh")>=0,V0=(fa.indexOf("Macintosh")>=0||fa.indexOf("iPad")>=0||fa.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0);const W0=V0,dT=H0,Yv=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?K.useLayoutEffect:K.useEffect;class hT{constructor(){this._size=void 0}getSize(){return this._size}setSize(i){this._size=i}}function Vo(a,i){const l=a.length,u=l-i.length;return u>=0&&a.slice(u,l)===i}var Zv,Xv={exports:{}},pT=(Zv||(Zv=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),I=l?l+v:v;return b._events[I]?b._events[I].fn?b._events[I]=[b._events[I],R]:b._events[I].push(R):(b._events[I]=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 I=l?l+b:b;if(!this._events[I])return!1;var M,B,N=this._events[I],z=arguments.length;if(N.fn){switch(N.once&&this.removeListener(b,N.fn,void 0,!0),z){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,v),!0;case 3:return N.fn.call(N.context,v,w),!0;case 4:return N.fn.call(N.context,v,w,E),!0;case 5:return N.fn.call(N.context,v,w,E,A),!0;case 6:return N.fn.call(N.context,v,w,E,A,R),!0}for(B=1,M=new Array(z-1);B<z;B++)M[B-1]=arguments[B];N.fn.apply(N.context,M)}else{var U,Y=N.length;for(B=0;B<Y;B++)switch(N[B].once&&this.removeListener(b,N[B].fn,void 0,!0),z){case 1:N[B].fn.call(N[B].context);break;case 2:N[B].fn.call(N[B].context,v);break;case 3:N[B].fn.call(N[B].context,v,w);break;case 4:N[B].fn.call(N[B].context,v,w,E);break;default:if(!M)for(U=1,M=new Array(z-1);U<z;U++)M[U-1]=arguments[U];N[B].fn.apply(N[B].context,M)}}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 I=0,M=[],B=R.length;I<B;I++)(R[I].fn!==v||E&&!R[I].once||w&&R[I].context!==w)&&M.push(R[I]);M.length?this._events[A]=M.length===1?M[0]:M: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=_})(Xv)),Xv.exports),Bd=Ia(pT);function Jv(a,i){const l=a.indexOf(i);l>-1&&(a.splice(l,1),a.unshift(i))}function Uu(a,i){const l=a.indexOf(i);l>-1&&(a.splice(l,1),a.push(i))}function un(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 fT="sash-module_sash__K-9lB",mT="sash-module_disabled__Hm-wx",gT="sash-module_mac__Jf6OJ",Qv="sash-module_vertical__pB-rs",yT="sash-module_minimum__-UKxp",_T="sash-module_maximum__TCWxD",e2="sash-module_horizontal__kFbiw",ju="sash-module_hover__80W6I",Vu="sash-module_active__bJspD";let hn=(function(a){return a.Vertical="VERTICAL",a.Horizontal="HORIZONTAL",a})({}),Yt=(function(a){return a.Disabled="DISABLED",a.Minimum="MINIMUM",a.Maximum="MAXIMUM",a.Enabled="ENABLED",a})({}),z0=W0?20:8;const q0=new Bd;class t2 extends Bd{get state(){return this._state}set state(i){this._state!==i&&(this.el.classList.toggle(mT,i===Yt.Disabled),this.el.classList.toggle("sash-disabled",i===Yt.Disabled),this.el.classList.toggle(yT,i===Yt.Minimum),this.el.classList.toggle("sash-minimum",i===Yt.Minimum),this.el.classList.toggle(_T,i===Yt.Maximum),this.el.classList.toggle("sash-maximum",i===Yt.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=sT(m=>m.classList.add("sash-hover",ju),this.hoverDelay),this._state=Yt.Enabled,this.onPointerStart=m=>{const f=m.pageX,_=m.pageY,b={startX:f,currentX:f,startY:_,currentY:_};this.el.classList.add("sash-active",Vu),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",Vu),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(Vu)?(this.hoverDelayer.cancel(),this.el.classList.add("sash-hover",ju)):this.hoverDelayer(this.el)},this.onMouseLeave=()=>{this.hoverDelayer.cancel(),this.el.classList.remove("sash-hover",ju)},this.el=document.createElement("div"),this.el.classList.add("sash",fT),this.el.dataset.testid="sash",i.append(this.el),dT&&this.el.classList.add("sash-mac",gT),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===hn.Vertical?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=z0,q0.on("onDidChangeGlobalSize",m=>{this.size=m,this.layout()})),this.layoutProvider=l,this.orientation=(h=u.orientation)!=null?h:hn.Vertical,this.orientation===hn.Horizontal?(this.el.classList.add("sash-horizontal",e2),this.el.classList.remove("sash-vertical",Qv)):(this.el.classList.remove("sash-horizontal",e2),this.el.classList.add("sash-vertical",Qv)),this.layout()}layout(){if(this.orientation===hn.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 al;var Hu;(Hu=al||(al={})).Distribute={type:"distribute"},Hu.Split=function(a){return{type:"split",index:a}},Hu.Invisible=function(a){return{type:"invisible",cachedVisibleSize:a}};let dn=(function(a){return a.Normal="NORMAL",a.Low="LOW",a.High="HIGH",a})({});class G0{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",j0),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=En(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 bT extends G0{layoutContainer(i){this.container.style.left=`${i}px`,this.container.style.width=`${this.size}px`}}class vT extends G0{layoutContainer(i){this.container.style.top=`${i}px`,this.container.style.height=`${this.size}px`}}class wT extends Bd{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:hn.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",aT),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===hn.Vertical?new vT(i,l,f):new bT(i,l,f);if(this.viewItems.splice(h,0,_),this.viewItems.length>1){const b=this.orientation===hn.Vertical?new t2(this.sashContainer,{getHorizontalSashTop:E=>this.getSashPosition(E),getHorizontalSashWidth:this.getSashOrthogonalSize},{orientation:hn.Horizontal}):new t2(this.sashContainer,{getVerticalSashLeft:E=>this.getSashPosition(E),getVerticalSashHeight:this.getSashOrthogonalSize},{orientation:hn.Vertical}),v=this.orientation===hn.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(I=>I.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(B=>B.sash===b),A=un(E,-1,-1),R=un(E+1,this.viewItems.length),I=this.findFirstSnapIndex(A),M=this.findFirstSnapIndex(R);(typeof I!="number"||this.viewItems[I].visible)&&(typeof M!="number"||this.viewItems[M].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):al.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=En(Math.round(this.proportions[u]*i),h.minimumSize,h.maximumSize)}else{const u=un(0,this.viewItems.length),h=u.filter(f=>this.viewItems[f].priority===dn.Low),m=u.filter(f=>this.viewItems[f].priority===dn.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=un(0,this.viewItems.length).filter(_=>_!==i),h=[...u.filter(_=>this.viewItems[_].priority===dn.Low),i],m=u.filter(_=>this.viewItems[_].priority===dn.High),f=this.viewItems[i];l=Math.round(l),l=En(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=En(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=En(u,_.minimumSize,_.maximumSize);const h=un(0,this.viewItems.length),m=h.filter(_=>this.viewItems[_].priority===dn.Low),f=h.filter(_=>this.viewItems[_].priority===dn.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(z=>z.size);let f,_,b=Number.NEGATIVE_INFINITY,v=Number.POSITIVE_INFINITY;const w=un(u,-1,-1),E=un(u+1,this.viewItems.length),A=w.reduce((z,U)=>z+(this.viewItems[U].minimumSize-m[U]),0),R=w.reduce((z,U)=>z+(this.viewItems[U].viewMaximumSize-m[U]),0),I=E.length===0?Number.POSITIVE_INFINITY:E.reduce((z,U)=>z+(m[U]-this.viewItems[U].minimumSize),0),M=E.length===0?Number.NEGATIVE_INFINITY:E.reduce((z,U)=>z+(m[U]-this.viewItems[U].viewMaximumSize),0);b=Math.max(A,M),v=Math.min(I,R);const B=this.findFirstSnapIndex(w),N=this.findFirstSnapIndex(E);if(typeof B=="number"){const z=this.viewItems[B],U=Math.floor(z.viewMinimumSize/2);f={index:B,limitDelta:z.visible?b-U:b+U,size:z.size}}if(typeof N=="number"){const z=this.viewItems[N],U=Math.floor(z.viewMinimumSize/2);_={index:N,limitDelta:z.visible?v+U:v-U,size:z.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=un(i,-1,-1),E=un(i+1,this.viewItems.length);if(m)for(const ee of m)Jv(w,ee),Jv(E,ee);if(h)for(const ee of h)Uu(w,ee),Uu(E,ee);const A=w.map(ee=>this.viewItems[ee]),R=w.map(ee=>u[ee]),I=E.map(ee=>this.viewItems[ee]),M=E.map(ee=>u[ee]),B=w.reduce((ee,ae)=>ee+(this.viewItems[ae].minimumSize-u[ae]),0),N=w.reduce((ee,ae)=>ee+(this.viewItems[ae].maximumSize-u[ae]),0),z=E.length===0?Number.POSITIVE_INFINITY:E.reduce((ee,ae)=>ee+(u[ae]-this.viewItems[ae].minimumSize),0),U=E.length===0?Number.NEGATIVE_INFINITY:E.reduce((ee,ae)=>ee+(u[ae]-this.viewItems[ae].maximumSize),0),Y=Math.max(B,U,f),se=Math.min(z,N,_);let ge=!1;if(b){const ee=this.viewItems[b.index],ae=l>=b.limitDelta;ge=ae!==ee.visible,ee.setVisible(ae,b.size)}if(!ge&&v){const ee=this.viewItems[v.index],ae=l<v.limitDelta;ge=ae!==ee.visible,ee.setVisible(ae,v.size)}if(ge)return this.resize(i,l,u,h,m,f,_);for(let ee=0,ae=l=En(l,Y,se);ee<A.length;ee++){const Oe=A[ee],oe=En(R[ee]+ae,Oe.minimumSize,Oe.maximumSize);ae-=oe-R[ee],Oe.size=oe}for(let ee=0,ae=l;ee<I.length;ee++){const Oe=I[ee],oe=En(M[ee]-ae,Oe.minimumSize,Oe.maximumSize);ae+=oe-M[ee],Oe.size=oe}return l}distributeEmptySpace(i){const l=this.viewItems.reduce((v,w)=>v+w.size,0);let u=this.size-l;const h=un(0,this.viewItems.length),m=[],f=h.filter(v=>this.viewItems[v].priority===dn.Low),_=h.filter(v=>this.viewItems[v].priority===dn.Normal),b=h.filter(v=>this.viewItems[v].priority===dn.High);m.push(...b,..._,...f),typeof i=="number"&&Uu(m,i);for(let v=0;u!==0&&v<m.length;v++){const w=this.viewItems[m[v]],E=En(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=un(b,-1,-1),R=un(b+1,this.viewItems.length),I=this.findFirstSnapIndex(A),M=this.findFirstSnapIndex(R),B=typeof I=="number"&&!this.viewItems[I].visible,N=typeof M=="number"&&!this.viewItems[M].visible;B&&m[b]&&(_>0||this.startSnappingEnabled)?v.state=Yt.Minimum:N&&l[b]&&(_<this.contentSize||this.endSnappingEnabled)?v.state=Yt.Maximum:v.state=Yt.Disabled}else v.state=w&&!E?Yt.Minimum:!w&&E?Yt.Maximum:Yt.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 Gr{constructor(i){this.size=void 0,this.size=i}getPreferredSize(){return this.size}}class n2{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 Ho{getPreferredSize(){}}class s2{get preferredSize(){return this.layoutStrategy.getPreferredSize()}set preferredSize(i){if(typeof i=="number")this.layoutStrategy=new Gr(i);else if(typeof i=="string"){const l=i.trim();if(Vo(l,"%")){const u=Number(l.slice(0,-1))/100;this.layoutStrategy=new n2(u,this.layoutService)}else if(Vo(l,"px")){const u=Number(l.slice(0,-2))/100;this.layoutStrategy=new Gr(u)}else if(typeof Number.parseFloat(l)=="number"){const u=Number.parseFloat(l);this.layoutStrategy=new Gr(u)}else this.layoutStrategy=new Ho}else this.layoutStrategy=new Ho}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 Gr(l.preferredSize);else if(typeof l.preferredSize=="string"){const h=l.preferredSize.trim();if(Vo(h,"%")){const m=Number(h.slice(0,-1))/100;this.layoutStrategy=new n2(m,this.layoutService)}else if(Vo(h,"px")){const m=Number(h.slice(0,-2));this.layoutStrategy=new Gr(m)}else if(typeof Number.parseFloat(h)=="number"){const m=Number.parseFloat(h);this.layoutStrategy=new Gr(m)}else this.layoutStrategy=new Ho}else this.layoutStrategy=new Ho;this.priority=(u=l.priority)!=null?u:dn.Normal,this.snap=typeof l.snap=="boolean"&&l.snap}layout(i){}}function r2(a){return a.minSize!==void 0||a.maxSize!==void 0||a.preferredSize!==void 0||a.priority!==void 0||a.visible!==void 0}const Ld=K.forwardRef(({className:a,children:i},l)=>K.createElement("div",{ref:l,className:ld("split-view-view",j0,a)},i));Ld.displayName="Allotment.Pane";const K0=K.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:I,onDragEnd:M},B)=>{const N=K.useRef(null),z=K.useRef([]),U=K.useRef(new Map),Y=K.useRef(null),se=K.useRef(new Map),ge=K.useRef(new hT),ee=K.useRef([]),[ae,Oe]=K.useState(!1);process.env.NODE_ENV!=="production"&&_&&console.warn("Prop sizes is deprecated. Please use defaultSizes instead.");const oe=K.useMemo(()=>K.Children.toArray(a).filter(K.isValidElement),[a]),je=K.useCallback(re=>{var be,Me;const xe=(be=ee.current)==null?void 0:be[re];return typeof(xe==null?void 0:xe.preferredSize)=="number"&&((Me=Y.current)!=null&&Me.resizeView(re,Math.round(xe.preferredSize)),!0)},[]);return K.useImperativeHandle(B,()=>({reset:()=>{if(A)A();else{var re;(re=Y.current)==null||re.distributeViewSizes();for(let be=0;be<ee.current.length;be++)je(be)}},resize:re=>{var be;(be=Y.current)==null||be.resizeViews(re)}})),Yv(()=>{let re=!0;b&&se.current.size!==b.length&&(re=!1,console.warn(`Expected ${b.length} children based on defaultSizes but found ${se.current.size}`)),re&&b&&(z.current=oe.map(xe=>xe.key));const be=ii({orientation:w?hn.Vertical:hn.Horizontal,proportionalLayout:m},re&&b&&{descriptor:{size:b.reduce((xe,Ce)=>xe+Ce,0),views:b.map((xe,Ce)=>{var ze,Re,tt,ie;const pe=U.current.get(z.current[Ce]),ve=new s2(ge.current,ii({element:document.createElement("div"),minimumSize:(ze=pe==null?void 0:pe.minSize)!=null?ze:h,maximumSize:(Re=pe==null?void 0:pe.maxSize)!=null?Re:u,priority:(tt=pe==null?void 0:pe.priority)!=null?tt:dn.Normal},(pe==null?void 0:pe.preferredSize)&&{preferredSize:pe==null?void 0:pe.preferredSize},{snap:(ie=pe==null?void 0:pe.snap)!=null?ie:v}));return ee.current.push(ve),{container:[...se.current.values()][Ce],size:xe,view:ve}})}});Y.current=new wT(N.current,be,E,I,M),Y.current.on("sashDragStart",()=>{var xe;(xe=N.current)==null||xe.classList.add("split-view-sash-dragging")}),Y.current.on("sashDragEnd",()=>{var xe;(xe=N.current)==null||xe.classList.remove("split-view-sash-dragging")}),Y.current.on("sashchange",xe=>{if(R&&Y.current){const Ce=oe.map(ze=>ze.key);for(let ze=0;ze<Ce.length;ze++){const Re=U.current.get(Ce[ze]);(Re==null?void 0:Re.visible)!==void 0&&Re.visible!==Y.current.isViewVisible(ze)&&R(ze,Y.current.isViewVisible(ze))}}}),Y.current.on("sashreset",xe=>{if(A)A();else{var Ce;if(je(xe)||je(xe+1))return;(Ce=Y.current)==null||Ce.distributeViewSizes()}});const Me=Y.current;return()=>{Me.dispose()}},[]),Yv(()=>{if(ae){const Ee=oe.map(De=>De.key),ke=[...z.current],Ne=Ee.filter(De=>!z.current.includes(De)),Te=Ee.filter(De=>z.current.includes(De)),Ke=z.current.map(De=>!Ee.includes(De));for(let De=Ke.length-1;De>=0;De--){var re;Ke[De]&&((re=Y.current)!=null&&re.removeView(De),ke.splice(De,1),ee.current.splice(De,1))}for(const De of Ne){var be,Me,xe,Ce,ze;const Pe=U.current.get(De),Ge=new s2(ge.current,ii({element:document.createElement("div"),minimumSize:(be=Pe==null?void 0:Pe.minSize)!=null?be:h,maximumSize:(Me=Pe==null?void 0:Pe.maxSize)!=null?Me:u,priority:(xe=Pe==null?void 0:Pe.priority)!=null?xe:dn.Normal},(Pe==null?void 0:Pe.preferredSize)&&{preferredSize:Pe==null?void 0:Pe.preferredSize},{snap:(Ce=Pe==null?void 0:Pe.snap)!=null?Ce:v}));(ze=Y.current)!=null&&ze.addView(se.current.get(De),Ge,al.Distribute,Ee.findIndex(we=>we===De)),ke.splice(Ee.findIndex(we=>we===De),0,De),ee.current.splice(Ee.findIndex(we=>we===De),0,Ge)}for(;!nT(Ee,ke);)for(const[De,Pe]of Ee.entries()){const Ge=ke.findIndex(we=>we===Pe);if(Ge!==De){var Re;(Re=Y.current)==null||Re.moveView(se.current.get(Pe),Ge,De);const we=ke[Ge];ke.splice(Ge,1),ke.splice(De,0,we);break}}for(const De of Ne){var tt;const Pe=Ee.findIndex(we=>we===De),Ge=ee.current[Pe].preferredSize;Ge!==void 0&&((tt=Y.current)==null||tt.resizeView(Pe,Ge))}for(const De of[...Ne,...Te]){var ie,pe;const Pe=U.current.get(De),Ge=Ee.findIndex(we=>we===De);Pe&&r2(Pe)&&Pe.visible!==void 0&&((ie=Y.current)==null?void 0:ie.isViewVisible(Ge))!==Pe.visible&&((pe=Y.current)==null||pe.setViewVisible(Ge,Pe.visible))}for(const De of Te){const Pe=U.current.get(De),Ge=Ee.findIndex(we=>we===De);if(Pe&&r2(Pe)){var ve;Pe.preferredSize!==void 0&&ee.current[Ge].preferredSize!==Pe.preferredSize&&(ee.current[Ge].preferredSize=Pe.preferredSize);let we=!1;Pe.minSize!==void 0&&ee.current[Ge].minimumSize!==Pe.minSize&&(ee.current[Ge].minimumSize=Pe.minSize,we=!0),Pe.maxSize!==void 0&&ee.current[Ge].maximumSize!==Pe.maxSize&&(ee.current[Ge].maximumSize=Pe.maxSize,we=!0),we&&((ve=Y.current)==null||ve.layout())}}(Ne.length>0||Ke.length>0)&&(z.current=Ee)}},[oe,ae,u,h,v]),K.useEffect(()=>{Y.current&&(Y.current.onDidChange=E)},[E]),K.useEffect(()=>{Y.current&&(Y.current.onDidDragStart=I)},[I]),K.useEffect(()=>{Y.current&&(Y.current.onDidDragEnd=M)},[M]),rT({ref:N,onResize:({width:re,height:be})=>{var Me;re&&be&&((Me=Y.current)!=null&&Me.layout(w?be:re),ge.current.setSize(w?be:re),Oe(!0))}}),K.useEffect(()=>{W0&&ST(20)},[]),K.createElement("div",{ref:N,className:ld("split-view",w?"split-view-vertical":"split-view-horizontal",{"split-view-separator-border":f},iT,w?lT:cT,{[uT]:f},i),id:l},K.createElement("div",{className:ld("split-view-container",oT)},K.Children.toArray(a).map(re=>{if(!K.isValidElement(re))return null;const be=re.key;return re.type.displayName==="Allotment.Pane"?(U.current.set(be,re.props),K.cloneElement(re,{key:be,ref:Me=>{const xe=re.ref;xe&&(xe.current=Me),Me?se.current.set(be,Me):se.current.delete(be)}})):K.createElement(Ld,{key:be,ref:Me=>{Me?se.current.set(be,Me):se.current.delete(be)}},re)})))});function ST(a){const i=En(a,4,20),l=En(a,1,8);document.documentElement.style.setProperty("--sash-size",i+"px"),document.documentElement.style.setProperty("--sash-hover-size",l+"px"),(function(u){z0=u,q0.emit("onDidChangeGlobalSize",u)})(i)}K0.displayName="Allotment";var Kr=Object.assign(K0,{Pane:Ld});const Y0=K.createContext({});function xT(a){const i=K.useRef(null);return i.current===null&&(i.current=a()),i.current}const ET=typeof window<"u",kT=ET?K.useLayoutEffect:K.useEffect,Md=K.createContext(null);function Fd(a,i){a.indexOf(i)===-1&&a.push(i)}function ol(a,i){const l=a.indexOf(i);l>-1&&a.splice(l,1)}const zn=(a,i,l)=>l>i?i:l<a?a:l;function cd(a,i){return i?`${a}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${i}`:a}let ci=()=>{},is=()=>{};var U0;typeof process<"u"&&((U0=process.env)==null?void 0:U0.NODE_ENV)!=="production"&&(ci=(a,i,l)=>{!a&&typeof console<"u"&&console.warn(cd(i,l))},is=(a,i,l)=>{if(!a)throw new Error(cd(i,l))});const as={},Z0=a=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(a);function X0(a){return typeof a=="object"&&a!==null}const J0=a=>/^0[^.\s]+$/u.test(a);function Q0(a){let i;return()=>(i===void 0&&(i=a()),i)}const fn=a=>a,CT=(a,i)=>l=>i(a(l)),Ra=(...a)=>a.reduce(CT),ka=(a,i,l)=>{const u=i-a;return u===0?1:(l-a)/u};class $d{constructor(){this.subscriptions=[]}add(i){return Fd(this.subscriptions,i),()=>ol(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 Ut=a=>a*1e3,pn=a=>a/1e3;function ew(a,i){return i?a*(1e3/i):0}const i2=new Set;function Ud(a,i,l){a||i2.has(i)||(console.warn(cd(i,l)),i2.add(i))}const tw=(a,i,l)=>(((1-3*l+3*i)*a+(3*l-6*i))*a+3*i)*a,AT=1e-7,TT=12;function IT(a,i,l,u,h){let m,f,_=0;do f=i+(l-i)/2,m=tw(f,u,h)-a,m>0?l=f:i=f;while(Math.abs(m)>AT&&++_<TT);return f}function Pa(a,i,l,u){if(a===i&&l===u)return fn;const h=m=>IT(m,0,1,a,l);return m=>m===0||m===1?m:tw(h(m),i,u)}const nw=a=>i=>i<=.5?a(2*i)/2:(2-a(2*(1-i)))/2,sw=a=>i=>1-a(1-i),rw=Pa(.33,1.53,.69,.99),jd=sw(rw),iw=nw(jd),aw=a=>(a*=2)<1?.5*jd(a):.5*(2-Math.pow(2,-10*(a-1))),Vd=a=>1-Math.sin(Math.acos(a)),ow=sw(Vd),lw=nw(Vd),RT=Pa(.42,0,1,1),PT=Pa(0,0,.58,1),cw=Pa(.42,0,.58,1),DT=a=>Array.isArray(a)&&typeof a[0]!="number",uw=a=>Array.isArray(a)&&typeof a[0]=="number",a2={linear:fn,easeIn:RT,easeInOut:cw,easeOut:PT,circIn:Vd,circInOut:lw,circOut:ow,backIn:jd,backInOut:iw,backOut:rw,anticipate:aw},OT=a=>typeof a=="string",o2=a=>{if(uw(a)){is(a.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[i,l,u,h]=a;return Pa(i,l,u,h)}else if(OT(a))return is(a2[a]!==void 0,`Invalid easing type '${a}'`,"invalid-easing-type"),a2[a];return a},Wo=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function NT(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 I=A&&h?l:u;return E&&f.add(w),I.has(w)||I.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 BT=40;function dw(a,i){let l=!1,u=!0;const h={delta:0,timestamp:0,isProcessing:!1},m=()=>l=!0,f=Wo.reduce((U,Y)=>(U[Y]=NT(m),U),{}),{setup:_,read:b,resolveKeyframes:v,preUpdate:w,update:E,preRender:A,render:R,postRender:I}=f,M=()=>{const U=as.useManualTiming?h.timestamp:performance.now();l=!1,as.useManualTiming||(h.delta=u?1e3/60:Math.max(Math.min(U-h.timestamp,BT),1)),h.timestamp=U,h.isProcessing=!0,_.process(h),b.process(h),v.process(h),w.process(h),E.process(h),A.process(h),R.process(h),I.process(h),h.isProcessing=!1,l&&i&&(u=!1,a(M))},B=()=>{l=!0,u=!0,h.isProcessing||a(M)};return{schedule:Wo.reduce((U,Y)=>{const se=f[Y];return U[Y]=(ge,ee=!1,ae=!1)=>(l||B(),se.schedule(ge,ee,ae)),U},{}),cancel:U=>{for(let Y=0;Y<Wo.length;Y++)f[Wo[Y]].cancel(U)},state:h,steps:f}}const{schedule:Ye,cancel:Ts,state:xt,steps:Wu}=dw(typeof requestAnimationFrame<"u"?requestAnimationFrame:fn,!0);let Qo;function LT(){Qo=void 0}const Nt={now:()=>(Qo===void 0&&Nt.set(xt.isProcessing||as.useManualTiming?xt.timestamp:performance.now()),Qo),set:a=>{Qo=a,queueMicrotask(LT)}},hw=a=>i=>typeof i=="string"&&i.startsWith(a),pw=hw("--"),MT=hw("var(--"),Hd=a=>MT(a)?FT.test(a.split("/*")[0].trim()):!1,FT=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function l2(a){return typeof a!="string"?!1:a.split("/*")[0].includes("var(--")}const ui={test:a=>typeof a=="number",parse:parseFloat,transform:a=>a},Ca={...ui,transform:a=>zn(0,1,a)},zo={...ui,default:1},Sa=a=>Math.round(a*1e5)/1e5,Wd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function $T(a){return a==null}const UT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zd=(a,i)=>l=>!!(typeof l=="string"&&UT.test(l)&&l.startsWith(a)||i&&!$T(l)&&Object.prototype.hasOwnProperty.call(l,i)),fw=(a,i,l)=>u=>{if(typeof u!="string")return u;const[h,m,f,_]=u.match(Wd);return{[a]:parseFloat(h),[i]:parseFloat(m),[l]:parseFloat(f),alpha:_!==void 0?parseFloat(_):1}},jT=a=>zn(0,255,a),zu={...ui,transform:a=>Math.round(jT(a))},ar={test:zd("rgb","red"),parse:fw("red","green","blue"),transform:({red:a,green:i,blue:l,alpha:u=1})=>"rgba("+zu.transform(a)+", "+zu.transform(i)+", "+zu.transform(l)+", "+Sa(Ca.transform(u))+")"};function VT(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 ud={test:zd("#"),parse:VT,transform:ar.transform},Da=a=>({test:i=>typeof i=="string"&&i.endsWith(a)&&i.split(" ").length===1,parse:parseFloat,transform:i=>`${i}${a}`}),ks=Da("deg"),Wn=Da("%"),de=Da("px"),HT=Da("vh"),WT=Da("vw"),c2={...Wn,parse:a=>Wn.parse(a)/100,transform:a=>Wn.transform(a*100)},Jr={test:zd("hsl","hue"),parse:fw("hue","saturation","lightness"),transform:({hue:a,saturation:i,lightness:l,alpha:u=1})=>"hsla("+Math.round(a)+", "+Wn.transform(Sa(i))+", "+Wn.transform(Sa(l))+", "+Sa(Ca.transform(u))+")"},ft={test:a=>ar.test(a)||ud.test(a)||Jr.test(a),parse:a=>ar.test(a)?ar.parse(a):Jr.test(a)?Jr.parse(a):ud.parse(a),transform:a=>typeof a=="string"?a:a.hasOwnProperty("red")?ar.transform(a):Jr.transform(a),getAnimatableNone:a=>{const i=ft.parse(a);return i.alpha=0,ft.transform(i)}},zT=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function qT(a){var i,l;return isNaN(a)&&typeof a=="string"&&(((i=a.match(Wd))==null?void 0:i.length)||0)+(((l=a.match(zT))==null?void 0:l.length)||0)>0}const mw="number",gw="color",GT="var",KT="var(",u2="${}",YT=/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 oi(a){const i=a.toString(),l=[],u={color:[],number:[],var:[]},h=[];let m=0;const _=i.replace(YT,b=>(ft.test(b)?(u.color.push(m),h.push(gw),l.push(ft.parse(b))):b.startsWith(KT)?(u.var.push(m),h.push(GT),l.push(b)):(u.number.push(m),h.push(mw),l.push(parseFloat(b))),++m,u2)).split(u2);return{values:l,split:_,indexes:u,types:h}}function ZT(a){return oi(a).values}function yw({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===mw?h+=Sa(u[m]):f===gw?h+=ft.transform(u[m]):h+=u[m]}return h}}function XT(a){return yw(oi(a))}const JT=a=>typeof a=="number"?0:ft.test(a)?ft.getAnimatableNone(a):a,QT=(a,i)=>typeof a=="number"?i!=null&&i.trim().endsWith("/")?a:0:JT(a);function eI(a){const i=oi(a);return yw(i)(i.values.map((u,h)=>QT(u,i.split[h])))}const kn={test:qT,parse:ZT,createTransformer:XT,getAnimatableNone:eI};function qu(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 tI({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=qu(b,_,a+1/3),m=qu(b,_,a),f=qu(b,_,a-1/3)}return{red:Math.round(h*255),green:Math.round(m*255),blue:Math.round(f*255),alpha:u}}function ll(a,i){return l=>l>0?i:a}const it=(a,i,l)=>a+(i-a)*l,Gu=(a,i,l)=>{const u=a*a,h=l*(i*i-u)+u;return h<0?0:Math.sqrt(h)},nI=[ud,ar,Jr],sI=a=>nI.find(i=>i.test(a));function d2(a){const i=sI(a);if(ci(!!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===Jr&&(l=tI(l)),l}const h2=(a,i)=>{const l=d2(a),u=d2(i);if(!l||!u)return ll(a,i);const h={...l};return m=>(h.red=Gu(l.red,u.red,m),h.green=Gu(l.green,u.green,m),h.blue=Gu(l.blue,u.blue,m),h.alpha=it(l.alpha,u.alpha,m),ar.transform(h))},dd=new Set(["none","hidden"]);function rI(a,i){return dd.has(a)?l=>l<=0?a:i:l=>l>=1?i:a}function iI(a,i){return l=>it(a,i,l)}function qd(a){return typeof a=="number"?iI:typeof a=="string"?Hd(a)?ll:ft.test(a)?h2:lI:Array.isArray(a)?_w:typeof a=="object"?ft.test(a)?h2:aI:ll}function _w(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 aI(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 oI(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 lI=(a,i)=>{const l=kn.createTransformer(i),u=oi(a),h=oi(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?dd.has(a)&&!h.values.length||dd.has(i)&&!u.values.length?rI(a,i):Ra(_w(oI(u,h),h.values),l):(ci(!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"),ll(a,i))};function bw(a,i,l){return typeof a=="number"&&typeof i=="number"&&typeof l=="number"?it(a,i,l):qd(a)(a,i)}const cI=a=>{const i=({timestamp:l})=>a(l);return{start:(l=!0)=>Ye.update(i,l),stop:()=>Ts(i),now:()=>xt.isProcessing?xt.timestamp:Nt.now()}},vw=(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)})`},cl=2e4;function Gd(a){let i=0;const l=50;let u=a.next(i);for(;!u.done&&i<cl;)i+=l,u=a.next(i);return i>=cl?1/0:i}function uI(a,i=100,l){const u=l({...a,keyframes:[0,i]}),h=Math.min(Gd(u),cl);return{type:"keyframes",ease:m=>u.next(h*m).value/i,duration:pn(h)}}const rt={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 hd(a,i){return a*Math.sqrt(1-i*i)}const dI=12;function hI(a,i,l){let u=l;for(let h=1;h<dI;h++)u=u-a(u)/i(u);return u}const Ku=.001;function pI({duration:a=rt.duration,bounce:i=rt.bounce,velocity:l=rt.velocity,mass:u=rt.mass}){let h,m;ci(a<=Ut(rt.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let f=1-i;f=zn(rt.minDamping,rt.maxDamping,f),a=zn(rt.minDuration,rt.maxDuration,pn(a)),f<1?(h=v=>{const w=v*f,E=w*a,A=w-l,R=hd(v,f),I=Math.exp(-E);return Ku-A/R*I},m=v=>{const E=v*f*a,A=E*l+l,R=Math.pow(f,2)*Math.pow(v,2)*a,I=Math.exp(-E),M=hd(Math.pow(v,2),f);return(-h(v)+Ku>0?-1:1)*((A-R)*I)/M}):(h=v=>{const w=Math.exp(-v*a),E=(v-l)*a+1;return-Ku+w*E},m=v=>{const w=Math.exp(-v*a),E=(l-v)*(a*a);return w*E});const _=5/a,b=hI(h,m,_);if(a=Ut(a),isNaN(b))return{stiffness:rt.stiffness,damping:rt.damping,duration:a};{const v=Math.pow(b,2)*u;return{stiffness:v,damping:f*2*Math.sqrt(u*v),duration:a}}}const fI=["duration","bounce"],mI=["stiffness","damping","mass"];function p2(a,i){return i.some(l=>a[l]!==void 0)}function gI(a){let i={velocity:rt.velocity,stiffness:rt.stiffness,damping:rt.damping,mass:rt.mass,isResolvedFromDuration:!1,...a};if(!p2(a,mI)&&p2(a,fI))if(i.velocity=0,a.visualDuration){const l=a.visualDuration,u=2*Math.PI/(l*1.2),h=u*u,m=2*zn(.05,1,1-(a.bounce||0))*Math.sqrt(h);i={...i,mass:rt.mass,stiffness:h,damping:m}}else{const l=pI({...a,velocity:0});i={...i,...l,mass:rt.mass},i.isResolvedFromDuration=!0}return i}function ul(a=rt.visualDuration,i=rt.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}=gI({...l,velocity:-pn(l.velocity||0)}),I=A||0,M=v/(2*Math.sqrt(b*w)),B=f-m,N=pn(Math.sqrt(b/w)),z=Math.abs(B)<5;u||(u=z?rt.restSpeed.granular:rt.restSpeed.default),h||(h=z?rt.restDelta.granular:rt.restDelta.default);let U,Y,se,ge,ee,ae;if(M<1)se=hd(N,M),ge=(I+M*N*B)/se,U=oe=>{const je=Math.exp(-M*N*oe);return f-je*(ge*Math.sin(se*oe)+B*Math.cos(se*oe))},ee=M*N*ge+B*se,ae=M*N*B-ge*se,Y=oe=>Math.exp(-M*N*oe)*(ee*Math.sin(se*oe)+ae*Math.cos(se*oe));else if(M===1){U=je=>f-Math.exp(-N*je)*(B+(I+N*B)*je);const oe=I+N*B;Y=je=>Math.exp(-N*je)*(N*oe*je-I)}else{const oe=N*Math.sqrt(M*M-1);U=Me=>{const xe=Math.exp(-M*N*Me),Ce=Math.min(oe*Me,300);return f-xe*((I+M*N*B)*Math.sinh(Ce)+oe*B*Math.cosh(Ce))/oe};const je=(I+M*N*B)/oe,re=M*N*je-B*oe,be=M*N*B-je*oe;Y=Me=>{const xe=Math.exp(-M*N*Me),Ce=Math.min(oe*Me,300);return xe*(re*Math.sinh(Ce)+be*Math.cosh(Ce))}}const Oe={calculatedDuration:R&&E||null,velocity:oe=>Ut(Y(oe)),next:oe=>{if(!R&&M<1){const re=Math.exp(-M*N*oe),be=Math.sin(se*oe),Me=Math.cos(se*oe),xe=f-re*(ge*be+B*Me),Ce=Ut(re*(ee*be+ae*Me));return _.done=Math.abs(Ce)<=u&&Math.abs(f-xe)<=h,_.value=_.done?f:xe,_}const je=U(oe);if(R)_.done=oe>=E;else{const re=Ut(Y(oe));_.done=Math.abs(re)<=u&&Math.abs(f-je)<=h}return _.value=_.done?f:je,_},toString:()=>{const oe=Math.min(Gd(Oe),cl),je=vw(re=>Oe.next(oe*re).value,oe,30);return oe+"ms "+je},toTransition:()=>{}};return Oe}ul.applyToOptions=a=>{const i=uI(a,100,ul);return a.ease=i.ease,a.duration=Ut(i.duration),a.type="keyframes",a};const yI=5;function ww(a,i,l){const u=Math.max(i-yI,0);return ew(l-a(u),i-u)}function pd({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,I=ae=>_===void 0?b:b===void 0||Math.abs(_-ae)<Math.abs(b-ae)?_:b;let M=l*i;const B=E+M,N=f===void 0?B:f(B);N!==B&&(M=N-E);const z=ae=>-M*Math.exp(-ae/u),U=ae=>N+z(ae),Y=ae=>{const Oe=z(ae),oe=U(ae);A.done=Math.abs(Oe)<=v,A.value=A.done?N:oe};let se,ge;const ee=ae=>{R(A.value)&&(se=ae,ge=ul({keyframes:[A.value,I(A.value)],velocity:ww(U,ae,A.value),damping:h,stiffness:m,restDelta:v,restSpeed:w}))};return ee(0),{calculatedDuration:null,next:ae=>{let Oe=!1;return!ge&&se===void 0&&(Oe=!0,Y(ae),ee(ae)),se!==void 0&&ae>=se?ge.next(ae-se):(!Oe&&Y(ae),A)}}}function _I(a,i,l){const u=[],h=l||as.mix||bw,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]||fn:i;_=Ra(b,_)}u.push(_)}return u}function bI(a,i,{clamp:l=!0,ease:u,mixer:h}={}){const m=a.length;if(is(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 _=_I(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=ka(a[E],a[E+1],w);return _[E](A)};return l?w=>v(zn(a[0],a[m-1],w)):v}function vI(a,i){const l=a[a.length-1];for(let u=1;u<=i;u++){const h=ka(0,i,u);a.push(it(l,1,h))}}function wI(a){const i=[0];return vI(i,a.length-1),i}function SI(a,i){return a.map(l=>l*i)}function xI(a,i){return a.map(()=>i||cw).splice(0,a.length-1)}function Qr({duration:a=300,keyframes:i,times:l,ease:u="easeInOut"}){const h=DT(u)?u.map(o2):o2(u),m={done:!1,value:i[0]},f=SI(l&&l.length===i.length?l:wI(i),a),_=bI(f,i,{ease:Array.isArray(h)?h:xI(i,h)});return{calculatedDuration:a,next:b=>(m.value=_(b),m.done=b>=a,m)}}const EI=a=>a!==null;function Kd(a,{repeat:i,repeatType:l="loop"},u,h=1){const m=a.filter(EI),_=h<0||i&&l!=="loop"&&i%2===1?0:m.length-1;return!_||u===void 0?m[_]:u}const kI={decay:pd,inertia:pd,tween:Qr,keyframes:Qr,spring:ul};function Sw(a){typeof a.type=="string"&&(a.type=kI[a.type])}class Yd{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 CI=a=>a/100;class Zd extends Yd{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!==Nt.now()&&this.tick(Nt.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;Sw(i);const{type:l=Qr,repeat:u=0,repeatDelay:h=0,repeatType:m,velocity:f=0}=i;let{keyframes:_}=i;const b=l||Qr;process.env.NODE_ENV!=="production"&&b!==Qr&&is(_.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${_}`,"spring-two-frames"),b!==Qr&&typeof _[0]!="number"&&(this.mixKeyframes=Ra(CI,bw(_[0],_[1])),_=[0,100]);const v=b({...i,keyframes:_});m==="mirror"&&(this.mirroredGenerator=b({...i,keyframes:[..._].reverse(),velocity:-f})),v.calculatedDuration===null&&(v.calculatedDuration=Gd(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:I,onUpdate:M,finalKeyframe:B}=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 N=this.currentTime-v*(this.playbackSpeed>=0?1:-1),z=this.playbackSpeed>=0?N<0:N>h;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=h);let U=this.currentTime,Y=u;if(E){const ae=Math.min(this.currentTime,h)/_;let Oe=Math.floor(ae),oe=ae%1;!oe&&ae>=1&&(oe=1),oe===1&&Oe--,Oe=Math.min(Oe,E+1),!!(Oe%2)&&(A==="reverse"?(oe=1-oe,R&&(oe-=R/_)):A==="mirror"&&(Y=f)),U=zn(0,1,oe)*_}const se=z?{done:!1,value:w[0]}:Y.next(U);m&&!z&&(se.value=m(se.value));let{done:ge}=se;!z&&b!==null&&(ge=this.playbackSpeed>=0?this.currentTime>=h:this.currentTime<=0);const ee=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&ge);return ee&&I!==pd&&(se.value=Kd(w,this.options,B,this.speed)),M&&M(se.value),ee&&this.finish(),se}then(i,l){return this.finished.then(i,l)}get duration(){return pn(this.calculatedDuration)}get iterationDuration(){const{delay:i=0}=this.options||{};return this.duration+pn(i)}get time(){return pn(this.currentTime)}set time(i){i=Ut(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 ww(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(Nt.now()),this.playbackSpeed=i,l&&this.driver&&(this.time=pn(this.currentTime))}play(){var h,m;if(this.isStopped)return;const{driver:i=cI,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(Nt.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 AI(a){for(let i=1;i<a.length;i++)a[i]??(a[i]=a[i-1])}const or=a=>a*180/Math.PI,fd=a=>{const i=or(Math.atan2(a[1],a[0]));return md(i)},TI={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:a=>(Math.abs(a[0])+Math.abs(a[3]))/2,rotate:fd,rotateZ:fd,skewX:a=>or(Math.atan(a[1])),skewY:a=>or(Math.atan(a[2])),skew:a=>(Math.abs(a[1])+Math.abs(a[2]))/2},md=a=>(a=a%360,a<0&&(a+=360),a),f2=fd,m2=a=>Math.sqrt(a[0]*a[0]+a[1]*a[1]),g2=a=>Math.sqrt(a[4]*a[4]+a[5]*a[5]),II={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:m2,scaleY:g2,scale:a=>(m2(a)+g2(a))/2,rotateX:a=>md(or(Math.atan2(a[6],a[5]))),rotateY:a=>md(or(Math.atan2(-a[2],a[0]))),rotateZ:f2,rotate:f2,skewX:a=>or(Math.atan(a[4])),skewY:a=>or(Math.atan(a[1])),skew:a=>(Math.abs(a[1])+Math.abs(a[4]))/2};function gd(a){return a.includes("scale")?1:0}function yd(a,i){if(!a||a==="none")return gd(i);const l=a.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let u,h;if(l)u=II,h=l;else{const _=a.match(/^matrix\(([-\d.e\s,]+)\)$/u);u=TI,h=_}if(!h)return gd(i);const m=u[i],f=h[1].split(",").map(PI);return typeof m=="function"?m(f):f[m]}const RI=(a,i)=>{const{transform:l="none"}=getComputedStyle(a);return yd(l,i)};function PI(a){return parseFloat(a.trim())}const di=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],hi=new Set(di),y2=a=>a===ui||a===de,DI=new Set(["x","y","z"]),OI=di.filter(a=>!DI.has(a));function NI(a){const i=[];return OI.forEach(l=>{const u=a.getValue(l);u!==void 0&&(i.push([l,u.get()]),u.set(l.startsWith("scale")?1:0))}),i}const As={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})=>yd(i,"x"),y:(a,{transform:i})=>yd(i,"y")};As.translateX=As.x;As.translateY=As.y;const lr=new Set;let _d=!1,bd=!1,vd=!1;function xw(){if(bd){const a=Array.from(lr).filter(u=>u.needsMeasurement),i=new Set(a.map(u=>u.element)),l=new Map;i.forEach(u=>{const h=NI(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)})}bd=!1,_d=!1,lr.forEach(a=>a.complete(vd)),lr.clear()}function Ew(){lr.forEach(a=>{a.readKeyframes(),a.needsMeasurement&&(bd=!0)})}function BI(){vd=!0,Ew(),xw(),vd=!1}class Xd{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?(lr.add(this),_d||(_d=!0,Ye.read(Ew),Ye.resolveKeyframes(xw))):(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])}AI(i)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(i=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,i),lr.delete(this)}cancel(){this.state==="scheduled"&&(lr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const LI=a=>a.startsWith("--");function kw(a,i,l){LI(i)?a.style.setProperty(i,l):a.style[i]=l}const MI={};function Cw(a,i){const l=Q0(a);return()=>MI[i]??l()}const FI=Cw(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Aw=Cw(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),wa=([a,i,l,u])=>`cubic-bezier(${a}, ${i}, ${l}, ${u})`,_2={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:wa([0,.65,.55,1]),circOut:wa([.55,0,1,.45]),backIn:wa([.31,.01,.66,-.59]),backOut:wa([.33,1.53,.69,.99])};function Tw(a,i){if(a)return typeof a=="function"?Aw()?vw(a,i):"ease-out":uw(a)?wa(a):Array.isArray(a)?a.map(l=>Tw(l,i)||_2.easeOut):_2[a]}function $I(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=Tw(_,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 Iw(a){return typeof a=="function"&&"applyToOptions"in a}function UI({type:a,...i}){return Iw(a)&&Aw()?a.applyToOptions(i):(i.duration??(i.duration=300),i.ease??(i.ease="easeOut"),i)}class Rw extends Yd{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,is(typeof i.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const v=UI(i);this.animation=$I(l,u,h,v,m),v.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!m){const w=Kd(h,this.options,_,this.speed);this.updateMotionValue&&this.updateMotionValue(w),kw(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 pn(Number(i))}get iterationDuration(){const{delay:i=0}=this.options||{};return this.duration+pn(i)}get time(){return pn(Number(this.animation.currentTime)||0)}set time(i){const l=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ut(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&&FI()?(this.animation.timeline=i,l&&(this.animation.rangeStart=l),u&&(this.animation.rangeEnd=u),fn):h(this)}}const Pw={anticipate:aw,backInOut:iw,circInOut:lw};function jI(a){return a in Pw}function VI(a){typeof a.ease=="string"&&jI(a.ease)&&(a.ease=Pw[a.ease])}const Yu=10;class HI extends Rw{constructor(i){VI(i),Sw(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 Zd({...f,autoplay:!1}),b=Math.max(Yu,Nt.now()-this.startTime),v=zn(0,Yu,b-Yu),w=_.sample(b).value,{name:E}=this.options;m&&E&&kw(m,E,w),l.setWithVelocity(_.sample(Math.max(0,b-v)).value,w,v),_.stop()}}const b2=(a,i)=>i==="zIndex"?!1:!!(typeof a=="number"||Array.isArray(a)||typeof a=="string"&&(kn.test(a)||a==="0")&&!a.startsWith("url("));function WI(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 zI(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=b2(h,i),_=b2(m,i);return ci(f===_,`You are trying to animate ${i} from "${h}" to "${m}". "${f?m:h}" is not an animatable value.`,"value-not-animatable"),!f||!_?!1:WI(a)||(l==="spring"||Iw(l))&&u}function wd(a){a.duration=0,a.type="keyframes"}const qI=new Set(["opacity","clipPath","filter","transform"]),GI=Q0(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function KI(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 GI()&&l&&qI.has(l)&&(l!=="transform"||!v)&&!b&&!u&&h!=="mirror"&&m!==0&&f!=="inertia"}const YI=40;class ZI extends Yd{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 I;super(),this.stop=()=>{var M,B;this._animation&&(this._animation.stop(),(M=this.stopTimeline)==null||M.call(this)),(B=this.keyframeResolver)==null||B.cancel()},this.createdAt=Nt.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)||Xd;this.keyframeResolver=new R(_,(M,B,N)=>this.onKeyframesResolved(M,B,A,!N),b,v,w),(I=this.keyframeResolver)==null||I.scheduleResolve()}onKeyframesResolved(i,l,u,h){var B,N;this.keyframeResolver=void 0;const{name:m,type:f,velocity:_,delay:b,isHandoff:v,onUpdate:w}=u;this.resolvedAt=Nt.now(),zI(i,m,f,_)||((as.instantAnimations||!b)&&(w==null||w(Kd(i,u,l))),i[0]=i[i.length-1],wd(u),u.repeat=0);const A={startTime:h?this.resolvedAt?this.resolvedAt-this.createdAt>YI?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:l,...u,keyframes:i},R=!v&&KI(A),I=(N=(B=A.motionValue)==null?void 0:B.owner)==null?void 0:N.current,M=R?new HI({...A,element:I}):new Zd(A);M.finished.then(()=>{this.notifyFinished()}).catch(fn),this.pendingTimeline&&(this.stopTimeline=M.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=M}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(),BI()),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 Dw(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 XI=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function JI(a){const i=XI.exec(a);if(!i)return[,];const[,l,u,h]=i;return[`--${l??u}`,h]}const QI=4;function Ow(a,i,l=1){is(l<=QI,`Max CSS variable fallback depth detected in property "${a}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[u,h]=JI(a);if(!u)return;const m=window.getComputedStyle(i).getPropertyValue(u);if(m){const f=m.trim();return Z0(f)?parseFloat(f):f}return Hd(h)?Ow(h,i,l+1):h}const eR={type:"spring",stiffness:500,damping:25,restSpeed:10},tR=a=>({type:"spring",stiffness:550,damping:a===0?2*Math.sqrt(550):30,restSpeed:10}),nR={type:"keyframes",duration:.8},sR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},rR=(a,{keyframes:i})=>i.length>2?nR:hi.has(a)?a.startsWith("scale")?tR(i[1]):eR:sR,iR=a=>a!==null;function aR(a,{repeat:i,repeatType:l="loop"},u){const h=a.filter(iR),m=i&&l!=="loop"&&i%2===1?0:h.length-1;return h[m]}function Nw(a,i){if(a!=null&&a.inherit&&i){const{inherit:l,...u}=a;return{...i,...u}}return a}function Jd(a,i){const l=(a==null?void 0:a[i])??(a==null?void 0:a.default)??a;return l!==a?Nw(l,a):l}function oR({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 Qd=(a,i,l,u={},h,m)=>f=>{const _=Jd(u,a)||{},b=_.delay||u.delay||0;let{elapsed:v=0}=u;v=v-Ut(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};oR(_)||Object.assign(w,rR(a,w)),w.duration&&(w.duration=Ut(w.duration)),w.repeatDelay&&(w.repeatDelay=Ut(w.repeatDelay)),w.from!==void 0&&(w.keyframes[0]=w.from);let E=!1;if((w.type===!1||w.duration===0&&!w.repeatDelay)&&(wd(w),w.delay===0&&(E=!0)),(as.instantAnimations||as.skipAnimations||h!=null&&h.shouldSkipAnimations)&&(E=!0,wd(w),w.delay=0),w.allowFlatten=!_.type&&!_.ease,E&&!m&&i.get()!==void 0){const A=aR(w.keyframes,_);if(A!==void 0){Ye.update(()=>{w.onUpdate(A),w.onComplete()});return}}return _.isSync?new Zd(w):new ZI(w)};function v2(a){const i=[{},{}];return a==null||a.values.forEach((l,u)=>{i[0][u]=l.get(),i[1][u]=l.getVelocity()}),i}function eh(a,i,l,u){if(typeof i=="function"){const[h,m]=v2(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]=v2(u);i=i(l!==void 0?l:a.custom,h,m)}return i}function ai(a,i,l){const u=a.getProps();return eh(u,i,l!==void 0?l:u.custom,a)}const Bw=new Set(["width","height","top","left","right","bottom",...di]),w2=30,lR=a=>!isNaN(parseFloat(a));class cR{constructor(i,l={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=u=>{var m;const h=Nt.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=Nt.now(),this.canTrackVelocity===null&&i!==void 0&&(this.canTrackVelocity=lR(this.current))}setPrevFrameValue(i=this.current){this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt}onChange(i){return process.env.NODE_ENV!=="production"&&Ud(!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 $d);const u=this.events[i].add(l);return i==="change"?()=>{u(),Ye.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=Nt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||i-this.updatedAt>w2)return 0;const l=Math.min(this.updatedAt-this.prevUpdatedAt,w2);return ew(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 li(a,i){return new cR(a,i)}const Sd=a=>Array.isArray(a);function uR(a,i,l){a.hasValue(i)?a.getValue(i).set(l):a.addValue(i,li(l))}function dR(a){return Sd(a)?a[a.length-1]||0:a}function hR(a,i){const l=ai(a,i);let{transitionEnd:u={},transition:h={},...m}=l||{};m={...m,...u};for(const f in m){const _=dR(m[f]);uR(a,f,_)}}const Tt=a=>!!(a&&a.getVelocity);function pR(a){return!!(Tt(a)&&a.add)}function xd(a,i){const l=a.getValue("willChange");if(pR(l))return l.add(i);if(!l&&as.WillChange){const u=new as.WillChange("auto");a.addValue("willChange",u),u.add(i)}}function th(a){return a.replace(/([A-Z])/g,i=>`-${i.toLowerCase()}`)}const fR="framerAppearId",Lw="data-"+th(fR);function Mw(a){return a.props[Lw]}function mR({protectedKeys:a,needsAnimating:i},l){const u=a.hasOwnProperty(l)&&i[l]!==!0;return i[l]=!1,u}function Fw(a,i,{delay:l=0,transitionOverride:u,type:h}={}){let{transition:m,transitionEnd:f,..._}=i;const b=a.getDefaultTransition();m=m?Nw(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),I=_[A];if(I===void 0||E&&mR(E,A))continue;const M={delay:l,...Jd(m||{},A)},B=R.get();if(B!==void 0&&!R.isAnimating&&!Array.isArray(I)&&I===B&&!M.velocity)continue;let N=!1;if(window.MotionHandoffAnimation){const Y=Mw(a);if(Y){const se=window.MotionHandoffAnimation(Y,A,Ye);se!==null&&(M.startTime=se,N=!0)}}xd(a,A);const z=v??a.shouldReduceMotion;R.start(Qd(A,R,I,z&&Bw.has(A)?{type:!1}:M,a,N));const U=R.animation;U&&w.push(U)}if(f){const A=()=>Ye.update(()=>{f&&hR(a,f)});w.length?Promise.all(w).then(A):A()}return w}function Ed(a,i,l={}){var b;const u=ai(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(Fw(a,u,l)):()=>Promise.resolve(),f=a.variantChildren&&a.variantChildren.size?(v=0)=>{const{delayChildren:w=0,staggerChildren:E,staggerDirection:A}=h;return gR(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 gR(a,i,l=0,u=0,h=0,m=1,f){const _=[];for(const b of a.variantChildren)b.notify("AnimationStart",i),_.push(Ed(b,i,{...f,delay:l+(typeof u=="function"?0:u)+Dw(a.variantChildren,b,u,h,m)}).then(()=>b.notify("AnimationComplete",i)));return Promise.all(_)}function yR(a,i,l={}){a.notify("AnimationStart",i);let u;if(Array.isArray(i)){const h=i.map(m=>Ed(a,m,l));u=Promise.all(h)}else if(typeof i=="string")u=Ed(a,i,l);else{const h=typeof i=="function"?ai(a,i,l.custom):i;u=Promise.all(Fw(a,h,l))}return u.then(()=>{a.notify("AnimationComplete",i)})}const _R={test:a=>a==="auto",parse:a=>a},$w=a=>i=>i.test(a),Uw=[ui,de,Wn,ks,WT,HT,_R],S2=a=>Uw.find($w(a));function bR(a){return typeof a=="number"?a===0:a!==null?a==="none"||a==="0"||J0(a):!0}const vR=new Set(["brightness","contrast","saturate","opacity"]);function wR(a){const[i,l]=a.slice(0,-1).split("(");if(i==="drop-shadow")return a;const[u]=l.match(Wd)||[];if(!u)return a;const h=l.replace(u,"");let m=vR.has(i)?1:0;return u!==l&&(m*=100),i+"("+m+h+")"}const SR=/\b([a-z-]*)\(.*?\)/gu,kd={...kn,getAnimatableNone:a=>{const i=a.match(SR);return i?i.map(wR).join(" "):a}},Cd={...kn,getAnimatableNone:a=>{const i=kn.parse(a);return kn.createTransformer(a)(i.map(u=>typeof u=="number"?0:typeof u=="object"?{...u,alpha:1}:u))}},x2={...ui,transform:Math.round},xR={rotate:ks,rotateX:ks,rotateY:ks,rotateZ:ks,scale:zo,scaleX:zo,scaleY:zo,scaleZ:zo,skew:ks,skewX:ks,skewY:ks,distance:de,translateX:de,translateY:de,translateZ:de,x:de,y:de,z:de,perspective:de,transformPerspective:de,opacity:Ca,originX:c2,originY:c2,originZ:de},nh={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,...xR,zIndex:x2,fillOpacity:Ca,strokeOpacity:Ca,numOctaves:x2},ER={...nh,color:ft,backgroundColor:ft,outlineColor:ft,fill:ft,stroke:ft,borderColor:ft,borderTopColor:ft,borderRightColor:ft,borderBottomColor:ft,borderLeftColor:ft,filter:kd,WebkitFilter:kd,mask:Cd,WebkitMask:Cd},jw=a=>ER[a],kR=new Set([kd,Cd]);function Vw(a,i){let l=jw(a);return kR.has(l)||(l=kn),l.getAnimatableNone?l.getAnimatableNone(i):void 0}const CR=new Set(["auto","none","0"]);function AR(a,i,l){let u=0,h;for(;u<a.length&&!h;){const m=a[u];typeof m=="string"&&!CR.has(m)&&oi(m).values.length&&(h=a[u]),u++}if(h&&l)for(const m of i)a[m]=Vw(l,h)}class TR extends Xd{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(),Hd(E))){const A=Ow(E,l.current);A!==void 0&&(i[w]=A),w===i.length-1&&(this.finalKeyframe=E)}}if(this.resolveNoneKeyframes(),!Bw.has(u)||i.length!==2)return;const[h,m]=i,f=S2(h),_=S2(m),b=l2(h),v=l2(m);if(b!==v&&As[u]){this.needsMeasurement=!0;return}if(f!==_)if(y2(f)&&y2(_))for(let w=0;w<i.length;w++){const E=i[w];typeof E=="string"&&(i[w]=parseFloat(E))}else As[u]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:i,name:l}=this,u=[];for(let h=0;h<i.length;h++)(i[h]===null||bR(i[h]))&&u.push(h);u.length&&AR(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=As[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]=As[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 IR=new Set(["opacity","clipPath","filter","transform"]);function Hw(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 Ww=(a,i)=>i&&typeof a=="number"?i.transform(a):a;function RR(a){return X0(a)&&"offsetHeight"in a}const{schedule:sh}=dw(queueMicrotask,!1),xn={x:!1,y:!1};function zw(){return xn.x||xn.y}function PR(a){return a==="x"||a==="y"?xn[a]?null:(xn[a]=!0,()=>{xn[a]=!1}):xn.x||xn.y?null:(xn.x=xn.y=!0,()=>{xn.x=xn.y=!1})}function qw(a,i){const l=Hw(a),u=new AbortController,h={passive:!0,...i,signal:u.signal};return[l,h,()=>u.abort()]}function DR(a){return!(a.pointerType==="touch"||zw())}function OR(a,i,l={}){const[u,h,m]=qw(a,l);return u.forEach(f=>{let _=!1,b=!1,v;const w=()=>{f.removeEventListener("pointerleave",I)},E=B=>{v&&(v(B),v=void 0),w()},A=B=>{_=!1,window.removeEventListener("pointerup",A),window.removeEventListener("pointercancel",A),b&&(b=!1,E(B))},R=()=>{_=!0,window.addEventListener("pointerup",A,h),window.addEventListener("pointercancel",A,h)},I=B=>{if(B.pointerType!=="touch"){if(_){b=!0;return}E(B)}},M=B=>{if(!DR(B))return;b=!1;const N=i(f,B);typeof N=="function"&&(v=N,f.addEventListener("pointerleave",I,h))};f.addEventListener("pointerenter",M,h),f.addEventListener("pointerdown",R,h)}),m}const Gw=(a,i)=>i?a===i?!0:Gw(a,i.parentElement):!1,rh=a=>a.pointerType==="mouse"?typeof a.button!="number"||a.button<=0:a.isPrimary!==!1,NR=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function BR(a){return NR.has(a.tagName)||a.isContentEditable===!0}const LR=new Set(["INPUT","SELECT","TEXTAREA"]);function MR(a){return LR.has(a.tagName)||a.isContentEditable===!0}const el=new WeakSet;function E2(a){return i=>{i.key==="Enter"&&a(i)}}function Zu(a,i){a.dispatchEvent(new PointerEvent("pointer"+i,{isPrimary:!0,bubbles:!0}))}const FR=(a,i)=>{const l=a.currentTarget;if(!l)return;const u=E2(()=>{if(el.has(l))return;Zu(l,"down");const h=E2(()=>{Zu(l,"up")}),m=()=>Zu(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 k2(a){return rh(a)&&!zw()}const C2=new WeakSet;function $R(a,i,l={}){const[u,h,m]=qw(a,l),f=_=>{const b=_.currentTarget;if(!k2(_)||C2.has(_))return;el.add(b),l.stopPropagation&&C2.add(_);const v=i(b,_),w=(R,I)=>{window.removeEventListener("pointerup",E),window.removeEventListener("pointercancel",A),el.has(b)&&el.delete(b),k2(R)&&typeof v=="function"&&v(R,{success:I})},E=R=>{w(R,b===window||b===document||l.useGlobalTarget||Gw(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),RR(_)&&(_.addEventListener("focus",v=>FR(v,h)),!BR(_)&&!_.hasAttribute("tabindex")&&(_.tabIndex=0))}),m}function ih(a){return X0(a)&&"ownerSVGElement"in a}const tl=new WeakMap;let Cs;const Kw=(a,i,l)=>(u,h)=>h&&h[0]?h[0][a+"Size"]:ih(u)&&"getBBox"in u?u.getBBox()[i]:u[l],UR=Kw("inline","width","offsetWidth"),jR=Kw("block","height","offsetHeight");function VR({target:a,borderBoxSize:i}){var l;(l=tl.get(a))==null||l.forEach(u=>{u(a,{get width(){return UR(a,i)},get height(){return jR(a,i)}})})}function HR(a){a.forEach(VR)}function WR(){typeof ResizeObserver>"u"||(Cs=new ResizeObserver(HR))}function zR(a,i){Cs||WR();const l=Hw(a);return l.forEach(u=>{let h=tl.get(u);h||(h=new Set,tl.set(u,h)),h.add(i),Cs==null||Cs.observe(u)}),()=>{l.forEach(u=>{const h=tl.get(u);h==null||h.delete(i),h!=null&&h.size||Cs==null||Cs.unobserve(u)})}}const nl=new Set;let ei;function qR(){ei=()=>{const a={get width(){return window.innerWidth},get height(){return window.innerHeight}};nl.forEach(i=>i(a))},window.addEventListener("resize",ei)}function GR(a){return nl.add(a),ei||qR(),()=>{nl.delete(a),!nl.size&&typeof ei=="function"&&(window.removeEventListener("resize",ei),ei=void 0)}}function A2(a,i){return typeof a=="function"?GR(a):zR(a,i)}function KR(a){return ih(a)&&a.tagName==="svg"}const YR=[...Uw,ft,kn],ZR=a=>YR.find($w(a)),T2=()=>({translate:0,scale:1,origin:0,originPoint:0}),ti=()=>({x:T2(),y:T2()}),I2=()=>({min:0,max:0}),yt=()=>({x:I2(),y:I2()}),XR=new WeakMap;function gl(a){return a!==null&&typeof a=="object"&&typeof a.start=="function"}function Aa(a){return typeof a=="string"||Array.isArray(a)}const ah=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],oh=["initial",...ah];function yl(a){return gl(a.animate)||oh.some(i=>Aa(a[i]))}function Yw(a){return!!(yl(a)||a.variants)}function JR(a,i,l){for(const u in i){const h=i[u],m=l[u];if(Tt(h))a.addValue(u,h);else if(Tt(m))a.addValue(u,li(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,li(f!==void 0?f:h,{owner:a}))}}for(const u in l)i[u]===void 0&&a.removeValue(u);return i}const Ad={current:null},Zw={current:!1},QR=typeof window<"u";function eP(){if(Zw.current=!0,!!QR)if(window.matchMedia){const a=window.matchMedia("(prefers-reduced-motion)"),i=()=>Ad.current=a.matches;a.addEventListener("change",i),i()}else Ad.current=!1}const R2=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let dl={};function Xw(a){dl=a}function tP(){return dl}class nP{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=Xd,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=Nt.now();this.renderScheduledAt<R&&(this.renderScheduledAt=R,Ye.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=yl(l),this.isVariantNode=Yw(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 I=A[R];v[R]!==void 0&&Tt(I)&&I.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,XR.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:(Zw.current||eP(),this.shouldReduceMotion=Ad.current),process.env.NODE_ENV!=="production"&&Ud(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(),Ts(this.notifyUpdate),Ts(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&&IR.has(i)&&this.current instanceof HTMLElement){const{factory:f,keyframes:_,times:b,ease:v,duration:w}=l.accelerate,E=new Rw({element:this.current,name:i,keyframes:_,times:b,ease:v,duration:Ut(w)}),A=f(E);this.valueSubscriptions.set(i,()=>{A(),E.cancel()});return}const u=hi.has(i);u&&this.onBindTransform&&this.onBindTransform();const h=l.on("change",f=>{this.latestValues[i]=f,this.props.onUpdate&&Ye.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 dl){const l=dl[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):yt()}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<R2.length;u++){const h=R2[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=JR(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=li(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"&&(Z0(u)||J0(u))?u=parseFloat(u):!ZR(u)&&kn.test(l)&&(u=Vw(i,l)),this.setBaseTarget(i,Tt(u)?u.get():u)),Tt(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=eh(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&&!Tt(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 $d),this.events[i].add(l)}notify(i,...l){this.events[i]&&this.events[i].notify(...l)}scheduleRenderMicrotask(){sh.render(this.render)}}class Jw extends nP{constructor(){super(...arguments),this.KeyframeResolver=TR}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;Tt(i)&&(this.childSubscription=i.on("change",l=>{this.current&&(this.current.textContent=`${l}`)}))}}class Is{constructor(i){this.isMounted=!1,this.node=i}update(){}}function Qw({top:a,left:i,right:l,bottom:u}){return{x:{min:i,max:l},y:{min:a,max:u}}}function sP({x:a,y:i}){return{top:i.min,right:a.max,bottom:i.max,left:a.min}}function rP(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 Xu(a){return a===void 0||a===1}function Td({scale:a,scaleX:i,scaleY:l}){return!Xu(a)||!Xu(i)||!Xu(l)}function ir(a){return Td(a)||eS(a)||a.z||a.rotate||a.rotateX||a.rotateY||a.skewX||a.skewY}function eS(a){return P2(a.x)||P2(a.y)}function P2(a){return a&&a!=="0%"}function hl(a,i,l){const u=a-l,h=i*u;return l+h}function D2(a,i,l,u,h){return h!==void 0&&(a=hl(a,h,u)),hl(a,l,u)+i}function Id(a,i=0,l=1,u,h){a.min=D2(a.min,i,l,u,h),a.max=D2(a.max,i,l,u,h)}function tS(a,{x:i,y:l}){Id(a.x,i.translate,i.scale,i.originPoint),Id(a.y,l.translate,l.scale,l.originPoint)}const O2=.999999999999,N2=1.0000000000001;function iP(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&&si(a,{x:-m.scroll.offset.x,y:-m.scroll.offset.y}),f&&(i.x*=f.x.scale,i.y*=f.y.scale,tS(a,f)),u&&ir(m.latestValues)&&si(a,m.latestValues,(_=m.layout)==null?void 0:_.layoutBox))}i.x<N2&&i.x>O2&&(i.x=1),i.y<N2&&i.y>O2&&(i.y=1)}function ni(a,i){a.min=a.min+i,a.max=a.max+i}function B2(a,i,l,u,h=.5){const m=it(a.min,a.max,h);Id(a,i,l,m,u)}function L2(a,i){return typeof a=="string"?parseFloat(a)/100*(i.max-i.min):a}function si(a,i,l){const u=l??a;B2(a.x,L2(i.x,u.x),i.scaleX,i.scale,i.originX),B2(a.y,L2(i.y,u.y),i.scaleY,i.scale,i.originY)}function nS(a,i){return Qw(rP(a.getBoundingClientRect(),i))}function aP(a,i,l){const u=nS(a,l),{scroll:h}=i;return h&&(ni(u.x,h.offset.x),ni(u.y,h.offset.y)),u}const oP={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},lP=di.length;function cP(a,i,l){let u="",h=!0;for(let m=0;m<lP;m++){const f=di[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=Ww(_,nh[f]);if(!b){h=!1;const w=oP[f]||f;u+=`${w}(${v}) `}l&&(i[f]=v)}}return u=u.trim(),l?u=l(i,h?"":u):h&&(u="none"),u}function lh(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(hi.has(b)){f=!0;continue}else if(pw(b)){h[b]=v;continue}else{const w=Ww(v,nh[b]);b.startsWith("origin")?(_=!0,m[b]=w):u[b]=w}}if(i.transform||(f||l?u.transform=cP(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 sS(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 M2(a,i){return i.max===i.min?0:a/(i.max-i.min)*100}const ma={correct:(a,i)=>{if(!i.target)return a;if(typeof a=="string")if(de.test(a))a=parseFloat(a);else return a;const l=M2(a,i.target.x),u=M2(a,i.target.y);return`${l}% ${u}%`}},uP={correct:(a,{treeScale:i,projectionDelta:l})=>{const u=a,h=kn.parse(a);if(h.length>5)return u;const m=kn.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=it(_,b,.5);return typeof h[2+f]=="number"&&(h[2+f]/=v),typeof h[3+f]=="number"&&(h[3+f]/=v),m(h)}},Rd={borderRadius:{...ma,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ma,borderTopRightRadius:ma,borderBottomLeftRadius:ma,borderBottomRightRadius:ma,boxShadow:uP};function rS(a,{layout:i,layoutId:l}){return hi.has(a)||a.startsWith("origin")||(i||l!==void 0)&&(!!Rd[a]||a==="opacity")}function ch(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)(Tt(u[_])||h&&Tt(h[_])||rS(_,a)||((f=l==null?void 0:l.getValue(_))==null?void 0:f.liveStyle)!==void 0)&&(m[_]=u[_]);return m}function dP(a){return window.getComputedStyle(a)}class hP extends Jw{constructor(){super(...arguments),this.type="html",this.renderInstance=sS}readValueFromInstance(i,l){var u;if(hi.has(l))return(u=this.projection)!=null&&u.isProjecting?gd(l):RI(i,l);{const h=dP(i),m=(pw(l)?h.getPropertyValue(l):h[l])||0;return typeof m=="string"?m.trim():m}}measureInstanceViewportBox(i,{transformPagePoint:l}){return nS(i,l)}build(i,l,u){lh(i,l,u.transformTemplate)}scrapeMotionValuesFromProps(i,l,u){return ch(i,l,u)}}const pP={offset:"stroke-dashoffset",array:"stroke-dasharray"},fP={offset:"strokeDashoffset",array:"strokeDasharray"};function mP(a,i,l=1,u=0,h=!0){a.pathLength=1;const m=h?pP:fP;a[m.offset]=`${-u}`,a[m.array]=`${i} ${l}`}const gP=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function iS(a,{attrX:i,attrY:l,attrScale:u,pathLength:h,pathSpacing:m=1,pathOffset:f=0,..._},b,v,w){if(lh(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 gP)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&&mP(E,h,m,f,!1)}const aS=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"]),oS=a=>typeof a=="string"&&a.toLowerCase()==="svg";function yP(a,i,l,u){sS(a,i,void 0,u);for(const h in i.attrs)a.setAttribute(aS.has(h)?h:th(h),i.attrs[h])}function lS(a,i,l){const u=ch(a,i,l);for(const h in a)if(Tt(a[h])||Tt(i[h])){const m=di.indexOf(h)!==-1?"attr"+h.charAt(0).toUpperCase()+h.substring(1):h;u[m]=a[h]}return u}class _P extends Jw{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yt}getBaseTargetFromProps(i,l){return i[l]}readValueFromInstance(i,l){if(hi.has(l)){const u=jw(l);return u&&u.default||0}return l=aS.has(l)?l:th(l),i.getAttribute(l)}scrapeMotionValuesFromProps(i,l,u){return lS(i,l,u)}build(i,l,u){iS(i,l,this.isSVGTag,u.transformTemplate,u.style)}renderInstance(i,l,u,h){yP(i,l,u,h)}mount(i){this.isSVGTag=oS(i.tagName),super.mount(i)}}const bP=oh.length;function cS(a){if(!a)return;if(!a.isControllingVariants){const l=a.parent?cS(a.parent)||{}:{};return a.props.initial!==void 0&&(l.initial=a.props.initial),l}const i={};for(let l=0;l<bP;l++){const u=oh[l],h=a.props[u];(Aa(h)||h===!1)&&(i[u]=h)}return i}function uS(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 vP=[...ah].reverse(),wP=ah.length;function SP(a){return i=>Promise.all(i.map(({animation:l,options:u})=>yR(a,l,u)))}function xP(a){let i=SP(a),l=F2(),u=!0,h=!1;const m=v=>(w,E)=>{var R;const A=ai(a,E,v==="exit"?(R=a.presenceContext)==null?void 0:R.custom:void 0);if(A){const{transition:I,transitionEnd:M,...B}=A;w={...w,...B,...M}}return w};function f(v){i=v(a)}function _(v){const{props:w}=a,E=cS(a.parent)||{},A=[],R=new Set;let I={},M=1/0;for(let N=0;N<wP;N++){const z=vP[N],U=l[z],Y=w[z]!==void 0?w[z]:E[z],se=Aa(Y),ge=z===v?U.isActive:null;ge===!1&&(M=N);let ee=Y===E[z]&&Y!==w[z]&&se;if(ee&&(u||h)&&a.manuallyAnimateOnMount&&(ee=!1),U.protectedKeys={...I},!U.isActive&&ge===null||!Y&&!U.prevProp||gl(Y)||typeof Y=="boolean")continue;if(z==="exit"&&U.isActive&&ge!==!0){U.prevResolvedValues&&(I={...I,...U.prevResolvedValues});continue}const ae=EP(U.prevProp,Y);let Oe=ae||z===v&&U.isActive&&!ee&&se||N>M&&se,oe=!1;const je=Array.isArray(Y)?Y:[Y];let re=je.reduce(m(z),{});ge===!1&&(re={});const{prevResolvedValues:be={}}=U,Me={...be,...re},xe=Re=>{Oe=!0,R.has(Re)&&(oe=!0,R.delete(Re)),U.needsAnimating[Re]=!0;const tt=a.getValue(Re);tt&&(tt.liveStyle=!1)};for(const Re in Me){const tt=re[Re],ie=be[Re];if(I.hasOwnProperty(Re))continue;let pe=!1;Sd(tt)&&Sd(ie)?pe=!uS(tt,ie):pe=tt!==ie,pe?tt!=null?xe(Re):R.add(Re):tt!==void 0&&R.has(Re)?xe(Re):U.protectedKeys[Re]=!0}U.prevProp=Y,U.prevResolvedValues=re,U.isActive&&(I={...I,...re}),(u||h)&&a.blockInitialAnimation&&(Oe=!1);const Ce=ee&&ae;Oe&&(!Ce||oe)&&A.push(...je.map(Re=>{const tt={type:z};if(typeof Re=="string"&&(u||h)&&!Ce&&a.manuallyAnimateOnMount&&a.parent){const{parent:ie}=a,pe=ai(ie,Re);if(ie.enteringChildren&&pe){const{delayChildren:ve}=pe.transition||{};tt.delay=Dw(ie.enteringChildren,a,ve)}}return{animation:Re,options:tt}}))}if(R.size){const N={};if(typeof w.initial!="boolean"){const z=ai(a,Array.isArray(w.initial)?w.initial[0]:w.initial);z&&z.transition&&(N.transition=z.transition)}R.forEach(z=>{const U=a.getBaseTarget(z),Y=a.getValue(z);Y&&(Y.liveStyle=!0),N[z]=U??null}),A.push({animation:N})}let B=!!A.length;return u&&(w.initial===!1||w.initial===w.animate)&&!a.manuallyAnimateOnMount&&(B=!1),u=!1,h=!1,B?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 I;return(I=R.animationState)==null?void 0:I.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=F2(),h=!0}}}function EP(a,i){return typeof i=="string"?i!==a:Array.isArray(i)?!uS(i,a):!1}function tr(a=!1){return{isActive:a,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function F2(){return{animate:tr(!0),whileInView:tr(),whileHover:tr(),whileTap:tr(),whileDrag:tr(),whileFocus:tr(),exit:tr()}}function $2(a,i){a.min=i.min,a.max=i.max}function bn(a,i){$2(a.x,i.x),$2(a.y,i.y)}function U2(a,i){a.translate=i.translate,a.scale=i.scale,a.originPoint=i.originPoint,a.origin=i.origin}const dS=1e-4,kP=1-dS,CP=1+dS,hS=.01,AP=0-hS,TP=0+hS;function Bt(a){return a.max-a.min}function IP(a,i,l){return Math.abs(a-i)<=l}function j2(a,i,l,u=.5){a.origin=u,a.originPoint=it(i.min,i.max,a.origin),a.scale=Bt(l)/Bt(i),a.translate=it(l.min,l.max,a.origin)-a.originPoint,(a.scale>=kP&&a.scale<=CP||isNaN(a.scale))&&(a.scale=1),(a.translate>=AP&&a.translate<=TP||isNaN(a.translate))&&(a.translate=0)}function xa(a,i,l,u){j2(a.x,i.x,l.x,u?u.originX:void 0),j2(a.y,i.y,l.y,u?u.originY:void 0)}function V2(a,i,l){a.min=l.min+i.min,a.max=a.min+Bt(i)}function RP(a,i,l){V2(a.x,i.x,l.x),V2(a.y,i.y,l.y)}function H2(a,i,l){a.min=i.min-l.min,a.max=a.min+Bt(i)}function pl(a,i,l){H2(a.x,i.x,l.x),H2(a.y,i.y,l.y)}function W2(a,i,l,u,h){return a-=i,a=hl(a,1/l,u),h!==void 0&&(a=hl(a,1/h,u)),a}function PP(a,i=0,l=1,u=.5,h,m=a,f=a){if(Wn.test(i)&&(i=parseFloat(i),i=it(f.min,f.max,i/100)-f.min),typeof i!="number")return;let _=it(m.min,m.max,u);a===m&&(_-=i),a.min=W2(a.min,i,l,_,h),a.max=W2(a.max,i,l,_,h)}function z2(a,i,[l,u,h],m,f){PP(a,i[l],i[u],i[h],i.scale,m,f)}const DP=["x","scaleX","originX"],OP=["y","scaleY","originY"];function q2(a,i,l,u){z2(a.x,i,DP,l?l.x:void 0,u?u.x:void 0),z2(a.y,i,OP,l?l.y:void 0,u?u.y:void 0)}function G2(a){return a.translate===0&&a.scale===1}function pS(a){return G2(a.x)&&G2(a.y)}function K2(a,i){return a.min===i.min&&a.max===i.max}function NP(a,i){return K2(a.x,i.x)&&K2(a.y,i.y)}function Y2(a,i){return Math.round(a.min)===Math.round(i.min)&&Math.round(a.max)===Math.round(i.max)}function fS(a,i){return Y2(a.x,i.x)&&Y2(a.y,i.y)}function Z2(a){return Bt(a.x)/Bt(a.y)}function X2(a,i){return a.translate===i.translate&&a.scale===i.scale&&a.originPoint===i.originPoint}function Hn(a){return[a("x"),a("y")]}function BP(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:I}=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) `),I&&(u+=`skewY(${I}deg) `)}const _=a.x.scale*i.x,b=a.y.scale*i.y;return(_!==1||b!==1)&&(u+=`scale(${_}, ${b})`),u||"none"}const mS=["TopLeft","TopRight","BottomLeft","BottomRight"],LP=mS.length,J2=a=>typeof a=="string"?parseFloat(a):a,Q2=a=>typeof a=="number"||de.test(a);function MP(a,i,l,u,h,m){h?(a.opacity=it(0,l.opacity??1,FP(u)),a.opacityExit=it(i.opacity??1,0,$P(u))):m&&(a.opacity=it(i.opacity??1,l.opacity??1,u));for(let f=0;f<LP;f++){const _=`border${mS[f]}Radius`;let b=e0(i,_),v=e0(l,_);if(b===void 0&&v===void 0)continue;b||(b=0),v||(v=0),b===0||v===0||Q2(b)===Q2(v)?(a[_]=Math.max(it(J2(b),J2(v),u),0),(Wn.test(v)||Wn.test(b))&&(a[_]+="%")):a[_]=v}(i.rotate||l.rotate)&&(a.rotate=it(i.rotate||0,l.rotate||0,u))}function e0(a,i){return a[i]!==void 0?a[i]:a.borderRadius}const FP=gS(0,.5,ow),$P=gS(.5,.95,fn);function gS(a,i,l){return u=>u<a?0:u>i?1:l(ka(a,i,u))}function UP(a,i,l){const u=Tt(a)?a:li(a);return u.start(Qd("",u,i,l)),u.animation}function Ta(a,i,l,u={passive:!0}){return a.addEventListener(i,l,u),()=>a.removeEventListener(i,l)}const jP=(a,i)=>a.depth-i.depth;class VP{constructor(){this.children=[],this.isDirty=!1}add(i){Fd(this.children,i),this.isDirty=!0}remove(i){ol(this.children,i),this.isDirty=!0}forEach(i){this.isDirty&&this.children.sort(jP),this.isDirty=!1,this.children.forEach(i)}}function HP(a,i){const l=Nt.now(),u=({timestamp:h})=>{const m=h-l;m>=i&&(Ts(u),a(m-i))};return Ye.setup(u,!0),()=>Ts(u)}function sl(a){return Tt(a)?a.get():a}class WP{constructor(){this.members=[]}add(i){Fd(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&&(ol(this.members,u),u.unmount())}i.scheduleRender()}remove(i){if(ol(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 rl={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ju=["","X","Y","Z"],zP=1e3;let qP=0;function Qu(a,i,l,u){const{latestValues:h}=i;h[a]&&(l[a]=h[a],i.setStaticValue(a,0),u&&(u[a]=0))}function yS(a){if(a.hasCheckedOptimisedAppear=!0,a.root===a)return;const{visualElement:i}=a.options;if(!i)return;const l=Mw(i);if(window.MotionHasOptimisedAnimation(l,"transform")){const{layout:h,layoutId:m}=a.options;window.MotionCancelOptimisedAnimation(l,"transform",Ye,!(h||m))}const{parent:u}=a;u&&!u.hasCheckedOptimisedAppear&&yS(u)}function _S({attachResizeListener:a,defaultParent:i,measureScroll:l,checkIsScrollRoot:u,resetTransform:h}){return class{constructor(f={},_=i==null?void 0:i()){this.id=qP++,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(YP),this.nodes.forEach(QP),this.nodes.forEach(eD),this.nodes.forEach(ZP)},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 VP)}addEventListener(f,_){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new $d),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=ih(f)&&!KR(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;Ye.read(()=>{E=window.innerWidth}),a(f,()=>{const R=window.innerWidth;R!==E&&(E=R,this.root.updateBlockedByResize=!0,w&&w(),w=HP(A,250),rl.hasAnimatedSinceResize&&(rl.hasAnimatedSinceResize=!1,this.nodes.forEach(s0)))})}_&&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 I=this.options.transition||v.getDefaultTransition()||iD,{onLayoutAnimationStart:M,onLayoutAnimationComplete:B}=v.getProps(),N=!this.targetLayout||!fS(this.targetLayout,R),z=!E&&A;if(this.options.layoutRoot||this.resumeFrom||z||E&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const U={...Jd(I,"layout"),onPlay:M,onComplete:B};(v.shouldReduceMotion||this.options.layoutRoot)&&(U.delay=0,U.type=!1),this.startAnimation(U),this.setAnimationOrigin(w,z)}else E||s0(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(),Ts(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(tD),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&&yS(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(t0);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(n0);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(JP),this.nodes.forEach(GP),this.nodes.forEach(KP)):this.nodes.forEach(n0),this.clearAllSnapshots();const _=Nt.now();xt.delta=zn(0,1e3/60,_-xt.timestamp),xt.timestamp=_,xt.isProcessing=!0,Wu.update.process(xt),Wu.preRender.process(xt),Wu.render.process(xt),xt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,sh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(XP),this.sharedNodes.forEach(nD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ye.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ye.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Bt(this.snapshot.measuredBox.x)&&!Bt(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=yt(),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&&!pS(this.projectionDelta),b=this.getTransformTemplate(),v=b?b(this.latestValues,""):void 0,w=v!==this.prevTransformTemplateValue;f&&this.instance&&(_||ir(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)),aD(b),{animationId:this.root.animationId,measuredBox:_,layoutBox:b,latestValues:{},source:this.id}}measurePageBox(){var v;const{visualElement:f}=this.options;if(!f)return yt();const _=f.measureViewportBox();if(!(((v=this.scroll)==null?void 0:v.wasRoot)||this.path.some(oD))){const{scroll:w}=this.root;w&&(ni(_.x,w.offset.x),ni(_.y,w.offset.y))}return _}removeElementScroll(f){var b;const _=yt();if(bn(_,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&&bn(_,f),ni(_.x,E.offset.x),ni(_.y,E.offset.y))}return _}applyTransform(f,_=!1){var v,w;const b=yt();bn(b,f);for(let E=0;E<this.path.length;E++){const A=this.path[E];!_&&A.options.layoutScroll&&A.scroll&&A!==A.root&&si(b,{x:-A.scroll.offset.x,y:-A.scroll.offset.y}),ir(A.latestValues)&&si(b,A.latestValues,(v=A.layout)==null?void 0:v.layoutBox)}return ir(this.latestValues)&&si(b,this.latestValues,(w=this.layout)==null?void 0:w.layoutBox),b}removeTransform(f){var b;const _=yt();bn(_,f);for(let v=0;v<this.path.length;v++){const w=this.path[v];if(!ir(w.latestValues))continue;let E;w.instance&&(Td(w.latestValues)&&w.updateSnapshot(),E=yt(),bn(E,w.measurePageBox())),q2(_,w.latestValues,(b=w.snapshot)==null?void 0:b.layoutBox,E)}return ir(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!==xt.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=xt.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=yt(),this.targetWithTransforms=yt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),RP(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):bn(this.target,this.layout.layoutBox),tS(this.target,this.targetDelta)):bn(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||Td(this.parent.latestValues)||eS(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=yt(),this.relativeTargetOrigin=yt(),pl(this.relativeTargetOrigin,_,b),bn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var I;const f=this.getLead(),_=!!this.resumingFrom||this!==f;let b=!0;if((this.isProjectionDirty||(I=this.parent)!=null&&I.isProjectionDirty)&&(b=!1),_&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(b=!1),this.resolvedRelativeTargetAt===xt.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;bn(this.layoutCorrected,this.layout.layoutBox);const E=this.treeScale.x,A=this.treeScale.y;iP(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=yt());const{target:R}=f;if(!R){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(U2(this.prevProjectionDelta.x,this.projectionDelta.x),U2(this.prevProjectionDelta.y,this.projectionDelta.y)),xa(this.projectionDelta,this.layoutCorrected,R,this.latestValues),(this.treeScale.x!==E||this.treeScale.y!==A||!X2(this.projectionDelta.x,this.prevProjectionDelta.x)||!X2(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=ti(),this.projectionDelta=ti(),this.projectionDeltaWithTransform=ti()}setAnimationOrigin(f,_=!1){const b=this.snapshot,v=b?b.latestValues:{},w={...this.latestValues},E=ti();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!_;const A=yt(),R=b?b.source:void 0,I=this.layout?this.layout.source:void 0,M=R!==I,B=this.getStack(),N=!B||B.members.length<=1,z=!!(M&&!N&&this.options.crossfade===!0&&!this.path.some(rD));this.animationProgress=0;let U;this.mixTargetDelta=Y=>{const se=Y/1e3;r0(E.x,f.x,se),r0(E.y,f.y,se),this.setTargetDelta(E),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(pl(A,this.layout.layoutBox,this.relativeParent.layout.layoutBox),sD(this.relativeTarget,this.relativeTargetOrigin,A,se),U&&NP(this.relativeTarget,U)&&(this.isProjectionDirty=!1),U||(U=yt()),bn(U,this.relativeTarget)),M&&(this.animationValues=w,MP(w,v,this.latestValues,se,z,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=se},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&&(Ts(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ye.update(()=>{rl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=li(0)),this.motionValue.jump(0,!1),this.currentAnimation=UP(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(zP),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&&bS(this.options.animationType,this.layout.layoutBox,v.layoutBox)){b=this.target||yt();const E=Bt(this.layout.layoutBox.x);b.x.min=f.target.x.min,b.x.max=b.x.min+E;const A=Bt(this.layout.layoutBox.y);b.y.min=f.target.y.min,b.y.max=b.y.min+A}bn(_,b),si(_,w),xa(this.projectionDeltaWithTransform,this.layoutCorrected,_,w)}}registerSharedNode(f,_){this.sharedNodes.has(f)||this.sharedNodes.set(f,new WP),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&&Qu("z",f,v,this.animationValues);for(let w=0;w<Ju.length;w++)Qu(`rotate${Ju[w]}`,f,v,this.animationValues),Qu(`skew${Ju[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=sl(_==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=sl(_==null?void 0:_.pointerEvents)||""),this.hasProjected&&!ir(this.latestValues)&&(f.transform=b?b({},""):"none",this.hasProjected=!1);return}f.visibility="";const w=v.animationValues||v.latestValues;this.applyTransformsToTarget();let E=BP(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 I in Rd){if(w[I]===void 0)continue;const{correct:M,applyTo:B,isCSSVariable:N}=Rd[I],z=E==="none"?w[I]:M(w[I],v);if(B){const U=B.length;for(let Y=0;Y<U;Y++)f[B[Y]]=z}else N?this.options.visualElement.renderState.vars[I]=z:f[I]=z}this.options.layoutId&&(f.pointerEvents=v===this?sl(_==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(t0),this.root.sharedNodes.clear()}}}function GP(a){a.updateLayout()}function KP(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"?Hn(E=>{const A=f?i.measuredBox[E]:i.layoutBox[E],R=Bt(A);A.min=u[E].min,A.max=A.min+R}):bS(m,i.layoutBox,u)&&Hn(E=>{const A=f?i.measuredBox[E]:i.layoutBox[E],R=Bt(u[E]);A.max=A.min+R,a.relativeTarget&&!a.currentAnimation&&(a.isProjectionDirty=!0,a.relativeTarget[E].max=a.relativeTarget[E].min+R)});const _=ti();xa(_,u,i.layoutBox);const b=ti();f?xa(b,a.applyTransform(h,!0),i.measuredBox):xa(b,u,i.layoutBox);const v=!pS(_);let w=!1;if(!a.resumeFrom){const E=a.getClosestProjectingParent();if(E&&!E.resumeFrom){const{snapshot:A,layout:R}=E;if(A&&R){const I=yt();pl(I,i.layoutBox,A.layoutBox);const M=yt();pl(M,u,R.layoutBox),fS(I,M)||(w=!0),E.options.layoutRoot&&(a.relativeTarget=M,a.relativeTargetOrigin=I,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 YP(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 ZP(a){a.isProjectionDirty=a.isSharedProjectionDirty=a.isTransformDirty=!1}function XP(a){a.clearSnapshot()}function t0(a){a.clearMeasurements()}function n0(a){a.isLayoutDirty=!1}function JP(a){const{visualElement:i}=a.options;i&&i.getProps().onBeforeLayoutMeasure&&i.notify("BeforeLayoutMeasure"),a.resetTransform()}function s0(a){a.finishAnimation(),a.targetDelta=a.relativeTarget=a.target=void 0,a.isProjectionDirty=!0}function QP(a){a.resolveTargetDelta()}function eD(a){a.calcProjection()}function tD(a){a.resetSkewAndRotation()}function nD(a){a.removeLeadSnapshot()}function r0(a,i,l){a.translate=it(i.translate,0,l),a.scale=it(i.scale,1,l),a.origin=i.origin,a.originPoint=i.originPoint}function i0(a,i,l,u){a.min=it(i.min,l.min,u),a.max=it(i.max,l.max,u)}function sD(a,i,l,u){i0(a.x,i.x,l.x,u),i0(a.y,i.y,l.y,u)}function rD(a){return a.animationValues&&a.animationValues.opacityExit!==void 0}const iD={duration:.45,ease:[.4,0,.1,1]},a0=a=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(a),o0=a0("applewebkit/")&&!a0("chrome/")?Math.round:fn;function l0(a){a.min=o0(a.min),a.max=o0(a.max)}function aD(a){l0(a.x),l0(a.y)}function bS(a,i,l){return a==="position"||a==="preserve-aspect"&&!IP(Z2(i),Z2(l),.2)}function oD(a){var i;return a!==a.root&&((i=a.scroll)==null?void 0:i.wasRoot)}const lD=_S({attachResizeListener:(a,i)=>Ta(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}),ed={current:void 0},vS=_S({measureScroll:a=>({x:a.scrollLeft,y:a.scrollTop}),defaultParent:()=>{if(!ed.current){const a=new lD({});a.mount(window),a.setOptions({layoutScroll:!0}),ed.current=a}return ed.current},resetTransform:(a,i)=>{a.style.transform=i!==void 0?i:"none"},checkIsScrollRoot:a=>window.getComputedStyle(a).position==="fixed"}),wS=K.createContext({transformPagePoint:a=>a,isStatic:!1,reducedMotion:"never"});function cD(a=!0){const i=K.useContext(Md);if(i===null)return[!0,null];const{isPresent:l,onExitComplete:u,register:h}=i,m=K.useId();K.useEffect(()=>{if(a)return h(m)},[a]);const f=K.useCallback(()=>a&&u&&u(m),[m,u,a]);return!l&&u?[!1,f]:[!0]}const SS=K.createContext({strict:!1}),c0={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 u0=!1;function uD(){if(u0)return;const a={};for(const i in c0)a[i]={isEnabled:l=>c0[i].some(u=>!!l[u])};Xw(a),u0=!0}function xS(){return uD(),tP()}function dD(a){const i=xS();for(const l in a)i[l]={...i[l],...a[l]};Xw(i)}const hD=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 fl(a){return a.startsWith("while")||a.startsWith("drag")&&a!=="draggable"||a.startsWith("layout")||a.startsWith("onTap")||a.startsWith("onPan")||a.startsWith("onLayout")||hD.has(a)}let ES=a=>!fl(a);function pD(a){typeof a=="function"&&(ES=i=>i.startsWith("on")?!fl(i):a(i))}try{pD(require("@emotion/is-prop-valid").default)}catch{}function fD(a,i,l){const u={};for(const h in a)h==="values"&&typeof a.values=="object"||(ES(h)||l===!0&&fl(h)||!i&&!fl(h)||a.draggable&&h.startsWith("onDrag"))&&(u[h]=a[h]);return u}const _l=K.createContext({});function mD(a,i){if(yl(a)){const{initial:l,animate:u}=a;return{initial:l===!1||Aa(l)?l:void 0,animate:Aa(u)?u:void 0}}return a.inherit!==!1?i:{}}function gD(a){const{initial:i,animate:l}=mD(a,K.useContext(_l));return K.useMemo(()=>({initial:i,animate:l}),[d0(i),d0(l)])}function d0(a){return Array.isArray(a)?a.join(" "):a}const uh=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function kS(a,i,l){for(const u in i)!Tt(i[u])&&!rS(u,l)&&(a[u]=i[u])}function yD({transformTemplate:a},i){return K.useMemo(()=>{const l=uh();return lh(l,i,a),Object.assign({},l.vars,l.style)},[i])}function _D(a,i){const l=a.style||{},u={};return kS(u,l,a),Object.assign(u,yD(a,i)),u}function bD(a,i){const l={},u=_D(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 CS=()=>({...uh(),attrs:{}});function vD(a,i,l,u){const h=K.useMemo(()=>{const m=CS();return iS(m,i,oS(u),a.transformTemplate,a.style),{...m.attrs,style:{...m.style}}},[i]);if(a.style){const m={};kS(m,a.style,a),h.style={...m,...h.style}}return h}const wD=["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 dh(a){return typeof a!="string"||a.includes("-")?!1:!!(wD.indexOf(a)>-1||/[A-Z]/u.test(a))}function SD(a,i,l,{latestValues:u},h,m=!1,f){const b=(f??dh(a)?vD:bD)(i,u,h,a),v=fD(i,typeof a=="string",m),w=a!==K.Fragment?{...v,...b,ref:l}:{},{children:E}=i,A=K.useMemo(()=>Tt(E)?E.get():E,[E]);return K.createElement(a,{...w,children:A})}function xD({scrapeMotionValuesFromProps:a,createRenderState:i},l,u,h){return{latestValues:ED(l,u,h,a),renderState:i()}}function ED(a,i,l,u){const h={},m=u(a,{});for(const A in m)h[A]=sl(m[A]);let{initial:f,animate:_}=a;const b=yl(a),v=Yw(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"&&!gl(E)){const A=Array.isArray(E)?E:[E];for(let R=0;R<A.length;R++){const I=eh(a,A[R]);if(I){const{transitionEnd:M,transition:B,...N}=I;for(const z in N){let U=N[z];if(Array.isArray(U)){const Y=w?U.length-1:0;U=U[Y]}U!==null&&(h[z]=U)}for(const z in M)h[z]=M[z]}}}return h}const AS=a=>(i,l)=>{const u=K.useContext(_l),h=K.useContext(Md),m=()=>xD(a,i,u,h);return l?m():xT(m)},kD=AS({scrapeMotionValuesFromProps:ch,createRenderState:uh}),CD=AS({scrapeMotionValuesFromProps:lS,createRenderState:CS}),AD=Symbol.for("motionComponentSymbol");function TD(a,i,l){const u=K.useRef(l);K.useInsertionEffect(()=>{u.current=l});const h=K.useRef(null);return K.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 TS=K.createContext({});function Xr(a){return a&&typeof a=="object"&&Object.prototype.hasOwnProperty.call(a,"current")}function ID(a,i,l,u,h,m){var U,Y;const{visualElement:f}=K.useContext(_l),_=K.useContext(SS),b=K.useContext(Md),v=K.useContext(wS),w=v.reducedMotion,E=v.skipAnimations,A=K.useRef(null),R=K.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 I=A.current,M=K.useContext(TS);I&&!I.projection&&h&&(I.type==="html"||I.type==="svg")&&RD(A.current,l,h,M);const B=K.useRef(!1);K.useInsertionEffect(()=>{I&&B.current&&I.update(l,b)});const N=l[Lw],z=K.useRef(!!N&&typeof window<"u"&&!((U=window.MotionHandoffIsComplete)!=null&&U.call(window,N))&&((Y=window.MotionHasOptimisedAnimation)==null?void 0:Y.call(window,N)));return kT(()=>{R.current=!0,I&&(B.current=!0,window.MotionIsMounted=!0,I.updateFeatures(),I.scheduleRenderMicrotask(),z.current&&I.animationState&&I.animationState.animateChanges())}),K.useEffect(()=>{I&&(!z.current&&I.animationState&&I.animationState.animateChanges(),z.current&&(queueMicrotask(()=>{var se;(se=window.MotionHandoffMarkAsComplete)==null||se.call(window,N)}),z.current=!1),I.enteringChildren=void 0)}),I}function RD(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:IS(a.parent)),a.projection.setOptions({layoutId:h,layout:m,alwaysMeasureLayout:!!f||_&&Xr(_),visualElement:a,animationType:typeof m=="string"?m:"both",initialPromotionConfig:u,crossfade:w,layoutScroll:b,layoutRoot:v})}function IS(a){if(a)return a.options.allowProjection!==!1?a.projection:IS(a.parent)}function td(a,{forwardMotionProps:i=!1,type:l}={},u,h){u&&dD(u);const m=l?l==="svg":dh(a),f=m?CD:kD;function _(v,w){let E;const A={...K.useContext(wS),...v,layoutId:PD(v)},{isStatic:R}=A,I=gD(v),M=f(v,R);if(!R&&typeof window<"u"){DD(A,u);const B=OD(A);E=B.MeasureLayout,I.visualElement=ID(a,M,A,h,B.ProjectionNode,m)}return Z.jsxs(_l.Provider,{value:I,children:[E&&I.visualElement?Z.jsx(E,{visualElement:I.visualElement,...A}):null,SD(a,v,TD(M,I.visualElement,w),M,R,i,m)]})}_.displayName=`motion.${typeof a=="string"?a:`create(${a.displayName??a.name??""})`}`;const b=K.forwardRef(_);return b[AD]=a,b}function PD({layoutId:a}){const i=K.useContext(Y0).id;return i&&a!==void 0?i+"-"+a:a}function DD(a,i){const l=K.useContext(SS).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?ci(!1,u,"lazy-strict-mode"):is(!1,u,"lazy-strict-mode")}}function OD(a){const i=xS(),{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 ND(a,i){if(typeof Proxy>"u")return td;const l=new Map,u=(m,f)=>td(m,f,a,i),h=(m,f)=>(process.env.NODE_ENV!=="production"&&Ud(!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,td(f,void 0,a,i)),l.get(f))})}const BD=(a,i)=>i.isSVG??dh(a)?new _P(i):new hP(i,{allowProjection:a!==K.Fragment});class LD extends Is{constructor(i){super(i),i.animationState||(i.animationState=xP(i))}updateAnimationControlsSubscription(){const{animate:i}=this.node.getProps();gl(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 MD=0;class FD extends Is{constructor(){super(...arguments),this.id=MD++}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 $D={animation:{Feature:LD},exit:{Feature:FD}};function Oa(a){return{point:{x:a.pageX,y:a.pageY}}}const UD=a=>i=>rh(i)&&a(i,Oa(i));function Ea(a,i,l,u){return Ta(a,i,UD(l),u)}const RS=({current:a})=>a?a.ownerDocument.defaultView:null,h0=(a,i)=>Math.abs(a-i);function jD(a,i){const l=h0(a.x,i.x),u=h0(a.y,i.y);return Math.sqrt(l**2+u**2)}const p0=new Set(["auto","scroll"]);class PS{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=qo(this.lastRawMoveEventInfo,this.transformPagePoint));const R=nd(this.lastMoveEventInfo,this.history),I=this.startEvent!==null,M=jD(R.offset,{x:0,y:0})>=this.distanceThreshold;if(!I&&!M)return;const{point:B}=R,{timestamp:N}=xt;this.history.push({...B,timestamp:N});const{onStart:z,onMove:U}=this.handlers;I||(z&&z(this.lastMoveEvent,R),this.startEvent=this.lastMoveEvent),U&&U(this.lastMoveEvent,R)},this.handlePointerMove=(R,I)=>{this.lastMoveEvent=R,this.lastRawMoveEventInfo=I,this.lastMoveEventInfo=qo(I,this.transformPagePoint),Ye.update(this.updatePoint,!0)},this.handlePointerUp=(R,I)=>{this.end();const{onEnd:M,onSessionEnd:B,resumeAnimation:N}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&N&&N(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const z=nd(R.type==="pointercancel"?this.lastMoveEventInfo:qo(I,this.transformPagePoint),this.history);this.startEvent&&M&&M(R,z),B&&B(R,z)},!rh(i))return;this.dragSnapToOrigin=m,this.handlers=l,this.transformPagePoint=u,this.distanceThreshold=f,this.contextWindow=h||window;const b=Oa(i),v=qo(b,this.transformPagePoint),{point:w}=v,{timestamp:E}=xt;this.history=[{...w,timestamp:E}];const{onSessionStart:A}=l;A&&A(i,nd(v,this.history)),this.removeListeners=Ra(Ea(this.contextWindow,"pointermove",this.handlePointerMove),Ea(this.contextWindow,"pointerup",this.handlePointerUp),Ea(this.contextWindow,"pointercancel",this.handlePointerUp)),_&&this.startScrollTracking(_)}startScrollTracking(i){let l=i.parentElement;for(;l;){const u=getComputedStyle(l);(p0.has(u.overflowX)||p0.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),Ye.update(this.updatePoint,!0))}updateHandlers(i){this.handlers=i}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ts(this.updatePoint)}}function qo(a,i){return i?{point:i(a.point)}:a}function f0(a,i){return{x:a.x-i.x,y:a.y-i.y}}function nd({point:a},i){return{point:a,delta:f0(a,DS(i)),offset:f0(a,VD(i)),velocity:HD(i,.1)}}function VD(a){return a[0]}function DS(a){return a[a.length-1]}function HD(a,i){if(a.length<2)return{x:0,y:0};let l=a.length-1,u=null;const h=DS(a);for(;l>=0&&(u=a[l],!(h.timestamp-u.timestamp>Ut(i)));)l--;if(!u)return{x:0,y:0};u===a[0]&&a.length>2&&h.timestamp-u.timestamp>Ut(i)*2&&(u=a[1]);const m=pn(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 WD(a,{min:i,max:l},u){return i!==void 0&&a<i?a=u?it(i,a,u.min):Math.max(a,i):l!==void 0&&a>l&&(a=u?it(l,a,u.max):Math.min(a,l)),a}function m0(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 zD(a,{top:i,left:l,bottom:u,right:h}){return{x:m0(a.x,l,h),y:m0(a.y,i,u)}}function g0(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 qD(a,i){return{x:g0(a.x,i.x),y:g0(a.y,i.y)}}function GD(a,i){let l=.5;const u=Bt(a),h=Bt(i);return h>u?l=ka(i.min,i.max-u,a.min):u>h&&(l=ka(a.min,a.max-h,i.min)),zn(0,1,l)}function KD(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 Pd=.35;function YD(a=Pd){return a===!1?a=0:a===!0&&(a=Pd),{x:y0(a,"left","right"),y:y0(a,"top","bottom")}}function y0(a,i,l){return{min:_0(a,i),max:_0(a,l)}}function _0(a,i){return typeof a=="number"?a:a[i]||0}const ZD=new WeakMap;class XD{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=yt(),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(Oa(E).point),this.stopAnimation()},f=(E,A)=>{const{drag:R,dragPropagation:I,onDragStart:M}=this.getProps();if(R&&!I&&(this.openDragLock&&this.openDragLock(),this.openDragLock=PR(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),Hn(N=>{let z=this.getAxisMotionValue(N).get()||0;if(Wn.test(z)){const{projection:U}=this.visualElement;if(U&&U.layout){const Y=U.layout.layoutBox[N];Y&&(z=Bt(Y)*(parseFloat(z)/100))}}this.originPoint[N]=z}),M&&Ye.update(()=>M(E,A),!1,!0),xd(this.visualElement,"transform");const{animationState:B}=this.visualElement;B&&B.setActive("whileDrag",!0)},_=(E,A)=>{this.latestPointerEvent=E,this.latestPanInfo=A;const{dragPropagation:R,dragDirectionLock:I,onDirectionLock:M,onDrag:B}=this.getProps();if(!R&&!this.openDragLock)return;const{offset:N}=A;if(I&&this.currentDirection===null){this.currentDirection=QD(N),this.currentDirection!==null&&M&&M(this.currentDirection);return}this.updateAxis("x",A.point,N),this.updateAxis("y",A.point,N),this.visualElement.render(),B&&Ye.update(()=>B(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 PS(i,{onSessionStart:m,onStart:f,onMove:_,onSessionEnd:b,resumeAnimation:v},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:w,distanceThreshold:u,contextWindow:RS(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();_&&Ye.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||!Go(i,h,this.currentDirection))return;const m=this.getAxisMotionValue(i);let f=this.originPoint[i]+u[i];this.constraints&&this.constraints[i]&&(f=WD(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&&Xr(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&u?this.constraints=zD(u.layoutBox,i):this.constraints=!1,this.elastic=YD(l),h!==this.constraints&&!Xr(i)&&u&&this.constraints&&!this.hasMutatedConstraints&&Hn(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=KD(u.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:i,onMeasureDragConstraints:l}=this.getProps();if(!i||!Xr(i))return!1;const u=i.current;is(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=aP(u,h.root,this.visualElement.getTransformPagePoint());let f=qD(h.layout.layoutBox,m);if(l){const _=l(sP(f));this.hasMutatedConstraints=!!_,_&&(f=Qw(_))}return f}startAnimation(i){const{drag:l,dragMomentum:u,dragElastic:h,dragTransition:m,dragSnapToOrigin:f,onDragTransitionEnd:_}=this.getProps(),b=this.constraints||{},v=Hn(w=>{if(!Go(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,I={type:"inertia",velocity:u?i[w]:0,bounceStiffness:A,bounceDamping:R,timeConstant:750,restDelta:1,restSpeed:10,...m,...E};return this.startAxisValueAnimation(w,I)});return Promise.all(v).then(_)}startAxisValueAnimation(i,l){const u=this.getAxisMotionValue(i);return xd(this.visualElement,i),u.start(Qd(i,u,0,l,this.visualElement,!1))}stopAnimation(){Hn(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){Hn(l=>{const{drag:u}=this.getProps();if(!Go(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]-it(f,_,.5)+b)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:i,dragConstraints:l}=this.getProps(),{projection:u}=this.visualElement;if(!Xr(l)||!u||!this.constraints)return;this.stopAnimation();const h={x:0,y:0};Hn(f=>{const _=this.getAxisMotionValue(f);if(_&&this.constraints!==!1){const b=_.get();h[f]=GD({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(),Hn(f=>{if(!Go(f,i,null))return;const _=this.getAxisMotionValue(f),{min:b,max:v}=this.constraints[f];_.set(it(b,v,h[f]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;ZD.set(this.visualElement,this);const i=this.visualElement.current,l=Ea(i,"pointerdown",v=>{const{drag:w,dragListener:E=!0}=this.getProps(),A=v.target,R=A!==i&&MR(A);w&&E&&!R&&this.start(v)});let u;const h=()=>{const{dragConstraints:v}=this.getProps();Xr(v)&&v.current&&(this.constraints=this.resolveRefConstraints(),u||(u=JD(i,v.current,()=>this.scalePositionWithinConstraints())))},{projection:m}=this.visualElement,f=m.addEventListener("measure",h);m&&!m.layout&&(m.root&&m.root.updateScroll(),m.updateLayout()),Ye.read(h);const _=Ta(window,"resize",()=>this.scalePositionWithinConstraints()),b=m.addEventListener("didUpdate",(({delta:v,hasLayoutChanged:w})=>{this.isDragging&&w&&(Hn(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=Pd,dragMomentum:_=!0}=i;return{...i,drag:l,dragDirectionLock:u,dragPropagation:h,dragConstraints:m,dragElastic:f,dragMomentum:_}}}function b0(a){let i=!0;return()=>{if(i){i=!1;return}a()}}function JD(a,i,l){const u=A2(a,b0(l)),h=A2(i,b0(l));return()=>{u(),h()}}function Go(a,i,l){return(i===!0||i===a)&&(l===null||l===a)}function QD(a,i=10){let l=null;return Math.abs(a.y)>i?l="y":Math.abs(a.x)>i&&(l="x"),l}class eO extends Is{constructor(i){super(i),this.removeGroupControls=fn,this.removeListeners=fn,this.controls=new XD(i)}mount(){const{dragControls:i}=this.node.getProps();i&&(this.removeGroupControls=i.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fn}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 sd=a=>(i,l)=>{a&&Ye.update(()=>a(i,l),!1,!0)};class tO extends Is{constructor(){super(...arguments),this.removePointerDownListener=fn}onPointerDown(i){this.session=new PS(i,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:RS(this.node)})}createPanHandlers(){const{onPanSessionStart:i,onPanStart:l,onPan:u,onPanEnd:h}=this.node.getProps();return{onSessionStart:sd(i),onStart:sd(l),onMove:sd(u),onEnd:(m,f)=>{delete this.session,h&&Ye.postRender(()=>h(m,f))}}}mount(){this.removePointerDownListener=Ea(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 rd=!1;class nO extends K.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),rd&&m.root.didUpdate(),m.addEventListener("animationComplete",()=>{this.safeToRemove()}),m.setOptions({...m.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),rl.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}),rd=!0,h||i.layoutDependency!==l||l===void 0||i.isPresent!==m?f.willUpdate():this.safeToRemove(),i.isPresent!==m&&(m?f.promote():f.relegate()||Ye.postRender(()=>{const _=f.getStack();(!_||!_.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:i}=this.props.visualElement;i&&(i.root.didUpdate(),sh.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:i,layoutGroup:l,switchLayoutGroup:u}=this.props,{projection:h}=i;rd=!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 OS(a){const[i,l]=cD(),u=K.useContext(Y0);return Z.jsx(nO,{...a,layoutGroup:u,switchLayoutGroup:K.useContext(TS),isPresent:i,safeToRemove:l})}const sO={pan:{Feature:tO},drag:{Feature:eO,ProjectionNode:vS,MeasureLayout:OS}};function v0(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&&Ye.postRender(()=>m(i,Oa(i)))}class rO extends Is{mount(){const{current:i}=this.node;i&&(this.unmount=OR(i,(l,u)=>(v0(this.node,u,"Start"),h=>v0(this.node,h,"End"))))}unmount(){}}class iO extends Is{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=Ra(Ta(this.node.current,"focus",()=>this.onFocus()),Ta(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function w0(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&&Ye.postRender(()=>m(i,Oa(i)))}class aO extends Is{mount(){const{current:i}=this.node;if(!i)return;const{globalTapTarget:l,propagate:u}=this.node.props;this.unmount=$R(i,(h,m)=>(w0(this.node,m,"Start"),(f,{success:_})=>w0(this.node,f,_?"End":"Cancel")),{useGlobalTarget:l,stopPropagation:(u==null?void 0:u.tap)===!1})}unmount(){}}const Dd=new WeakMap,id=new WeakMap,oO=a=>{const i=Dd.get(a.target);i&&i(a)},lO=a=>{a.forEach(oO)};function cO({root:a,...i}){const l=a||document;id.has(l)||id.set(l,{});const u=id.get(l),h=JSON.stringify(i);return u[h]||(u[h]=new IntersectionObserver(lO,{root:a,...i})),u[h]}function uO(a,i,l){const u=cO(i);return Dd.set(a,l),u.observe(a),()=>{Dd.delete(a),u.unobserve(a)}}const dO={some:0,all:1};class hO extends Is{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:dO[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 uO(this.node.current,f,_)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:i,prevProps:l}=this.node;["amount","margin","root"].some(pO(i,l))&&this.startObserver()}unmount(){}}function pO({viewport:a={}},{viewport:i={}}={}){return l=>a[l]!==i[l]}const fO={inView:{Feature:hO},tap:{Feature:aO},focus:{Feature:iO},hover:{Feature:rO}},mO={layout:{ProjectionNode:vS,MeasureLayout:OS}},gO={...$D,...fO,...sO,...mO},Od=ND(gO,BD),yO={new:"#4ade80",modified:"#fb923c",deleted:"#f87171",unchanged:"transparent"},_O={new:"N",modified:"M",deleted:"D",unchanged:""};function NS(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 bO({expanded:a}){return Z.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:Z.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function vO({open:a}){return a?Z.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"shrink-0",children:[Z.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"}),Z.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"})]}):Z.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"shrink-0",children:Z.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 wO(a){var u;const i=((u=a.split(".").pop())==null?void 0:u.toLowerCase())||"";return{js:"#f0db4f",jsx:"#61dafb",ts:"#3178c6",tsx:"#61dafb",json:"#a8b065",html:"#e44d26",css:"#264de4",scss:"#cd6799",md:"#ffffff",py:"#3776ab",rb:"#cc342d",go:"#00add8",rs:"#dea584",yml:"#cb171e",yaml:"#cb171e",env:"#ecd53f",sh:"#89e051",sql:"#e38c00",svg:"#ffb13b"}[i]||"#8c8c8c"}function SO({name:a}){const i=wO(a);return Z.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"shrink-0",children:[Z.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:i,opacity:"0.2"}),Z.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:i,strokeWidth:"1"}),Z.jsx("path",{d:"M9.5 1.5V5H13",stroke:i,strokeWidth:"1"})]})}function BS({files:a,selectedFile:i,onSelectFile:l,fileChanges:u}){return Z.jsxs("div",{className:"h-full overflow-auto bg-sb-sidebar text-sm select-none",children:[Z.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"}),Z.jsx("div",{className:"py-1",children:a.map(h=>Z.jsx(LS,{node:h,depth:0,selectedFile:i,onSelectFile:l,fileChanges:u},h.path))})]})}function LS({node:a,depth:i,selectedFile:l,onSelectFile:u,fileChanges:h}){var w;const[m,f]=K.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 Z.jsxs("div",{children:[Z.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:[Z.jsx(bO,{expanded:m}),Z.jsx(vO,{open:m}),Z.jsx("span",{className:"truncate ml-0.5 flex-1",children:a.name}),E&&Z.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0 mr-2",style:{backgroundColor:"#fb923c"}})]}),m&&a.children&&Z.jsx("div",{children:a.children.map(A=>Z.jsx(LS,{node:A,depth:i+1,selectedFile:l,onSelectFile:u,fileChanges:h},A.path))})]})}return Z.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:[Z.jsx(SO,{name:a.name}),Z.jsx("span",{className:"truncate ml-0.5 flex-1",children:a.name}),v!=="unchanged"&&Z.jsx("span",{className:"text-[9px] font-bold shrink-0 mr-2",style:{color:yO[v]},title:v,children:_O[v]})]})}let ri=null,ml=null,Ko=null;function xO(){return ri&&ml?Promise.resolve():Ko||(Ko=import("@monaco-editor/react").then(a=>{ri=a.default||a.Editor,ml=a.DiffEditor}),Ko)}function EO(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 kO={new:"#4ade80",modified:"#fb923c",deleted:"#f87171",unchanged:"transparent"},CO={new:"New file",modified:"Modified",deleted:"Deleted",unchanged:""};function MS({files:a,originalFiles:i,fileChanges:l,activeFile:u,openFiles:h,onSelectFile:m,onCloseFile:f,onFileChange:_,readOnly:b=!1}){const[v,w]=K.useState(!!ri),[E,A]=K.useState(!1);K.useEffect(()=>{ri||xO().then(()=>w(!0))},[]);const R=u&&a[u]||"",I=u?i[u]??"":"",M=u?EO(u):"plaintext",B=u?l[u]==="modified"||l[u]==="new":!1;K.useEffect(()=>{!B&&E&&A(!1)},[B,E,u]);const N=K.useCallback(U=>{u&&U!==void 0&&_(u,U)},[u,_]),z=K.useCallback(U=>{if(!U||!u)return;const Y=U.getModifiedEditor();Y.onDidChangeModelContent(()=>{const se=Y.getValue();_(u,se)})},[u,_]);return Z.jsxs("div",{className:"flex flex-col h-full bg-sb-editor",children:[Z.jsxs("div",{className:"flex items-center bg-sb-bg-alt border-b border-sb-border overflow-x-auto",children:[h.map(U=>{const Y=U.split("/").pop()||U,se=U===u,ge=l[U]||"unchanged";return Z.jsxs("div",{className:`group flex items-center gap-2 px-3 py-1.5 text-xs cursor-pointer border-r border-sb-border
6
+ ${se?"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(U),children:[ge!=="unchanged"&&Z.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:kO[ge]},title:CO[ge]}),Z.jsx("span",{className:"truncate max-w-[120px]",children:Y}),Z.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:text-sb-text-active ml-1 text-[10px]",onClick:ee=>{ee.stopPropagation(),f(U)},title:"Close",children:"✕"})]},U)}),Z.jsx("div",{className:"flex-1"}),B&&Z.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(U=>!U),title:E?"Switch to editor":"Show diff view",children:E?"Editor":"Diff"})]}),Z.jsxs("div",{className:"flex-1 overflow-hidden",children:[!u&&Z.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&&ml&&Z.jsx(ml,{height:"100%",language:M,original:I,modified:R,theme:"vs-dark",onMount:z,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&&ri&&Z.jsx(ri,{height:"100%",language:M,value:R,onChange:N,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&&Z.jsx("div",{className:"flex items-center justify-center h-full text-sb-text-muted text-sm",children:"Loading editor..."})]})]})}function FS({output:a,className:i=""}){const l=K.useRef(null);return K.useEffect(()=>{const u=l.current;u&&(u.scrollTop=u.scrollHeight)},[a.length]),Z.jsxs("div",{className:`flex flex-col h-full bg-sb-terminal ${i}`,children:[Z.jsx("div",{className:"flex items-center px-3 py-1 bg-sb-bg-alt border-b border-sb-border",children:Z.jsx("span",{className:"text-xs font-medium text-sb-text-muted uppercase tracking-wider",children:"Terminal"})}),Z.jsx("div",{ref:l,className:"flex-1 overflow-auto p-3 font-mono text-xs leading-relaxed",children:a.length===0?Z.jsx("span",{className:"text-sb-text-muted",children:"Waiting for output..."}):a.map((u,h)=>Z.jsx("div",{className:`whitespace-pre-wrap ${u.startsWith("[stderr]")?"text-sb-error":u.startsWith("$")||u.startsWith(" ✓")?"text-sb-success":u.startsWith(" ✗")?"text-sb-error":"text-sb-text"}`,children:u},h))})]})}function AO(){return`
7
+ (function() {
8
+ // Guard against double-injection
9
+ if (window.__sandboxErrorCapture) return;
10
+ window.__sandboxErrorCapture = true;
11
+
12
+ var post = function(category, message, stack, filename, lineno, colno) {
13
+ try {
14
+ window.parent.postMessage({
15
+ type: 'sandbox-error',
16
+ category: category,
17
+ message: String(message || 'Unknown error'),
18
+ stack: stack || undefined,
19
+ filename: filename || undefined,
20
+ lineno: lineno || undefined,
21
+ colno: colno || undefined
22
+ }, '*');
23
+ } catch(e) { /* swallow — parent may not be listening */ }
24
+ };
25
+
26
+ // 1. Uncaught exceptions
27
+ window.onerror = function(msg, source, lineno, colno, error) {
28
+ post(
29
+ 'browser-error',
30
+ msg,
31
+ error && error.stack ? error.stack : undefined,
32
+ source,
33
+ lineno,
34
+ colno
35
+ );
36
+ };
37
+
38
+ // 2. Unhandled promise rejections
39
+ window.onunhandledrejection = function(event) {
40
+ var reason = event.reason;
41
+ var msg = reason instanceof Error ? reason.message : String(reason);
42
+ var stack = reason instanceof Error ? reason.stack : undefined;
43
+ post('browser-unhandled-rejection', msg, stack);
44
+ };
45
+
46
+ // 3. console.error intercept
47
+ var origError = console.error;
48
+ console.error = function() {
49
+ // Forward to original so DevTools still shows it
50
+ origError.apply(console, arguments);
51
+ var parts = [];
52
+ for (var i = 0; i < arguments.length; i++) {
53
+ var arg = arguments[i];
54
+ if (arg instanceof Error) {
55
+ parts.push(arg.message);
56
+ // Use the stack from the first Error argument
57
+ if (parts.length === 1) {
58
+ post('browser-console-error', arg.message, arg.stack);
59
+ return;
60
+ }
61
+ } else {
62
+ parts.push(String(arg));
63
+ }
64
+ }
65
+ post('browser-console-error', parts.join(' '));
66
+ };
67
+ })();
68
+ `}let TO=0;function $S({url:a,className:i="",onBrowserError:l}){const u=K.useRef(null),h=K.useRef(l);h.current=l;const m=K.useCallback(()=>{var _;const f=u.current;if(f)try{const b=f.contentDocument||((_=f.contentWindow)==null?void 0:_.document);if(!b)return;const v=b.createElement("script");v.textContent=AO();const w=b.head||b.body||b.documentElement;w&&w.appendChild(v)}catch(b){console.warn("[CodeSandbox:Preview] Could not inject error capture:",b)}},[]);return K.useEffect(()=>{const f=_=>{if(!_.data||_.data.type!=="sandbox-error")return;const b=_.data,v=h.current;if(!v)return;let w;if(b.filename){const A=b.filename.match(/\/__(?:preview|virtual)__\/\d+(\/.*)/);w=A?A[1].replace(/^\//,""):void 0}const E={id:`browser_${++TO}_${Date.now()}`,category:b.category,message:b.message,stack:b.stack,filePath:w,line:b.lineno??void 0,column:b.colno??void 0,timestamp:new Date().toISOString()};v(E)};return window.addEventListener("message",f),()=>window.removeEventListener("message",f)},[]),K.useEffect(()=>{u.current&&a&&(u.current.src=a)},[a]),Z.jsx("div",{className:`h-full w-full bg-white ${i}`,children:a?Z.jsx("iframe",{ref:u,src:a,className:"w-full h-full border-none",title:"Preview",sandbox:"allow-scripts allow-forms allow-same-origin allow-popups allow-modals",onLoad:m}):Z.jsx("div",{className:"flex items-center justify-center h-full bg-sb-bg",children:Z.jsxs("div",{className:"text-center px-4",children:[Z.jsx("div",{className:"w-10 h-10 mx-auto mb-3 border-2 border-sb-accent border-t-transparent rounded-full animate-spin"}),Z.jsx("p",{className:"text-sb-text-muted text-sm",children:"Waiting for dev server to start..."})]})})})}const S0={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 US({progress:a,className:i=""}){const l=S0[a.stage]||S0.initializing;return a.stage==="ready"?null:Z.jsx("div",{className:`absolute inset-0 z-50 flex items-center justify-center bg-sb-bg/95 backdrop-blur-sm ${i}`,children:Z.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-md px-8",children:[Z.jsx("div",{className:"text-5xl animate-bounce",children:l.icon}),Z.jsxs("h2",{className:`text-xl font-semibold ${l.color}`,children:[l.label,a.stage!=="error"&&Z.jsx(RO,{})]}),Z.jsx("div",{className:"w-64 h-2 bg-sb-bg-active rounded-full overflow-hidden",children:Z.jsx("div",{className:"h-full bg-sb-accent rounded-full transition-all duration-500 ease-out",style:{width:`${a.percent}%`}})}),Z.jsx("p",{className:"text-sm text-sb-text-muted text-center",children:a.message}),Z.jsx("div",{className:"flex items-center gap-2 mt-4",children:["initializing","writing-files","installing","starting"].map((u,h)=>{const m=IO(a.stage)>h,f=a.stage===u;return Z.jsxs(K.Fragment,{children:[Z.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&&Z.jsx("div",{className:`w-8 h-0.5 transition-colors duration-300 ${m?"bg-sb-success":"bg-sb-bg-active"}`})]},u)})})]})})}function IO(a){return["initializing","writing-files","installing","starting","ready"].indexOf(a)}function RO(){return Z.jsxs("span",{className:"inline-flex ml-1",children:[Z.jsx("span",{className:"animate-pulse",style:{animationDelay:"0ms"},children:"."}),Z.jsx("span",{className:"animate-pulse",style:{animationDelay:"200ms"},children:"."}),Z.jsx("span",{className:"animate-pulse",style:{animationDelay:"400ms"},children:"."})]})}const PO=[.4,0,.2,1],x0=K.memo(function({selected:i,children:l,onClick:u}){return Z.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:[Z.jsx("span",{className:"relative z-10",children:l}),i&&Z.jsx(Od.span,{layoutId:"view-slider-pill",transition:{duration:.2,ease:PO},className:"absolute inset-0 z-0 bg-sb-accent rounded-full"})]})}),jS=K.memo(function({selected:i,onSelect:l}){return Z.jsxs("div",{className:"flex items-center gap-0.5 bg-sb-bg rounded-full p-0.5 border border-sb-border",children:[Z.jsx(x0,{selected:i==="code",onClick:()=>l("code"),children:"Code"}),Z.jsx(x0,{selected:i==="preview",onClick:()=>l("preview"),children:"Preview"})]})});var DO=Object.defineProperty,OO=(a,i,l)=>i in a?DO(a,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[i]=l,H=(a,i,l)=>OO(a,typeof i!="symbol"?i+"":i,l);let E0,ga,W,vn,ne,ad,k0,C0,A0,T0,Se,xs,ya,Xe,_a,I0,R0,P0,D0,Yo,nr,Yr,sr,Zr,od,ba,rs,O0,N0,Zo,Vn,Xo,rr,Jo,B0,wn,va,il,L0,M0,F0;(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"}));ya={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:ya.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",I=[".js",".ts",".jsx",".tsx",".mjs",".cjs",".json"],M={".ts":"ts",".tsx":"tsx",".js":"js",".mjs":"js",".cjs":"js",".jsx":"jsx",".json":"json",".css":"css",".map":"json",".txt":"text",".wasm":"file"},B={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"},N={UID:1e3,GID:1e3},z={BLOCK_SIZE:4096,BLOCK_CALC_SIZE:512},U={MODEL:"Virtual CPU",SPEED:2400,COUNT:2},Y={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},se=[.5,.5,.5],ge={COLUMNS:80,ROWS:24,FONT_SIZE:13},ee={PID:1,PPID:0,TITLE:"node",EXEC_PATH:"/usr/local/bin/node"};vn={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/${ya.NPM} node/${ya.NODE} linux x64 workspaces/false`,npm_execpath:"/usr/local/lib/node_modules/npm/bin/npm-cli.js",npm_node_execpath:"/usr/local/bin/node"},xs={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},Oe={BASE:3e3,RANGE:1e3},oe={TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10};class je{constructor(t){H(this,"_listeners",new Map),H(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 re(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}va=class{constructor(e){H(this,"tree"),H(this,"textEncoder",new TextEncoder),H(this,"textDecoder",new TextDecoder),H(this,"activeWatchers",new Map),H(this,"subscribers",new Map),H(this,"_handler"),H(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 va,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 va,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 re("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:N.UID,gid:N.GID,dev:0,ino:0,rdev:0,blksize:z.BLOCK_SIZE,blocks:Math.ceil(r/z.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 re("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:z.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 re("ENOENT","open",e);if(s.kind!=="file")throw re("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 re("ENOENT","mkdir",s);if(o.kind!=="directory")throw re("ENOTDIR","mkdir",s);if(o.children.has(r))throw re("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 re("ENOENT","scandir",e);if(n.kind!=="directory")throw re("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 re("ENOENT","unlink",e);const o=r.children.get(s);if(!o)throw re("ENOENT","unlink",e);if(o.kind!=="file")throw re("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 re("ENOENT","rmdir",e);const o=r.children.get(s);if(!o)throw re("ENOENT","rmdir",e);if(o.kind!=="directory")throw re("ENOTDIR","rmdir",e);if(o.children.size>0)throw re("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 re("ENOENT","rename",e);const o=this.nameOf(n),c=r.children.get(o);if(!c)throw re("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 re("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 re("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 re("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 re("ENOENT","link",e);if(n.kind!=="file")throw re("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 re("ENOENT","chmod",e)}chownSync(e,t,n){const s=this.normalize(e);if(!this.locate(s))throw re("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 re("ENOENT","truncate",e);if(s.kind!=="file")throw re("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 je(()=>{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 be(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)}Jo=class{constructor(e){H(this,"_map",new Map),H(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 Me={pathNormCacheSize:2048,statCacheSize:512,resolveCacheSize:4096,manifestCacheSize:256,transformCacheSize:512,moduleSoftCacheSize:512,heapWarnThresholdMB:350,monitorIntervalMs:3e4,maxProcessOutputBytes:4194304};B0=class{constructor(e){H(this,"options"),H(this,"pathNormCache"),H(this,"statCache"),H(this,"transformCache"),H(this,"_monitorTimer",null),H(this,"_pressureCallbacks",[]),H(this,"_destroyed",!1),this.options={...Me,...e},this.pathNormCache=new Jo(this.options.pathNormCacheSize),this.statCache=new Jo(this.options.statCacheSize),this.transformCache=new Jo(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 xe=null;Zo=function(){return xe};const Ce=new Set;function ze(){const e=Zo();if(e)for(const t of e.drainListeners)t();for(const t of Ce)t()}rs=function(){const e=Zo();e&&e.refCount++},wn=function(){const e=Zo();e&&e.refCount>0&&e.refCount--,ze()};const Re=10,tt=new WeakSet,ie=new Set;function pe(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(),ie.delete(o)};ie.add(o)}function ve(e){return e._registry||(e._registry=new Map),e._registry}function Ee(e,t){const n=ve(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 Ee(this,t).push(n),t==="change"&&!tt.has(this)&&this._watched instanceof Map&&(tt.add(this),pe(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 Ee(this,t).push(r),this},ne.prototype.removeListener=function(t,n){const s=ve(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?ve(this).delete(t):ve(this).clear(),this},ne.prototype.emit=function(t,...n){const s=ve(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"&&(rs(),c.then(()=>wn(),()=>wn()))};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=ve(this).get(t);return n?n.slice():[]},ne.prototype.rawListeners=function(t){return this.listeners(t)},ne.prototype.listenerCount=function(t){const n=ve(this).get(t);return n?n.length:0},ne.prototype.eventNames=function(){return Array.from(ve(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 Ee(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 ke=ne;ke.EventEmitter=ne,ke.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)}),ke.on=(e,t)=>({async next(){return new Promise(s=>{e.once(t,(...r)=>s({value:r,done:!1}))})},[Symbol.asyncIterator](){return this}}),ke.getEventListeners=(e,t)=>e.listeners(t),ke.listenerCount=(e,t)=>e.listenerCount(t),Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:ne,default:ke},Symbol.toStringTag,{value:"Module"}));const Ne=new TextEncoder,Te=new TextDecoder("utf-8"),Ke=new Uint8Array(128);for(let e=0;e<10;e++)Ke[48+e]=e;for(let e=0;e<6;e++)Ke[65+e]=10+e,Ke[97+e]=10+e;const De=class St extends Uint8Array{static from(t,n,s){if(typeof n=="function"){const o=Array.from(t,n,s);return new St(o)}const r=n;if(Array.isArray(t))return new St(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 St(m(c))}if(o==="hex"){const c=new Uint8Array(t.length>>>1);for(let d=0;d<t.length;d+=2)c[d>>>1]=Ke[t.charCodeAt(d)]<<4|Ke[t.charCodeAt(d+1)];return new St(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 St(c)}return new St(Ne.encode(t))}return t instanceof ArrayBuffer?new St(t):new St(t)}static alloc(t,n){const s=new St(t);return n!==void 0&&s.fill(n),s}static allocUnsafe(t){return new St(t)}static allocUnsafeSlow(t){return new St(t)}static concat(t){let n=0;for(const o of t)n+=o.length;const s=new St(n);let r=0;for(const o of t)s.set(o,r),r+=o.length;return s}static isBuffer(t){return t instanceof St||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:Ne.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):Te.decode(this)}slice(t,n){return new St(super.slice(t,n))}subarray(t,n){return new St(super.subarray(t,n))}write(t,n,s,r){const o=typeof n=="number"?n:0,c=Ne.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"?St.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}};H(De,"BYTES_PER_ELEMENT",1);let Pe=De;W=new Proxy(Pe,{apply(e,t,n){return Pe.from(...n)}}),typeof globalThis.Buffer>"u"&&(globalThis.Buffer=W);function Ge(e){return e instanceof Uint8Array?e.byteLength:typeof e=="string"?W.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"?W.from(t):t;this._readableByteLength+=Ge(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"?W.from(t):t;this._readableByteLength+=Ge(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-=Ge(t)),this.readableDidRead=!0,this._encoding&&t instanceof Uint8Array?this.emit("data",W.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=W.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?W.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:W.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"?W.from(r):r;s.push(o)}s.push(null)}catch(r){s.destroy(r)}})(),s},Xe=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(Xe.prototype,ne.prototype),Xe.prototype._write=function(t,n,s){s(null)},Xe.prototype._final=function(t){t(null)},Xe.prototype._destroy=function(t,n){n(t)},Xe.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"?W.from(t):t;if(this._parts.push(c),this._writableByteLength+=Ge(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-=Ge(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},Xe.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},Xe.prototype.getBuffer=function(){return W.concat(this._parts)},Xe.prototype.getBufferAsString=function(t){return this.getBuffer().toString(t||"utf8")},Xe.prototype.close=function(t){this.destroy(),t&&t(null)},Xe.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)},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 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)})}},Xe.prototype.setDefaultEncoding=function(t){return this},Object.defineProperty(Xe.prototype,"writableLength",{get:function(){return this._objectMode?this._parts.length:this._writableByteLength},configurable:!0}),Xe.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)))}})},Xe.fromWeb=function(t,n){const s=t.getWriter();return new Xe({...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 we=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(we.prototype,Se.prototype),we.prototype._write=function(t,n,s){s(null)},we.prototype._final=function(t){t(null)},we.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"?W.from(t):t;if(this._writeParts.push(c),this._writableByteLen+=Ge(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-=Ge(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},we.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},we.prototype.cork=function(){this._duplexCorked++,this.writableCorked=this._duplexCorked},we.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)})}},we.prototype.setDefaultEncoding=function(t){return this},Object.defineProperty(we.prototype,"writableLength",{get:function(){return this._writeObjectMode?this._writeParts.length:this._writableByteLen},configurable:!0}),we.from=function(t,n){const s=new we;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"?W.from(r):r;s.push(o)}s.push(null)}catch(r){s.destroy(r)}})();return s},we.toWeb=function(t){if(t instanceof we){const n=Se.toWeb(t),s=Xe.toWeb(t);return{readable:n,writable:s}}return Se.toWeb(t)},we.fromWeb=function(t,n){if(t instanceof ReadableStream)return Se.fromWeb(t,n);const s=t,r=new we,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 pi=function(t){this&&we.call(this,t)};Object.setPrototypeOf(pi.prototype,we.prototype),pi.prototype.write=function(t,n,s){const r=typeof t=="string"?W.from(t):t;this.push(r);const o=typeof n=="function"?n:s;return o&&queueMicrotask(()=>o(null)),!0};const Cn=function(t){this&&(we.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(Cn.prototype,we.prototype),Cn.prototype._transform=function(t,n,s){s(null,t)},Cn.prototype._flush=function(t){t(null)},Cn.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()})},Cn.prototype.write=function(t,n,s){const r=typeof t=="string"?W.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},Cn.prototype.end=function(t,n,s){return this._flushed||(this._flushed=!0,this._flush((r,o)=>{o&&this.push(o)})),we.prototype.end.call(this,t,n,s)};const Rs=function(){this&&ne.call(this)};Object.setPrototypeOf(Rs.prototype,ne.prototype),Rs.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},Rs.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 hh(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 _t=Rs;_t.Readable=Se,_t.Writable=Xe,_t.Duplex=we,_t.Transform=Cn,_t.PassThrough=pi,_t.Stream=Rs,_t.from=Se.from,_t.addAbortSignal=hh;function bl(...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 vl(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 ph=16384,fh=16;function mh(e){return e?fh:ph}function gh(e,t){e?fh=t:ph=t}const yh={pipeline:async(...e)=>new Promise((t,n)=>{bl(...e,s=>{s?n(s):t()})}),finished:async(e,t)=>new Promise((n,s)=>{vl(e,t,r=>{r?s(r):n()})})};_t.pipeline=bl,_t.finished=vl,_t.promises=yh,_t.getDefaultHighWaterMark=mh,_t.setDefaultHighWaterMark=gh;function _h(...e){return new pi}function wl(e){if(!e||typeof e!="object")return!1;const t=e;return!(typeof t.read!="function"||t.destroyed||t.readableEnded||t._terminated)}function bh(e){if(!e||typeof e!="object")return!1;const t=e;return!(typeof t.write!="function"||t.destroyed||t.writableEnded||t.writableFinished)}function Sl(e){if(!e||typeof e!="object")return!1;const t=e;return!!t.readableDidRead||!!t._reading}function vh(e){return!e||typeof e!="object"?!1:e.errored!=null}_t.compose=_h,_t.isReadable=wl,_t.isWritable=bh,_t.isDisturbed=Sl,_t.isErrored=vh,Se.isDisturbed=Sl,Se.isReadable=wl,Object.freeze(Object.defineProperty({__proto__:null,Duplex:we,PassThrough:pi,Readable:Se,Stream:Rs,Transform:Cn,Writable:Xe,addAbortSignal:hh,compose:_h,default:Rs,finished:vl,getDefaultHighWaterMark:mh,isDisturbed:Sl,isErrored:vh,isReadable:wl,isWritable:bh,pipeline:bl,promises:yh,setDefaultHighWaterMark:gh},Symbol.toStringTag,{value:"Module"})),new TextDecoder,new TextEncoder;const fi=function(t,n){this&&(this.path=t,this._entries=n,this._pos=0,this._closed=!1)};fi.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++]},fi.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)}})},fi.prototype.closeSync=function(){this._closed=!0},fi.prototype.close=function(t){if(this._closed=!0,t){queueMicrotask(()=>t(null));return}return Promise.resolve()},fi.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 xl="/",El=":";Vn=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 mt(...e){if(e.length===0)return".";const t=e.filter(n=>n!=="").join("/");return Vn(t)}rr=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:"")),Vn(t)};function mi(e){return e.charAt(0)==="/"}sr=function(e){if(!e)return".";const t=Vn(e),n=t.lastIndexOf("/");return n<0?".":n===0?"/":t.substring(0,n)},nr=function(e,t){if(!e)return"";const n=Vn(e);let s=n.substring(n.lastIndexOf("/")+1);return t&&s.endsWith(t)&&(s=s.substring(0,s.length-t.length)),s},Zr=function(e){const t=nr(e),n=t.lastIndexOf(".");return n<=0?"":t.substring(n)},_a=function(e,t){const n=rr(e),s=rr(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 Na(e){const t=Vn(e),n=mi(t),s=sr(t),r=nr(t),o=Zr(t),c=r.substring(0,r.length-o.length);return{root:n?"/":"",dir:s,base:r,ext:o,name:c}}function Ba(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 wh={sep:xl,delimiter:El,normalize:Vn,join:mt,resolve:rr,isAbsolute:mi,dirname:sr,basename:nr,extname:Zr,relative:_a,parse:Na,format:Ba},Sh={sep:"\\",delimiter:";",normalize:Vn,join:mt,resolve:rr,isAbsolute:mi,dirname:sr,basename:nr,extname:Zr,relative:_a,parse:Na,format:Ba};Object.freeze(Object.defineProperty({__proto__:null,basename:nr,default:{sep:xl,delimiter:El,normalize:Vn,join:mt,resolve:rr,isAbsolute:mi,dirname:sr,basename:nr,extname:Zr,relative:_a,parse:Na,format:Ba,posix:wh,win32:Sh},delimiter:El,dirname:sr,extname:Zr,format:Ba,isAbsolute:mi,join:mt,normalize:Vn,parse:Na,posix:wh,relative:_a,resolve:rr,sep:xl,win32:Sh},Symbol.toStringTag,{value:"Module"}));const xh=console;function kl(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}E0=function(e){let t=(e==null?void 0:e.cwd)||"/",n=18;const s=Date.now(),r=new ne,o={NODE_ENV:vn.NODE_ENV,PATH:vn.PATH,HOME:vn.HOME,SHELL:vn.SHELL,TERM:vn.TERM,COLORTERM:vn.COLORTERM,REQUIRES_WASM:vn.REQUIRES_WASM,npm_config_user_agent:vn.npm_config_user_agent,npm_execpath:vn.npm_execpath,npm_node_execpath:vn.npm_node_execpath,NAPI_RS_FORCE_WASM:"1",NEXT_TELEMETRY_DISABLED:"1",DO_NOT_TRACK:"1",...e==null?void 0:e.env},c=kl(!0,x=>(e!=null&&e.onStdout?e.onStdout(x):xh.log(x),!0)),d=kl(!0,x=>(e!=null&&e.onStderr?e.onStderr(x):xh.error(x),!0)),p=kl(!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:B.PLATFORM,arch:B.ARCH,title:ee.TITLE,version:ya.NODE,versions:{...w},argv:["node","/index.js"],argv0:"node",execPath:ee.EXEC_PATH,execArgv:[],pid:(e==null?void 0:e.pid)??ee.PID,ppid:(e==null?void 0:e.ppid)??ee.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:Y.RSS,heapTotal:Y.HEAP_TOTAL,heapUsed:Y.HEAP_USED,external:Y.EXTERNAL,arrayBuffers:0}},{rss:()=>Y.RSS}),uptime(){return(Date.now()-s)/1e3},cpuUsage(){return{user:0,system:0}},resourceUsage(){return{userCPUTime:0,systemCPUTime:0,maxRSS:Y.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},E0();const ot=function(t){this&&(we.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,we.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"?W.from(t):t;this.push(n)},ot.prototype._feedEnd=function(){this.push(null)};const Zt=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(Zt.prototype,ne.prototype),Zt.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=Oe.BASE+Math.floor(Math.random()*Oe.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},Zt.prototype.address=function(){return this._addr?{...this._addr,host:this._addr.address}:null},Zt.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},Zt.prototype.getConnections=function(t){typeof t=="function"&&t(null,this._peers.size)},Zt.prototype.ref=function(){return this},Zt.prototype.unref=function(){return this},Zt.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 Eh(e,t){return new Zt(e,t)}function Cl(e,t,n){return new ot().connect(e,t,n)}const kh=Cl;function La(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 Ch(e){return La(e)===4}function Ah(e){return La(e)===6}Object.freeze(Object.defineProperty({__proto__:null,TcpServer:Zt,TcpSocket:ot,connect:kh,createConnection:Cl,createServer:Eh,default:{Socket:ot,Server:Zt,createServer:Eh,createConnection:Cl,connect:kh,isIP:La,isIPv4:Ch,isIPv6:Ah},isIP:La,isIPv4:Ch,isIPv6:Ah},Symbol.toStringTag,{value:"Module"}));function Ma(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 Th(e){return e.includes("512")?64:e.includes("384")?48:e.includes("1")||e==="SHA-1"?20:32}function Al(e,t){const n=Th(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 Tl(e,t,n){const s=new Uint8Array(t.length+e.length);return s.set(t,0),s.set(e,t.length),Al(s,n)}function cr(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 Fa(e,t){return t==="hex"?Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join(""):t==="base64"?btoa(String.fromCharCode(...e)):W.from(e)}function It(e){const t=new Uint8Array(e);return crypto.getRandomValues(t),W.from(t)}function Il(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 Ih(){return crypto.randomUUID()}function Rh(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 Ph(e){return crypto.getRandomValues(e)}const ur=function(t){this&&(this._alg=Ma(t),this._parts=[])};ur.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"?W.from(atob(t)):W.from(t):s=W.from(t),this._parts.push(s),this},ur.prototype.digestAsync=async function(t){const n=cr(this._parts),s=new Uint8Array(n).buffer,r=await crypto.subtle.digest(this._alg,s);return Fa(new Uint8Array(r),t)},ur.prototype.digest=function(t){const n=cr(this._parts),s=Al(n,this._alg);return Fa(s,t)},Yr=function(e){return new ur(e)};function Dh(e,t,n){const s=Yr(e);return s.update(t),s.digest(n)}const dr=function(t,n){this&&(this._alg=Ma(t),this._key=typeof n=="string"?W.from(n):n,this._parts=[])};dr.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"?W.from(t):t;return this._parts.push(s),this},dr.prototype.digestAsync=async function(t){const n=cr(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 Fa(new Uint8Array(c),t)},dr.prototype.digest=function(t){const n=cr(this._parts),s=Tl(n,this._key,this._alg);return Fa(s,t)};function $a(e,t){return new dr(e,t)}function Oh(e,t,n,s,r,o){qS(e,t,n,s,r).then(c=>o(null,c)).catch(c=>o(c,W.alloc(0)))}async function qS(e,t,n,s,r){const o=typeof e=="string"?W.from(e):e,c=typeof t=="string"?W.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:Ma(r)},y,s*8);return W.from(g)}function Rl(e,t,n,s,r){const o=typeof e=="string"?W.from(e):e,c=typeof t=="string"?W.from(t):t,d=Ma(r),p=Th(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=Tl(C,o,d);const L=new Uint8Array(T);for(let V=1;V<n;V++){T=Tl(T,o,d);for(let G=0;G<L.length;G++)L[G]^=T[G]}g.set(L,(x-1)*p)}return W.from(g.slice(0,s))}function Nh(e,t,n,s,r){try{const o=Pl(e,t,n);setTimeout(()=>r(null,o),0)}catch(o){setTimeout(()=>r(o,W.alloc(0)),0)}}function Pl(e,t,n,s){return Rl(e,t,16384,n,"sha256")}function Ps(e){if(e instanceof Xt)return{raw:e._data,alg:e._alg,kind:e._kind,fmt:"raw"};if(typeof e=="object"&&"key"in e)return Ps(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=W.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"?W.from(e):e,kind:"secret",fmt:"raw"}}function Ua(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),W.from(Al(r,e))}function Dl(e,t,n,s){const r=Ua(e,t,n);return Nl(W.from(s),r)}function Bh(e,t,n,s){const r=Ps(n),o=e||r.alg||"SHA-256";if(s){try{s(null,Ua(o,t,r))}catch(c){s(c,null)}return}return Ua(o,t,r)}function Lh(e,t,n,s,r){const o=Ps(n),c=e||o.alg||"SHA-256";if(r){try{r(null,Dl(c,t,o,s))}catch(d){r(d,!1)}return}return Dl(c,t,o,s)}const gi=function(t){this&&(ne.call(this),this._alg=t,this._parts=[])};Object.setPrototypeOf(gi.prototype,ne.prototype),gi.prototype.update=function(t,n){return this._parts.push(typeof t=="string"?W.from(t):t),this},gi.prototype.sign=function(t,n){const s=cr(this._parts),r=Ps(t),o=Ua(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 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"?W.from(t):t),this},yi.prototype.verify=function(t,n,s){const r=cr(this._parts),o=Ps(t);let c;return typeof n=="string"?s==="base64"?c=W.from(atob(n)):s==="hex"?c=W.from(n.match(/.{2}/g).map(d=>parseInt(d,16))):c=W.from(n):c=n,Dl(this._alg,r,o,c)};function Mh(e){return new gi(e)}function Fh(e){return new yi(e)}function $h(e,t,n){throw new Error("createCipheriv is not supported in the browser polyfill")}function Uh(e,t,n){throw new Error("createDecipheriv is not supported in the browser polyfill")}const Xt=function(t,n,s){this&&(this._kind=t,this._data=n,this._alg=s)};Object.defineProperty(Xt.prototype,"type",{get:function(){return this._kind},configurable:!0}),Object.defineProperty(Xt.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(Xt.prototype,"symmetricKeySize",{get:function(){if(this._kind==="secret")return this._data instanceof Uint8Array?this._data.length*8:void 0},configurable:!0}),Xt.prototype.export=function(t){if(this._data instanceof Uint8Array)return W.from(this._data);throw new Error("Cannot synchronously export a CryptoKey")};function Ol(e,t){const n=typeof e=="string"?W.from(e,t):e;return new Xt("secret",n)}function jh(e){const t=Ps(e);return new Xt("public",t.raw,t.alg)}function Vh(e){const t=Ps(e);return new Xt("private",t.raw,t.alg)}function Nl(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 Hh(){return["aes-128-cbc","aes-256-cbc","aes-128-gcm","aes-256-gcm"]}function Wh(){return["sha1","sha256","sha384","sha512"]}const zh={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=It(n);return Ol(s)}function Gh(e,t){const n=((t==null?void 0:t.modulusLength)||2048)/8,s=It(n),r=It(n),o=new Xt("private",s,e),c=new Xt("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-----
7
69
  ${btoa(String.fromCharCode(...r))}
8
70
  -----END PUBLIC KEY-----`:c,privateKey:(p==null?void 0:p.format)==="pem"?`-----BEGIN PRIVATE KEY-----
9
71
  ${btoa(String.fromCharCode(...s))}
10
- -----END PRIVATE KEY-----`:o}}function Ol(e,t){const n=kt(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 zh(e,t,n){try{const s=Ol(e,t);setTimeout(()=>n(null,s),0)}catch(s){setTimeout(()=>n(s,H.alloc(0)),0)}}function Nl(e){return!0}function qh(e,t){setTimeout(()=>t(null,Nl()),0)}function Gh(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{Al(e,r,o),c&&setTimeout(()=>c(null,e),0)}catch(d){c&&setTimeout(()=>c(d,e),0)}}function Bl(e,t,n,s,r){const o=H.from(n),c=H.from(t),d=H.from(s),p=Fa(e,o).update(c).digest(),y=p.length,g=Math.ceil(r/y),x=H.alloc(g*y);let E=H.alloc(0);for(let C=0;C<g;C++){const T=H.concat([E,d,H.from([C+1])]);E=H.from(Fa(e,p).update(T).digest()),E.copy(x,C*y)}return x.slice(0,r)}function Kh(e,t,n,s,r,o){try{const c=Bl(e,t,n,s,r);setTimeout(()=>o(null,c),0)}catch(c){setTimeout(()=>o(c,H.alloc(0)),0)}}function Ll(e){return{generateKeys:()=>kt(256),computeSecret:t=>kt(32),getPrime:()=>kt(256),getGenerator:()=>H.from([2]),getPublicKey:()=>kt(256),getPrivateKey:()=>kt(256),setPublicKey:()=>{},setPrivateKey:()=>{}}}function Yh(e,t){return Ll()}function Zh(e){return{generateKeys:(t,n)=>kt(65),computeSecret:t=>kt(32),getPublicKey:(t,n)=>kt(65),getPrivateKey:t=>kt(32),setPublicKey:()=>{},setPrivateKey:()=>{}}}function Xh(){return["P-256","P-384","P-521","secp256k1"]}function Jh(e){}function Qh(){return 0}function ep(){return{total:0,min:0,used:0}}const tp=globalThis.crypto,HS=Object.freeze(Object.defineProperty({__proto__:null,Hash:lr,Hmac:cr,KeyObject:Kt,SignStream:fi,VerifyStream:mi,checkPrime:qh,checkPrimeSync:Nl,constants:Vh,createCipheriv:Lh,createDecipheriv:Mh,createDiffieHellman:Yh,createECDH:Zh,createHash:Gr,createHmac:Fa,createPrivateKey:$h,createPublicKey:Fh,createSecretKey:Pl,createSign:Nh,createVerify:Bh,default:{randomBytes:kt,randomFill:Gh,randomFillSync:Al,randomUUID:Ch,randomInt:Ah,getRandomValues:Th,createHash:Gr,hash:Ih,createHmac:Fa,createSign:Nh,createVerify:Bh,createCipheriv:Lh,createDecipheriv:Mh,sign:Dh,verify:Oh,pbkdf2:Rh,pbkdf2Sync:Tl,scrypt:Ph,scryptSync:Il,hkdf:Kh,hkdfSync:Bl,timingSafeEqual:Dl,getCiphers:Uh,getHashes:jh,getCurves:Xh,constants:Vh,KeyObject:Kt,createSecretKey:Pl,createPublicKey:Fh,createPrivateKey:$h,generateKeySync:Hh,generateKeyPairSync:Wh,generatePrimeSync:Ol,generatePrime:zh,checkPrimeSync:Nl,checkPrime:qh,createDiffieHellman:Yh,getDiffieHellman:Ll,createECDH:Zh,setFips:Jh,getFips:Qh,secureHeapUsed:ep,webcrypto:tp,Hash:lr,Hmac:cr},generateKeyPairSync:Wh,generateKeySync:Hh,generatePrime:zh,generatePrimeSync:Ol,getCiphers:Uh,getCurves:Xh,getDiffieHellman:Ll,getFips:Qh,getHashes:jh,getRandomValues:Th,hash:Ih,hkdf:Kh,hkdfSync:Bl,pbkdf2:Rh,pbkdf2Sync:Tl,randomBytes:kt,randomFill:Gh,randomFillSync:Al,randomInt:Ah,randomUUID:Ch,scrypt:Ph,scryptSync:Il,secureHeapUsed:ep,setFips:Jh,sign:Dh,timingSafeEqual:Dl,verify:Oh,webcrypto:tp},Symbol.toStringTag,{value:"Module"})),WS=typeof window<"u"&&typeof window.document<"u"&&typeof globalThis.WebSocket=="function"?globalThis.WebSocket:null,Ct=function(t){this&&(ve.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 et,this.connection=this.socket)};Object.setPrototypeOf(Ct.prototype,ve.prototype),Ct.prototype.setTimeout=function(t,n){return n&&this.once("timeout",n),this},Ct.prototype.destroy=function(t){return ve.prototype.destroy.call(this,t),this},Ct.prototype._injectBody=function(t){t===null?this._payload=null:this._payload=typeof t=="string"?H.from(t):t;const n=this;queueMicrotask(()=>{n._payload&&n.push(n._payload),n.push(null),n.complete=!0})},Ct.build=function(t,n,s,r){const o=new et;o.remoteAddress="127.0.0.1",o.remotePort=0,o.remoteFamily="IPv4";const c=new Ct(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 Le=function(t){this&&(He.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(Le.prototype,He.prototype),Le.prototype._onComplete=function(t){this._completionCallback=t},Le.prototype.assignSocket=function(t){this.socket=t,this.connection=t},Le.prototype.detachSocket=function(t){this.socket=null,this.connection=null},Le.prototype.setHeader=function(t,n){if(this.headersSent)throw new Error("Headers already dispatched");return this._hdrs.set(t.toLowerCase(),String(n)),this},Le.prototype.getHeader=function(t){return this._hdrs.get(t.toLowerCase())},Le.prototype.getHeaders=function(){const t={};return this._hdrs.forEach((n,s)=>{t[s]=n}),t},Le.prototype.getHeaderNames=function(){return[...this._hdrs.keys()]},Le.prototype.hasHeader=function(t){return this._hdrs.has(t.toLowerCase())},Le.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},Le.prototype.removeHeader=function(t){if(this.headersSent)throw new Error("Headers already dispatched");this._hdrs.delete(t.toLowerCase())},Le.prototype.flushHeaders=function(){this.headersSent=!0},Le.prototype.writeContinue=function(){},Le.prototype.writeProcessing=function(){},Le.prototype.writeEarlyHints=function(t,n){n&&queueMicrotask(n)},Le.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},Le.prototype.write=function(t,n,s){this.headersSent=!0;const r=typeof t=="string"?H.from(t):t;this._chunks.push(r);const o=typeof n=="function"?n:s;return o&&queueMicrotask(()=>o(null)),!0},Le.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=H.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},Le.prototype.send=function(t){return typeof t=="object"&&!H.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()},Le.prototype.setTimeout=function(t,n){return n&&this.once("timeout",n),this},Le.prototype.json=function(t){return this.setHeader("Content-Type","application/json"),this.end(JSON.stringify(t))},Le.prototype.status=function(t){return this.statusCode=t,this},Le.prototype.redirect=function(t,n){typeof t=="number"?(this.statusCode=t,this.setHeader("Location",n)):(this.statusCode=302,this.setHeader("Location",t)),this.end()},Le.prototype.addTrailers=function(t){},Le.prototype._collectedBody=function(){return H.concat(this._chunks)},Le.prototype._collectedBodyText=function(){return this._collectedBody().toString("utf8")};const vt=function(t,n){if(!this)return;se.call(this),typeof t=="function"?this._handler=t:this._handler=n,this._tcp=new Gt,this.listening=!1,this.maxHeadersCount=null,this.timeout=0,this.keepAliveTimeout=Ss.HTTP_KEEP_ALIVE,this.headersTimeout=Ss.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(vt.prototype,se.prototype),vt.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&&qS(g.port,d),p&&p()},this._tcp.listen(r,o,c),this},vt.prototype.close=function(t){const n=this._tcp.address();return n&&GS(n.port),this._tcp.close(t),this},vt.prototype.address=function(){return this._tcp.address()},vt.prototype.setTimeout=function(t,n){return this.timeout=t||0,n&&this.on("timeout",n),this},vt.prototype.ref=function(){return this._tcp.ref(),this},vt.prototype.unref=function(){return this._tcp.unref(),this},vt.prototype.closeAllConnections=function(){},vt.prototype.closeIdleConnections=function(){},vt.prototype.dispatchUpgrade=function(t,n){const s=new et;s.cork=()=>{},s.uncork=()=>{},s._readableState={endEmitted:!1},s._writableState={finished:!1,errorEmitted:!1};const r=new Ct(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,H.alloc(0))}),{req:r,socket:s}},vt.prototype.dispatchRequest=async function(t,n,s,r){const o=this;return new Promise((c,d)=>{var p;const y=Ct.build(t,n,s,r),g=new Le(y);g._onComplete(c);const x=o.timeout||Ss.HTTP_DISPATCH_SAFETY,E=setTimeout(()=>{d(new Error(`dispatchRequest timed out after ${x}ms for ${t} ${n}`))},x);g.on("finish",()=>{clearTimeout(E)});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 N;if(clearTimeout(E),console.error("[DEBUG] dispatchRequest async error:",(T==null?void 0:T.message)||T,(N=T==null?void 0:T.stack)==null?void 0:N.split(`
72
+ -----END PRIVATE KEY-----`:o}}function Bl(e,t){const n=It(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 Kh(e,t,n){try{const s=Bl(e,t);setTimeout(()=>n(null,s),0)}catch(s){setTimeout(()=>n(s,W.alloc(0)),0)}}function Ll(e){return!0}function Yh(e,t){setTimeout(()=>t(null,Ll()),0)}function Zh(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{Il(e,r,o),c&&setTimeout(()=>c(null,e),0)}catch(d){c&&setTimeout(()=>c(d,e),0)}}function Ml(e,t,n,s,r){const o=W.from(n),c=W.from(t),d=W.from(s),p=$a(e,o).update(c).digest(),y=p.length,g=Math.ceil(r/y),x=W.alloc(g*y);let k=W.alloc(0);for(let C=0;C<g;C++){const T=W.concat([k,d,W.from([C+1])]);k=W.from($a(e,p).update(T).digest()),k.copy(x,C*y)}return x.slice(0,r)}function Xh(e,t,n,s,r,o){try{const c=Ml(e,t,n,s,r);setTimeout(()=>o(null,c),0)}catch(c){setTimeout(()=>o(c,W.alloc(0)),0)}}function Fl(e){return{generateKeys:()=>It(256),computeSecret:t=>It(32),getPrime:()=>It(256),getGenerator:()=>W.from([2]),getPublicKey:()=>It(256),getPrivateKey:()=>It(256),setPublicKey:()=>{},setPrivateKey:()=>{}}}function Jh(e,t){return Fl()}function Qh(e){return{generateKeys:(t,n)=>It(65),computeSecret:t=>It(32),getPublicKey:(t,n)=>It(65),getPrivateKey:t=>It(32),setPublicKey:()=>{},setPrivateKey:()=>{}}}function ep(){return["P-256","P-384","P-521","secp256k1"]}function tp(e){}function np(){return 0}function sp(){return{total:0,min:0,used:0}}const rp=globalThis.crypto,GS=Object.freeze(Object.defineProperty({__proto__:null,Hash:ur,Hmac:dr,KeyObject:Xt,SignStream:gi,VerifyStream:yi,checkPrime:Yh,checkPrimeSync:Ll,constants:zh,createCipheriv:$h,createDecipheriv:Uh,createDiffieHellman:Jh,createECDH:Qh,createHash:Yr,createHmac:$a,createPrivateKey:Vh,createPublicKey:jh,createSecretKey:Ol,createSign:Mh,createVerify:Fh,default:{randomBytes:It,randomFill:Zh,randomFillSync:Il,randomUUID:Ih,randomInt:Rh,getRandomValues:Ph,createHash:Yr,hash:Dh,createHmac:$a,createSign:Mh,createVerify:Fh,createCipheriv:$h,createDecipheriv:Uh,sign:Bh,verify:Lh,pbkdf2:Oh,pbkdf2Sync:Rl,scrypt:Nh,scryptSync:Pl,hkdf:Xh,hkdfSync:Ml,timingSafeEqual:Nl,getCiphers:Hh,getHashes:Wh,getCurves:ep,constants:zh,KeyObject:Xt,createSecretKey:Ol,createPublicKey:jh,createPrivateKey:Vh,generateKeySync:qh,generateKeyPairSync:Gh,generatePrimeSync:Bl,generatePrime:Kh,checkPrimeSync:Ll,checkPrime:Yh,createDiffieHellman:Jh,getDiffieHellman:Fl,createECDH:Qh,setFips:tp,getFips:np,secureHeapUsed:sp,webcrypto:rp,Hash:ur,Hmac:dr},generateKeyPairSync:Gh,generateKeySync:qh,generatePrime:Kh,generatePrimeSync:Bl,getCiphers:Hh,getCurves:ep,getDiffieHellman:Fl,getFips:np,getHashes:Wh,getRandomValues:Ph,hash:Dh,hkdf:Xh,hkdfSync:Ml,pbkdf2:Oh,pbkdf2Sync:Rl,randomBytes:It,randomFill:Zh,randomFillSync:Il,randomInt:Rh,randomUUID:Ih,scrypt:Nh,scryptSync:Pl,secureHeapUsed:sp,setFips:tp,sign:Bh,timingSafeEqual:Nl,verify:Lh,webcrypto:rp},Symbol.toStringTag,{value:"Module"})),KS=typeof window<"u"&&typeof window.document<"u"&&typeof globalThis.WebSocket=="function"?globalThis.WebSocket:null,Rt=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(Rt.prototype,Se.prototype),Rt.prototype.setTimeout=function(t,n){return n&&this.once("timeout",n),this},Rt.prototype.destroy=function(t){return Se.prototype.destroy.call(this,t),this},Rt.prototype._injectBody=function(t){t===null?this._payload=null:this._payload=typeof t=="string"?W.from(t):t;const n=this;queueMicrotask(()=>{n._payload&&n.push(n._payload),n.push(null),n.complete=!0})},Rt.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 Rt(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 He=function(t){this&&(Xe.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(He.prototype,Xe.prototype),He.prototype._onComplete=function(t){this._completionCallback=t},He.prototype.assignSocket=function(t){this.socket=t,this.connection=t},He.prototype.detachSocket=function(t){this.socket=null,this.connection=null},He.prototype.setHeader=function(t,n){if(this.headersSent)throw new Error("Headers already dispatched");return this._hdrs.set(t.toLowerCase(),String(n)),this},He.prototype.getHeader=function(t){return this._hdrs.get(t.toLowerCase())},He.prototype.getHeaders=function(){const t={};return this._hdrs.forEach((n,s)=>{t[s]=n}),t},He.prototype.getHeaderNames=function(){return[...this._hdrs.keys()]},He.prototype.hasHeader=function(t){return this._hdrs.has(t.toLowerCase())},He.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},He.prototype.removeHeader=function(t){if(this.headersSent)throw new Error("Headers already dispatched");this._hdrs.delete(t.toLowerCase())},He.prototype.flushHeaders=function(){this.headersSent=!0},He.prototype.writeContinue=function(){},He.prototype.writeProcessing=function(){},He.prototype.writeEarlyHints=function(t,n){n&&queueMicrotask(n)},He.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},He.prototype.write=function(t,n,s){this.headersSent=!0;const r=typeof t=="string"?W.from(t):t;this._chunks.push(r);const o=typeof n=="function"?n:s;return o&&queueMicrotask(()=>o(null)),!0},He.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=W.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},He.prototype.send=function(t){return typeof t=="object"&&!W.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()},He.prototype.setTimeout=function(t,n){return n&&this.once("timeout",n),this},He.prototype.json=function(t){return this.setHeader("Content-Type","application/json"),this.end(JSON.stringify(t))},He.prototype.status=function(t){return this.statusCode=t,this},He.prototype.redirect=function(t,n){typeof t=="number"?(this.statusCode=t,this.setHeader("Location",n)):(this.statusCode=302,this.setHeader("Location",t)),this.end()},He.prototype.addTrailers=function(t){},He.prototype._collectedBody=function(){return W.concat(this._chunks)},He.prototype._collectedBodyText=function(){return this._collectedBody().toString("utf8")};const Et=function(t,n){if(!this)return;ne.call(this),typeof t=="function"?this._handler=t:this._handler=n,this._tcp=new Zt,this.listening=!1,this.maxHeadersCount=null,this.timeout=0,this.keepAliveTimeout=xs.HTTP_KEEP_ALIVE,this.headersTimeout=xs.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(Et.prototype,ne.prototype),Et.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&&ZS(g.port,d),p&&p()},this._tcp.listen(r,o,c),this},Et.prototype.close=function(t){const n=this._tcp.address();return n&&XS(n.port),this._tcp.close(t),this},Et.prototype.address=function(){return this._tcp.address()},Et.prototype.setTimeout=function(t,n){return this.timeout=t||0,n&&this.on("timeout",n),this},Et.prototype.ref=function(){return this._tcp.ref(),this},Et.prototype.unref=function(){return this._tcp.unref(),this},Et.prototype.closeAllConnections=function(){},Et.prototype.closeIdleConnections=function(){},Et.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 Rt(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,W.alloc(0))}),{req:r,socket:s}},Et.prototype.dispatchRequest=async function(t,n,s,r){const o=this;return new Promise((c,d)=>{var p;const y=Rt.build(t,n,s,r),g=new He(y);g._onComplete(c);const x=o.timeout||xs.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(`
11
73
  `).slice(0,5).join(`
12
- `)),g.headersSent)try{g.end()}catch{}else try{g.statusCode=500,g.end("Internal Server Error")}catch{}})}}catch(C){if(clearTimeout(E),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(`
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(`
13
75
  `).slice(0,5).join(`
14
- `)),!g.headersSent)try{g.statusCode=500,g.end("Internal Server Error")}catch{}d(C)}})};function Ua(e,t){return new vt(e,t)}const gi={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"},ja=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","CONNECT","TRACE"];function zS(){try{return typeof localStorage<"u"?localStorage.getItem("__corsProxyUrl")??null:null}catch{return null}}const Ke=function(t,n){if(!this)return;if(He.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 et,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(Ke.prototype,He.prototype),Object.defineProperty(Ke.prototype,"socket",{get:function(){return this._socket},configurable:!0}),Object.defineProperty(Ke.prototype,"connection",{get:function(){return this._socket},configurable:!0}),Ke.prototype.setHeader=function(t,n){this.headers[t.toLowerCase()]=n},Ke.prototype.getHeader=function(t){return this.headers[t.toLowerCase()]},Ke.prototype.removeHeader=function(t){delete this.headers[t.toLowerCase()]},Ke.prototype.write=function(t,n,s){const r=typeof t=="string"?H.from(t):t;this._pending.push(r);const o=typeof n=="function"?n:s;return o&&queueMicrotask(()=>o(null)),!0},Ke.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},Ke.prototype.abort=function(){this._cancelled=!0,this.aborted=!0,this._waitTimer&&clearTimeout(this._waitTimer),this.emit("abort")},Ke.prototype.setTimeout=function(t,n){return this._waitMs=t,n&&this.once("timeout",n),this},Ke.prototype.flushHeaders=function(){},Ke.prototype.setNoDelay=function(t){},Ke.prototype.setSocketKeepAlive=function(t,n){},Ke.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=En.get(d);if(T){const j=this._pending.length>0?H.concat(this._pending):void 0;try{const q=await T.dispatchRequest(this.method,this._opts.path??"/",this.headers,j);if(this._cancelled)return;const J=new Ct;J.statusCode=q.statusCode,J.statusMessage=q.statusMessage;for(const[Y,W]of Object.entries(q.headers))J.headers[Y.toLowerCase()]=W,J.rawHeaders.push(Y,W);J._injectBody(q.body),this.emit("response",J)}catch(q){this.emit("error",q)}return}const N=new Error(`connect ECONNREFUSED ${s}:${d}`);N.code="ECONNREFUSED",N.errno=-111,N.syscall="connect",N.address=s,N.port=d,this.emit("error",N);return}const p=zS(),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=H.concat(this._pending));const x=new AbortController;g.signal=x.signal,this._waitMs&&(this._waitTimer=setTimeout(()=>{x.abort(),this.emit("timeout")},this._waitMs));const E=await fetch(y,g);if(this._waitTimer&&(clearTimeout(this._waitTimer),this._waitTimer=null),this._cancelled)return;const C=await this._mapResponse(E);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)}},Ke.prototype._mapResponse=async function(t){const n=new Ct;n.statusCode=t.status,n.statusMessage=t.statusText||gi[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(H.from(s)),n},Ke.prototype._bridgeWebSocket=function(t){const n=t.replace(/^https:/,"wss:").replace(/^http:/,"ws:"),s=this.headers["sec-websocket-key"]??"",r=WS;if(!r){const E=this;setTimeout(()=>E.emit("error",new TypeError("No WebSocket available")),0);return}const c=Gr("sha1").update(s+"258EAFA5-E914-47DA-95CA-C5AB0DC85B11").digest("base64");let d;try{d=new r(n),d.binaryType="arraybuffer"}catch(E){const C=this;setTimeout(()=>C.emit("error",E instanceof Error?E:new Error(String(E))),0);return}const p=new et;p.cork=()=>{},p.uncork=()=>{},p._readableState={endEmitted:!1},p._writableState={finished:!1,errorEmitted:!1};let y=new Uint8Array(0);p.write=(E,C,T)=>{const N=typeof E=="string"?H.from(E):new Uint8Array(E),j=typeof C=="function"?C:T,q=new Uint8Array(y.length+N.length);for(q.set(y,0),q.set(N,y.length),y=q;y.length>=2;){const J=wi(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 j&&queueMicrotask(()=>j(null)),!0};const g=this;d.onopen=()=>{const E=new Ct(p);E.statusCode=101,E.statusMessage="Switching Protocols",E.headers={upgrade:"websocket",connection:"Upgrade","sec-websocket-accept":c},E.complete=!0,E.push(null),g.emit("upgrade",E,p,H.alloc(0))},d.onmessage=E=>{let C,T;if(typeof E.data=="string")C=new TextEncoder().encode(E.data),T=1;else if(E.data instanceof ArrayBuffer)C=new Uint8Array(E.data),T=2;else return;const N=hn(T,C,!1);p._feedData(H.from(N))},d.onclose=E=>{const C=E.code||1e3,T=new Uint8Array(2);T[0]=C>>8&255,T[1]=C&255;const N=hn(8,T,!1);p._feedData(H.from(N)),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=E=>((d.readyState===r.OPEN||d.readyState===r.CONNECTING)&&d.close(),x(E))};function Ml(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 np(e,t,n){const{opts:s,cb:r}=Ml(e,t,n),o=new Ke(s,"http");return r&&o.once("response",r),o}function sp(e,t,n){const{opts:s,cb:r}=Ml(e,t,n),o=new Ke({...s,method:"GET"},"http");return r&&o.once("response",r),o.end(),o}function Va(e,t,n,s){const{opts:r,cb:o}=Ml(e,t,n),c=new Ke(r,s);return o&&c.once("response",o),c}const En=new Map,yi=new Map;let Fl=null,$l=null;function qS(e,t,n){En.set(e,t),ns(),Fl&&Fl(e,t)}function GS(e){En.has(e)&&_n(),En.delete(e),yi.delete(e),$l&&$l(e)}function _i(e){return En.get(e)}ya=function(){return new Map(En)},R0=function(){for(const[,e]of En)try{e.close()}catch{}En.clear(),yi.clear()};function KS(e){for(const[t,n]of yi)if(n===e){const s=En.get(t);if(s)try{s.close()}catch{}En.delete(t),yi.delete(t)}}function YS(e){return yi.get(e)}function bi(e){Fl=e}function vi(e){$l=e}const kn=function(t){this&&(se.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(kn.prototype,se.prototype),kn.prototype.createConnection=function(t,n){const s=new et;return n&&n(null,s),s},kn.prototype.getName=function(t){return`${t.host??"localhost"}:${t.port??80}:${t.localAddress??""}`},kn.prototype.addRequest=function(t,n){},kn.prototype.destroy=function(){this.sockets={},this.freeSockets={},this.requests={}};const Ha=new kn;function wi(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 hn(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}T0=Object.freeze(Object.defineProperty({__proto__:null,Agent:kn,ClientRequest:Ke,IncomingMessage:Ct,METHODS:ja,STATUS_CODES:gi,Server:vt,ServerResponse:Le,_buildClientRequest:Va,closeAllServers:R0,closeServersByPid:KS,createServer:Ua,decodeFrame:wi,default:{Server:vt,IncomingMessage:Ct,ServerResponse:Le,ClientRequest:Ke,createServer:Ua,request:np,get:sp,STATUS_CODES:gi,METHODS:ja,getServer:_i,getAllServers:ya,setServerListenCallback:bi,setServerCloseCallback:vi,_buildClientRequest:Va,Agent:kn,globalAgent:Ha,decodeFrame:wi,encodeFrame:hn},encodeFrame:hn,get:sp,getAllServers:ya,getServer:_i,getServerOwner:YS,globalAgent:Ha,request:np,setServerCloseCallback:vi,setServerListenCallback:bi},Symbol.toStringTag,{value:"Module"}));function rp(e,t,n){return Va(e,t,n,"https")}function ip(e,t,n){const s=Va(e,t,n,"https");return s.end(),s}const ZS=Object.freeze(Object.defineProperty({__proto__:null,Agent:kn,ClientRequest:Ke,IncomingMessage:Ct,METHODS:ja,STATUS_CODES:gi,Server:vt,ServerResponse:Le,createServer:Ua,default:{Server:vt,IncomingMessage:Ct,ServerResponse:Le,ClientRequest:Ke,createServer:Ua,request:rp,get:ip,STATUS_CODES:gi,METHODS:ja,getServer:_i,getAllServers:ya,setServerListenCallback:bi,setServerCloseCallback:vi,Agent:kn,globalAgent:Ha},get:ip,getAllServers:ya,getServer:_i,globalAgent:Ha,request:rp,setServerCloseCallback:vi,setServerListenCallback:bi},Symbol.toStringTag,{value:"Module"}));function ap(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 op(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 lp(e,t){try{return new globalThis.URL(t,e).href}catch{return t}}const cp=globalThis.URL,up=globalThis.URLSearchParams;function dp(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 hp(e){const t=encodeURIComponent(e).replace(/%2F/g,"/");return new globalThis.URL("file://"+t)}function pp(e){try{return new globalThis.URL(`http://${e}`).hostname}catch{return e}}function fp(e){return e}Object.freeze(Object.defineProperty({__proto__:null,URL:cp,URLSearchParams:up,default:{parse:ap,format:op,resolve:lp,URL:cp,URLSearchParams:up,fileURLToPath:dp,pathToFileURL:hp,domainToASCII:pp,domainToUnicode:fp},domainToASCII:pp,domainToUnicode:fp,fileURLToPath:dp,format:op,parse:ap,pathToFileURL:hp,resolve:lp},Symbol.toStringTag,{value:"Module"}));function Ul(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,E;if(g>=0?(x=decodeURIComponent(y.substring(0,g).replace(/\+/g," ")),E=decodeURIComponent(y.substring(g+1).replace(/\+/g," "))):(x=decodeURIComponent(y.replace(/\+/g," ")),E=""),x in r){const C=r[x];Array.isArray(C)?C.push(E):r[x]=[C,E]}else r[x]=E}return r}function jl(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 mp(e){return encodeURIComponent(e)}function gp(e){return decodeURIComponent(e.replace(/\+/g," "))}const yp=jl,_p=Ul;Object.freeze(Object.defineProperty({__proto__:null,decode:_p,default:{parse:Ul,stringify:jl,escape:mp,unescape:gp,encode:yp,decode:_p},encode:yp,escape:mp,parse:Ul,stringify:jl,unescape:gp},Symbol.toStringTag,{value:"Module"})),id=function(e,...t){if(typeof e!="string")return[e,...t].map(r=>typeof r=="string"?r:Si(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 Si(o);default:return r}});for(;n<t.length;){const r=t[n++];s+=" "+(typeof r=="string"?r:Si(r))}return s};function Si(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,E])=>`${r(x,c+1)} => ${r(E,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 bp(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 vp(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 wp(e,t,n){let s=!1;return function(...o){return s||(console.warn(`DeprecationWarning: ${t}${n?` (${n})`:""}`),s=!0),e.apply(this,o)}}function Sp(e){return(...t)=>new Promise((n,s)=>{e(...t,(r,o)=>{r?s(r):n(o)})})}function xp(e){return(...t)=>{const n=t.pop();e(...t).then(s=>n(null,s)).catch(s=>n(s,void 0))}}function Wa(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)=>Wa(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=>Wa(e[r],t[r]))}return!1}function Vl(e){return Array.isArray(e)}function Hl(e){return typeof e=="boolean"}function Wl(e){return e===null}function zl(e){return e==null}function ql(e){return typeof e=="number"}function Gl(e){return typeof e=="string"}function Kl(e){return e===void 0}function Yl(e){return e instanceof RegExp}function Zl(e){return typeof e=="object"&&e!==null}function Xl(e){return e instanceof Date}function Jl(e){return e instanceof Error}function Ql(e){return typeof e=="function"}function ec(e){return e===null||typeof e!="object"&&typeof e!="function"}function tc(e){return e instanceof Uint8Array}function nc(e){return e instanceof Promise}function sc(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 Ep=sc;function kp(e){return e.replace(/\x1B\[[0-9;]*[a-zA-Z]|\x1B\].*?(\x07|\x1B\\)|\x1B[()][A-Z0-9]|\x1B[#=]|\x1B./g,"")}const Cp={isArray:Vl,isBoolean:Hl,isNull:Wl,isNullOrUndefined:zl,isNumber:ql,isString:Gl,isUndefined:Kl,isRegExp:Yl,isObject:Zl,isDate:Xl,isError:Jl,isFunction:Ql,isPrimitive:ec,isBuffer:tc,isPromise:nc},XS={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 Ap(e,t){const n=Array.isArray(e)?e:[e];let s=t;for(const r of n){const o=XS[r];o&&(s=`\x1B[${o[0]}m${s}\x1B[${o[1]}m`)}return s}function Tp(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("="),N=T!==-1?C.slice(2,T):C.slice(2),j=n[N];if(!j&&r)throw new Error(`Unknown option '--${N}'`);const q=(j==null?void 0:j.type)??"boolean";let J;if(q==="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 '--${N}' requires a value`);if(j!=null&&j.multiple){const Y=d[N]??[];Y.push(J),d[N]=Y}else d[N]=J;o&&y.push({kind:"option",name:N,value:J,index:g}),g++;continue}if(C.startsWith("-")&&C.length>1){const T=C.slice(1);for(let N=0;N<T.length;N++){const j=T[N],q=c[j];if(!q&&r)throw new Error(`Unknown option '-${j}'`);const J=q??j,Y=q?n[q]:void 0,W=(Y==null?void 0:Y.type)??"boolean";let F;if(W==="boolean")F=!0;else{const ne=T.slice(N+1);if(ne.length>0)F=ne,N=T.length;else if(g+1<t.length)F=t[++g];else throw new Error(`Option '-${j}' requires a value`)}if(Y!=null&&Y.multiple){const ne=d[J]??[];ne.push(F),d[J]=ne}else d[J]=F;o&&y.push({kind:"option",name:J,value:F,index:g})}g++;continue}g++}const E={values:d,positionals:p};return o&&(E.tokens=y),E}const Ip=globalThis.TextEncoder,Rp=globalThis.TextDecoder;Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:Rp,TextEncoder:Ip,_extend:vp,callbackify:xp,debug:Ep,debuglog:sc,default:{format:id,inspect:Si,inherits:bp,_extend:vp,deprecate:wp,promisify:Sp,callbackify:xp,isDeepStrictEqual:Wa,debuglog:sc,debug:Ep,stripVTControlCharacters:kp,isArray:Vl,isBoolean:Hl,isNull:Wl,isNullOrUndefined:zl,isNumber:ql,isString:Gl,isUndefined:Kl,isRegExp:Yl,isObject:Zl,isDate:Xl,isError:Jl,isFunction:Ql,isPrimitive:ec,isBuffer:tc,isPromise:nc,styleText:Ap,parseArgs:Tp,types:Cp,TextEncoder:Ip,TextDecoder:Rp},deprecate:wp,format:id,inherits:bp,inspect:Si,isArray:Vl,isBoolean:Hl,isBuffer:tc,isDate:Xl,isDeepStrictEqual:Wa,isError:Jl,isFunction:Ql,isNull:Wl,isNullOrUndefined:zl,isNumber:ql,isObject:Zl,isPrimitive:ec,isPromise:nc,isRegExp:Yl,isString:Gl,isUndefined:Kl,parseArgs:Tp,promisify:Sp,stripVTControlCharacters:kp,styleText:Ap,types:Cp},Symbol.toStringTag,{value:"Module"}));function Pp(e){return!1}const rc=function(){this&&(this.isTTY=!1,this.isRaw=!1)};rc.prototype.setRawMode=function(t){return this.isRaw=t,this};const Wn=function(){this&&(this.isTTY=!1,this.columns=120,this.rows=40)};Wn.prototype.getColorDepth=function(){return 8},Wn.prototype.hasColors=function(t){return(t??1)<=256},Wn.prototype.getWindowSize=function(){return[this.columns,this.rows]},Wn.prototype.clearLine=function(t,n){return n==null||n(),!0},Wn.prototype.clearScreenDown=function(t){return t==null||t(),!0},Wn.prototype.cursorTo=function(t,n,s){return typeof n=="function"?n():s==null||s(),!0},Wn.prototype.moveCursor=function(t,n,s){return s==null||s(),!0},Object.freeze(Object.defineProperty({__proto__:null,ReadStream:rc,WriteStream:Wn,default:{isatty:Pp,ReadStream:rc,WriteStream:Wn},isatty:Pp},Symbol.toStringTag,{value:"Module"}));function Dp(){return $.HOSTNAME}function Op(){return $.PLATFORM}function Np(){return $.ARCH}function Bp(){return $.TYPE}function Lp(){return $.RELEASE}function Mp(){return $.VERSION}function Fp(){return $.MACHINE}function $p(){return $.TMPDIR}function Up(){return $.HOMEDIR}function jp(){const e={model:G.MODEL,speed:G.SPEED,times:{user:0,nice:0,sys:0,idle:0,irq:0}};return Array.from({length:G.COUNT},()=>({...e}))}function Vp(){return Z.TOTAL}function Hp(){return Z.FREE}function Wp(){return Math.floor(performance.now()/1e3)}function zp(){return[...ae]}function qp(){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 Gp(){return{username:$.USERNAME,uid:B.UID,gid:B.GID,shell:$.SHELL,homedir:$.HOMEDIR}}function Kp(){return $.ENDIANNESS}function Yp(e){return 0}function Zp(e,t){}const Xp=`
15
- `,Jp="/dev/null",Qp={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:Xp,arch:Np,constants:Qp,cpus:jp,default:{hostname:Dp,platform:Op,arch:Np,type:Bp,release:Lp,version:Mp,machine:Fp,tmpdir:$p,homedir:Up,cpus:jp,totalmem:Vp,freemem:Hp,uptime:Wp,loadavg:zp,networkInterfaces:qp,userInfo:Gp,endianness:Kp,getPriority:Yp,setPriority:Zp,EOL:Xp,devNull:Jp,constants:Qp},devNull:Jp,endianness:Kp,freemem:Hp,getPriority:Yp,homedir:Up,hostname:Dp,loadavg:zp,machine:Fp,networkInterfaces:qp,platform:Op,release:Lp,setPriority:Zp,tmpdir:$p,totalmem:Vp,type:Bp,uptime:Wp,userInfo:Gp,version:Mp},Symbol.toStringTag,{value:"Module"}));const ic="0.20.0",ef="4.9.0",JS="3.0.1",tf=`https://esm.sh/esbuild-wasm@${ic}`,ac=`https://esm.sh/esbuild-wasm@${ic}/esbuild.wasm`,QS=`https://esm.sh/esbuild-wasm@${ic}/esm/browser.min.js`,ex=`https://esm.sh/@rollup/browser@${ef}`,tx=`https://esm.sh/brotli-wasm@${JS}`,za=new Function("url","return import(url)"),nx=4,nf=0,sf=1,sx=2;function ur(e){let t=e.length;for(;--t>=0;)e[t]=0}const rx=0,rf=1,ix=2,ax=3,ox=258,oc=29,xi=256,Ei=xi+1+oc,dr=30,lc=19,af=2*Ei+1,Rs=15,cc=16,lx=7,uc=256,of=16,lf=17,cf=18,dc=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]),qa=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]),cx=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),uf=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ux=512,zn=new Array((Ei+2)*2);ur(zn);const ki=new Array(dr*2);ur(ki);const Ci=new Array(ux);ur(Ci);const Ai=new Array(ox-ax+1);ur(Ai);const hc=new Array(oc);ur(hc);const Ga=new Array(dr);ur(Ga);function pc(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 df,hf,pf;function fc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const ff=e=>e<256?Ci[e]:Ci[256+(e>>>7)],Ti=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Ot=(e,t,n)=>{e.bi_valid>cc-n?(e.bi_buf|=t<<e.bi_valid&65535,Ti(e,e.bi_buf),e.bi_buf=t>>cc-e.bi_valid,e.bi_valid+=n-cc):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Cn=(e,t,n)=>{Ot(e,n[t*2],n[t*2+1])},mf=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},dx=e=>{e.bi_valid===16?(Ti(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)},hx=(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,E,C,T,N=0;for(E=0;E<=Rs;E++)e.bl_count[E]=0;for(n[e.heap[e.heap_max]*2+1]=0,y=e.heap_max+1;y<af;y++)g=e.heap[y],E=n[n[g*2+1]*2+1]+1,E>p&&(E=p,N++),n[g*2+1]=E,!(g>s)&&(e.bl_count[E]++,C=0,g>=d&&(C=c[g-d]),T=n[g*2],e.opt_len+=T*(E+C),o&&(e.static_len+=T*(r[g*2+1]+C)));if(N!==0){do{for(E=p-1;e.bl_count[E]===0;)E--;e.bl_count[E]--,e.bl_count[E+1]+=2,e.bl_count[p]--,N-=2}while(N>0);for(E=p;E!==0;E--)for(g=e.bl_count[E];g!==0;)x=e.heap[--y],!(x>s)&&(n[x*2+1]!==E&&(e.opt_len+=(E-n[x*2+1])*n[x*2],n[x*2+1]=E),g--)}},gf=(e,t,n)=>{const s=new Array(Rs+1);let r=0,o,c;for(o=1;o<=Rs;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]=mf(s[d]++,d))}},px=()=>{let e,t,n,s,r;const o=new Array(Rs+1);for(n=0,s=0;s<oc-1;s++)for(hc[s]=n,e=0;e<1<<dc[s];e++)Ai[n++]=s;for(Ai[n-1]=s,r=0,s=0;s<16;s++)for(Ga[s]=r,e=0;e<1<<qa[s];e++)Ci[r++]=s;for(r>>=7;s<dr;s++)for(Ga[s]=r<<7,e=0;e<1<<qa[s]-7;e++)Ci[256+r++]=s;for(t=0;t<=Rs;t++)o[t]=0;for(e=0;e<=143;)zn[e*2+1]=8,e++,o[8]++;for(;e<=255;)zn[e*2+1]=9,e++,o[9]++;for(;e<=279;)zn[e*2+1]=7,e++,o[7]++;for(;e<=287;)zn[e*2+1]=8,e++,o[8]++;for(gf(zn,Ei+1,o),e=0;e<dr;e++)ki[e*2+1]=5,ki[e*2]=mf(e,5);df=new pc(zn,dc,xi+1,Ei,Rs),hf=new pc(ki,qa,0,dr,Rs),pf=new pc(new Array(0),cx,0,lc,lx)},yf=e=>{let t;for(t=0;t<Ei;t++)e.dyn_ltree[t*2]=0;for(t=0;t<dr;t++)e.dyn_dtree[t*2]=0;for(t=0;t<lc;t++)e.bl_tree[t*2]=0;e.dyn_ltree[uc*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},_f=e=>{e.bi_valid>8?Ti(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},bf=(e,t,n,s)=>{const r=t*2,o=n*2;return e[r]<e[o]||e[r]===e[o]&&s[t]<=s[n]},mc=(e,t,n)=>{const s=e.heap[n];let r=n<<1;for(;r<=e.heap_len&&(r<e.heap_len&&bf(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!bf(t,s,e.heap[r],e.depth));)e.heap[n]=e.heap[r],n=r,r<<=1;e.heap[n]=s},vf=(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?Cn(e,r,t):(c=Ai[r],Cn(e,c+xi+1,t),d=dc[c],d!==0&&(r-=hc[c],Ot(e,r,d)),s--,c=ff(s),Cn(e,c,n),d=qa[c],d!==0&&(s-=Ga[c],Ot(e,s,d)));while(o<e.sym_next);Cn(e,uc,t)},gc=(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=af,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--)mc(e,n,c);y=o;do c=e.heap[1],e.heap[1]=e.heap[e.heap_len--],mc(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++,mc(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],hx(e,t),gf(n,p,e.bl_count)},wf=(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[of*2]++):d<=10?e.bl_tree[lf*2]++:e.bl_tree[cf*2]++,d=0,r=o,c===0?(p=138,y=3):o===c?(p=6,y=3):(p=7,y=4))},Sf=(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 Cn(e,o,e.bl_tree);while(--d!==0);else o!==0?(o!==r&&(Cn(e,o,e.bl_tree),d--),Cn(e,of,e.bl_tree),Ot(e,d-3,2)):d<=10?(Cn(e,lf,e.bl_tree),Ot(e,d-3,3)):(Cn(e,cf,e.bl_tree),Ot(e,d-11,7));d=0,r=o,c===0?(p=138,y=3):o===c?(p=6,y=3):(p=7,y=4)}},fx=e=>{let t;for(wf(e,e.dyn_ltree,e.l_desc.max_code),wf(e,e.dyn_dtree,e.d_desc.max_code),gc(e,e.bl_desc),t=lc-1;t>=3&&e.bl_tree[uf[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},mx=(e,t,n,s)=>{let r;for(Ot(e,t-257,5),Ot(e,n-1,5),Ot(e,s-4,4),r=0;r<s;r++)Ot(e,e.bl_tree[uf[r]*2+1],3);Sf(e,e.dyn_ltree,t-1),Sf(e,e.dyn_dtree,n-1)},gx=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return nf;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return sf;for(n=32;n<xi;n++)if(e.dyn_ltree[n*2]!==0)return sf;return nf};let xf=!1;const yx=e=>{xf||(px(),xf=!0),e.l_desc=new fc(e.dyn_ltree,df),e.d_desc=new fc(e.dyn_dtree,hf),e.bl_desc=new fc(e.bl_tree,pf),e.bi_buf=0,e.bi_valid=0,yf(e)},Ef=(e,t,n,s)=>{Ot(e,(rx<<1)+(s?1:0),3),_f(e),Ti(e,n),Ti(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},_x=e=>{Ot(e,rf<<1,3),Cn(e,uc,zn),dx(e)},bx=(e,t,n,s)=>{let r,o,c=0;e.level>0?(e.strm.data_type===sx&&(e.strm.data_type=gx(e)),gc(e,e.l_desc),gc(e,e.d_desc),c=fx(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?Ef(e,t,n,s):e.strategy===nx||o===r?(Ot(e,(rf<<1)+(s?1:0),3),vf(e,zn,ki)):(Ot(e,(ix<<1)+(s?1:0),3),mx(e,e.l_desc.max_code+1,e.d_desc.max_code+1,c+1),vf(e,e.dyn_ltree,e.dyn_dtree)),yf(e),s&&_f(e)},vx=(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[(Ai[n]+xi+1)*2]++,e.dyn_dtree[ff(t)*2]++),e.sym_next===e.sym_end);var wx=yx,Sx=Ef,xx=bx,Ex=vx,kx=_x,Cx={_tr_init:wx,_tr_stored_block:Sx,_tr_flush_block:xx,_tr_tally:Ex,_tr_align:kx},Ii=(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 Ax=()=>{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},Tx=new Uint32Array(Ax());var ht=(e,t,n,s)=>{const r=Tx,o=s+n;e^=-1;for(let c=s;c<o;c++)e=e>>>8^r[(e^t[c])&255];return e^-1},Ps={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"},Ri={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:Ix,_tr_stored_block:yc,_tr_flush_block:Rx,_tr_tally:as,_tr_align:Px}=Cx,{Z_NO_FLUSH:os,Z_PARTIAL_FLUSH:Dx,Z_FULL_FLUSH:Ox,Z_FINISH:Yt,Z_BLOCK:kf,Z_OK:ft,Z_STREAM_END:Cf,Z_STREAM_ERROR:An,Z_DATA_ERROR:Nx,Z_BUF_ERROR:_c,Z_DEFAULT_COMPRESSION:Bx,Z_FILTERED:Lx,Z_HUFFMAN_ONLY:Ka,Z_RLE:Mx,Z_FIXED:Fx,Z_DEFAULT_STRATEGY:$x,Z_UNKNOWN:Ux,Z_DEFLATED:Ya}=Ri,jx=9,Vx=15,Hx=8,bc=256+1+29,Wx=30,zx=19,qx=2*bc+1,Gx=15,De=3,ls=258,Tn=ls+De+1,Kx=32,hr=42,vc=57,wc=69,Sc=73,xc=91,Ec=103,Ds=113,Pi=666,At=1,pr=2,Os=3,fr=4,Yx=3,Ns=(e,t)=>(e.msg=Ps[t],t),Af=e=>e*2-(e>4?9:0),cs=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Zx=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 us=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const Ft=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))},$t=(e,t)=>{Rx(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ft(e.strm)},Me=(e,t)=>{e.pending_buf[e.pending++]=t},Di=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},kc=(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=Ii(e.adler,t,r,n):e.state.wrap===2&&(e.adler=ht(e.adler,t,r,n)),e.next_in+=r,e.total_in+=r,r)},Tf=(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-Tn?e.strstart-(e.w_size-Tn):0,y=e.window,g=e.w_mask,x=e.prev,E=e.strstart+ls;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<E);if(o=ls-(E-s),s=E-ls,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},mr=e=>{const t=e.w_size;let n,s,r;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Tn)&&(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),Zx(e),s+=t),e.strm.avail_in===0)break;if(n=kc(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=n,e.lookahead+e.insert>=De)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=us(e,e.ins_h,e.window[r+1]);e.insert&&(e.ins_h=us(e,e.ins_h,e.window[r+De-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<De)););}while(e.lookahead<Tn&&e.strm.avail_in!==0)},If=(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!==Yt||t===os||s!==r+e.strm.avail_in)))break;c=t===Yt&&s===r+e.strm.avail_in?1:0,yc(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,Ft(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&&(kc(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?fr:t!==os&&t!==Yt&&e.strm.avail_in===0&&e.strstart===e.block_start?pr:(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&&(kc(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===Yt)&&t!==os&&e.strm.avail_in===0&&r<=o)&&(s=r>o?o:r,c=t===Yt&&e.strm.avail_in===0&&s===r?1:0,yc(e,e.block_start,s,c),e.block_start+=s,Ft(e.strm)),c?Os:At)},Cc=(e,t)=>{let n,s;for(;;){if(e.lookahead<Tn){if(mr(e),e.lookahead<Tn&&t===os)return At;if(e.lookahead===0)break}if(n=0,e.lookahead>=De&&(e.ins_h=us(e,e.ins_h,e.window[e.strstart+De-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-Tn&&(e.match_length=Tf(e,n)),e.match_length>=De)if(s=as(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=us(e,e.ins_h,e.window[e.strstart+De-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=us(e,e.ins_h,e.window[e.strstart+1]);else s=as(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(s&&($t(e,!1),e.strm.avail_out===0))return At}return e.insert=e.strstart<De-1?e.strstart:De-1,t===Yt?($t(e,!0),e.strm.avail_out===0?Os:fr):e.sym_next&&($t(e,!1),e.strm.avail_out===0)?At:pr},gr=(e,t)=>{let n,s,r;for(;;){if(e.lookahead<Tn){if(mr(e),e.lookahead<Tn&&t===os)return At;if(e.lookahead===0)break}if(n=0,e.lookahead>=De&&(e.ins_h=us(e,e.ins_h,e.window[e.strstart+De-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=De-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Tn&&(e.match_length=Tf(e,n),e.match_length<=5&&(e.strategy===Lx||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){r=e.strstart+e.lookahead-De,s=as(e,e.strstart-1-e.prev_match,e.prev_length-De),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=r&&(e.ins_h=us(e,e.ins_h,e.window[e.strstart+De-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=De-1,e.strstart++,s&&($t(e,!1),e.strm.avail_out===0))return At}else if(e.match_available){if(s=as(e,0,e.window[e.strstart-1]),s&&$t(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return At}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(s=as(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<De-1?e.strstart:De-1,t===Yt?($t(e,!0),e.strm.avail_out===0?Os:fr):e.sym_next&&($t(e,!1),e.strm.avail_out===0)?At:pr},Xx=(e,t)=>{let n,s,r,o;const c=e.window;for(;;){if(e.lookahead<=ls){if(mr(e),e.lookahead<=ls&&t===os)return At;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=De&&e.strstart>0&&(r=e.strstart-1,s=c[r],s===c[++r]&&s===c[++r]&&s===c[++r])){o=e.strstart+ls;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=ls-(o-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=De?(n=as(e,1,e.match_length-De),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=as(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&($t(e,!1),e.strm.avail_out===0))return At}return e.insert=0,t===Yt?($t(e,!0),e.strm.avail_out===0?Os:fr):e.sym_next&&($t(e,!1),e.strm.avail_out===0)?At:pr},Jx=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(mr(e),e.lookahead===0)){if(t===os)return At;break}if(e.match_length=0,n=as(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&($t(e,!1),e.strm.avail_out===0))return At}return e.insert=0,t===Yt?($t(e,!0),e.strm.avail_out===0?Os:fr):e.sym_next&&($t(e,!1),e.strm.avail_out===0)?At:pr};function In(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 Oi=[new In(0,0,0,0,If),new In(4,4,8,4,Cc),new In(4,5,16,8,Cc),new In(4,6,32,32,Cc),new In(4,4,16,16,gr),new In(8,16,32,32,gr),new In(8,16,128,128,gr),new In(8,32,128,256,gr),new In(32,128,258,1024,gr),new In(32,258,258,4096,gr)],Qx=e=>{e.window_size=2*e.w_size,cs(e.head),e.max_lazy_match=Oi[e.level].max_lazy,e.good_match=Oi[e.level].good_length,e.nice_match=Oi[e.level].nice_length,e.max_chain_length=Oi[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 eE(){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=Ya,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(qx*2),this.dyn_dtree=new Uint16Array((2*Wx+1)*2),this.bl_tree=new Uint16Array((2*zx+1)*2),cs(this.dyn_ltree),cs(this.dyn_dtree),cs(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Gx+1),this.heap=new Uint16Array(2*bc+1),cs(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*bc+1),cs(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 Ni=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==hr&&t.status!==vc&&t.status!==wc&&t.status!==Sc&&t.status!==xc&&t.status!==Ec&&t.status!==Ds&&t.status!==Pi?1:0},Rf=e=>{if(Ni(e))return Ns(e,An);e.total_in=e.total_out=0,e.data_type=Ux;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?vc:t.wrap?hr:Ds,e.adler=t.wrap===2?0:1,t.last_flush=-2,Ix(t),ft},Pf=e=>{const t=Rf(e);return t===ft&&Qx(e.state),t},tE=(e,t)=>Ni(e)||e.state.wrap!==2?An:(e.state.gzhead=t,ft),Df=(e,t,n,s,r,o)=>{if(!e)return An;let c=1;if(t===Bx&&(t=6),s<0?(c=0,s=-s):s>15&&(c=2,s-=16),r<1||r>jx||n!==Ya||s<8||s>15||t<0||t>9||o<0||o>Fx||s===8&&c!==1)return Ns(e,An);s===8&&(s=9);const d=new eE;return e.state=d,d.strm=e,d.status=hr,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+De-1)/De),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,Pf(e)},nE=(e,t)=>Df(e,t,Ya,Vx,Hx,$x),sE=(e,t)=>{if(Ni(e)||t>kf||t<0)return e?Ns(e,An):An;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===Pi&&t!==Yt)return Ns(e,e.avail_out===0?_c:An);const s=n.last_flush;if(n.last_flush=t,n.pending!==0){if(Ft(e),e.avail_out===0)return n.last_flush=-1,ft}else if(e.avail_in===0&&Af(t)<=Af(s)&&t!==Yt)return Ns(e,_c);if(n.status===Pi&&e.avail_in!==0)return Ns(e,_c);if(n.status===hr&&n.wrap===0&&(n.status=Ds),n.status===hr){let r=Ya+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=Ka||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,r|=o<<6,n.strstart!==0&&(r|=Kx),r+=31-r%31,Di(n,r),n.strstart!==0&&(Di(n,e.adler>>>16),Di(n,e.adler&65535)),e.adler=1,n.status=Ds,Ft(e),n.pending!==0)return n.last_flush=-1,ft}if(n.status===vc){if(e.adler=0,Me(n,31),Me(n,139),Me(n,8),n.gzhead)Me(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)),Me(n,n.gzhead.time&255),Me(n,n.gzhead.time>>8&255),Me(n,n.gzhead.time>>16&255),Me(n,n.gzhead.time>>24&255),Me(n,n.level===9?2:n.strategy>=Ka||n.level<2?4:0),Me(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Me(n,n.gzhead.extra.length&255),Me(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=ht(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=wc;else if(Me(n,0),Me(n,0),Me(n,0),Me(n,0),Me(n,0),Me(n,n.level===9?2:n.strategy>=Ka||n.level<2?4:0),Me(n,Yx),n.status=Ds,Ft(e),n.pending!==0)return n.last_flush=-1,ft}if(n.status===wc){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=ht(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex+=d,Ft(e),n.pending!==0)return n.last_flush=-1,ft;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=ht(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=Sc}if(n.status===Sc){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=ht(e.adler,n.pending_buf,n.pending-r,r)),Ft(e),n.pending!==0)return n.last_flush=-1,ft;r=0}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,Me(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>r&&(e.adler=ht(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=xc}if(n.status===xc){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=ht(e.adler,n.pending_buf,n.pending-r,r)),Ft(e),n.pending!==0)return n.last_flush=-1,ft;r=0}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,Me(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>r&&(e.adler=ht(e.adler,n.pending_buf,n.pending-r,r))}n.status=Ec}if(n.status===Ec){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Ft(e),n.pending!==0))return n.last_flush=-1,ft;Me(n,e.adler&255),Me(n,e.adler>>8&255),e.adler=0}if(n.status=Ds,Ft(e),n.pending!==0)return n.last_flush=-1,ft}if(e.avail_in!==0||n.lookahead!==0||t!==os&&n.status!==Pi){let r=n.level===0?If(n,t):n.strategy===Ka?Jx(n,t):n.strategy===Mx?Xx(n,t):Oi[n.level].func(n,t);if((r===Os||r===fr)&&(n.status=Pi),r===At||r===Os)return e.avail_out===0&&(n.last_flush=-1),ft;if(r===pr&&(t===Dx?Px(n):t!==kf&&(yc(n,0,0,!1),t===Ox&&(cs(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Ft(e),e.avail_out===0))return n.last_flush=-1,ft}return t!==Yt?ft:n.wrap<=0?Cf:(n.wrap===2?(Me(n,e.adler&255),Me(n,e.adler>>8&255),Me(n,e.adler>>16&255),Me(n,e.adler>>24&255),Me(n,e.total_in&255),Me(n,e.total_in>>8&255),Me(n,e.total_in>>16&255),Me(n,e.total_in>>24&255)):(Di(n,e.adler>>>16),Di(n,e.adler&65535)),Ft(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ft:Cf)},rE=e=>{if(Ni(e))return An;const t=e.state.status;return e.state=null,t===Ds?Ns(e,Nx):ft},iE=(e,t)=>{let n=t.length;if(Ni(e))return An;const s=e.state,r=s.wrap;if(r===2||r===1&&s.status!==hr||s.lookahead)return An;if(r===1&&(e.adler=Ii(e.adler,t,n,0)),s.wrap=0,n>=s.w_size){r===0&&(cs(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,mr(s);s.lookahead>=De;){let p=s.strstart,y=s.lookahead-(De-1);do s.ins_h=us(s,s.ins_h,s.window[p+De-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=De-1,mr(s)}return s.strstart+=s.lookahead,s.block_start=s.strstart,s.insert=s.lookahead,s.lookahead=0,s.match_length=s.prev_length=De-1,s.match_available=0,e.next_in=c,e.input=d,e.avail_in=o,s.wrap=r,ft};var aE=nE,oE=Df,lE=Pf,cE=Rf,uE=tE,dE=sE,hE=rE,pE=iE,fE="pako deflate (from Nodeca project)",Bi={deflateInit:aE,deflateInit2:oE,deflateReset:lE,deflateResetKeep:cE,deflateSetHeader:uE,deflate:dE,deflateEnd:hE,deflateSetDictionary:pE,deflateInfo:fE};const mE=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var gE=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)mE(n,s)&&(e[s]=n[s])}}return e},yE=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},Za={assign:gE,flattenChunks:yE};let Of=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Of=!1}const Li=new Uint8Array(256);for(let e=0;e<256;e++)Li[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Li[254]=Li[254]=1;var _E=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 bE=(e,t)=>{if(t<65534&&e.subarray&&Of)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 vE=(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=Li[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 bE(o,r)},wE=(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+Li[e[n]]>t?n:t},Mi={string2buf:_E,buf2string:vE,utf8border:wE};function SE(){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 Nf=SE;const Bf=Object.prototype.toString,{Z_NO_FLUSH:xE,Z_SYNC_FLUSH:EE,Z_FULL_FLUSH:kE,Z_FINISH:CE,Z_OK:Xa,Z_STREAM_END:AE,Z_DEFAULT_COMPRESSION:TE,Z_DEFAULT_STRATEGY:IE,Z_DEFLATED:RE}=Ri;function Fi(e){this.options=Za.assign({level:TE,method:RE,chunkSize:16384,windowBits:15,memLevel:8,strategy:IE},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 Nf,this.strm.avail_out=0;let n=Bi.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Xa)throw new Error(Ps[n]);if(t.header&&Bi.deflateSetHeader(this.strm,t.header),t.dictionary){let s;if(typeof t.dictionary=="string"?s=Mi.string2buf(t.dictionary):Bf.call(t.dictionary)==="[object ArrayBuffer]"?s=new Uint8Array(t.dictionary):s=t.dictionary,n=Bi.deflateSetDictionary(this.strm,s),n!==Xa)throw new Error(Ps[n]);this._dict_set=!0}}Fi.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?CE:xE,typeof e=="string"?n.input=Mi.string2buf(e):Bf.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===EE||o===kE)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(r=Bi.deflate(n,o),r===AE)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=Bi.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Xa;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},Fi.prototype.onData=function(e){this.chunks.push(e)},Fi.prototype.onEnd=function(e){e===Xa&&(this.result=Za.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ac(e,t){const n=new Fi(t);if(n.push(e,!0),n.err)throw n.msg||Ps[n.err];return n.result}function PE(e,t){return t=t||{},t.raw=!0,Ac(e,t)}function DE(e,t){return t=t||{},t.gzip=!0,Ac(e,t)}var OE=Fi,NE=Ac,BE=PE,LE=DE,ME={Deflate:OE,deflate:NE,deflateRaw:BE,gzip:LE};const Ja=16209,FE=16191;var $E=function(t,n){let s,r,o,c,d,p,y,g,x,E,C,T,N,j,q,J,Y,W,F,ne,P,D,L,U;const O=t.state;s=t.next_in,L=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=O.dmax,y=O.wsize,g=O.whave,x=O.wnext,E=O.window,C=O.hold,T=O.bits,N=O.lencode,j=O.distcode,q=(1<<O.lenbits)-1,J=(1<<O.distbits)-1;e:do{T<15&&(C+=L[s++]<<T,T+=8,C+=L[s++]<<T,T+=8),Y=N[C&q];t:for(;;){if(W=Y>>>24,C>>>=W,T-=W,W=Y>>>16&255,W===0)U[o++]=Y&65535;else if(W&16){F=Y&65535,W&=15,W&&(T<W&&(C+=L[s++]<<T,T+=8),F+=C&(1<<W)-1,C>>>=W,T-=W),T<15&&(C+=L[s++]<<T,T+=8,C+=L[s++]<<T,T+=8),Y=j[C&J];n:for(;;){if(W=Y>>>24,C>>>=W,T-=W,W=Y>>>16&255,W&16){if(ne=Y&65535,W&=15,T<W&&(C+=L[s++]<<T,T+=8,T<W&&(C+=L[s++]<<T,T+=8)),ne+=C&(1<<W)-1,ne>p){t.msg="invalid distance too far back",O.mode=Ja;break e}if(C>>>=W,T-=W,W=o-c,ne>W){if(W=ne-W,W>g&&O.sane){t.msg="invalid distance too far back",O.mode=Ja;break e}if(P=0,D=E,x===0){if(P+=y-W,W<F){F-=W;do U[o++]=E[P++];while(--W);P=o-ne,D=U}}else if(x<W){if(P+=y+x-W,W-=x,W<F){F-=W;do U[o++]=E[P++];while(--W);if(P=0,x<F){W=x,F-=W;do U[o++]=E[P++];while(--W);P=o-ne,D=U}}}else if(P+=x-W,W<F){F-=W;do U[o++]=E[P++];while(--W);P=o-ne,D=U}for(;F>2;)U[o++]=D[P++],U[o++]=D[P++],U[o++]=D[P++],F-=3;F&&(U[o++]=D[P++],F>1&&(U[o++]=D[P++]))}else{P=o-ne;do U[o++]=U[P++],U[o++]=U[P++],U[o++]=U[P++],F-=3;while(F>2);F&&(U[o++]=U[P++],F>1&&(U[o++]=U[P++]))}}else if((W&64)===0){Y=j[(Y&65535)+(C&(1<<W)-1)];continue n}else{t.msg="invalid distance code",O.mode=Ja;break e}break}}else if((W&64)===0){Y=N[(Y&65535)+(C&(1<<W)-1)];continue t}else if(W&32){O.mode=FE;break e}else{t.msg="invalid literal/length code",O.mode=Ja;break e}break}}while(s<r&&o<d);F=T>>3,s-=F,T-=F<<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),O.hold=C,O.bits=T};const yr=15,Lf=852,Mf=592,Ff=0,Tc=1,$f=2,UE=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]),jE=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]),VE=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]),HE=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 $i=(e,t,n,s,r,o,c,d)=>{const p=d.bits;let y=0,g=0,x=0,E=0,C=0,T=0,N=0,j=0,q=0,J=0,Y,W,F,ne,P,D=null,L;const U=new Uint16Array(yr+1),O=new Uint16Array(yr+1);let te=null,le,oe,fe;for(y=0;y<=yr;y++)U[y]=0;for(g=0;g<s;g++)U[t[n+g]]++;for(C=p,E=yr;E>=1&&U[E]===0;E--);if(C>E&&(C=E),E===0)return r[o++]=1<<24|64<<16|0,r[o++]=1<<24|64<<16|0,d.bits=1,0;for(x=1;x<E&&U[x]===0;x++);for(C<x&&(C=x),j=1,y=1;y<=yr;y++)if(j<<=1,j-=U[y],j<0)return-1;if(j>0&&(e===Ff||E!==1))return-1;for(O[1]=0,y=1;y<yr;y++)O[y+1]=O[y]+U[y];for(g=0;g<s;g++)t[n+g]!==0&&(c[O[t[n+g]]++]=g);if(e===Ff?(D=te=c,L=20):e===Tc?(D=UE,te=jE,L=257):(D=VE,te=HE,L=0),J=0,g=0,y=x,P=o,T=C,N=0,F=-1,q=1<<C,ne=q-1,e===Tc&&q>Lf||e===$f&&q>Mf)return 1;for(;;){le=y-N,c[g]+1<L?(oe=0,fe=c[g]):c[g]>=L?(oe=te[c[g]-L],fe=D[c[g]-L]):(oe=96,fe=0),Y=1<<y-N,W=1<<T,x=W;do W-=Y,r[P+(J>>N)+W]=le<<24|oe<<16|fe|0;while(W!==0);for(Y=1<<y-1;J&Y;)Y>>=1;if(Y!==0?(J&=Y-1,J+=Y):J=0,g++,--U[y]===0){if(y===E)break;y=t[n+c[g]]}if(y>C&&(J&ne)!==F){for(N===0&&(N=C),P+=x,T=y-N,j=1<<T;T+N<E&&(j-=U[T+N],!(j<=0));)T++,j<<=1;if(q+=1<<T,e===Tc&&q>Lf||e===$f&&q>Mf)return 1;F=J&ne,r[F]=C<<24|T<<16|P-o|0}}return J!==0&&(r[P+J]=y-N<<24|64<<16|0),d.bits=C,0};const WE=0,Uf=1,jf=2,{Z_FINISH:Vf,Z_BLOCK:zE,Z_TREES:Qa,Z_OK:Bs,Z_STREAM_END:qE,Z_NEED_DICT:GE,Z_STREAM_ERROR:Zt,Z_DATA_ERROR:Hf,Z_MEM_ERROR:Wf,Z_BUF_ERROR:KE,Z_DEFLATED:zf}=Ri,eo=16180,qf=16181,Gf=16182,Kf=16183,Yf=16184,Zf=16185,Xf=16186,Jf=16187,Qf=16188,em=16189,to=16190,qn=16191,Ic=16192,tm=16193,Rc=16194,nm=16195,sm=16196,rm=16197,im=16198,no=16199,so=16200,am=16201,om=16202,lm=16203,cm=16204,um=16205,Pc=16206,dm=16207,hm=16208,ze=16209,pm=16210,fm=16211,YE=852,ZE=592,XE=15,mm=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function JE(){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 Ls=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<eo||t.mode>fm?1:0},gm=e=>{if(Ls(e))return Zt;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=eo,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(YE),t.distcode=t.distdyn=new Int32Array(ZE),t.sane=1,t.back=-1,Bs},ym=e=>{if(Ls(e))return Zt;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,gm(e)},_m=(e,t)=>{let n;if(Ls(e))return Zt;const s=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Zt:(s.window!==null&&s.wbits!==t&&(s.window=null),s.wrap=n,s.wbits=t,ym(e))},bm=(e,t)=>{if(!e)return Zt;const n=new JE;e.state=n,n.strm=e,n.window=null,n.mode=eo;const s=_m(e,t);return s!==Bs&&(e.state=null),s},QE=e=>bm(e,XE);let vm=!0,Dc,Oc;const e1=e=>{if(vm){Dc=new Int32Array(512),Oc=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($i(Uf,e.lens,0,288,Dc,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;$i(jf,e.lens,0,32,Oc,0,e.work,{bits:5}),vm=!1}e.lencode=Dc,e.lenbits=9,e.distcode=Oc,e.distbits=5},wm=(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},t1=(e,t)=>{let n,s,r,o,c,d,p,y,g,x,E,C,T,N,j=0,q,J,Y,W,F,ne,P,D;const L=new Uint8Array(4);let U,O;const te=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ls(e)||!e.output||!e.input&&e.avail_in!==0)return Zt;n=e.state,n.mode===qn&&(n.mode=Ic),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,E=p,D=Bs;e:for(;;)switch(n.mode){case eo:if(n.wrap===0){n.mode=Ic;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,L[0]=y&255,L[1]=y>>>8&255,n.check=ht(n.check,L,2,0),y=0,g=0,n.mode=qf;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((y&255)<<8)+(y>>8))%31){e.msg="incorrect header check",n.mode=ze;break}if((y&15)!==zf){e.msg="unknown compression method",n.mode=ze;break}if(y>>>=4,g-=4,P=(y&15)+8,n.wbits===0&&(n.wbits=P),P>15||P>n.wbits){e.msg="invalid window size",n.mode=ze;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=y&512?em:qn,y=0,g=0;break;case qf:for(;g<16;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(n.flags=y,(n.flags&255)!==zf){e.msg="unknown compression method",n.mode=ze;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=ze;break}n.head&&(n.head.text=y>>8&1),n.flags&512&&n.wrap&4&&(L[0]=y&255,L[1]=y>>>8&255,n.check=ht(n.check,L,2,0)),y=0,g=0,n.mode=Gf;case Gf: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&&(L[0]=y&255,L[1]=y>>>8&255,L[2]=y>>>16&255,L[3]=y>>>24&255,n.check=ht(n.check,L,4,0)),y=0,g=0,n.mode=Kf;case Kf: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&&(L[0]=y&255,L[1]=y>>>8&255,n.check=ht(n.check,L,2,0)),y=0,g=0,n.mode=Yf;case Yf: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&&(L[0]=y&255,L[1]=y>>>8&255,n.check=ht(n.check,L,2,0)),y=0,g=0}else n.head&&(n.head.extra=null);n.mode=Zf;case Zf:if(n.flags&1024&&(C=n.length,C>d&&(C=d),C&&(n.head&&(P=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),P)),n.flags&512&&n.wrap&4&&(n.check=ht(n.check,s,C,o)),d-=C,o+=C,n.length-=C),n.length))break e;n.length=0,n.mode=Xf;case Xf:if(n.flags&2048){if(d===0)break e;C=0;do P=s[o+C++],n.head&&P&&n.length<65536&&(n.head.name+=String.fromCharCode(P));while(P&&C<d);if(n.flags&512&&n.wrap&4&&(n.check=ht(n.check,s,C,o)),d-=C,o+=C,P)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=Jf;case Jf:if(n.flags&4096){if(d===0)break e;C=0;do P=s[o+C++],n.head&&P&&n.length<65536&&(n.head.comment+=String.fromCharCode(P));while(P&&C<d);if(n.flags&512&&n.wrap&4&&(n.check=ht(n.check,s,C,o)),d-=C,o+=C,P)break e}else n.head&&(n.head.comment=null);n.mode=Qf;case Qf: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=ze;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=qn;break;case em:for(;g<32;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}e.adler=n.check=mm(y),y=0,g=0,n.mode=to;case to: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,GE;e.adler=n.check=1,n.mode=qn;case qn:if(t===zE||t===Qa)break e;case Ic:if(n.last){y>>>=g&7,g-=g&7,n.mode=Pc;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=tm;break;case 1:if(e1(n),n.mode=no,t===Qa){y>>>=2,g-=2;break e}break;case 2:n.mode=sm;break;case 3:e.msg="invalid block type",n.mode=ze}y>>>=2,g-=2;break;case tm: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=ze;break}if(n.length=y&65535,y=0,g=0,n.mode=Rc,t===Qa)break e;case Rc:n.mode=nm;case nm: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=qn;break;case sm: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=ze;break}n.have=0,n.mode=rm;case rm:for(;n.have<n.ncode;){for(;g<3;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}n.lens[te[n.have++]]=y&7,y>>>=3,g-=3}for(;n.have<19;)n.lens[te[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,U={bits:n.lenbits},D=$i(WE,n.lens,0,19,n.lencode,0,n.work,U),n.lenbits=U.bits,D){e.msg="invalid code lengths set",n.mode=ze;break}n.have=0,n.mode=im;case im:for(;n.have<n.nlen+n.ndist;){for(;j=n.lencode[y&(1<<n.lenbits)-1],q=j>>>24,J=j>>>16&255,Y=j&65535,!(q<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(Y<16)y>>>=q,g-=q,n.lens[n.have++]=Y;else{if(Y===16){for(O=q+2;g<O;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(y>>>=q,g-=q,n.have===0){e.msg="invalid bit length repeat",n.mode=ze;break}P=n.lens[n.have-1],C=3+(y&3),y>>>=2,g-=2}else if(Y===17){for(O=q+3;g<O;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}y>>>=q,g-=q,P=0,C=3+(y&7),y>>>=3,g-=3}else{for(O=q+7;g<O;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}y>>>=q,g-=q,P=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=ze;break}for(;C--;)n.lens[n.have++]=P}}if(n.mode===ze)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=ze;break}if(n.lenbits=9,U={bits:n.lenbits},D=$i(Uf,n.lens,0,n.nlen,n.lencode,0,n.work,U),n.lenbits=U.bits,D){e.msg="invalid literal/lengths set",n.mode=ze;break}if(n.distbits=6,n.distcode=n.distdyn,U={bits:n.distbits},D=$i(jf,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,U),n.distbits=U.bits,D){e.msg="invalid distances set",n.mode=ze;break}if(n.mode=no,t===Qa)break e;case no:n.mode=so;case so: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,$E(e,E),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===qn&&(n.back=-1);break}for(n.back=0;j=n.lencode[y&(1<<n.lenbits)-1],q=j>>>24,J=j>>>16&255,Y=j&65535,!(q<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(J&&(J&240)===0){for(W=q,F=J,ne=Y;j=n.lencode[ne+((y&(1<<W+F)-1)>>W)],q=j>>>24,J=j>>>16&255,Y=j&65535,!(W+q<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}y>>>=W,g-=W,n.back+=W}if(y>>>=q,g-=q,n.back+=q,n.length=Y,J===0){n.mode=um;break}if(J&32){n.back=-1,n.mode=qn;break}if(J&64){e.msg="invalid literal/length code",n.mode=ze;break}n.extra=J&15,n.mode=am;case am:if(n.extra){for(O=n.extra;g<O;){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=om;case om:for(;j=n.distcode[y&(1<<n.distbits)-1],q=j>>>24,J=j>>>16&255,Y=j&65535,!(q<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if((J&240)===0){for(W=q,F=J,ne=Y;j=n.distcode[ne+((y&(1<<W+F)-1)>>W)],q=j>>>24,J=j>>>16&255,Y=j&65535,!(W+q<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}y>>>=W,g-=W,n.back+=W}if(y>>>=q,g-=q,n.back+=q,J&64){e.msg="invalid distance code",n.mode=ze;break}n.offset=Y,n.extra=J&15,n.mode=lm;case lm:if(n.extra){for(O=n.extra;g<O;){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=ze;break}n.mode=cm;case cm:if(p===0)break e;if(C=E-p,n.offset>C){if(C=n.offset-C,C>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=ze;break}C>n.wnext?(C-=n.wnext,T=n.wsize-C):T=n.wnext-C,C>n.length&&(C=n.length),N=n.window}else N=r,T=c-n.offset,C=n.length;C>p&&(C=p),p-=C,n.length-=C;do r[c++]=N[T++];while(--C);n.length===0&&(n.mode=so);break;case um:if(p===0)break e;r[c++]=n.length,p--,n.mode=so;break;case Pc:if(n.wrap){for(;g<32;){if(d===0)break e;d--,y|=s[o++]<<g,g+=8}if(E-=p,e.total_out+=E,n.total+=E,n.wrap&4&&E&&(e.adler=n.check=n.flags?ht(n.check,r,E,c-E):Ii(n.check,r,E,c-E)),E=p,n.wrap&4&&(n.flags?y:mm(y))!==n.check){e.msg="incorrect data check",n.mode=ze;break}y=0,g=0}n.mode=dm;case dm: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=ze;break}y=0,g=0}n.mode=hm;case hm:D=qE;break e;case ze:D=Hf;break e;case pm:return Wf;case fm:default:return Zt}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||E!==e.avail_out&&n.mode<ze&&(n.mode<Pc||t!==Vf))&&wm(e,e.output,e.next_out,E-e.avail_out),x-=e.avail_in,E-=e.avail_out,e.total_in+=x,e.total_out+=E,n.total+=E,n.wrap&4&&E&&(e.adler=n.check=n.flags?ht(n.check,r,E,e.next_out-E):Ii(n.check,r,E,e.next_out-E)),e.data_type=n.bits+(n.last?64:0)+(n.mode===qn?128:0)+(n.mode===no||n.mode===Rc?256:0),(x===0&&E===0||t===Vf)&&D===Bs&&(D=KE),D},n1=e=>{if(Ls(e))return Zt;let t=e.state;return t.window&&(t.window=null),e.state=null,Bs},s1=(e,t)=>{if(Ls(e))return Zt;const n=e.state;return(n.wrap&2)===0?Zt:(n.head=t,t.done=!1,Bs)},r1=(e,t)=>{const n=t.length;let s,r,o;return Ls(e)||(s=e.state,s.wrap!==0&&s.mode!==to)?Zt:s.mode===to&&(r=1,r=Ii(r,t,n,0),r!==s.check)?Hf:(o=wm(e,t,n,n),o?(s.mode=pm,Wf):(s.havedict=1,Bs))};var i1=ym,a1=_m,o1=gm,l1=QE,c1=bm,u1=t1,d1=n1,h1=s1,p1=r1,f1="pako inflate (from Nodeca project)",Gn={inflateReset:i1,inflateReset2:a1,inflateResetKeep:o1,inflateInit:l1,inflateInit2:c1,inflate:u1,inflateEnd:d1,inflateGetHeader:h1,inflateSetDictionary:p1,inflateInfo:f1};function m1(){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 g1=m1;const Sm=Object.prototype.toString,{Z_NO_FLUSH:y1,Z_FINISH:_1,Z_OK:Ui,Z_STREAM_END:Nc,Z_NEED_DICT:Bc,Z_STREAM_ERROR:b1,Z_DATA_ERROR:xm,Z_MEM_ERROR:v1}=Ri;function ji(e){this.options=Za.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 Nf,this.strm.avail_out=0;let n=Gn.inflateInit2(this.strm,t.windowBits);if(n!==Ui)throw new Error(Ps[n]);if(this.header=new g1,Gn.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Mi.string2buf(t.dictionary):Sm.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Gn.inflateSetDictionary(this.strm,t.dictionary),n!==Ui)))throw new Error(Ps[n])}ji.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?_1:y1,Sm.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=Gn.inflate(n,c),o===Bc&&r&&(o=Gn.inflateSetDictionary(n,r),o===Ui?o=Gn.inflate(n,c):o===xm&&(o=Bc));n.avail_in>0&&o===Nc&&n.state.wrap>0&&e[n.next_in]!==0;)Gn.inflateReset(n),o=Gn.inflate(n,c);switch(o){case b1:case xm:case Bc:case v1:return this.onEnd(o),this.ended=!0,!1}if(d=n.avail_out,n.next_out&&(n.avail_out===0||o===Nc))if(this.options.to==="string"){let p=Mi.utf8border(n.output,n.next_out),y=n.next_out-p,g=Mi.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===Ui&&d===0)){if(o===Nc)return o=Gn.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},ji.prototype.onData=function(e){this.chunks.push(e)},ji.prototype.onEnd=function(e){e===Ui&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Za.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Lc(e,t){const n=new ji(t);if(n.push(e),n.err)throw n.msg||Ps[n.err];return n.result}function w1(e,t){return t=t||{},t.raw=!0,Lc(e,t)}var S1=ji,x1=Lc,E1=w1,k1=Lc,C1={Inflate:S1,inflate:x1,inflateRaw:E1,ungzip:k1};const{Deflate:A1,deflate:T1,deflateRaw:I1,gzip:R1}=ME,{Inflate:P1,inflate:D1,inflateRaw:O1,ungzip:N1}=C1;var Em=A1,km=T1,Cm=I1,Am=R1,Tm=P1,Im=D1,Rm=O1,Pm=N1,Dm=Ri,rt={Deflate:Em,deflate:km,deflateRaw:Cm,gzip:Am,Inflate:Tm,inflate:Im,inflateRaw:Rm,ungzip:Pm,constants:Dm};const B1=Object.freeze(Object.defineProperty({__proto__:null,Deflate:Em,Inflate:Tm,constants:Dm,default:rt,deflate:km,deflateRaw:Cm,gzip:Am,inflate:Im,inflateRaw:Rm,ungzip:Pm},Symbol.toStringTag,{value:"Module"}));let Xt=null,Mc=null;async function Om(){return Xt||(Mc||(Mc=(async()=>{try{return Xt=await(await za(tx)).default,Xt}catch{return null}})()),Mc)}function Nm(e,t){try{const n=typeof e=="string"?H.from(e):e,s=rt.gzip(n);t(null,H.from(s))}catch(n){t(n,H.alloc(0))}}function Bm(e,t){try{const n=rt.ungzip(e);t(null,H.from(n))}catch(n){t(n,H.alloc(0))}}function Lm(e,t){try{const n=typeof e=="string"?H.from(e):e,s=rt.deflate(n);t(null,H.from(s))}catch(n){t(n,H.alloc(0))}}function Mm(e,t){try{const n=rt.inflate(e);t(null,H.from(n))}catch(n){t(n,H.alloc(0))}}function Fm(e,t){try{const n=typeof e=="string"?H.from(e):e,s=rt.deflateRaw(n);t(null,H.from(s))}catch(n){t(n,H.alloc(0))}}function $m(e,t){try{const n=rt.inflateRaw(e);t(null,H.from(n))}catch(n){t(n,H.alloc(0))}}function Um(e,t,n){const s=typeof t=="function"?t:n;Om().then(r=>{if(!r){s(new Error("Brotli WASM is not available"),H.alloc(0));return}try{const o=typeof e=="string"?H.from(e):e,c=r.compress(new Uint8Array(o));s(null,H.from(c))}catch(o){s(o,H.alloc(0))}}).catch(r=>s(r,H.alloc(0)))}function jm(e,t,n){const s=typeof t=="function"?t:n;Om().then(r=>{if(!r){s(new Error("Brotli WASM is not available"),H.alloc(0));return}try{const o=r.decompress(new Uint8Array(e));s(null,H.from(o))}catch(o){s(o,H.alloc(0))}}).catch(r=>s(r,H.alloc(0)))}function Vm(e){const t=typeof e=="string"?H.from(e):e;return H.from(rt.gzip(t))}function Hm(e){return H.from(rt.ungzip(e))}function Wm(e){const t=typeof e=="string"?H.from(e):e;return H.from(rt.deflate(t))}function zm(e){return H.from(rt.inflate(e))}function qm(e){const t=typeof e=="string"?H.from(e):e;return H.from(rt.deflateRaw(t))}function Gm(e){return H.from(rt.inflateRaw(e))}function Km(e,t){if(!Xt)throw new Error("Brotli WASM not loaded yet. Use async brotliCompress first.");const n=typeof e=="string"?H.from(e):e;return H.from(Xt.compress(new Uint8Array(n)))}function Ym(e,t){if(!Xt)throw new Error("Brotli WASM not loaded yet. Use async brotliDecompress first.");return H.from(Xt.decompress(new Uint8Array(e)))}function Nt(e){if(e.chunks&&e.chunks.length>0){const t=e.chunks.splice(0);if(t.length===1)return H.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 H.from(s)}if(e.result&&e.result.length>0){const t=H.from(e.result);return e.result=null,t}return null}const qe=function(t){this&&(xn.call(this),this._opts=t||{},this.bytesWritten=0,this._handle={close:()=>{}})};Object.setPrototypeOf(qe.prototype,xn.prototype),qe.prototype.close=function(t){this.destroy(),t&&queueMicrotask(t)},qe.prototype.flush=function(t){t&&queueMicrotask(()=>t(null))},qe.prototype.reset=function(){},qe.prototype.params=function(t,n,s){s&&queueMicrotask(()=>s(null))},qe.prototype._processChunk=function(t,n){let s=null;return this._transform(t,"buffer",(r,o)=>{if(r)throw r;o&&(s=H.from(o))}),n===4&&this._flush((r,o)=>{if(r)throw r;o&&(s=s?H.concat([s,H.from(o)]):H.from(o))}),s};const _r=function(t){this&&(qe.call(this,t),this._engine=new rt.Deflate({...t||{},gzip:!0}))};Object.setPrototypeOf(_r.prototype,qe.prototype),_r.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=Nt(this._engine);s(null,r??void 0)}catch(r){s(r)}},_r.prototype._flush=function(t){try{this._engine.push(new Uint8Array(0),!0);const n=Nt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const br=function(t){this&&(qe.call(this,t),this._engine=new rt.Inflate({...t||{}}))};Object.setPrototypeOf(br.prototype,qe.prototype),br.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=Nt(this._engine);s(null,r??void 0)}catch(r){s(r)}},br.prototype._flush=function(t){try{this._engine.push(new Uint8Array(0),!0);const n=Nt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const vr=function(t){this&&(qe.call(this,t),this._engine=new rt.Deflate({...t||{}}))};Object.setPrototypeOf(vr.prototype,qe.prototype),vr.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=Nt(this._engine);s(null,r??void 0)}catch(r){s(r)}},vr.prototype._flush=function(t){try{this._engine.push(new Uint8Array(0),!0);const n=Nt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const wr=function(t){this&&(qe.call(this,t),this._engine=new rt.Inflate({...t||{}}))};Object.setPrototypeOf(wr.prototype,qe.prototype),wr.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=Nt(this._engine);s(null,r??void 0)}catch(r){s(r)}},wr.prototype._flush=function(t){try{this._engine.push(new Uint8Array(0),!0);const n=Nt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const Sr=function(t){this&&(qe.call(this,t),this._engine=new rt.Deflate({...t||{},raw:!0}))};Object.setPrototypeOf(Sr.prototype,qe.prototype),Sr.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=Nt(this._engine);s(null,r??void 0)}catch(r){s(r)}},Sr.prototype._flush=function(t){try{this._engine.push(new Uint8Array(0),!0);const n=Nt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const xr=function(t){this&&(qe.call(this,t),this._engine=new rt.Inflate({...t||{},raw:!0}))};Object.setPrototypeOf(xr.prototype,qe.prototype),xr.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=Nt(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=Nt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const Er=function(t){this&&(qe.call(this,t),this._engine=null)};Object.setPrototypeOf(Er.prototype,qe.prototype),Er.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 rt.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=Nt(this._engine);s(null,r??void 0)}catch(r){s(r)}},Er.prototype._flush=function(t){try{if(this._engine){this._engine.push(new Uint8Array(0),!0);const n=Nt(this._engine);t(null,n??void 0)}else t(null)}catch(n){t(n)}};const kr=function(t){this&&qe.call(this,t)};Object.setPrototypeOf(kr.prototype,qe.prototype),kr.prototype._transform=function(t,n,s){if(!Xt){s(new Error("Brotli WASM not loaded"));return}try{const r=t instanceof Uint8Array?t:new Uint8Array(t);s(null,H.from(Xt.compress(r)))}catch(r){s(r)}};const Cr=function(t){this&&qe.call(this,t)};Object.setPrototypeOf(Cr.prototype,qe.prototype),Cr.prototype._transform=function(t,n,s){if(!Xt){s(new Error("Brotli WASM not loaded"));return}try{const r=t instanceof Uint8Array?t:new Uint8Array(t);s(null,H.from(Xt.decompress(r)))}catch(r){s(r)}};const L1=kr,M1=Cr;function Zm(e){return new _r(e)}function Xm(e){return new br(e)}function Jm(e){return new vr(e)}function Qm(e){return new wr(e)}function eg(e){return new Sr(e)}function tg(e){return new xr(e)}function ng(e){return new Er(e)}function sg(e){return new kr(e)}function rg(e){return new Cr(e)}const ig={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:L1,BrotliCompressStream:kr,BrotliDecompress:M1,BrotliDecompressStream:Cr,Deflate:vr,DeflateRaw:Sr,Gunzip:br,Gzip:_r,Inflate:wr,InflateRaw:xr,Unzip:Er,brotliCompress:Um,brotliCompressSync:Km,brotliDecompress:jm,brotliDecompressSync:Ym,constants:ig,createBrotliCompress:sg,createBrotliDecompress:rg,createDeflate:Jm,createDeflateRaw:eg,createGunzip:Xm,createGzip:Zm,createInflate:Qm,createInflateRaw:tg,createUnzip:ng,default:{gzip:Nm,gunzip:Bm,deflate:Lm,inflate:Mm,deflateRaw:Fm,inflateRaw:$m,brotliCompress:Um,brotliDecompress:jm,gzipSync:Vm,gunzipSync:Hm,deflateSync:Wm,inflateSync:zm,deflateRawSync:qm,inflateRawSync:Gm,brotliCompressSync:Km,brotliDecompressSync:Ym,Gzip:_r,Gunzip:br,Deflate:vr,Inflate:wr,DeflateRaw:Sr,InflateRaw:xr,Unzip:Er,BrotliCompress:kr,BrotliDecompress:Cr,createGzip:Zm,createGunzip:Xm,createDeflate:Jm,createInflate:Qm,createDeflateRaw:eg,createInflateRaw:tg,createUnzip:ng,createBrotliCompress:sg,createBrotliDecompress:rg,constants:ig},deflate:Lm,deflateRaw:Fm,deflateRawSync:qm,deflateSync:Wm,gunzip:Bm,gunzipSync:Hm,gzip:Nm,gzipSync:Vm,inflate:Mm,inflateRaw:$m,inflateRawSync:Gm,inflateSync:zm},Symbol.toStringTag,{value:"Module"}));function ro(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 io(e,t){setTimeout(()=>t(null,["0.0.0.0"]),0)}function ag(e,t){io(e,t)}function og(e,t){setTimeout(()=>t(null,["::1"]),0)}function lg(e,t){setTimeout(()=>t(null,["localhost"]),0)}function cg(e){}function ug(){return[]}function dg(e){}function hg(){return"verbatim"}const Fc={lookup(e,t){return new Promise((n,s)=>{t!=null&&t.all?ro(e,t,(r,o)=>{r?s(r):n(o??[])}):ro(e,t??{},(r,o,c)=>{r?s(r):n({address:o,family:c})})})},resolve(e){return new Promise((t,n)=>{io(e,(s,r)=>s?n(s):t(r??[]))})},resolve4(e){return Fc.resolve(e)},resolve6(e){return Promise.resolve(["::1"])},reverse(e){return Promise.resolve(["localhost"])},setServers(e){},getServers(){return[]}},pg=0,fg=0,mg=0;Object.freeze(Object.defineProperty({__proto__:null,ADDRCONFIG:pg,ALL:mg,V4MAPPED:fg,default:{lookup:ro,resolve:io,resolve4:ag,resolve6:og,reverse:lg,setServers:cg,getServers:ug,setDefaultResultOrder:dg,getDefaultResultOrder:hg,promises:Fc,ADDRCONFIG:pg,V4MAPPED:fg,ALL:mg},getDefaultResultOrder:hg,getServers:ug,lookup:ro,promises:Fc,resolve:io,resolve4:ag,resolve6:og,reverse:lg,setDefaultResultOrder:dg,setServers:cg},Symbol.toStringTag,{value:"Module"}));let gg=null;function yg(e){gg=e}function _g(){return gg}function bg(e){yg(e)}const Vi=function(){this&&(this.handlers=new Map)};Vi.prototype.on=function(t,n){return this.handlers.has(t)||this.handlers.set(t,new Set),this.handlers.get(t).add(n),this},Vi.prototype.off=function(t,n){var s;return(s=this.handlers.get(t))==null||s.delete(n),this},Vi.prototype.fire=function(t,...n){const s=this.handlers.get(t);if(s)for(const r of s)try{r(...n)}catch{}};const Ut=function(t={}){if(!this)return;Vi.call(this);const n=_g();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(Ut.prototype,Vi.prototype),Ut.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},Ut.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},Ut.prototype.close=function(){this.terminated=!0;for(const t of this.handles.values())t.close();return this.handles.clear(),this.fire("close"),Promise.resolve()},Ut.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},Ut.prototype.resolvePath=function(t){let n=t;return this.cfg.cwd&&!n.startsWith("/")&&(n=this.cfg.cwd+"/"+n),n.startsWith("/")||(n="/"+n),n},Ut.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},Ut.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{}},Ut.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)},Ut.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 vg(e,t){const n=new Ut(t);return n.add(e),n}Object.freeze(Object.defineProperty({__proto__:null,PathWatcher:Ut,default:{watch:vg,PathWatcher:Ut,setVolume:bg},setVolume:bg,watch:vg},Symbol.toStringTag,{value:"Module"}));const Ms=typeof CloseEvent<"u"?CloseEvent:class extends Event{constructor(t,n){super(t),V(this,"code"),V(this,"reason"),V(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}},Ar=typeof MessageEvent<"u"?MessageEvent:class extends Event{constructor(t,n){super(t),V(this,"data"),this.data=n==null?void 0:n.data}};let Jt=null;try{Jt=new BroadcastChannel("nodepod-ws-bridge")}catch{}const wg=new Map;let F1=0;const Fs=function(){this&&(this._listeners=new Map)};Fs.prototype.on=function(t,n){return this._listeners.has(t)||this._listeners.set(t,new Set),this._listeners.get(t).add(n),this},Fs.prototype.off=function(t,n){var s;return(s=this._listeners.get(t))==null||s.delete(n),this},Fs.prototype.emit=function(t,...n){const s=this._listeners.get(t);if(s)for(const r of s)try{r(...n)}catch{}};const Hi=0,Rn=1,Wi=2,jt=3,ct=function(t,n){if(!this)return;Fs.call(this),this.CONNECTING=Hi,this.OPEN=Rn,this.CLOSING=Wi,this.CLOSED=jt,this.readyState=Hi,this.url=t,this.protocol="",this.extensions="",this.bufferedAmount=0,this.binaryType="blob",this._uid=`ws-${++F1}`,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(ct.prototype,Fs.prototype),ct.CONNECTING=Hi,ct.OPEN=Rn,ct.CLOSING=Wi,ct.CLOSED=jt,ct.prototype._open=function(){var t;if(this.url.startsWith("internal://")){this.readyState=Rn,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(!Jt){const o=this;setTimeout(()=>{var c;o.readyState=Rn,o.emit("open"),(c=o.onopen)==null||c.call(o,new Event("open"))},0);return}Jt.postMessage({kind:"connect",uid:this._uid,url:this.url});const n=Jt,s=this,r=o=>{var c,d,p,y;const g=o.data;if(g.targetUid===s._uid){if(g.kind==="connected")s.readyState=Rn,s.emit("open"),(c=s.onopen)==null||c.call(s,new Event("open"));else if(g.kind==="payload"){const x=new Ar("message",{data:g.body});s.emit("message",x),(d=s.onmessage)==null||d.call(s,x)}else if(g.kind==="closed"){s.readyState=jt;const x=new Ms("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===Hi&&(s.readyState=Rn,s.emit("open"),(o=s.onopen)==null||o.call(s,new Event("open")))},100)},ct.prototype._openNative=function(){var t;const s=typeof window<"u"&&typeof window.document<"u"&&typeof globalThis.WebSocket=="function"&&globalThis.WebSocket!==ct?globalThis.WebSocket:null;if(!s){const o=this;setTimeout(()=>{var c;o.readyState=Rn,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=jt;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=Rn,r.emit("open"),(o=r.onopen)==null||o.call(r,new Event("open"))},this._native.onmessage=o=>{var c;const d=new Ar("message",{data:o.data});r.emit("message",d),(c=r.onmessage)==null||c.call(r,d)},this._native.onclose=o=>{var c;r.readyState=jt,r._native=null;const d=new Ms("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)}},ct.prototype.send=function(t){if(this.readyState!==Rn)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=hn(s,n,!1);this._tcpSocket.write(H.from(r));return}if(this._boundServer){this._boundServer._injectClientPayload(this,t);return}Jt&&Jt.postMessage({kind:"payload",uid:this._uid,url:this.url,body:t})},ct.prototype.close=function(t,n){if(this.readyState===jt||this.readyState===Wi)return;if(this.readyState=Wi,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=hn(8,o,!1);try{this._tcpSocket.write(H.from(c))}catch{}const d=this;setTimeout(()=>{var p;d.readyState=jt;const y=new Ms("close",{code:r,reason:n||"",wasClean:!0});d.emit("close",y),(p=d.onclose)==null||p.call(d,y),d._tcpSocket=null},0);return}Jt&&Jt.postMessage({kind:"disconnect",uid:this._uid,url:this.url,code:t,reason:n});const s=this;setTimeout(()=>{var r;s.readyState=jt;const o=new Ms("close",{code:t||1e3,reason:n||"",wasClean:!0});s.emit("close",o),(r=s.onclose)==null||r.call(s,o)},0)},ct.prototype.ping=function(){},ct.prototype.pong=function(){},ct.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=jt;const n=new Ms("close",{code:1006,reason:"Terminated",wasClean:!1});this.emit("close",n),(t=this.onclose)==null||t.call(this,n)},ct.prototype._bindServer=function(t){this._boundServer=t},ct.prototype._deliverMessage=function(t){var n;const s=new Ar("message",{data:t});this.emit("message",s),(n=this.onmessage)==null||n.call(this,s)};const Sg="258EAFA5-E914-47DA-95CA-5AB5DC76CB76";function $1(e){try{const t=Gr("sha1");return t.update(e+Sg),t.digest("base64")}catch{return btoa(e+Sg).slice(0,28)}}const ds=function(t={}){this&&(Fs.call(this),this.clients=new Set,this.options=t,this._route=t.path||"/",this._channelCb=null,t.noServer||this._listen(),wg.set(this._route,this))};Object.setPrototypeOf(ds.prototype,Fs.prototype),ds.prototype._listen=function(){if(!Jt)return;const t=Jt,n=this;this._channelCb=s=>{const r=s.data;if(r.kind==="connect"){const o=new ct("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)},ds.prototype._injectClientPayload=function(t,n){const s=new Ar("message",{data:n});t.emit("message",s)},ds.prototype.handleUpgrade=function(t,n,s,r){const o=new ct("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"]||"",E=`HTTP/1.1 101 Switching Protocols\r
76
+ `)),!g.headersSent)try{g.statusCode=500,g.end("Internal Server Error")}catch{}d(C)}})};function ja(e,t){return new Et(e,t)}const _i={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"},Va=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","CONNECT","TRACE"];function YS(){try{return typeof localStorage<"u"?localStorage.getItem("__corsProxyUrl")??null:null}catch{return null}}const nt=function(t,n){if(!this)return;if(Xe.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(nt.prototype,Xe.prototype),Object.defineProperty(nt.prototype,"socket",{get:function(){return this._socket},configurable:!0}),Object.defineProperty(nt.prototype,"connection",{get:function(){return this._socket},configurable:!0}),nt.prototype.setHeader=function(t,n){this.headers[t.toLowerCase()]=n},nt.prototype.getHeader=function(t){return this.headers[t.toLowerCase()]},nt.prototype.removeHeader=function(t){delete this.headers[t.toLowerCase()]},nt.prototype.write=function(t,n,s){const r=typeof t=="string"?W.from(t):t;this._pending.push(r);const o=typeof n=="function"?n:s;return o&&queueMicrotask(()=>o(null)),!0},nt.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},nt.prototype.abort=function(){this._cancelled=!0,this.aborted=!0,this._waitTimer&&clearTimeout(this._waitTimer),this.emit("abort")},nt.prototype.setTimeout=function(t,n){return this._waitMs=t,n&&this.once("timeout",n),this},nt.prototype.flushHeaders=function(){},nt.prototype.setNoDelay=function(t){},nt.prototype.setSocketKeepAlive=function(t,n){},nt.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=An.get(d);if(T){const V=this._pending.length>0?W.concat(this._pending):void 0;try{const G=await T.dispatchRequest(this.method,this._opts.path??"/",this.headers,V);if(this._cancelled)return;const J=new Rt;J.statusCode=G.statusCode,J.statusMessage=G.statusMessage;for(const[X,q]of Object.entries(G.headers))J.headers[X.toLowerCase()]=q,J.rawHeaders.push(X,q);J._injectBody(G.body),this.emit("response",J)}catch(G){this.emit("error",G)}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=YS(),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=W.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)}},nt.prototype._mapResponse=async function(t){const n=new Rt;n.statusCode=t.status,n.statusMessage=t.statusText||_i[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(W.from(s)),n},nt.prototype._bridgeWebSocket=function(t){const n=t.replace(/^https:/,"wss:").replace(/^http:/,"ws:"),s=this.headers["sec-websocket-key"]??"",r=KS;if(!r){const k=this;setTimeout(()=>k.emit("error",new TypeError("No WebSocket available")),0);return}const c=Yr("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"?W.from(k):new Uint8Array(k),V=typeof C=="function"?C:T,G=new Uint8Array(y.length+L.length);for(G.set(y,0),G.set(L,y.length),y=G;y.length>=2;){const J=xi(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 Rt(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,W.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=mn(T,C,!1);p._feedData(W.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=mn(8,T,!1);p._feedData(W.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 $l(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 ip(e,t,n){const{opts:s,cb:r}=$l(e,t,n),o=new nt(s,"http");return r&&o.once("response",r),o}function ap(e,t,n){const{opts:s,cb:r}=$l(e,t,n),o=new nt({...s,method:"GET"},"http");return r&&o.once("response",r),o.end(),o}function Ha(e,t,n,s){const{opts:r,cb:o}=$l(e,t,n),c=new nt(r,s);return o&&c.once("response",o),c}const An=new Map,bi=new Map;let Ul=null,jl=null;function ZS(e,t,n){An.set(e,t),rs(),Ul&&Ul(e,t)}function XS(e){An.has(e)&&wn(),An.delete(e),bi.delete(e),jl&&jl(e)}function vi(e){return An.get(e)}ba=function(){return new Map(An)},O0=function(){for(const[,e]of An)try{e.close()}catch{}An.clear(),bi.clear()};function JS(e){for(const[t,n]of bi)if(n===e){const s=An.get(t);if(s)try{s.close()}catch{}An.delete(t),bi.delete(t)}}function QS(e){return bi.get(e)}function wi(e){Ul=e}function Si(e){jl=e}const Tn=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(Tn.prototype,ne.prototype),Tn.prototype.createConnection=function(t,n){const s=new ot;return n&&n(null,s),s},Tn.prototype.getName=function(t){return`${t.host??"localhost"}:${t.port??80}:${t.localAddress??""}`},Tn.prototype.addRequest=function(t,n){},Tn.prototype.destroy=function(){this.sockets={},this.freeSockets={},this.requests={}};const Wa=new Tn;function xi(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 mn(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}P0=Object.freeze(Object.defineProperty({__proto__:null,Agent:Tn,ClientRequest:nt,IncomingMessage:Rt,METHODS:Va,STATUS_CODES:_i,Server:Et,ServerResponse:He,_buildClientRequest:Ha,closeAllServers:O0,closeServersByPid:JS,createServer:ja,decodeFrame:xi,default:{Server:Et,IncomingMessage:Rt,ServerResponse:He,ClientRequest:nt,createServer:ja,request:ip,get:ap,STATUS_CODES:_i,METHODS:Va,getServer:vi,getAllServers:ba,setServerListenCallback:wi,setServerCloseCallback:Si,_buildClientRequest:Ha,Agent:Tn,globalAgent:Wa,decodeFrame:xi,encodeFrame:mn},encodeFrame:mn,get:ap,getAllServers:ba,getServer:vi,getServerOwner:QS,globalAgent:Wa,request:ip,setServerCloseCallback:Si,setServerListenCallback:wi},Symbol.toStringTag,{value:"Module"}));function op(e,t,n){return Ha(e,t,n,"https")}function lp(e,t,n){const s=Ha(e,t,n,"https");return s.end(),s}const ex=Object.freeze(Object.defineProperty({__proto__:null,Agent:Tn,ClientRequest:nt,IncomingMessage:Rt,METHODS:Va,STATUS_CODES:_i,Server:Et,ServerResponse:He,createServer:ja,default:{Server:Et,IncomingMessage:Rt,ServerResponse:He,ClientRequest:nt,createServer:ja,request:op,get:lp,STATUS_CODES:_i,METHODS:Va,getServer:vi,getAllServers:ba,setServerListenCallback:wi,setServerCloseCallback:Si,Agent:Tn,globalAgent:Wa},get:lp,getAllServers:ba,getServer:vi,globalAgent:Wa,request:op,setServerCloseCallback:Si,setServerListenCallback:wi},Symbol.toStringTag,{value:"Module"}));function cp(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 up(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 dp(e,t){try{return new globalThis.URL(t,e).href}catch{return t}}const hp=globalThis.URL,pp=globalThis.URLSearchParams;function fp(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 mp(e){const t=encodeURIComponent(e).replace(/%2F/g,"/");return new globalThis.URL("file://"+t)}function gp(e){try{return new globalThis.URL(`http://${e}`).hostname}catch{return e}}function yp(e){return e}Object.freeze(Object.defineProperty({__proto__:null,URL:hp,URLSearchParams:pp,default:{parse:cp,format:up,resolve:dp,URL:hp,URLSearchParams:pp,fileURLToPath:fp,pathToFileURL:mp,domainToASCII:gp,domainToUnicode:yp},domainToASCII:gp,domainToUnicode:yp,fileURLToPath:fp,format:up,parse:cp,pathToFileURL:mp,resolve:dp},Symbol.toStringTag,{value:"Module"}));function Vl(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 Hl(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 _p(e){return encodeURIComponent(e)}function bp(e){return decodeURIComponent(e.replace(/\+/g," "))}const vp=Hl,wp=Vl;Object.freeze(Object.defineProperty({__proto__:null,decode:wp,default:{parse:Vl,stringify:Hl,escape:_p,unescape:bp,encode:vp,decode:wp},encode:vp,escape:_p,parse:Vl,stringify:Hl,unescape:bp},Symbol.toStringTag,{value:"Module"})),od=function(e,...t){if(typeof e!="string")return[e,...t].map(r=>typeof r=="string"?r:Ei(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 Ei(o);default:return r}});for(;n<t.length;){const r=t[n++];s+=" "+(typeof r=="string"?r:Ei(r))}return s};function Ei(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 Sp(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 xp(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 Ep(e,t,n){let s=!1;return function(...o){return s||(console.warn(`DeprecationWarning: ${t}${n?` (${n})`:""}`),s=!0),e.apply(this,o)}}function kp(e){return(...t)=>new Promise((n,s)=>{e(...t,(r,o)=>{r?s(r):n(o)})})}function Cp(e){return(...t)=>{const n=t.pop();e(...t).then(s=>n(null,s)).catch(s=>n(s,void 0))}}function za(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)=>za(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=>za(e[r],t[r]))}return!1}function Wl(e){return Array.isArray(e)}function zl(e){return typeof e=="boolean"}function ql(e){return e===null}function Gl(e){return e==null}function Kl(e){return typeof e=="number"}function Yl(e){return typeof e=="string"}function Zl(e){return e===void 0}function Xl(e){return e instanceof RegExp}function Jl(e){return typeof e=="object"&&e!==null}function Ql(e){return e instanceof Date}function ec(e){return e instanceof Error}function tc(e){return typeof e=="function"}function nc(e){return e===null||typeof e!="object"&&typeof e!="function"}function sc(e){return e instanceof Uint8Array}function rc(e){return e instanceof Promise}function ic(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 Ap=ic;function Tp(e){return e.replace(/\x1B\[[0-9;]*[a-zA-Z]|\x1B\].*?(\x07|\x1B\\)|\x1B[()][A-Z0-9]|\x1B[#=]|\x1B./g,"")}const Ip={isArray:Wl,isBoolean:zl,isNull:ql,isNullOrUndefined:Gl,isNumber:Kl,isString:Yl,isUndefined:Zl,isRegExp:Xl,isObject:Jl,isDate:Ql,isError:ec,isFunction:tc,isPrimitive:nc,isBuffer:sc,isPromise:rc},tx={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 Rp(e,t){const n=Array.isArray(e)?e:[e];let s=t;for(const r of n){const o=tx[r];o&&(s=`\x1B[${o[0]}m${s}\x1B[${o[1]}m`)}return s}function Pp(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 G=(V==null?void 0:V.type)??"boolean";let J;if(G==="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],G=c[V];if(!G&&r)throw new Error(`Unknown option '-${V}'`);const J=G??V,X=G?n[G]:void 0,q=(X==null?void 0:X.type)??"boolean";let $;if(q==="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 Dp=globalThis.TextEncoder,Op=globalThis.TextDecoder;Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:Op,TextEncoder:Dp,_extend:xp,callbackify:Cp,debug:Ap,debuglog:ic,default:{format:od,inspect:Ei,inherits:Sp,_extend:xp,deprecate:Ep,promisify:kp,callbackify:Cp,isDeepStrictEqual:za,debuglog:ic,debug:Ap,stripVTControlCharacters:Tp,isArray:Wl,isBoolean:zl,isNull:ql,isNullOrUndefined:Gl,isNumber:Kl,isString:Yl,isUndefined:Zl,isRegExp:Xl,isObject:Jl,isDate:Ql,isError:ec,isFunction:tc,isPrimitive:nc,isBuffer:sc,isPromise:rc,styleText:Rp,parseArgs:Pp,types:Ip,TextEncoder:Dp,TextDecoder:Op},deprecate:Ep,format:od,inherits:Sp,inspect:Ei,isArray:Wl,isBoolean:zl,isBuffer:sc,isDate:Ql,isDeepStrictEqual:za,isError:ec,isFunction:tc,isNull:ql,isNullOrUndefined:Gl,isNumber:Kl,isObject:Jl,isPrimitive:nc,isPromise:rc,isRegExp:Xl,isString:Yl,isUndefined:Zl,parseArgs:Pp,promisify:kp,stripVTControlCharacters:Tp,styleText:Rp,types:Ip},Symbol.toStringTag,{value:"Module"}));function Np(e){return!1}const ac=function(){this&&(this.isTTY=!1,this.isRaw=!1)};ac.prototype.setRawMode=function(t){return this.isRaw=t,this};const qn=function(){this&&(this.isTTY=!1,this.columns=120,this.rows=40)};qn.prototype.getColorDepth=function(){return 8},qn.prototype.hasColors=function(t){return(t??1)<=256},qn.prototype.getWindowSize=function(){return[this.columns,this.rows]},qn.prototype.clearLine=function(t,n){return n==null||n(),!0},qn.prototype.clearScreenDown=function(t){return t==null||t(),!0},qn.prototype.cursorTo=function(t,n,s){return typeof n=="function"?n():s==null||s(),!0},qn.prototype.moveCursor=function(t,n,s){return s==null||s(),!0},Object.freeze(Object.defineProperty({__proto__:null,ReadStream:ac,WriteStream:qn,default:{isatty:Np,ReadStream:ac,WriteStream:qn},isatty:Np},Symbol.toStringTag,{value:"Module"}));function Bp(){return B.HOSTNAME}function Lp(){return B.PLATFORM}function Mp(){return B.ARCH}function Fp(){return B.TYPE}function $p(){return B.RELEASE}function Up(){return B.VERSION}function jp(){return B.MACHINE}function Vp(){return B.TMPDIR}function Hp(){return B.HOMEDIR}function Wp(){const e={model:U.MODEL,speed:U.SPEED,times:{user:0,nice:0,sys:0,idle:0,irq:0}};return Array.from({length:U.COUNT},()=>({...e}))}function zp(){return Y.TOTAL}function qp(){return Y.FREE}function Gp(){return Math.floor(performance.now()/1e3)}function Kp(){return[...se]}function Yp(){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 Zp(){return{username:B.USERNAME,uid:N.UID,gid:N.GID,shell:B.SHELL,homedir:B.HOMEDIR}}function Xp(){return B.ENDIANNESS}function Jp(e){return 0}function Qp(e,t){}const ef=`
77
+ `,tf="/dev/null",nf={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:ef,arch:Mp,constants:nf,cpus:Wp,default:{hostname:Bp,platform:Lp,arch:Mp,type:Fp,release:$p,version:Up,machine:jp,tmpdir:Vp,homedir:Hp,cpus:Wp,totalmem:zp,freemem:qp,uptime:Gp,loadavg:Kp,networkInterfaces:Yp,userInfo:Zp,endianness:Xp,getPriority:Jp,setPriority:Qp,EOL:ef,devNull:tf,constants:nf},devNull:tf,endianness:Xp,freemem:qp,getPriority:Jp,homedir:Hp,hostname:Bp,loadavg:Kp,machine:jp,networkInterfaces:Yp,platform:Lp,release:$p,setPriority:Qp,tmpdir:Vp,totalmem:zp,type:Fp,uptime:Gp,userInfo:Zp,version:Up},Symbol.toStringTag,{value:"Module"}));const oc="0.20.0",sf="4.9.0",nx="3.0.1",rf=`https://esm.sh/esbuild-wasm@${oc}`,lc=`https://esm.sh/esbuild-wasm@${oc}/esbuild.wasm`,sx=`https://esm.sh/esbuild-wasm@${oc}/esm/browser.min.js`,rx=`https://esm.sh/@rollup/browser@${sf}`,ix=`https://esm.sh/brotli-wasm@${nx}`,qa=new Function("url","return import(url)"),ax=4,af=0,of=1,ox=2;function hr(e){let t=e.length;for(;--t>=0;)e[t]=0}const lx=0,lf=1,cx=2,ux=3,dx=258,cc=29,ki=256,Ci=ki+1+cc,pr=30,uc=19,cf=2*Ci+1,Ds=15,dc=16,hx=7,hc=256,uf=16,df=17,hf=18,pc=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]),Ga=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]),px=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),pf=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fx=512,Gn=new Array((Ci+2)*2);hr(Gn);const Ai=new Array(pr*2);hr(Ai);const Ti=new Array(fx);hr(Ti);const Ii=new Array(dx-ux+1);hr(Ii);const fc=new Array(cc);hr(fc);const Ka=new Array(pr);hr(Ka);function mc(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 ff,mf,gf;function gc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const yf=e=>e<256?Ti[e]:Ti[256+(e>>>7)],Ri=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Lt=(e,t,n)=>{e.bi_valid>dc-n?(e.bi_buf|=t<<e.bi_valid&65535,Ri(e,e.bi_buf),e.bi_buf=t>>dc-e.bi_valid,e.bi_valid+=n-dc):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},In=(e,t,n)=>{Lt(e,n[t*2],n[t*2+1])},_f=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},mx=e=>{e.bi_valid===16?(Ri(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)},gx=(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<=Ds;k++)e.bl_count[k]=0;for(n[e.heap[e.heap_max]*2+1]=0,y=e.heap_max+1;y<cf;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--)}},bf=(e,t,n)=>{const s=new Array(Ds+1);let r=0,o,c;for(o=1;o<=Ds;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]=_f(s[d]++,d))}},yx=()=>{let e,t,n,s,r;const o=new Array(Ds+1);for(n=0,s=0;s<cc-1;s++)for(fc[s]=n,e=0;e<1<<pc[s];e++)Ii[n++]=s;for(Ii[n-1]=s,r=0,s=0;s<16;s++)for(Ka[s]=r,e=0;e<1<<Ga[s];e++)Ti[r++]=s;for(r>>=7;s<pr;s++)for(Ka[s]=r<<7,e=0;e<1<<Ga[s]-7;e++)Ti[256+r++]=s;for(t=0;t<=Ds;t++)o[t]=0;for(e=0;e<=143;)Gn[e*2+1]=8,e++,o[8]++;for(;e<=255;)Gn[e*2+1]=9,e++,o[9]++;for(;e<=279;)Gn[e*2+1]=7,e++,o[7]++;for(;e<=287;)Gn[e*2+1]=8,e++,o[8]++;for(bf(Gn,Ci+1,o),e=0;e<pr;e++)Ai[e*2+1]=5,Ai[e*2]=_f(e,5);ff=new mc(Gn,pc,ki+1,Ci,Ds),mf=new mc(Ai,Ga,0,pr,Ds),gf=new mc(new Array(0),px,0,uc,hx)},vf=e=>{let t;for(t=0;t<Ci;t++)e.dyn_ltree[t*2]=0;for(t=0;t<pr;t++)e.dyn_dtree[t*2]=0;for(t=0;t<uc;t++)e.bl_tree[t*2]=0;e.dyn_ltree[hc*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},wf=e=>{e.bi_valid>8?Ri(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Sf=(e,t,n,s)=>{const r=t*2,o=n*2;return e[r]<e[o]||e[r]===e[o]&&s[t]<=s[n]},yc=(e,t,n)=>{const s=e.heap[n];let r=n<<1;for(;r<=e.heap_len&&(r<e.heap_len&&Sf(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!Sf(t,s,e.heap[r],e.depth));)e.heap[n]=e.heap[r],n=r,r<<=1;e.heap[n]=s},xf=(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?In(e,r,t):(c=Ii[r],In(e,c+ki+1,t),d=pc[c],d!==0&&(r-=fc[c],Lt(e,r,d)),s--,c=yf(s),In(e,c,n),d=Ga[c],d!==0&&(s-=Ka[c],Lt(e,s,d)));while(o<e.sym_next);In(e,hc,t)},_c=(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=cf,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--)yc(e,n,c);y=o;do c=e.heap[1],e.heap[1]=e.heap[e.heap_len--],yc(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++,yc(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],gx(e,t),bf(n,p,e.bl_count)},Ef=(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[uf*2]++):d<=10?e.bl_tree[df*2]++:e.bl_tree[hf*2]++,d=0,r=o,c===0?(p=138,y=3):o===c?(p=6,y=3):(p=7,y=4))},kf=(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 In(e,o,e.bl_tree);while(--d!==0);else o!==0?(o!==r&&(In(e,o,e.bl_tree),d--),In(e,uf,e.bl_tree),Lt(e,d-3,2)):d<=10?(In(e,df,e.bl_tree),Lt(e,d-3,3)):(In(e,hf,e.bl_tree),Lt(e,d-11,7));d=0,r=o,c===0?(p=138,y=3):o===c?(p=6,y=3):(p=7,y=4)}},_x=e=>{let t;for(Ef(e,e.dyn_ltree,e.l_desc.max_code),Ef(e,e.dyn_dtree,e.d_desc.max_code),_c(e,e.bl_desc),t=uc-1;t>=3&&e.bl_tree[pf[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},bx=(e,t,n,s)=>{let r;for(Lt(e,t-257,5),Lt(e,n-1,5),Lt(e,s-4,4),r=0;r<s;r++)Lt(e,e.bl_tree[pf[r]*2+1],3);kf(e,e.dyn_ltree,t-1),kf(e,e.dyn_dtree,n-1)},vx=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return af;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return of;for(n=32;n<ki;n++)if(e.dyn_ltree[n*2]!==0)return of;return af};let Cf=!1;const wx=e=>{Cf||(yx(),Cf=!0),e.l_desc=new gc(e.dyn_ltree,ff),e.d_desc=new gc(e.dyn_dtree,mf),e.bl_desc=new gc(e.bl_tree,gf),e.bi_buf=0,e.bi_valid=0,vf(e)},Af=(e,t,n,s)=>{Lt(e,(lx<<1)+(s?1:0),3),wf(e),Ri(e,n),Ri(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},Sx=e=>{Lt(e,lf<<1,3),In(e,hc,Gn),mx(e)},xx=(e,t,n,s)=>{let r,o,c=0;e.level>0?(e.strm.data_type===ox&&(e.strm.data_type=vx(e)),_c(e,e.l_desc),_c(e,e.d_desc),c=_x(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?Af(e,t,n,s):e.strategy===ax||o===r?(Lt(e,(lf<<1)+(s?1:0),3),xf(e,Gn,Ai)):(Lt(e,(cx<<1)+(s?1:0),3),bx(e,e.l_desc.max_code+1,e.d_desc.max_code+1,c+1),xf(e,e.dyn_ltree,e.dyn_dtree)),vf(e),s&&wf(e)},Ex=(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[(Ii[n]+ki+1)*2]++,e.dyn_dtree[yf(t)*2]++),e.sym_next===e.sym_end);var kx=wx,Cx=Af,Ax=xx,Tx=Ex,Ix=Sx,Rx={_tr_init:kx,_tr_stored_block:Cx,_tr_flush_block:Ax,_tr_tally:Tx,_tr_align:Ix},Pi=(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 Px=()=>{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},Dx=new Uint32Array(Px());var bt=(e,t,n,s)=>{const r=Dx,o=s+n;e^=-1;for(let c=s;c<o;c++)e=e>>>8^r[(e^t[c])&255];return e^-1},Os={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"},Di={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:Ox,_tr_stored_block:bc,_tr_flush_block:Nx,_tr_tally:os,_tr_align:Bx}=Rx,{Z_NO_FLUSH:ls,Z_PARTIAL_FLUSH:Lx,Z_FULL_FLUSH:Mx,Z_FINISH:Jt,Z_BLOCK:Tf,Z_OK:wt,Z_STREAM_END:If,Z_STREAM_ERROR:Rn,Z_DATA_ERROR:Fx,Z_BUF_ERROR:vc,Z_DEFAULT_COMPRESSION:$x,Z_FILTERED:Ux,Z_HUFFMAN_ONLY:Ya,Z_RLE:jx,Z_FIXED:Vx,Z_DEFAULT_STRATEGY:Hx,Z_UNKNOWN:Wx,Z_DEFLATED:Za}=Di,zx=9,qx=15,Gx=8,wc=256+1+29,Kx=30,Yx=19,Zx=2*wc+1,Xx=15,Fe=3,cs=258,Pn=cs+Fe+1,Jx=32,fr=42,Sc=57,xc=69,Ec=73,kc=91,Cc=103,Ns=113,Oi=666,Pt=1,mr=2,Bs=3,gr=4,Qx=3,Ls=(e,t)=>(e.msg=Os[t],t),Rf=e=>e*2-(e>4?9:0),us=e=>{let t=e.length;for(;--t>=0;)e[t]=0},eE=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 ds=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const jt=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))},Vt=(e,t)=>{Nx(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,jt(e.strm)},We=(e,t)=>{e.pending_buf[e.pending++]=t},Ni=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Ac=(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=Pi(e.adler,t,r,n):e.state.wrap===2&&(e.adler=bt(e.adler,t,r,n)),e.next_in+=r,e.total_in+=r,r)},Pf=(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-Pn?e.strstart-(e.w_size-Pn):0,y=e.window,g=e.w_mask,x=e.prev,k=e.strstart+cs;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=cs-(k-s),s=k-cs,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},yr=e=>{const t=e.w_size;let n,s,r;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Pn)&&(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),eE(e),s+=t),e.strm.avail_in===0)break;if(n=Ac(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=n,e.lookahead+e.insert>=Fe)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=ds(e,e.ins_h,e.window[r+1]);e.insert&&(e.ins_h=ds(e,e.ins_h,e.window[r+Fe-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<Fe)););}while(e.lookahead<Pn&&e.strm.avail_in!==0)},Df=(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!==Jt||t===ls||s!==r+e.strm.avail_in)))break;c=t===Jt&&s===r+e.strm.avail_in?1:0,bc(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,jt(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&&(Ac(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?gr:t!==ls&&t!==Jt&&e.strm.avail_in===0&&e.strstart===e.block_start?mr:(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&&(Ac(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===Jt)&&t!==ls&&e.strm.avail_in===0&&r<=o)&&(s=r>o?o:r,c=t===Jt&&e.strm.avail_in===0&&s===r?1:0,bc(e,e.block_start,s,c),e.block_start+=s,jt(e.strm)),c?Bs:Pt)},Tc=(e,t)=>{let n,s;for(;;){if(e.lookahead<Pn){if(yr(e),e.lookahead<Pn&&t===ls)return Pt;if(e.lookahead===0)break}if(n=0,e.lookahead>=Fe&&(e.ins_h=ds(e,e.ins_h,e.window[e.strstart+Fe-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-Pn&&(e.match_length=Pf(e,n)),e.match_length>=Fe)if(s=os(e,e.strstart-e.match_start,e.match_length-Fe),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Fe){e.match_length--;do e.strstart++,e.ins_h=ds(e,e.ins_h,e.window[e.strstart+Fe-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=ds(e,e.ins_h,e.window[e.strstart+1]);else s=os(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(s&&(Vt(e,!1),e.strm.avail_out===0))return Pt}return e.insert=e.strstart<Fe-1?e.strstart:Fe-1,t===Jt?(Vt(e,!0),e.strm.avail_out===0?Bs:gr):e.sym_next&&(Vt(e,!1),e.strm.avail_out===0)?Pt:mr},_r=(e,t)=>{let n,s,r;for(;;){if(e.lookahead<Pn){if(yr(e),e.lookahead<Pn&&t===ls)return Pt;if(e.lookahead===0)break}if(n=0,e.lookahead>=Fe&&(e.ins_h=ds(e,e.ins_h,e.window[e.strstart+Fe-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=Fe-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Pn&&(e.match_length=Pf(e,n),e.match_length<=5&&(e.strategy===Ux||e.match_length===Fe&&e.strstart-e.match_start>4096)&&(e.match_length=Fe-1)),e.prev_length>=Fe&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-Fe,s=os(e,e.strstart-1-e.prev_match,e.prev_length-Fe),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=r&&(e.ins_h=ds(e,e.ins_h,e.window[e.strstart+Fe-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=Fe-1,e.strstart++,s&&(Vt(e,!1),e.strm.avail_out===0))return Pt}else if(e.match_available){if(s=os(e,0,e.window[e.strstart-1]),s&&Vt(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Pt}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(s=os(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Fe-1?e.strstart:Fe-1,t===Jt?(Vt(e,!0),e.strm.avail_out===0?Bs:gr):e.sym_next&&(Vt(e,!1),e.strm.avail_out===0)?Pt:mr},tE=(e,t)=>{let n,s,r,o;const c=e.window;for(;;){if(e.lookahead<=cs){if(yr(e),e.lookahead<=cs&&t===ls)return Pt;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Fe&&e.strstart>0&&(r=e.strstart-1,s=c[r],s===c[++r]&&s===c[++r]&&s===c[++r])){o=e.strstart+cs;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=cs-(o-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Fe?(n=os(e,1,e.match_length-Fe),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=os(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Vt(e,!1),e.strm.avail_out===0))return Pt}return e.insert=0,t===Jt?(Vt(e,!0),e.strm.avail_out===0?Bs:gr):e.sym_next&&(Vt(e,!1),e.strm.avail_out===0)?Pt:mr},nE=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(yr(e),e.lookahead===0)){if(t===ls)return Pt;break}if(e.match_length=0,n=os(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Vt(e,!1),e.strm.avail_out===0))return Pt}return e.insert=0,t===Jt?(Vt(e,!0),e.strm.avail_out===0?Bs:gr):e.sym_next&&(Vt(e,!1),e.strm.avail_out===0)?Pt:mr};function Dn(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 Bi=[new Dn(0,0,0,0,Df),new Dn(4,4,8,4,Tc),new Dn(4,5,16,8,Tc),new Dn(4,6,32,32,Tc),new Dn(4,4,16,16,_r),new Dn(8,16,32,32,_r),new Dn(8,16,128,128,_r),new Dn(8,32,128,256,_r),new Dn(32,128,258,1024,_r),new Dn(32,258,258,4096,_r)],sE=e=>{e.window_size=2*e.w_size,us(e.head),e.max_lazy_match=Bi[e.level].max_lazy,e.good_match=Bi[e.level].good_length,e.nice_match=Bi[e.level].nice_length,e.max_chain_length=Bi[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Fe-1,e.match_available=0,e.ins_h=0};function rE(){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=Za,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(Zx*2),this.dyn_dtree=new Uint16Array((2*Kx+1)*2),this.bl_tree=new Uint16Array((2*Yx+1)*2),us(this.dyn_ltree),us(this.dyn_dtree),us(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Xx+1),this.heap=new Uint16Array(2*wc+1),us(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*wc+1),us(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 Li=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==fr&&t.status!==Sc&&t.status!==xc&&t.status!==Ec&&t.status!==kc&&t.status!==Cc&&t.status!==Ns&&t.status!==Oi?1:0},Of=e=>{if(Li(e))return Ls(e,Rn);e.total_in=e.total_out=0,e.data_type=Wx;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?Sc:t.wrap?fr:Ns,e.adler=t.wrap===2?0:1,t.last_flush=-2,Ox(t),wt},Nf=e=>{const t=Of(e);return t===wt&&sE(e.state),t},iE=(e,t)=>Li(e)||e.state.wrap!==2?Rn:(e.state.gzhead=t,wt),Bf=(e,t,n,s,r,o)=>{if(!e)return Rn;let c=1;if(t===$x&&(t=6),s<0?(c=0,s=-s):s>15&&(c=2,s-=16),r<1||r>zx||n!==Za||s<8||s>15||t<0||t>9||o<0||o>Vx||s===8&&c!==1)return Ls(e,Rn);s===8&&(s=9);const d=new rE;return e.state=d,d.strm=e,d.status=fr,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+Fe-1)/Fe),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,Nf(e)},aE=(e,t)=>Bf(e,t,Za,qx,Gx,Hx),oE=(e,t)=>{if(Li(e)||t>Tf||t<0)return e?Ls(e,Rn):Rn;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===Oi&&t!==Jt)return Ls(e,e.avail_out===0?vc:Rn);const s=n.last_flush;if(n.last_flush=t,n.pending!==0){if(jt(e),e.avail_out===0)return n.last_flush=-1,wt}else if(e.avail_in===0&&Rf(t)<=Rf(s)&&t!==Jt)return Ls(e,vc);if(n.status===Oi&&e.avail_in!==0)return Ls(e,vc);if(n.status===fr&&n.wrap===0&&(n.status=Ns),n.status===fr){let r=Za+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=Ya||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,r|=o<<6,n.strstart!==0&&(r|=Jx),r+=31-r%31,Ni(n,r),n.strstart!==0&&(Ni(n,e.adler>>>16),Ni(n,e.adler&65535)),e.adler=1,n.status=Ns,jt(e),n.pending!==0)return n.last_flush=-1,wt}if(n.status===Sc){if(e.adler=0,We(n,31),We(n,139),We(n,8),n.gzhead)We(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)),We(n,n.gzhead.time&255),We(n,n.gzhead.time>>8&255),We(n,n.gzhead.time>>16&255),We(n,n.gzhead.time>>24&255),We(n,n.level===9?2:n.strategy>=Ya||n.level<2?4:0),We(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(We(n,n.gzhead.extra.length&255),We(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=bt(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=xc;else if(We(n,0),We(n,0),We(n,0),We(n,0),We(n,0),We(n,n.level===9?2:n.strategy>=Ya||n.level<2?4:0),We(n,Qx),n.status=Ns,jt(e),n.pending!==0)return n.last_flush=-1,wt}if(n.status===xc){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=bt(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex+=d,jt(e),n.pending!==0)return n.last_flush=-1,wt;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=bt(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=Ec}if(n.status===Ec){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=bt(e.adler,n.pending_buf,n.pending-r,r)),jt(e),n.pending!==0)return n.last_flush=-1,wt;r=0}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,We(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>r&&(e.adler=bt(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=kc}if(n.status===kc){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=bt(e.adler,n.pending_buf,n.pending-r,r)),jt(e),n.pending!==0)return n.last_flush=-1,wt;r=0}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,We(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>r&&(e.adler=bt(e.adler,n.pending_buf,n.pending-r,r))}n.status=Cc}if(n.status===Cc){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(jt(e),n.pending!==0))return n.last_flush=-1,wt;We(n,e.adler&255),We(n,e.adler>>8&255),e.adler=0}if(n.status=Ns,jt(e),n.pending!==0)return n.last_flush=-1,wt}if(e.avail_in!==0||n.lookahead!==0||t!==ls&&n.status!==Oi){let r=n.level===0?Df(n,t):n.strategy===Ya?nE(n,t):n.strategy===jx?tE(n,t):Bi[n.level].func(n,t);if((r===Bs||r===gr)&&(n.status=Oi),r===Pt||r===Bs)return e.avail_out===0&&(n.last_flush=-1),wt;if(r===mr&&(t===Lx?Bx(n):t!==Tf&&(bc(n,0,0,!1),t===Mx&&(us(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),jt(e),e.avail_out===0))return n.last_flush=-1,wt}return t!==Jt?wt:n.wrap<=0?If:(n.wrap===2?(We(n,e.adler&255),We(n,e.adler>>8&255),We(n,e.adler>>16&255),We(n,e.adler>>24&255),We(n,e.total_in&255),We(n,e.total_in>>8&255),We(n,e.total_in>>16&255),We(n,e.total_in>>24&255)):(Ni(n,e.adler>>>16),Ni(n,e.adler&65535)),jt(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?wt:If)},lE=e=>{if(Li(e))return Rn;const t=e.state.status;return e.state=null,t===Ns?Ls(e,Fx):wt},cE=(e,t)=>{let n=t.length;if(Li(e))return Rn;const s=e.state,r=s.wrap;if(r===2||r===1&&s.status!==fr||s.lookahead)return Rn;if(r===1&&(e.adler=Pi(e.adler,t,n,0)),s.wrap=0,n>=s.w_size){r===0&&(us(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,yr(s);s.lookahead>=Fe;){let p=s.strstart,y=s.lookahead-(Fe-1);do s.ins_h=ds(s,s.ins_h,s.window[p+Fe-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=Fe-1,yr(s)}return s.strstart+=s.lookahead,s.block_start=s.strstart,s.insert=s.lookahead,s.lookahead=0,s.match_length=s.prev_length=Fe-1,s.match_available=0,e.next_in=c,e.input=d,e.avail_in=o,s.wrap=r,wt};var uE=aE,dE=Bf,hE=Nf,pE=Of,fE=iE,mE=oE,gE=lE,yE=cE,_E="pako deflate (from Nodeca project)",Mi={deflateInit:uE,deflateInit2:dE,deflateReset:hE,deflateResetKeep:pE,deflateSetHeader:fE,deflate:mE,deflateEnd:gE,deflateSetDictionary:yE,deflateInfo:_E};const bE=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var vE=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)bE(n,s)&&(e[s]=n[s])}}return e},wE=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},Xa={assign:vE,flattenChunks:wE};let Lf=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Lf=!1}const Fi=new Uint8Array(256);for(let e=0;e<256;e++)Fi[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Fi[254]=Fi[254]=1;var SE=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 xE=(e,t)=>{if(t<65534&&e.subarray&&Lf)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 EE=(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=Fi[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 xE(o,r)},kE=(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+Fi[e[n]]>t?n:t},$i={string2buf:SE,buf2string:EE,utf8border:kE};function CE(){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 Mf=CE;const Ff=Object.prototype.toString,{Z_NO_FLUSH:AE,Z_SYNC_FLUSH:TE,Z_FULL_FLUSH:IE,Z_FINISH:RE,Z_OK:Ja,Z_STREAM_END:PE,Z_DEFAULT_COMPRESSION:DE,Z_DEFAULT_STRATEGY:OE,Z_DEFLATED:NE}=Di;function Ui(e){this.options=Xa.assign({level:DE,method:NE,chunkSize:16384,windowBits:15,memLevel:8,strategy:OE},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 Mf,this.strm.avail_out=0;let n=Mi.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Ja)throw new Error(Os[n]);if(t.header&&Mi.deflateSetHeader(this.strm,t.header),t.dictionary){let s;if(typeof t.dictionary=="string"?s=$i.string2buf(t.dictionary):Ff.call(t.dictionary)==="[object ArrayBuffer]"?s=new Uint8Array(t.dictionary):s=t.dictionary,n=Mi.deflateSetDictionary(this.strm,s),n!==Ja)throw new Error(Os[n]);this._dict_set=!0}}Ui.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?RE:AE,typeof e=="string"?n.input=$i.string2buf(e):Ff.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===TE||o===IE)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(r=Mi.deflate(n,o),r===PE)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=Mi.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Ja;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},Ui.prototype.onData=function(e){this.chunks.push(e)},Ui.prototype.onEnd=function(e){e===Ja&&(this.result=Xa.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ic(e,t){const n=new Ui(t);if(n.push(e,!0),n.err)throw n.msg||Os[n.err];return n.result}function BE(e,t){return t=t||{},t.raw=!0,Ic(e,t)}function LE(e,t){return t=t||{},t.gzip=!0,Ic(e,t)}var ME=Ui,FE=Ic,$E=BE,UE=LE,jE={Deflate:ME,deflate:FE,deflateRaw:$E,gzip:UE};const Qa=16209,VE=16191;var HE=function(t,n){let s,r,o,c,d,p,y,g,x,k,C,T,L,V,G,J,X,q,$,te,P,D,F,j;const O=t.state;s=t.next_in,F=t.input,r=s+(t.avail_in-5),o=t.next_out,j=t.output,c=o-(n-t.avail_out),d=o+(t.avail_out-257),p=O.dmax,y=O.wsize,g=O.whave,x=O.wnext,k=O.window,C=O.hold,T=O.bits,L=O.lencode,V=O.distcode,G=(1<<O.lenbits)-1,J=(1<<O.distbits)-1;e:do{T<15&&(C+=F[s++]<<T,T+=8,C+=F[s++]<<T,T+=8),X=L[C&G];t:for(;;){if(q=X>>>24,C>>>=q,T-=q,q=X>>>16&255,q===0)j[o++]=X&65535;else if(q&16){$=X&65535,q&=15,q&&(T<q&&(C+=F[s++]<<T,T+=8),$+=C&(1<<q)-1,C>>>=q,T-=q),T<15&&(C+=F[s++]<<T,T+=8,C+=F[s++]<<T,T+=8),X=V[C&J];n:for(;;){if(q=X>>>24,C>>>=q,T-=q,q=X>>>16&255,q&16){if(te=X&65535,q&=15,T<q&&(C+=F[s++]<<T,T+=8,T<q&&(C+=F[s++]<<T,T+=8)),te+=C&(1<<q)-1,te>p){t.msg="invalid distance too far back",O.mode=Qa;break e}if(C>>>=q,T-=q,q=o-c,te>q){if(q=te-q,q>g&&O.sane){t.msg="invalid distance too far back",O.mode=Qa;break e}if(P=0,D=k,x===0){if(P+=y-q,q<$){$-=q;do j[o++]=k[P++];while(--q);P=o-te,D=j}}else if(x<q){if(P+=y+x-q,q-=x,q<$){$-=q;do j[o++]=k[P++];while(--q);if(P=0,x<$){q=x,$-=q;do j[o++]=k[P++];while(--q);P=o-te,D=j}}}else if(P+=x-q,q<$){$-=q;do j[o++]=k[P++];while(--q);P=o-te,D=j}for(;$>2;)j[o++]=D[P++],j[o++]=D[P++],j[o++]=D[P++],$-=3;$&&(j[o++]=D[P++],$>1&&(j[o++]=D[P++]))}else{P=o-te;do j[o++]=j[P++],j[o++]=j[P++],j[o++]=j[P++],$-=3;while($>2);$&&(j[o++]=j[P++],$>1&&(j[o++]=j[P++]))}}else if((q&64)===0){X=V[(X&65535)+(C&(1<<q)-1)];continue n}else{t.msg="invalid distance code",O.mode=Qa;break e}break}}else if((q&64)===0){X=L[(X&65535)+(C&(1<<q)-1)];continue t}else if(q&32){O.mode=VE;break e}else{t.msg="invalid literal/length code",O.mode=Qa;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),O.hold=C,O.bits=T};const br=15,$f=852,Uf=592,jf=0,Rc=1,Vf=2,WE=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]),zE=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]),qE=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]),GE=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 ji=(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,G=0,J=0,X,q,$,te,P,D=null,F;const j=new Uint16Array(br+1),O=new Uint16Array(br+1);let Q=null,ce,le,fe;for(y=0;y<=br;y++)j[y]=0;for(g=0;g<s;g++)j[t[n+g]]++;for(C=p,k=br;k>=1&&j[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&&j[x]===0;x++);for(C<x&&(C=x),V=1,y=1;y<=br;y++)if(V<<=1,V-=j[y],V<0)return-1;if(V>0&&(e===jf||k!==1))return-1;for(O[1]=0,y=1;y<br;y++)O[y+1]=O[y]+j[y];for(g=0;g<s;g++)t[n+g]!==0&&(c[O[t[n+g]]++]=g);if(e===jf?(D=Q=c,F=20):e===Rc?(D=WE,Q=zE,F=257):(D=qE,Q=GE,F=0),J=0,g=0,y=x,P=o,T=C,L=0,$=-1,G=1<<C,te=G-1,e===Rc&&G>$f||e===Vf&&G>Uf)return 1;for(;;){ce=y-L,c[g]+1<F?(le=0,fe=c[g]):c[g]>=F?(le=Q[c[g]-F],fe=D[c[g]-F]):(le=96,fe=0),X=1<<y-L,q=1<<T,x=q;do q-=X,r[P+(J>>L)+q]=ce<<24|le<<16|fe|0;while(q!==0);for(X=1<<y-1;J&X;)X>>=1;if(X!==0?(J&=X-1,J+=X):J=0,g++,--j[y]===0){if(y===k)break;y=t[n+c[g]]}if(y>C&&(J&te)!==$){for(L===0&&(L=C),P+=x,T=y-L,V=1<<T;T+L<k&&(V-=j[T+L],!(V<=0));)T++,V<<=1;if(G+=1<<T,e===Rc&&G>$f||e===Vf&&G>Uf)return 1;$=J&te,r[$]=C<<24|T<<16|P-o|0}}return J!==0&&(r[P+J]=y-L<<24|64<<16|0),d.bits=C,0};const KE=0,Hf=1,Wf=2,{Z_FINISH:zf,Z_BLOCK:YE,Z_TREES:eo,Z_OK:Ms,Z_STREAM_END:ZE,Z_NEED_DICT:XE,Z_STREAM_ERROR:Qt,Z_DATA_ERROR:qf,Z_MEM_ERROR:Gf,Z_BUF_ERROR:JE,Z_DEFLATED:Kf}=Di,to=16180,Yf=16181,Zf=16182,Xf=16183,Jf=16184,Qf=16185,em=16186,tm=16187,nm=16188,sm=16189,no=16190,Kn=16191,Pc=16192,rm=16193,Dc=16194,im=16195,am=16196,om=16197,lm=16198,so=16199,ro=16200,cm=16201,um=16202,dm=16203,hm=16204,pm=16205,Oc=16206,fm=16207,mm=16208,Je=16209,gm=16210,ym=16211,QE=852,e1=592,t1=15,_m=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function n1(){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 Fs=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<to||t.mode>ym?1:0},bm=e=>{if(Fs(e))return Qt;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=to,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(QE),t.distcode=t.distdyn=new Int32Array(e1),t.sane=1,t.back=-1,Ms},vm=e=>{if(Fs(e))return Qt;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,bm(e)},wm=(e,t)=>{let n;if(Fs(e))return Qt;const s=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Qt:(s.window!==null&&s.wbits!==t&&(s.window=null),s.wrap=n,s.wbits=t,vm(e))},Sm=(e,t)=>{if(!e)return Qt;const n=new n1;e.state=n,n.strm=e,n.window=null,n.mode=to;const s=wm(e,t);return s!==Ms&&(e.state=null),s},s1=e=>Sm(e,t1);let xm=!0,Nc,Bc;const r1=e=>{if(xm){Nc=new Int32Array(512),Bc=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(ji(Hf,e.lens,0,288,Nc,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ji(Wf,e.lens,0,32,Bc,0,e.work,{bits:5}),xm=!1}e.lencode=Nc,e.lenbits=9,e.distcode=Bc,e.distbits=5},Em=(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},i1=(e,t)=>{let n,s,r,o,c,d,p,y,g,x,k,C,T,L,V=0,G,J,X,q,$,te,P,D;const F=new Uint8Array(4);let j,O;const Q=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Fs(e)||!e.output||!e.input&&e.avail_in!==0)return Qt;n=e.state,n.mode===Kn&&(n.mode=Pc),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=Ms;e:for(;;)switch(n.mode){case to:if(n.wrap===0){n.mode=Pc;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=bt(n.check,F,2,0),y=0,g=0,n.mode=Yf;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((y&255)<<8)+(y>>8))%31){e.msg="incorrect header check",n.mode=Je;break}if((y&15)!==Kf){e.msg="unknown compression method",n.mode=Je;break}if(y>>>=4,g-=4,P=(y&15)+8,n.wbits===0&&(n.wbits=P),P>15||P>n.wbits){e.msg="invalid window size",n.mode=Je;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=y&512?sm:Kn,y=0,g=0;break;case Yf:for(;g<16;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(n.flags=y,(n.flags&255)!==Kf){e.msg="unknown compression method",n.mode=Je;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Je;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=bt(n.check,F,2,0)),y=0,g=0,n.mode=Zf;case Zf: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=bt(n.check,F,4,0)),y=0,g=0,n.mode=Xf;case Xf: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=bt(n.check,F,2,0)),y=0,g=0,n.mode=Jf;case Jf: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=bt(n.check,F,2,0)),y=0,g=0}else n.head&&(n.head.extra=null);n.mode=Qf;case Qf:if(n.flags&1024&&(C=n.length,C>d&&(C=d),C&&(n.head&&(P=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),P)),n.flags&512&&n.wrap&4&&(n.check=bt(n.check,s,C,o)),d-=C,o+=C,n.length-=C),n.length))break e;n.length=0,n.mode=em;case em:if(n.flags&2048){if(d===0)break e;C=0;do P=s[o+C++],n.head&&P&&n.length<65536&&(n.head.name+=String.fromCharCode(P));while(P&&C<d);if(n.flags&512&&n.wrap&4&&(n.check=bt(n.check,s,C,o)),d-=C,o+=C,P)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=tm;case tm:if(n.flags&4096){if(d===0)break e;C=0;do P=s[o+C++],n.head&&P&&n.length<65536&&(n.head.comment+=String.fromCharCode(P));while(P&&C<d);if(n.flags&512&&n.wrap&4&&(n.check=bt(n.check,s,C,o)),d-=C,o+=C,P)break e}else n.head&&(n.head.comment=null);n.mode=nm;case nm: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=Je;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=Kn;break;case sm:for(;g<32;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}e.adler=n.check=_m(y),y=0,g=0,n.mode=no;case no: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,XE;e.adler=n.check=1,n.mode=Kn;case Kn:if(t===YE||t===eo)break e;case Pc:if(n.last){y>>>=g&7,g-=g&7,n.mode=Oc;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=rm;break;case 1:if(r1(n),n.mode=so,t===eo){y>>>=2,g-=2;break e}break;case 2:n.mode=am;break;case 3:e.msg="invalid block type",n.mode=Je}y>>>=2,g-=2;break;case rm: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=Je;break}if(n.length=y&65535,y=0,g=0,n.mode=Dc,t===eo)break e;case Dc:n.mode=im;case im: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=Kn;break;case am: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=Je;break}n.have=0,n.mode=om;case om: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,j={bits:n.lenbits},D=ji(KE,n.lens,0,19,n.lencode,0,n.work,j),n.lenbits=j.bits,D){e.msg="invalid code lengths set",n.mode=Je;break}n.have=0,n.mode=lm;case lm:for(;n.have<n.nlen+n.ndist;){for(;V=n.lencode[y&(1<<n.lenbits)-1],G=V>>>24,J=V>>>16&255,X=V&65535,!(G<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(X<16)y>>>=G,g-=G,n.lens[n.have++]=X;else{if(X===16){for(O=G+2;g<O;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(y>>>=G,g-=G,n.have===0){e.msg="invalid bit length repeat",n.mode=Je;break}P=n.lens[n.have-1],C=3+(y&3),y>>>=2,g-=2}else if(X===17){for(O=G+3;g<O;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}y>>>=G,g-=G,P=0,C=3+(y&7),y>>>=3,g-=3}else{for(O=G+7;g<O;){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}y>>>=G,g-=G,P=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=Je;break}for(;C--;)n.lens[n.have++]=P}}if(n.mode===Je)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Je;break}if(n.lenbits=9,j={bits:n.lenbits},D=ji(Hf,n.lens,0,n.nlen,n.lencode,0,n.work,j),n.lenbits=j.bits,D){e.msg="invalid literal/lengths set",n.mode=Je;break}if(n.distbits=6,n.distcode=n.distdyn,j={bits:n.distbits},D=ji(Wf,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,j),n.distbits=j.bits,D){e.msg="invalid distances set",n.mode=Je;break}if(n.mode=so,t===eo)break e;case so:n.mode=ro;case ro: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,HE(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===Kn&&(n.back=-1);break}for(n.back=0;V=n.lencode[y&(1<<n.lenbits)-1],G=V>>>24,J=V>>>16&255,X=V&65535,!(G<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if(J&&(J&240)===0){for(q=G,$=J,te=X;V=n.lencode[te+((y&(1<<q+$)-1)>>q)],G=V>>>24,J=V>>>16&255,X=V&65535,!(q+G<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}y>>>=q,g-=q,n.back+=q}if(y>>>=G,g-=G,n.back+=G,n.length=X,J===0){n.mode=pm;break}if(J&32){n.back=-1,n.mode=Kn;break}if(J&64){e.msg="invalid literal/length code",n.mode=Je;break}n.extra=J&15,n.mode=cm;case cm:if(n.extra){for(O=n.extra;g<O;){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=um;case um:for(;V=n.distcode[y&(1<<n.distbits)-1],G=V>>>24,J=V>>>16&255,X=V&65535,!(G<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}if((J&240)===0){for(q=G,$=J,te=X;V=n.distcode[te+((y&(1<<q+$)-1)>>q)],G=V>>>24,J=V>>>16&255,X=V&65535,!(q+G<=g);){if(d===0)break e;d--,y+=s[o++]<<g,g+=8}y>>>=q,g-=q,n.back+=q}if(y>>>=G,g-=G,n.back+=G,J&64){e.msg="invalid distance code",n.mode=Je;break}n.offset=X,n.extra=J&15,n.mode=dm;case dm:if(n.extra){for(O=n.extra;g<O;){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=Je;break}n.mode=hm;case hm: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=Je;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=ro);break;case pm:if(p===0)break e;r[c++]=n.length,p--,n.mode=ro;break;case Oc: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?bt(n.check,r,k,c-k):Pi(n.check,r,k,c-k)),k=p,n.wrap&4&&(n.flags?y:_m(y))!==n.check){e.msg="incorrect data check",n.mode=Je;break}y=0,g=0}n.mode=fm;case fm: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=Je;break}y=0,g=0}n.mode=mm;case mm:D=ZE;break e;case Je:D=qf;break e;case gm:return Gf;case ym:default:return Qt}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<Je&&(n.mode<Oc||t!==zf))&&Em(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?bt(n.check,r,k,e.next_out-k):Pi(n.check,r,k,e.next_out-k)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Kn?128:0)+(n.mode===so||n.mode===Dc?256:0),(x===0&&k===0||t===zf)&&D===Ms&&(D=JE),D},a1=e=>{if(Fs(e))return Qt;let t=e.state;return t.window&&(t.window=null),e.state=null,Ms},o1=(e,t)=>{if(Fs(e))return Qt;const n=e.state;return(n.wrap&2)===0?Qt:(n.head=t,t.done=!1,Ms)},l1=(e,t)=>{const n=t.length;let s,r,o;return Fs(e)||(s=e.state,s.wrap!==0&&s.mode!==no)?Qt:s.mode===no&&(r=1,r=Pi(r,t,n,0),r!==s.check)?qf:(o=Em(e,t,n,n),o?(s.mode=gm,Gf):(s.havedict=1,Ms))};var c1=vm,u1=wm,d1=bm,h1=s1,p1=Sm,f1=i1,m1=a1,g1=o1,y1=l1,_1="pako inflate (from Nodeca project)",Yn={inflateReset:c1,inflateReset2:u1,inflateResetKeep:d1,inflateInit:h1,inflateInit2:p1,inflate:f1,inflateEnd:m1,inflateGetHeader:g1,inflateSetDictionary:y1,inflateInfo:_1};function b1(){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 v1=b1;const km=Object.prototype.toString,{Z_NO_FLUSH:w1,Z_FINISH:S1,Z_OK:Vi,Z_STREAM_END:Lc,Z_NEED_DICT:Mc,Z_STREAM_ERROR:x1,Z_DATA_ERROR:Cm,Z_MEM_ERROR:E1}=Di;function Hi(e){this.options=Xa.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 Mf,this.strm.avail_out=0;let n=Yn.inflateInit2(this.strm,t.windowBits);if(n!==Vi)throw new Error(Os[n]);if(this.header=new v1,Yn.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=$i.string2buf(t.dictionary):km.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Yn.inflateSetDictionary(this.strm,t.dictionary),n!==Vi)))throw new Error(Os[n])}Hi.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?S1:w1,km.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=Yn.inflate(n,c),o===Mc&&r&&(o=Yn.inflateSetDictionary(n,r),o===Vi?o=Yn.inflate(n,c):o===Cm&&(o=Mc));n.avail_in>0&&o===Lc&&n.state.wrap>0&&e[n.next_in]!==0;)Yn.inflateReset(n),o=Yn.inflate(n,c);switch(o){case x1:case Cm:case Mc:case E1:return this.onEnd(o),this.ended=!0,!1}if(d=n.avail_out,n.next_out&&(n.avail_out===0||o===Lc))if(this.options.to==="string"){let p=$i.utf8border(n.output,n.next_out),y=n.next_out-p,g=$i.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===Vi&&d===0)){if(o===Lc)return o=Yn.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},Hi.prototype.onData=function(e){this.chunks.push(e)},Hi.prototype.onEnd=function(e){e===Vi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Xa.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Fc(e,t){const n=new Hi(t);if(n.push(e),n.err)throw n.msg||Os[n.err];return n.result}function k1(e,t){return t=t||{},t.raw=!0,Fc(e,t)}var C1=Hi,A1=Fc,T1=k1,I1=Fc,R1={Inflate:C1,inflate:A1,inflateRaw:T1,ungzip:I1};const{Deflate:P1,deflate:D1,deflateRaw:O1,gzip:N1}=jE,{Inflate:B1,inflate:L1,inflateRaw:M1,ungzip:F1}=R1;var Am=P1,Tm=D1,Im=O1,Rm=N1,Pm=B1,Dm=L1,Om=M1,Nm=F1,Bm=Di,dt={Deflate:Am,deflate:Tm,deflateRaw:Im,gzip:Rm,Inflate:Pm,inflate:Dm,inflateRaw:Om,ungzip:Nm,constants:Bm};const $1=Object.freeze(Object.defineProperty({__proto__:null,Deflate:Am,Inflate:Pm,constants:Bm,default:dt,deflate:Tm,deflateRaw:Im,gzip:Rm,inflate:Dm,inflateRaw:Om,ungzip:Nm},Symbol.toStringTag,{value:"Module"}));let en=null,$c=null;async function Lm(){return en||($c||($c=(async()=>{try{return en=await(await qa(ix)).default,en}catch{return null}})()),$c)}function Mm(e,t){try{const n=typeof e=="string"?W.from(e):e,s=dt.gzip(n);t(null,W.from(s))}catch(n){t(n,W.alloc(0))}}function Fm(e,t){try{const n=dt.ungzip(e);t(null,W.from(n))}catch(n){t(n,W.alloc(0))}}function $m(e,t){try{const n=typeof e=="string"?W.from(e):e,s=dt.deflate(n);t(null,W.from(s))}catch(n){t(n,W.alloc(0))}}function Um(e,t){try{const n=dt.inflate(e);t(null,W.from(n))}catch(n){t(n,W.alloc(0))}}function jm(e,t){try{const n=typeof e=="string"?W.from(e):e,s=dt.deflateRaw(n);t(null,W.from(s))}catch(n){t(n,W.alloc(0))}}function Vm(e,t){try{const n=dt.inflateRaw(e);t(null,W.from(n))}catch(n){t(n,W.alloc(0))}}function Hm(e,t,n){const s=typeof t=="function"?t:n;Lm().then(r=>{if(!r){s(new Error("Brotli WASM is not available"),W.alloc(0));return}try{const o=typeof e=="string"?W.from(e):e,c=r.compress(new Uint8Array(o));s(null,W.from(c))}catch(o){s(o,W.alloc(0))}}).catch(r=>s(r,W.alloc(0)))}function Wm(e,t,n){const s=typeof t=="function"?t:n;Lm().then(r=>{if(!r){s(new Error("Brotli WASM is not available"),W.alloc(0));return}try{const o=r.decompress(new Uint8Array(e));s(null,W.from(o))}catch(o){s(o,W.alloc(0))}}).catch(r=>s(r,W.alloc(0)))}function zm(e){const t=typeof e=="string"?W.from(e):e;return W.from(dt.gzip(t))}function qm(e){return W.from(dt.ungzip(e))}function Gm(e){const t=typeof e=="string"?W.from(e):e;return W.from(dt.deflate(t))}function Km(e){return W.from(dt.inflate(e))}function Ym(e){const t=typeof e=="string"?W.from(e):e;return W.from(dt.deflateRaw(t))}function Zm(e){return W.from(dt.inflateRaw(e))}function Xm(e,t){if(!en)throw new Error("Brotli WASM not loaded yet. Use async brotliCompress first.");const n=typeof e=="string"?W.from(e):e;return W.from(en.compress(new Uint8Array(n)))}function Jm(e,t){if(!en)throw new Error("Brotli WASM not loaded yet. Use async brotliDecompress first.");return W.from(en.decompress(new Uint8Array(e)))}function Mt(e){if(e.chunks&&e.chunks.length>0){const t=e.chunks.splice(0);if(t.length===1)return W.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 W.from(s)}if(e.result&&e.result.length>0){const t=W.from(e.result);return e.result=null,t}return null}const Qe=function(t){this&&(Cn.call(this),this._opts=t||{},this.bytesWritten=0,this._handle={close:()=>{}})};Object.setPrototypeOf(Qe.prototype,Cn.prototype),Qe.prototype.close=function(t){this.destroy(),t&&queueMicrotask(t)},Qe.prototype.flush=function(t){t&&queueMicrotask(()=>t(null))},Qe.prototype.reset=function(){},Qe.prototype.params=function(t,n,s){s&&queueMicrotask(()=>s(null))},Qe.prototype._processChunk=function(t,n){let s=null;return this._transform(t,"buffer",(r,o)=>{if(r)throw r;o&&(s=W.from(o))}),n===4&&this._flush((r,o)=>{if(r)throw r;o&&(s=s?W.concat([s,W.from(o)]):W.from(o))}),s};const vr=function(t){this&&(Qe.call(this,t),this._engine=new dt.Deflate({...t||{},gzip:!0}))};Object.setPrototypeOf(vr.prototype,Qe.prototype),vr.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=Mt(this._engine);s(null,r??void 0)}catch(r){s(r)}},vr.prototype._flush=function(t){try{this._engine.push(new Uint8Array(0),!0);const n=Mt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const wr=function(t){this&&(Qe.call(this,t),this._engine=new dt.Inflate({...t||{}}))};Object.setPrototypeOf(wr.prototype,Qe.prototype),wr.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=Mt(this._engine);s(null,r??void 0)}catch(r){s(r)}},wr.prototype._flush=function(t){try{this._engine.push(new Uint8Array(0),!0);const n=Mt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const Sr=function(t){this&&(Qe.call(this,t),this._engine=new dt.Deflate({...t||{}}))};Object.setPrototypeOf(Sr.prototype,Qe.prototype),Sr.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=Mt(this._engine);s(null,r??void 0)}catch(r){s(r)}},Sr.prototype._flush=function(t){try{this._engine.push(new Uint8Array(0),!0);const n=Mt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const xr=function(t){this&&(Qe.call(this,t),this._engine=new dt.Inflate({...t||{}}))};Object.setPrototypeOf(xr.prototype,Qe.prototype),xr.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=Mt(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=Mt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const Er=function(t){this&&(Qe.call(this,t),this._engine=new dt.Deflate({...t||{},raw:!0}))};Object.setPrototypeOf(Er.prototype,Qe.prototype),Er.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=Mt(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=Mt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const kr=function(t){this&&(Qe.call(this,t),this._engine=new dt.Inflate({...t||{},raw:!0}))};Object.setPrototypeOf(kr.prototype,Qe.prototype),kr.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=Mt(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=Mt(this._engine);t(null,n??void 0)}catch(n){t(n)}};const Cr=function(t){this&&(Qe.call(this,t),this._engine=null)};Object.setPrototypeOf(Cr.prototype,Qe.prototype),Cr.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=Mt(this._engine);s(null,r??void 0)}catch(r){s(r)}},Cr.prototype._flush=function(t){try{if(this._engine){this._engine.push(new Uint8Array(0),!0);const n=Mt(this._engine);t(null,n??void 0)}else t(null)}catch(n){t(n)}};const Ar=function(t){this&&Qe.call(this,t)};Object.setPrototypeOf(Ar.prototype,Qe.prototype),Ar.prototype._transform=function(t,n,s){if(!en){s(new Error("Brotli WASM not loaded"));return}try{const r=t instanceof Uint8Array?t:new Uint8Array(t);s(null,W.from(en.compress(r)))}catch(r){s(r)}};const Tr=function(t){this&&Qe.call(this,t)};Object.setPrototypeOf(Tr.prototype,Qe.prototype),Tr.prototype._transform=function(t,n,s){if(!en){s(new Error("Brotli WASM not loaded"));return}try{const r=t instanceof Uint8Array?t:new Uint8Array(t);s(null,W.from(en.decompress(r)))}catch(r){s(r)}};const U1=Ar,j1=Tr;function Qm(e){return new vr(e)}function eg(e){return new wr(e)}function tg(e){return new Sr(e)}function ng(e){return new xr(e)}function sg(e){return new Er(e)}function rg(e){return new kr(e)}function ig(e){return new Cr(e)}function ag(e){return new Ar(e)}function og(e){return new Tr(e)}const lg={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:U1,BrotliCompressStream:Ar,BrotliDecompress:j1,BrotliDecompressStream:Tr,Deflate:Sr,DeflateRaw:Er,Gunzip:wr,Gzip:vr,Inflate:xr,InflateRaw:kr,Unzip:Cr,brotliCompress:Hm,brotliCompressSync:Xm,brotliDecompress:Wm,brotliDecompressSync:Jm,constants:lg,createBrotliCompress:ag,createBrotliDecompress:og,createDeflate:tg,createDeflateRaw:sg,createGunzip:eg,createGzip:Qm,createInflate:ng,createInflateRaw:rg,createUnzip:ig,default:{gzip:Mm,gunzip:Fm,deflate:$m,inflate:Um,deflateRaw:jm,inflateRaw:Vm,brotliCompress:Hm,brotliDecompress:Wm,gzipSync:zm,gunzipSync:qm,deflateSync:Gm,inflateSync:Km,deflateRawSync:Ym,inflateRawSync:Zm,brotliCompressSync:Xm,brotliDecompressSync:Jm,Gzip:vr,Gunzip:wr,Deflate:Sr,Inflate:xr,DeflateRaw:Er,InflateRaw:kr,Unzip:Cr,BrotliCompress:Ar,BrotliDecompress:Tr,createGzip:Qm,createGunzip:eg,createDeflate:tg,createInflate:ng,createDeflateRaw:sg,createInflateRaw:rg,createUnzip:ig,createBrotliCompress:ag,createBrotliDecompress:og,constants:lg},deflate:$m,deflateRaw:jm,deflateRawSync:Ym,deflateSync:Gm,gunzip:Fm,gunzipSync:qm,gzip:Mm,gzipSync:zm,inflate:Um,inflateRaw:Vm,inflateRawSync:Zm,inflateSync:Km},Symbol.toStringTag,{value:"Module"}));function io(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 ao(e,t){setTimeout(()=>t(null,["0.0.0.0"]),0)}function cg(e,t){ao(e,t)}function ug(e,t){setTimeout(()=>t(null,["::1"]),0)}function dg(e,t){setTimeout(()=>t(null,["localhost"]),0)}function hg(e){}function pg(){return[]}function fg(e){}function mg(){return"verbatim"}const Uc={lookup(e,t){return new Promise((n,s)=>{t!=null&&t.all?io(e,t,(r,o)=>{r?s(r):n(o??[])}):io(e,t??{},(r,o,c)=>{r?s(r):n({address:o,family:c})})})},resolve(e){return new Promise((t,n)=>{ao(e,(s,r)=>s?n(s):t(r??[]))})},resolve4(e){return Uc.resolve(e)},resolve6(e){return Promise.resolve(["::1"])},reverse(e){return Promise.resolve(["localhost"])},setServers(e){},getServers(){return[]}},gg=0,yg=0,_g=0;Object.freeze(Object.defineProperty({__proto__:null,ADDRCONFIG:gg,ALL:_g,V4MAPPED:yg,default:{lookup:io,resolve:ao,resolve4:cg,resolve6:ug,reverse:dg,setServers:hg,getServers:pg,setDefaultResultOrder:fg,getDefaultResultOrder:mg,promises:Uc,ADDRCONFIG:gg,V4MAPPED:yg,ALL:_g},getDefaultResultOrder:mg,getServers:pg,lookup:io,promises:Uc,resolve:ao,resolve4:cg,resolve6:ug,reverse:dg,setDefaultResultOrder:fg,setServers:hg},Symbol.toStringTag,{value:"Module"}));let bg=null;function vg(e){bg=e}function wg(){return bg}function Sg(e){vg(e)}const Wi=function(){this&&(this.handlers=new Map)};Wi.prototype.on=function(t,n){return this.handlers.has(t)||this.handlers.set(t,new Set),this.handlers.get(t).add(n),this},Wi.prototype.off=function(t,n){var s;return(s=this.handlers.get(t))==null||s.delete(n),this},Wi.prototype.fire=function(t,...n){const s=this.handlers.get(t);if(s)for(const r of s)try{r(...n)}catch{}};const Ht=function(t={}){if(!this)return;Wi.call(this);const n=wg();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(Ht.prototype,Wi.prototype),Ht.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},Ht.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},Ht.prototype.close=function(){this.terminated=!0;for(const t of this.handles.values())t.close();return this.handles.clear(),this.fire("close"),Promise.resolve()},Ht.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},Ht.prototype.resolvePath=function(t){let n=t;return this.cfg.cwd&&!n.startsWith("/")&&(n=this.cfg.cwd+"/"+n),n.startsWith("/")||(n="/"+n),n},Ht.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},Ht.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{}},Ht.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)},Ht.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 xg(e,t){const n=new Ht(t);return n.add(e),n}Object.freeze(Object.defineProperty({__proto__:null,PathWatcher:Ht,default:{watch:xg,PathWatcher:Ht,setVolume:Sg},setVolume:Sg,watch:xg},Symbol.toStringTag,{value:"Module"}));const $s=typeof CloseEvent<"u"?CloseEvent:class extends Event{constructor(t,n){super(t),H(this,"code"),H(this,"reason"),H(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}},Ir=typeof MessageEvent<"u"?MessageEvent:class extends Event{constructor(t,n){super(t),H(this,"data"),this.data=n==null?void 0:n.data}};let tn=null;try{tn=new BroadcastChannel("nodepod-ws-bridge")}catch{}const Eg=new Map;let V1=0;const Us=function(){this&&(this._listeners=new Map)};Us.prototype.on=function(t,n){return this._listeners.has(t)||this._listeners.set(t,new Set),this._listeners.get(t).add(n),this},Us.prototype.off=function(t,n){var s;return(s=this._listeners.get(t))==null||s.delete(n),this},Us.prototype.emit=function(t,...n){const s=this._listeners.get(t);if(s)for(const r of s)try{r(...n)}catch{}};const zi=0,On=1,qi=2,Wt=3,gt=function(t,n){if(!this)return;Us.call(this),this.CONNECTING=zi,this.OPEN=On,this.CLOSING=qi,this.CLOSED=Wt,this.readyState=zi,this.url=t,this.protocol="",this.extensions="",this.bufferedAmount=0,this.binaryType="blob",this._uid=`ws-${++V1}`,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(gt.prototype,Us.prototype),gt.CONNECTING=zi,gt.OPEN=On,gt.CLOSING=qi,gt.CLOSED=Wt,gt.prototype._open=function(){var t;if(this.url.startsWith("internal://")){this.readyState=On,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(!tn){const o=this;setTimeout(()=>{var c;o.readyState=On,o.emit("open"),(c=o.onopen)==null||c.call(o,new Event("open"))},0);return}tn.postMessage({kind:"connect",uid:this._uid,url:this.url});const n=tn,s=this,r=o=>{var c,d,p,y;const g=o.data;if(g.targetUid===s._uid){if(g.kind==="connected")s.readyState=On,s.emit("open"),(c=s.onopen)==null||c.call(s,new Event("open"));else if(g.kind==="payload"){const x=new Ir("message",{data:g.body});s.emit("message",x),(d=s.onmessage)==null||d.call(s,x)}else if(g.kind==="closed"){s.readyState=Wt;const x=new $s("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===zi&&(s.readyState=On,s.emit("open"),(o=s.onopen)==null||o.call(s,new Event("open")))},100)},gt.prototype._openNative=function(){var t;const s=typeof window<"u"&&typeof window.document<"u"&&typeof globalThis.WebSocket=="function"&&globalThis.WebSocket!==gt?globalThis.WebSocket:null;if(!s){const o=this;setTimeout(()=>{var c;o.readyState=On,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=Wt;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=On,r.emit("open"),(o=r.onopen)==null||o.call(r,new Event("open"))},this._native.onmessage=o=>{var c;const d=new Ir("message",{data:o.data});r.emit("message",d),(c=r.onmessage)==null||c.call(r,d)},this._native.onclose=o=>{var c;r.readyState=Wt,r._native=null;const d=new $s("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)}},gt.prototype.send=function(t){if(this.readyState!==On)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=mn(s,n,!1);this._tcpSocket.write(W.from(r));return}if(this._boundServer){this._boundServer._injectClientPayload(this,t);return}tn&&tn.postMessage({kind:"payload",uid:this._uid,url:this.url,body:t})},gt.prototype.close=function(t,n){if(this.readyState===Wt||this.readyState===qi)return;if(this.readyState=qi,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=mn(8,o,!1);try{this._tcpSocket.write(W.from(c))}catch{}const d=this;setTimeout(()=>{var p;d.readyState=Wt;const y=new $s("close",{code:r,reason:n||"",wasClean:!0});d.emit("close",y),(p=d.onclose)==null||p.call(d,y),d._tcpSocket=null},0);return}tn&&tn.postMessage({kind:"disconnect",uid:this._uid,url:this.url,code:t,reason:n});const s=this;setTimeout(()=>{var r;s.readyState=Wt;const o=new $s("close",{code:t||1e3,reason:n||"",wasClean:!0});s.emit("close",o),(r=s.onclose)==null||r.call(s,o)},0)},gt.prototype.ping=function(){},gt.prototype.pong=function(){},gt.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=Wt;const n=new $s("close",{code:1006,reason:"Terminated",wasClean:!1});this.emit("close",n),(t=this.onclose)==null||t.call(this,n)},gt.prototype._bindServer=function(t){this._boundServer=t},gt.prototype._deliverMessage=function(t){var n;const s=new Ir("message",{data:t});this.emit("message",s),(n=this.onmessage)==null||n.call(this,s)};const kg="258EAFA5-E914-47DA-95CA-5AB5DC76CB76";function H1(e){try{const t=Yr("sha1");return t.update(e+kg),t.digest("base64")}catch{return btoa(e+kg).slice(0,28)}}const hs=function(t={}){this&&(Us.call(this),this.clients=new Set,this.options=t,this._route=t.path||"/",this._channelCb=null,t.noServer||this._listen(),Eg.set(this._route,this))};Object.setPrototypeOf(hs.prototype,Us.prototype),hs.prototype._listen=function(){if(!tn)return;const t=tn,n=this;this._channelCb=s=>{const r=s.data;if(r.kind==="connect"){const o=new gt("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)},hs.prototype._injectClientPayload=function(t,n){const s=new Ir("message",{data:n});t.emit("message",s)},hs.prototype.handleUpgrade=function(t,n,s,r){const o=new gt("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
16
78
  Upgrade: websocket\r
17
79
  Connection: Upgrade\r
18
- Sec-WebSocket-Accept: ${$1(g)}\r
80
+ Sec-WebSocket-Accept: ${H1(g)}\r
19
81
  \r
20
- `;c.write(H.from(E)),c.on("data",C=>{var T,N,j;const q=C instanceof Uint8Array?C:new Uint8Array(C),J=new Uint8Array(o._tcpInboundBuf.length+q.length);for(J.set(o._tcpInboundBuf,0),J.set(q,o._tcpInboundBuf.length),o._tcpInboundBuf=J;o._tcpInboundBuf.length>=2;){const Y=wi(o._tcpInboundBuf);if(!Y)break;switch(o._tcpInboundBuf=o._tcpInboundBuf.slice(Y.consumed),Y.op){case 1:{const W=new TextDecoder().decode(Y.data),F=new Ar("message",{data:W});o.emit("message",F),(T=o.onmessage)==null||T.call(o,F);break}case 2:{const W=new Ar("message",{data:Y.data.buffer});o.emit("message",W),(N=o.onmessage)==null||N.call(o,W);break}case 8:{const W=Y.data.length>=2?Y.data[0]<<8|Y.data[1]:1e3;o.readyState=jt;const F=new Ms("close",{code:W,reason:"",wasClean:!0});o.emit("close",F),(j=o.onclose)==null||j.call(o,F),o._tcpSocket=null;break}case 9:{const W=hn(10,Y.data,!1);c.write(H.from(W));break}case 10:{o.emit("pong",Y.data);break}}}}),c.on("close",()=>{var C;if(o.readyState!==jt){o.readyState=jt;const T=new Ms("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)},ds.prototype.close=function(t){for(const n of this.clients)n.close(1001,"Server closing");this.clients.clear(),wg.delete(this._route),this._channelCb&&Jt&&(Jt.removeEventListener("message",this._channelCb),this._channelCb=null),this.emit("close"),t&&setTimeout(t,0)},ds.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:jt,CLOSING:Wi,CONNECTING:Hi,OPEN:Rn,Server:ds,WebSocket:ct,WebSocketServer:ds,createWebSocketStream:()=>{throw new Error("createWebSocketStream is not available in the browser")},default:ct},Symbol.toStringTag,{value:"Module"}));const xg={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 Eg(e,t){return()=>Promise.resolve()}function kg(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:xg,default:{watch:Eg,getInfo:kg,constants:xg},getInfo:kg,watch:Eg},Symbol.toStringTag,{value:"Module"}));function U1(e){yg(e)}const Vt=function(t,n={}){this&&(this.rootDir=t,this.cfg=n,this.results=[],this.scanned=!1,this.handlerMap=new Map)};Vt.prototype[Symbol.asyncIterator]=async function*(){this.runScan();for(const e of this.results)yield e},Vt.prototype.toArray=async function(){return this.runScan(),[...this.results]},Vt.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},Vt.prototype.once=function(t,n){const s=this,r=(...o)=>{n(...o),s.off(t,r)};return this.on(t,r)},Vt.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},Vt.prototype.fireEvent=function(t,...n){const s=this.handlerMap.get(t);if(s)for(const r of s)r(...n)},Vt.prototype.runScan=function(){this.scanned||(this.scanned=!0,this.crawl(this.rootDir,0,""))},Vt.prototype.crawl=function(t,n,s){const r=_g();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}},E=this.cfg.type||"files";if(g){if(!this.applyFilter(x,this.cfg.directoryFilter))continue;(E==="directories"||E==="files_directories"||E==="all")&&this.results.push(x),this.crawl(d,n+1,p)}else(E==="files"||E==="files_directories"||E==="all")&&this.applyFilter(x,this.cfg.fileFilter)&&this.results.push(x)}},Vt.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("!"))},Vt.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 Cg(e,t){return new Vt(e,t)}async function j1(e,t){return new Vt(e,t).toArray()}Object.freeze(Object.defineProperty({__proto__:null,DirectoryScanner:Vt,default:Cg,readdirp:Cg,readdirpPromise:j1,setVolume:U1},Symbol.toStringTag,{value:"Module"}));const ao=["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 Ag(e){const t=e.startsWith("node:")?e.slice(5):e;if(ao.includes(t))return!0;const n=t.indexOf("/");return n!==-1?ao.includes(t.slice(0,n)):!1}function Tg(e){return function(n){throw new Error(`Cannot resolve module '${n}' from '${e}'`)}}const Ig={},Rg={".js":()=>{},".json":()=>{},".node":()=>{}},Pg={};function Dg(e,t,n,s){return e}function Og(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 Ng(e,t,n){throw new Error(`Cannot load module '${e}'`)}function Bg(e,t,n){return e}function Lg(e){return"(function (exports, require, module, __filename, __dirname) { "+e+`
21
- });`}const Mg=["(function (exports, require, module, __filename, __dirname) { ",`
22
- });`];function Fg(){}function Ge(e,t){this.id=e||"",this.filename=e||"",this.loaded=!1,this.parent=t||null,this.children=[],this.exports={},this.paths=[]}Ge.prototype.require=function(e){throw new Error(`Cannot resolve module '${e}' from '${this.filename}'`)},Ge.prototype.load=function(e){this.loaded=!0},Ge.prototype._compile=function(e,t){},Ge.createRequire=Tg,Ge.builtinModules=ao,Ge.isBuiltin=Ag,Ge._cache=Ig,Ge._extensions=Rg,Ge._pathCache=Pg,Ge._resolveFilename=Dg,Ge._nodeModulePaths=Og,Ge._load=Ng,Ge._findPath=Bg,Ge.syncBuiltinESMExports=Fg,Ge.wrap=Lg,Ge.wrapper=Mg,Ge.Module=Ge,Ge.runMain=function(){},Ge._preloadModules=function(e){},Ge._initPaths=function(){},Ge.globalPaths=["/node_modules"],Object.freeze(Object.defineProperty({__proto__:null,Module:Ge,_cache:Ig,_extensions:Rg,_findPath:Bg,_load:Ng,_nodeModulePaths:Og,_pathCache:Pg,_resolveFilename:Dg,builtinModules:ao,createRequire:Tg,default:Ge,isBuiltin:Ag,syncBuiltinESMExports:Fg,wrap:Lg,wrapper:Mg},Symbol.toStringTag,{value:"Module"}));const $g=globalThis.performance??{now:()=>Date.now(),timeOrigin:Date.now(),mark:()=>{},measure:()=>{},getEntries:()=>[],getEntriesByName:()=>[],getEntriesByType:()=>[],clearMarks:()=>{},clearMeasures:()=>{},clearResourceTimings:()=>{}},Tr=function(t){this&&(this._fn=t,this._types=[])};Tr.supportedEntryTypes=["mark","measure","resource","navigation"],Tr.prototype.observe=function(t){this._types=t.entryTypes??(t.type?[t.type]:[])},Tr.prototype.disconnect=function(){this._types=[]},Tr.prototype.takeRecords=function(){return[]};const zi=function(){this&&(this.min=0,this.max=0,this.mean=0,this.stddev=0,this.percentiles=new Map,this.exceeds=0)};zi.prototype.reset=function(){this.min=0,this.max=0,this.mean=0,this.stddev=0,this.percentiles.clear(),this.exceeds=0},zi.prototype.percentile=function(t){return this.percentiles.get(t)??0};function Ug(){return new zi}function jg(e){return new zi}Object.freeze(Object.defineProperty({__proto__:null,PerformanceObserver:Tr,TimingHistogram:zi,createHistogram:Ug,default:{performance:$g,PerformanceObserver:Tr,createHistogram:Ug,monitorEventLoopDelay:jg},monitorEventLoopDelay:jg,performance:$g},Symbol.toStringTag,{value:"Module"}));let Vg=!0,Hg=null,Wg=null,zg=0,$c=null;function qg(e){$c=e}let V1=1;const Pn=function(){this&&se.call(this)};Object.setPrototypeOf(Pn.prototype,se.prototype),Pn.prototype.postMessage=function(t,n){},Pn.prototype.start=function(){},Pn.prototype.close=function(){},Pn.prototype.ref=function(){},Pn.prototype.unref=function(){};const Gg=function(){if(!this)return;this.port1=new Pn,this.port2=new Pn;const t=this.port1,n=this.port2;t.postMessage=s=>{queueMicrotask(()=>n.emit("message",s))},n.postMessage=s=>{queueMicrotask(()=>t.emit("message",s))}},hs=function(t,n){var s,r;if(!this)return;se.call(this),this.threadId=V1++,this.resourceLimits={},this._handle=null,this._terminated=!1,this._isReffed=!1;const o=typeof t=="string"?t:t.href,c=this;if(!$c){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=$c(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,_n()),c._terminated=!0,c.emit("exit",x)},onStdout:x=>{var E,C;const T=(C=(E=globalThis.process)==null?void 0:E.stdout)==null?void 0:C.write;typeof T=="function"&&T.call(globalThis.process.stdout,x)},onStderr:x=>{var E,C;const T=(C=(E=globalThis.process)==null?void 0:E.stderr)==null?void 0:C.write;typeof T=="function"&&T.call(globalThis.process.stderr,x)}});this._handle=g,this._isReffed=!0,ns(),queueMicrotask(()=>{c._terminated||c.emit("online")})};Object.setPrototypeOf(hs.prototype,se.prototype),hs.prototype.postMessage=function(t,n){this._handle&&!this._terminated&&this._handle.postMessage(t)},hs.prototype.terminate=function(){return this._handle&&!this._terminated&&(this._isReffed&&(this._isReffed=!1,_n()),this._terminated=!0,this._handle.terminate()),Promise.resolve(0)},hs.prototype.ref=function(){return!this._isReffed&&!this._terminated&&(this._isReffed=!0,ns()),this},hs.prototype.unref=function(){return this._isReffed&&(this._isReffed=!1,_n()),this},hs.prototype.getHeapSnapshot=function(){return Promise.resolve({})};const $s=function(t){this&&(se.call(this),this.name=t)};Object.setPrototypeOf($s.prototype,se.prototype),$s.prototype.postMessage=function(t){},$s.prototype.close=function(){},$s.prototype.ref=function(){},$s.prototype.unref=function(){};function Kg(e,t){return e}function Yg(e){}const Zg=Symbol.for("nodejs.worker_threads.SHARE_ENV");function Xg(e){}function Jg(e){}function Qg(e,t){}Object.freeze(Object.defineProperty({__proto__:null,BroadcastChannel:$s,MessageChannel:Gg,MessagePort:Pn,SHARE_ENV:Zg,Worker:hs,default:{isMainThread:Vg,parentPort:Hg,workerData:Wg,threadId:zg,Worker:hs,MessageChannel:Gg,MessagePort:Pn,BroadcastChannel:$s,moveMessagePortToContext:Kg,receiveMessageOnPort:Yg,SHARE_ENV:Zg,markAsUntransferable:Xg,getEnvironmentData:Jg,setEnvironmentData:Qg,setWorkerThreadForkCallback:qg},getEnvironmentData:Jg,isMainThread:Vg,markAsUntransferable:Xg,moveMessagePortToContext:Kg,parentPort:Hg,receiveMessageOnPort:Yg,setEnvironmentData:Qg,setWorkerThreadForkCallback:qg,threadId:zg,workerData:Wg},Symbol.toStringTag,{value:"Module"}));var H1=[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],ey=[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],W1="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",ty="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Uc={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"},jc="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",z1={5:jc,"5module":jc+" export import",6:jc+" const class extends export import super"},q1=/^in(stanceof)?$/,G1=new RegExp("["+ty+"]"),K1=new RegExp("["+ty+W1+"]");function Vc(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 pn(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&G1.test(String.fromCharCode(e)):t===!1?!1:Vc(e,ey)}function Kn(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&&K1.test(String.fromCharCode(e)):t===!1?!1:Vc(e,ey)||Vc(e,H1)}var Ne=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 Qt(e,t){return new Ne(e,{beforeExpr:!0,binop:t})}var en={beforeExpr:!0},Bt={startsExpr:!0},oo={};function Oe(e,t){return t===void 0&&(t={}),t.keyword=e,oo[e]=new Ne(e,t)}var S={num:new Ne("num",Bt),regexp:new Ne("regexp",Bt),string:new Ne("string",Bt),name:new Ne("name",Bt),privateId:new Ne("privateId",Bt),eof:new Ne("eof"),bracketL:new Ne("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new Ne("]"),braceL:new Ne("{",{beforeExpr:!0,startsExpr:!0}),braceR:new Ne("}"),parenL:new Ne("(",{beforeExpr:!0,startsExpr:!0}),parenR:new Ne(")"),comma:new Ne(",",en),semi:new Ne(";",en),colon:new Ne(":",en),dot:new Ne("."),question:new Ne("?",en),questionDot:new Ne("?."),arrow:new Ne("=>",en),template:new Ne("template"),invalidTemplate:new Ne("invalidTemplate"),ellipsis:new Ne("...",en),backQuote:new Ne("`",Bt),dollarBraceL:new Ne("${",{beforeExpr:!0,startsExpr:!0}),eq:new Ne("=",{beforeExpr:!0,isAssign:!0}),assign:new Ne("_=",{beforeExpr:!0,isAssign:!0}),incDec:new Ne("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new Ne("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Qt("||",1),logicalAND:Qt("&&",2),bitwiseOR:Qt("|",3),bitwiseXOR:Qt("^",4),bitwiseAND:Qt("&",5),equality:Qt("==/!=/===/!==",6),relational:Qt("</>/<=/>=",7),bitShift:Qt("<</>>/>>>",8),plusMin:new Ne("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Qt("%",10),star:Qt("*",10),slash:Qt("/",10),starstar:new Ne("**",{beforeExpr:!0}),coalesce:Qt("??",1),_break:Oe("break"),_case:Oe("case",en),_catch:Oe("catch"),_continue:Oe("continue"),_debugger:Oe("debugger"),_default:Oe("default",en),_do:Oe("do",{isLoop:!0,beforeExpr:!0}),_else:Oe("else",en),_finally:Oe("finally"),_for:Oe("for",{isLoop:!0}),_function:Oe("function",Bt),_if:Oe("if"),_return:Oe("return",en),_switch:Oe("switch"),_throw:Oe("throw",en),_try:Oe("try"),_var:Oe("var"),_const:Oe("const"),_while:Oe("while",{isLoop:!0}),_with:Oe("with"),_new:Oe("new",{beforeExpr:!0,startsExpr:!0}),_this:Oe("this",Bt),_super:Oe("super",Bt),_class:Oe("class",Bt),_extends:Oe("extends",en),_export:Oe("export"),_import:Oe("import",Bt),_null:Oe("null",Bt),_true:Oe("true",Bt),_false:Oe("false",Bt),_in:Oe("in",{beforeExpr:!0,binop:7}),_instanceof:Oe("instanceof",{beforeExpr:!0,binop:7}),_typeof:Oe("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Oe("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Oe("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Tt=/\r\n?|\n|\u2028|\u2029/,ny=new RegExp(Tt.source,"g");function Us(e){return e===10||e===13||e===8232||e===8233}function sy(e,t,n){n===void 0&&(n=e.length);for(var s=t;s<n;s++){var r=e.charCodeAt(s);if(Us(r))return s<n-1&&r===13&&e.charCodeAt(s+1)===10?s+2:s+1}return-1}var Hc=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,wt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ry=Object.prototype,Y1=ry.hasOwnProperty,Z1=ry.toString,Ir=Object.hasOwn||function(e,t){return Y1.call(e,t)},iy=Array.isArray||function(e){return Z1.call(e)==="[object Array]"},ay=Object.create(null);function ps(e){return ay[e]||(ay[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function Yn(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var X1=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Rr=function(t,n){this.line=t,this.column=n};Rr.prototype.offset=function(t){return new Rr(this.line,this.column+t)};var qi=function(t,n,s){this.start=n,this.end=s,t.sourceFile!==null&&(this.source=t.sourceFile)};function Wc(e,t){for(var n=1,s=0;;){var r=sy(e,s,t);if(r<0)return new Rr(n,t-s);++n,s=r}}var lo={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},oy=!1;function J1(e){var t={};for(var n in lo)t[n]=e&&Ir(e,n)?e[n]:lo[n];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!oy&&typeof console=="object"&&console.warn&&(oy=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
23
- 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),iy(t.onToken)){var s=t.onToken;t.onToken=function(r){return s.push(r)}}return iy(t.onComment)&&(t.onComment=Q1(t,t.onComment)),t}function Q1(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 qi(this,c,d)),e.ranges&&(p.range=[r,o]),t.push(p)}}var Gi=1,Pr=2,zc=4,ly=8,qc=16,cy=32,co=64,uy=128,js=256,Ki=512,uo=Gi|Pr|js;function Gc(e,t){return Pr|(e?zc:0)|(t?ly:0)}var ho=0,Kc=1,Zn=2,dy=3,hy=4,py=5,Ye=function(t,n,s){this.options=t=J1(t),this.sourceFile=t.sourceFile,this.keywords=ps(z1[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var r="";t.allowReserved!==!0&&(r=Uc[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(r+=" await")),this.reservedWords=ps(r);var o=(r?r+" ":"")+Uc.strict;this.reservedWordsStrict=ps(o),this.reservedWordsStrictBind=ps(o+" "+Uc.strictBind),this.input=String(n),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf(`
24
- `,s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Tt).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(Gi),this.regexpState=null,this.privateNameStack=[]},Dn={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}};Ye.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)},Dn.inFunction.get=function(){return(this.currentVarScope().flags&Pr)>0},Dn.inGenerator.get=function(){return(this.currentVarScope().flags&ly)>0},Dn.inAsync.get=function(){return(this.currentVarScope().flags&zc)>0},Dn.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(js|Ki))return!1;if(n&Pr)return(n&zc)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Dn.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&co)>0||this.options.allowSuperOutsideMethod},Dn.allowDirectSuper.get=function(){return(this.currentThisScope().flags&uy)>0},Dn.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Dn.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(js|Ki)||n&Pr&&!(n&qc))return!0}return!1},Dn.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&js)>0},Ye.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},Ye.parse=function(t,n){return new this(n,t).parse()},Ye.parseExpressionAt=function(t,n,s){var r=new this(s,t,n);return r.nextToken(),r.parseExpression()},Ye.tokenizer=function(t,n){return new this(n,t)},Object.defineProperties(Ye.prototype,Dn);var It=Ye.prototype,ek=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;It.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){wt.lastIndex=e,e+=wt.exec(this.input)[0].length;var t=ek.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){wt.lastIndex=e+t[0].length;var n=wt.exec(this.input),s=n.index+n[0].length,r=this.input.charAt(s);return r===";"||r==="}"||Tt.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="=")}e+=t[0].length,wt.lastIndex=e,e+=wt.exec(this.input)[0].length,this.input[e]===";"&&e++}},It.eat=function(e){return this.type===e?(this.next(),!0):!1},It.isContextual=function(e){return this.type===S.name&&this.value===e&&!this.containsEsc},It.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},It.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},It.canInsertSemicolon=function(){return this.type===S.eof||this.type===S.braceR||Tt.test(this.input.slice(this.lastTokEnd,this.start))},It.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},It.semicolon=function(){!this.eat(S.semi)&&!this.insertSemicolon()&&this.unexpected()},It.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},It.expect=function(e){this.eat(e)||this.unexpected()},It.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var po=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};It.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")}},It.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")},It.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")},It.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var de=Ye.prototype;de.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 Yc={kind:"loop"},tk={kind:"switch"};de.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;wt.lastIndex=this.pos;var t=wt.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(pn(s,!0)){for(var r=n+1;Kn(s=this.input.charCodeAt(r),!0);)++r;if(s===92||s>55295&&s<56320)return!0;var o=this.input.slice(n,r);if(!q1.test(o))return!0}return!1},de.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;wt.lastIndex=this.pos;var e=wt.exec(this.input),t=this.pos+e[0].length,n;return!Tt.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(Kn(n=this.input.charCodeAt(t+8))||n>55295&&n<56320))},de.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;wt.lastIndex=this.pos;var n=wt.exec(this.input),s=this.pos+n[0].length;if(Tt.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||Kn(o=this.input.charCodeAt(r))||o>55295&&o<56320)return!1;wt.lastIndex=r;var c=wt.exec(this.input);if(c&&Tt.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||!Kn(p=this.input.charCodeAt(d))&&!(p>55295&&p<56320)))return!1}var y=this.input.charCodeAt(s);return pn(y,!0)||y===92},de.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},de.isUsing=function(e){return this.isUsingKeyword(!1,e)},de.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){wt.lastIndex=this.pos;var c=wt.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)}},de.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")},de.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},de.parseDoStatement=function(e){return this.next(),this.labels.push(Yc),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")},de.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Yc),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 po,x=this.start,E=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&&(E.start===x&&!y&&E.type==="Identifier"&&E.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),o&&c&&this.raise(E.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(E,!1,g),this.checkLValPattern(E),this.parseForIn(e,E)):(this.checkExpressionErrors(g,!0),t>-1&&this.unexpected(t),this.parseFor(e,E))},de.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))},de.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Yi|(n?0:Zc),!1,t)},de.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")},de.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")},de.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(S.braceL),this.labels.push(tk),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")},de.parseThrowStatement=function(e){return this.next(),Tt.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 nk=[];de.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?cy:0),this.checkLValPattern(e,t?hy:Zn),this.expect(S.parenR),e},de.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")},de.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,"VariableDeclaration")},de.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Yc),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},de.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")},de.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},de.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")},de.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},de.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")},de.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")},de.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")},de.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},de.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Kc:Zn,!1)};var Yi=1,Zc=2,fy=4;de.parseFunction=function(e,t,n,s,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===S.star&&t&Zc&&this.unexpected(),e.generator=this.eat(S.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&Yi&&(e.id=t&fy&&this.type!==S.name?null:this.parseIdent(),e.id&&!(t&Zc)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Kc:Zn:dy));var o=this.yieldPos,c=this.awaitPos,d=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Gc(e.async,e.generator)),t&Yi||(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&Yi?"FunctionDeclaration":"FunctionExpression")},de.parseFunctionParams=function(e){this.expect(S.parenL),e.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},de.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"&&sk(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")},de.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&&fo(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},de.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},de.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)},de.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&&fo(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")},de.parseClassField=function(e){return fo(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&fo(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(S.eq)?(this.enterScope(Ki|co),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},de.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(js|co);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")},de.parseClassId=function(e,t){this.type===S.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Zn,!1)):(t===!0&&this.unexpected(),e.id=null)},de.parseClassSuper=function(e){e.superClass=this.eat(S._extends)?this.parseExprSubscripts(null,!1):null},de.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},de.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];Ir(t,c.name)||(r?r.used.push(c):this.raiseRecoverable(c.start,"Private field '#"+c.name+"' must be declared in an enclosing class"))}};function sk(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 fo(e,t){var n=e.computed,s=e.key;return!n&&(s.type==="Identifier"&&s.name===t||s.type==="Literal"&&s.value===t)}de.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")},de.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")},de.parseExportDeclaration=function(e){return this.parseStatement(null)},de.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,Yi|fy,!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}},de.checkExport=function(e,t,n){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),Ir(e,t)&&this.raiseRecoverable(n,"Duplicate export '"+t+"'"),e[t]=!0)},de.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)},de.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)}},de.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},de.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")},de.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},de.parseImport=function(e){return this.next(),this.type===S.string?(e.specifiers=nk,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")},de.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,Zn),this.finishNode(e,"ImportSpecifier")},de.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Zn),this.finishNode(e,"ImportDefaultSpecifier")},de.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,Zn),this.finishNode(e,"ImportNamespaceSpecifier")},de.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},de.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;Ir(t,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),t[r]=!0,e.push(s)}return e},de.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")},de.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===S.string){var e=this.parseLiteral(this.value);return X1.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},de.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)},de.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 tn=Ye.prototype;tn.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},tn.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},tn.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},tn.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")},tn.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()},tn.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},tn.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},tn.parseBindingListItem=function(e){return e},tn.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")},tn.checkLValSimple=function(e,t,n){t===void 0&&(t=ho);var s=t!==ho;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===Zn&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),n&&(Ir(n,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),n[e.name]=!0),t!==py&&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")}},tn.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=ho),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)}},tn.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=ho),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 nn=function(t,n,s,r,o){this.token=t,this.isExpr=!!n,this.preserveSpace=!!s,this.override=r,this.generator=!!o},Ve={b_stat:new nn("{",!1),b_expr:new nn("{",!0),b_tmpl:new nn("${",!1),p_stat:new nn("(",!1),p_expr:new nn("(",!0),q_tmpl:new nn("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new nn("function",!1),f_expr:new nn("function",!0),f_expr_gen:new nn("function",!0,!1,null,!0),f_gen:new nn("function",!1,!1,null,!0)},Dr=Ye.prototype;Dr.initialContext=function(){return[Ve.b_stat]},Dr.curContext=function(){return this.context[this.context.length-1]},Dr.braceIsBlock=function(e){var t=this.curContext();return t===Ve.f_expr||t===Ve.f_stat?!0:e===S.colon&&(t===Ve.b_stat||t===Ve.b_expr)?!t.isExpr:e===S._return||e===S.name&&this.exprAllowed?Tt.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===Ve.b_stat:e===S._var||e===S._const||e===S.name?!1:!this.exprAllowed},Dr.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},Dr.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},Dr.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===Ve.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)?Ve.b_stat:Ve.b_expr),this.exprAllowed=!0},S.dollarBraceL.updateContext=function(){this.context.push(Ve.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?Ve.p_stat:Ve.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()!==Ve.p_stat)&&!(e===S._return&&Tt.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===S.colon||e===S.braceL)&&this.curContext()===Ve.b_stat)?this.context.push(Ve.f_expr):this.context.push(Ve.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()===Ve.q_tmpl?this.context.pop():this.context.push(Ve.q_tmpl),this.exprAllowed=!1},S.star.updateContext=function(e){if(e===S._function){var t=this.context.length-1;this.context[t]===Ve.f_expr?this.context[t]=Ve.f_expr_gen:this.context[t]=Ve.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 ge=Ye.prototype;ge.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}},ge.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},ge.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 po,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},ge.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},ge.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)},ge.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),E=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(E,t,n,s,r)}return e},ge.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")},ge.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"&&my(d.argument)?this.raiseRecoverable(d.start,"Deleting local variable in strict mode"):d.operator==="delete"&&Xc(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 my(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&my(e.expression)}function Xc(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Xc(e.expression)||e.type==="ParenthesizedExpression"&&Xc(e.expression)}ge.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},ge.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}},ge.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(S.arrow)},ge.parseSubscriptAsyncArrow=function(e,t,n,s){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,s)},ge.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 po,E=this.yieldPos,C=this.awaitPos,T=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var N=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=E,this.awaitPos=C,this.awaitIdentPos=T,this.parseSubscriptAsyncArrow(t,n,N,c);this.checkExpressionErrors(x,!0),this.yieldPos=E||this.yieldPos,this.awaitPos=C||this.awaitPos,this.awaitIdentPos=T||this.awaitIdentPos;var j=this.startNodeAt(t,n);j.callee=e,j.arguments=N,d&&(j.optional=p),e=this.finishNode(j,"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 q=this.startNodeAt(t,n);q.tag=e,q.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(q,"TaggedTemplateExpression")}return e},ge.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(Ve.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(Ve.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()}},ge.parseExprAtomDefault=function(){this.unexpected()},ge.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()},ge.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")},ge.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")},ge.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")},ge.parseParenExpression=function(){this.expect(S.parenL);var e=this.parseExpression();return this.expect(S.parenR),e},ge.shouldParseArrow=function(e){return!this.canInsertSemicolon()},ge.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 po,E=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 N=this.lastTokEnd,j=this.lastTokEndLoc;if(this.expect(S.parenR),e&&this.shouldParseArrow(p)&&this.eat(S.arrow))return this.checkPatternErrors(x,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=E,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=E||this.yieldPos,this.awaitPos=C||this.awaitPos,p.length>1?(r=this.startNodeAt(c,d),r.expressions=p,this.finishNodeAt(r,"SequenceExpression",N,j)):r=p[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var q=this.startNodeAt(n,s);return q.expression=r,this.finishNode(q,"ParenthesizedExpression")}else return r},ge.parseParenItem=function(e){return e},ge.parseParenArrowList=function(e,t,n,s){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,s)};var rk=[];ge.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=rk,this.finishNode(e,"NewExpression")},ge.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,`
82
+ `;c.write(W.from(k)),c.on("data",C=>{var T,L,V;const G=C instanceof Uint8Array?C:new Uint8Array(C),J=new Uint8Array(o._tcpInboundBuf.length+G.length);for(J.set(o._tcpInboundBuf,0),J.set(G,o._tcpInboundBuf.length),o._tcpInboundBuf=J;o._tcpInboundBuf.length>=2;){const X=xi(o._tcpInboundBuf);if(!X)break;switch(o._tcpInboundBuf=o._tcpInboundBuf.slice(X.consumed),X.op){case 1:{const q=new TextDecoder().decode(X.data),$=new Ir("message",{data:q});o.emit("message",$),(T=o.onmessage)==null||T.call(o,$);break}case 2:{const q=new Ir("message",{data:X.data.buffer});o.emit("message",q),(L=o.onmessage)==null||L.call(o,q);break}case 8:{const q=X.data.length>=2?X.data[0]<<8|X.data[1]:1e3;o.readyState=Wt;const $=new $s("close",{code:q,reason:"",wasClean:!0});o.emit("close",$),(V=o.onclose)==null||V.call(o,$),o._tcpSocket=null;break}case 9:{const q=mn(10,X.data,!1);c.write(W.from(q));break}case 10:{o.emit("pong",X.data);break}}}}),c.on("close",()=>{var C;if(o.readyState!==Wt){o.readyState=Wt;const T=new $s("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)},hs.prototype.close=function(t){for(const n of this.clients)n.close(1001,"Server closing");this.clients.clear(),Eg.delete(this._route),this._channelCb&&tn&&(tn.removeEventListener("message",this._channelCb),this._channelCb=null),this.emit("close"),t&&setTimeout(t,0)},hs.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:Wt,CLOSING:qi,CONNECTING:zi,OPEN:On,Server:hs,WebSocket:gt,WebSocketServer:hs,createWebSocketStream:()=>{throw new Error("createWebSocketStream is not available in the browser")},default:gt},Symbol.toStringTag,{value:"Module"}));const Cg={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 Ag(e,t){return()=>Promise.resolve()}function Tg(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:Cg,default:{watch:Ag,getInfo:Tg,constants:Cg},getInfo:Tg,watch:Ag},Symbol.toStringTag,{value:"Module"}));function W1(e){vg(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=wg();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 Ig(e,t){return new zt(e,t)}async function z1(e,t){return new zt(e,t).toArray()}Object.freeze(Object.defineProperty({__proto__:null,DirectoryScanner:zt,default:Ig,readdirp:Ig,readdirpPromise:z1,setVolume:W1},Symbol.toStringTag,{value:"Module"}));const oo=["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 Rg(e){const t=e.startsWith("node:")?e.slice(5):e;if(oo.includes(t))return!0;const n=t.indexOf("/");return n!==-1?oo.includes(t.slice(0,n)):!1}function Pg(e){return function(n){throw new Error(`Cannot resolve module '${n}' from '${e}'`)}}const Dg={},Og={".js":()=>{},".json":()=>{},".node":()=>{}},Ng={};function Bg(e,t,n,s){return e}function Lg(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 Mg(e,t,n){throw new Error(`Cannot load module '${e}'`)}function Fg(e,t,n){return e}function $g(e){return"(function (exports, require, module, __filename, __dirname) { "+e+`
83
+ });`}const Ug=["(function (exports, require, module, __filename, __dirname) { ",`
84
+ });`];function jg(){}function et(e,t){this.id=e||"",this.filename=e||"",this.loaded=!1,this.parent=t||null,this.children=[],this.exports={},this.paths=[]}et.prototype.require=function(e){throw new Error(`Cannot resolve module '${e}' from '${this.filename}'`)},et.prototype.load=function(e){this.loaded=!0},et.prototype._compile=function(e,t){},et.createRequire=Pg,et.builtinModules=oo,et.isBuiltin=Rg,et._cache=Dg,et._extensions=Og,et._pathCache=Ng,et._resolveFilename=Bg,et._nodeModulePaths=Lg,et._load=Mg,et._findPath=Fg,et.syncBuiltinESMExports=jg,et.wrap=$g,et.wrapper=Ug,et.Module=et,et.runMain=function(){},et._preloadModules=function(e){},et._initPaths=function(){},et.globalPaths=["/node_modules"],Object.freeze(Object.defineProperty({__proto__:null,Module:et,_cache:Dg,_extensions:Og,_findPath:Fg,_load:Mg,_nodeModulePaths:Lg,_pathCache:Ng,_resolveFilename:Bg,builtinModules:oo,createRequire:Pg,default:et,isBuiltin:Rg,syncBuiltinESMExports:jg,wrap:$g,wrapper:Ug},Symbol.toStringTag,{value:"Module"}));const Vg=globalThis.performance??{now:()=>Date.now(),timeOrigin:Date.now(),mark:()=>{},measure:()=>{},getEntries:()=>[],getEntriesByName:()=>[],getEntriesByType:()=>[],clearMarks:()=>{},clearMeasures:()=>{},clearResourceTimings:()=>{}},Rr=function(t){this&&(this._fn=t,this._types=[])};Rr.supportedEntryTypes=["mark","measure","resource","navigation"],Rr.prototype.observe=function(t){this._types=t.entryTypes??(t.type?[t.type]:[])},Rr.prototype.disconnect=function(){this._types=[]},Rr.prototype.takeRecords=function(){return[]};const Gi=function(){this&&(this.min=0,this.max=0,this.mean=0,this.stddev=0,this.percentiles=new Map,this.exceeds=0)};Gi.prototype.reset=function(){this.min=0,this.max=0,this.mean=0,this.stddev=0,this.percentiles.clear(),this.exceeds=0},Gi.prototype.percentile=function(t){return this.percentiles.get(t)??0};function Hg(){return new Gi}function Wg(e){return new Gi}Object.freeze(Object.defineProperty({__proto__:null,PerformanceObserver:Rr,TimingHistogram:Gi,createHistogram:Hg,default:{performance:Vg,PerformanceObserver:Rr,createHistogram:Hg,monitorEventLoopDelay:Wg},monitorEventLoopDelay:Wg,performance:Vg},Symbol.toStringTag,{value:"Module"}));let zg=!0,qg=null,Gg=null,Kg=0,jc=null;function Yg(e){jc=e}let q1=1;const Nn=function(){this&&ne.call(this)};Object.setPrototypeOf(Nn.prototype,ne.prototype),Nn.prototype.postMessage=function(t,n){},Nn.prototype.start=function(){},Nn.prototype.close=function(){},Nn.prototype.ref=function(){},Nn.prototype.unref=function(){};const Zg=function(){if(!this)return;this.port1=new Nn,this.port2=new Nn;const t=this.port1,n=this.port2;t.postMessage=s=>{queueMicrotask(()=>n.emit("message",s))},n.postMessage=s=>{queueMicrotask(()=>t.emit("message",s))}},ps=function(t,n){var s,r;if(!this)return;ne.call(this),this.threadId=q1++,this.resourceLimits={},this._handle=null,this._terminated=!1,this._isReffed=!1;const o=typeof t=="string"?t:t.href,c=this;if(!jc){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=jc(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,wn()),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,rs(),queueMicrotask(()=>{c._terminated||c.emit("online")})};Object.setPrototypeOf(ps.prototype,ne.prototype),ps.prototype.postMessage=function(t,n){this._handle&&!this._terminated&&this._handle.postMessage(t)},ps.prototype.terminate=function(){return this._handle&&!this._terminated&&(this._isReffed&&(this._isReffed=!1,wn()),this._terminated=!0,this._handle.terminate()),Promise.resolve(0)},ps.prototype.ref=function(){return!this._isReffed&&!this._terminated&&(this._isReffed=!0,rs()),this},ps.prototype.unref=function(){return this._isReffed&&(this._isReffed=!1,wn()),this},ps.prototype.getHeapSnapshot=function(){return Promise.resolve({})};const js=function(t){this&&(ne.call(this),this.name=t)};Object.setPrototypeOf(js.prototype,ne.prototype),js.prototype.postMessage=function(t){},js.prototype.close=function(){},js.prototype.ref=function(){},js.prototype.unref=function(){};function Xg(e,t){return e}function Jg(e){}const Qg=Symbol.for("nodejs.worker_threads.SHARE_ENV");function ey(e){}function ty(e){}function ny(e,t){}Object.freeze(Object.defineProperty({__proto__:null,BroadcastChannel:js,MessageChannel:Zg,MessagePort:Nn,SHARE_ENV:Qg,Worker:ps,default:{isMainThread:zg,parentPort:qg,workerData:Gg,threadId:Kg,Worker:ps,MessageChannel:Zg,MessagePort:Nn,BroadcastChannel:js,moveMessagePortToContext:Xg,receiveMessageOnPort:Jg,SHARE_ENV:Qg,markAsUntransferable:ey,getEnvironmentData:ty,setEnvironmentData:ny,setWorkerThreadForkCallback:Yg},getEnvironmentData:ty,isMainThread:zg,markAsUntransferable:ey,moveMessagePortToContext:Xg,parentPort:qg,receiveMessageOnPort:Jg,setEnvironmentData:ny,setWorkerThreadForkCallback:Yg,threadId:Kg,workerData:Gg},Symbol.toStringTag,{value:"Module"}));var G1=[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],sy=[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],K1="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",ry="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Vc={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"},Hc="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",Y1={5:Hc,"5module":Hc+" export import",6:Hc+" const class extends export import super"},Z1=/^in(stanceof)?$/,X1=new RegExp("["+ry+"]"),J1=new RegExp("["+ry+K1+"]");function Wc(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 gn(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&X1.test(String.fromCharCode(e)):t===!1?!1:Wc(e,sy)}function Zn(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&&J1.test(String.fromCharCode(e)):t===!1?!1:Wc(e,sy)||Wc(e,G1)}var Ue=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 nn(e,t){return new Ue(e,{beforeExpr:!0,binop:t})}var sn={beforeExpr:!0},Ft={startsExpr:!0},lo={};function $e(e,t){return t===void 0&&(t={}),t.keyword=e,lo[e]=new Ue(e,t)}var S={num:new Ue("num",Ft),regexp:new Ue("regexp",Ft),string:new Ue("string",Ft),name:new Ue("name",Ft),privateId:new Ue("privateId",Ft),eof:new Ue("eof"),bracketL:new Ue("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new Ue("]"),braceL:new Ue("{",{beforeExpr:!0,startsExpr:!0}),braceR:new Ue("}"),parenL:new Ue("(",{beforeExpr:!0,startsExpr:!0}),parenR:new Ue(")"),comma:new Ue(",",sn),semi:new Ue(";",sn),colon:new Ue(":",sn),dot:new Ue("."),question:new Ue("?",sn),questionDot:new Ue("?."),arrow:new Ue("=>",sn),template:new Ue("template"),invalidTemplate:new Ue("invalidTemplate"),ellipsis:new Ue("...",sn),backQuote:new Ue("`",Ft),dollarBraceL:new Ue("${",{beforeExpr:!0,startsExpr:!0}),eq:new Ue("=",{beforeExpr:!0,isAssign:!0}),assign:new Ue("_=",{beforeExpr:!0,isAssign:!0}),incDec:new Ue("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new Ue("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:nn("||",1),logicalAND:nn("&&",2),bitwiseOR:nn("|",3),bitwiseXOR:nn("^",4),bitwiseAND:nn("&",5),equality:nn("==/!=/===/!==",6),relational:nn("</>/<=/>=",7),bitShift:nn("<</>>/>>>",8),plusMin:new Ue("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:nn("%",10),star:nn("*",10),slash:nn("/",10),starstar:new Ue("**",{beforeExpr:!0}),coalesce:nn("??",1),_break:$e("break"),_case:$e("case",sn),_catch:$e("catch"),_continue:$e("continue"),_debugger:$e("debugger"),_default:$e("default",sn),_do:$e("do",{isLoop:!0,beforeExpr:!0}),_else:$e("else",sn),_finally:$e("finally"),_for:$e("for",{isLoop:!0}),_function:$e("function",Ft),_if:$e("if"),_return:$e("return",sn),_switch:$e("switch"),_throw:$e("throw",sn),_try:$e("try"),_var:$e("var"),_const:$e("const"),_while:$e("while",{isLoop:!0}),_with:$e("with"),_new:$e("new",{beforeExpr:!0,startsExpr:!0}),_this:$e("this",Ft),_super:$e("super",Ft),_class:$e("class",Ft),_extends:$e("extends",sn),_export:$e("export"),_import:$e("import",Ft),_null:$e("null",Ft),_true:$e("true",Ft),_false:$e("false",Ft),_in:$e("in",{beforeExpr:!0,binop:7}),_instanceof:$e("instanceof",{beforeExpr:!0,binop:7}),_typeof:$e("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:$e("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:$e("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Dt=/\r\n?|\n|\u2028|\u2029/,iy=new RegExp(Dt.source,"g");function Vs(e){return e===10||e===13||e===8232||e===8233}function ay(e,t,n){n===void 0&&(n=e.length);for(var s=t;s<n;s++){var r=e.charCodeAt(s);if(Vs(r))return s<n-1&&r===13&&e.charCodeAt(s+1)===10?s+2:s+1}return-1}var zc=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,kt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,oy=Object.prototype,Q1=oy.hasOwnProperty,ek=oy.toString,Pr=Object.hasOwn||function(e,t){return Q1.call(e,t)},ly=Array.isArray||function(e){return ek.call(e)==="[object Array]"},cy=Object.create(null);function fs(e){return cy[e]||(cy[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function Xn(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var tk=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Dr=function(t,n){this.line=t,this.column=n};Dr.prototype.offset=function(t){return new Dr(this.line,this.column+t)};var Ki=function(t,n,s){this.start=n,this.end=s,t.sourceFile!==null&&(this.source=t.sourceFile)};function qc(e,t){for(var n=1,s=0;;){var r=ay(e,s,t);if(r<0)return new Dr(n,t-s);++n,s=r}}var co={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},uy=!1;function nk(e){var t={};for(var n in co)t[n]=e&&Pr(e,n)?e[n]:co[n];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!uy&&typeof console=="object"&&console.warn&&(uy=!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),ly(t.onToken)){var s=t.onToken;t.onToken=function(r){return s.push(r)}}return ly(t.onComment)&&(t.onComment=sk(t,t.onComment)),t}function sk(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 Ki(this,c,d)),e.ranges&&(p.range=[r,o]),t.push(p)}}var Yi=1,Or=2,Gc=4,dy=8,Kc=16,hy=32,uo=64,py=128,Hs=256,Zi=512,ho=Yi|Or|Hs;function Yc(e,t){return Or|(e?Gc:0)|(t?dy:0)}var po=0,Zc=1,Jn=2,fy=3,my=4,gy=5,st=function(t,n,s){this.options=t=nk(t),this.sourceFile=t.sourceFile,this.keywords=fs(Y1[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var r="";t.allowReserved!==!0&&(r=Vc[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(r+=" await")),this.reservedWords=fs(r);var o=(r?r+" ":"")+Vc.strict;this.reservedWordsStrict=fs(o),this.reservedWordsStrictBind=fs(o+" "+Vc.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(Dt).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(Yi),this.regexpState=null,this.privateNameStack=[]},Bn={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}};st.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)},Bn.inFunction.get=function(){return(this.currentVarScope().flags&Or)>0},Bn.inGenerator.get=function(){return(this.currentVarScope().flags&dy)>0},Bn.inAsync.get=function(){return(this.currentVarScope().flags&Gc)>0},Bn.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(Hs|Zi))return!1;if(n&Or)return(n&Gc)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Bn.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&uo)>0||this.options.allowSuperOutsideMethod},Bn.allowDirectSuper.get=function(){return(this.currentThisScope().flags&py)>0},Bn.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Bn.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(Hs|Zi)||n&Or&&!(n&Kc))return!0}return!1},Bn.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Hs)>0},st.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},st.parse=function(t,n){return new this(n,t).parse()},st.parseExpressionAt=function(t,n,s){var r=new this(s,t,n);return r.nextToken(),r.parseExpression()},st.tokenizer=function(t,n){return new this(n,t)},Object.defineProperties(st.prototype,Bn);var Ot=st.prototype,rk=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Ot.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){kt.lastIndex=e,e+=kt.exec(this.input)[0].length;var t=rk.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){kt.lastIndex=e+t[0].length;var n=kt.exec(this.input),s=n.index+n[0].length,r=this.input.charAt(s);return r===";"||r==="}"||Dt.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="=")}e+=t[0].length,kt.lastIndex=e,e+=kt.exec(this.input)[0].length,this.input[e]===";"&&e++}},Ot.eat=function(e){return this.type===e?(this.next(),!0):!1},Ot.isContextual=function(e){return this.type===S.name&&this.value===e&&!this.containsEsc},Ot.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},Ot.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Ot.canInsertSemicolon=function(){return this.type===S.eof||this.type===S.braceR||Dt.test(this.input.slice(this.lastTokEnd,this.start))},Ot.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Ot.semicolon=function(){!this.eat(S.semi)&&!this.insertSemicolon()&&this.unexpected()},Ot.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Ot.expect=function(e){this.eat(e)||this.unexpected()},Ot.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var fo=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Ot.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")}},Ot.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")},Ot.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")},Ot.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var he=st.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 Xc={kind:"loop"},ik={kind:"switch"};he.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;kt.lastIndex=this.pos;var t=kt.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(gn(s,!0)){for(var r=n+1;Zn(s=this.input.charCodeAt(r),!0);)++r;if(s===92||s>55295&&s<56320)return!0;var o=this.input.slice(n,r);if(!Z1.test(o))return!0}return!1},he.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;kt.lastIndex=this.pos;var e=kt.exec(this.input),t=this.pos+e[0].length,n;return!Dt.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(Zn(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;kt.lastIndex=this.pos;var n=kt.exec(this.input),s=this.pos+n[0].length;if(Dt.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||Zn(o=this.input.charCodeAt(r))||o>55295&&o<56320)return!1;kt.lastIndex=r;var c=kt.exec(this.input);if(c&&Dt.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||!Zn(p=this.input.charCodeAt(d))&&!(p>55295&&p<56320)))return!1}var y=this.input.charCodeAt(s);return gn(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){kt.lastIndex=this.pos;var c=kt.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(Xc),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(Xc),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 fo,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,Xi|(n?0:Jc),!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(ik),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(),Dt.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 ak=[];he.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?hy:0),this.checkLValPattern(e,t?my:Jn),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(Xc),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"?Zc:Jn,!1)};var Xi=1,Jc=2,yy=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&Jc&&this.unexpected(),e.generator=this.eat(S.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&Xi&&(e.id=t&yy&&this.type!==S.name?null:this.parseIdent(),e.id&&!(t&Jc)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Zc:Jn:fy));var o=this.yieldPos,c=this.awaitPos,d=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Yc(e.async,e.generator)),t&Xi||(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&Xi?"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"&&ok(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&&mo(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&&mo(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 mo(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&mo(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(S.eq)?(this.enterScope(Zi|uo),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(Hs|uo);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,Jn,!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];Pr(t,c.name)||(r?r.used.push(c):this.raiseRecoverable(c.start,"Private field '#"+c.name+"' must be declared in an enclosing class"))}};function ok(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 mo(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,Xi|yy,!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),Pr(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=ak,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,Jn),this.finishNode(e,"ImportSpecifier")},he.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Jn),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,Jn),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;Pr(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 tk.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 rn=st.prototype;rn.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},rn.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},rn.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},rn.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")},rn.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()},rn.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},rn.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},rn.parseBindingListItem=function(e){return e},rn.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")},rn.checkLValSimple=function(e,t,n){t===void 0&&(t=po);var s=t!==po;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===Jn&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),n&&(Pr(n,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),n[e.name]=!0),t!==gy&&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")}},rn.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=po),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)}},rn.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=po),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 an=function(t,n,s,r,o){this.token=t,this.isExpr=!!n,this.preserveSpace=!!s,this.override=r,this.generator=!!o},Ze={b_stat:new an("{",!1),b_expr:new an("{",!0),b_tmpl:new an("${",!1),p_stat:new an("(",!1),p_expr:new an("(",!0),q_tmpl:new an("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new an("function",!1),f_expr:new an("function",!0),f_expr_gen:new an("function",!0,!1,null,!0),f_gen:new an("function",!1,!1,null,!0)},Nr=st.prototype;Nr.initialContext=function(){return[Ze.b_stat]},Nr.curContext=function(){return this.context[this.context.length-1]},Nr.braceIsBlock=function(e){var t=this.curContext();return t===Ze.f_expr||t===Ze.f_stat?!0:e===S.colon&&(t===Ze.b_stat||t===Ze.b_expr)?!t.isExpr:e===S._return||e===S.name&&this.exprAllowed?Dt.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===Ze.b_stat:e===S._var||e===S._const||e===S.name?!1:!this.exprAllowed},Nr.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},Nr.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},Nr.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===Ze.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)?Ze.b_stat:Ze.b_expr),this.exprAllowed=!0},S.dollarBraceL.updateContext=function(){this.context.push(Ze.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?Ze.p_stat:Ze.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()!==Ze.p_stat)&&!(e===S._return&&Dt.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===S.colon||e===S.braceL)&&this.curContext()===Ze.b_stat)?this.context.push(Ze.f_expr):this.context.push(Ze.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()===Ze.q_tmpl?this.context.pop():this.context.push(Ze.q_tmpl),this.exprAllowed=!1},S.star.updateContext=function(e){if(e===S._function){var t=this.context.length-1;this.context[t]===Ze.f_expr?this.context[t]=Ze.f_expr_gen:this.context[t]=Ze.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 ye=st.prototype;ye.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}},ye.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},ye.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 fo,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},ye.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},ye.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)},ye.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},ye.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")},ye.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"&&_y(d.argument)?this.raiseRecoverable(d.start,"Deleting local variable in strict mode"):d.operator==="delete"&&Qc(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 _y(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&_y(e.expression)}function Qc(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Qc(e.expression)||e.type==="ParenthesizedExpression"&&Qc(e.expression)}ye.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},ye.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}},ye.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(S.arrow)},ye.parseSubscriptAsyncArrow=function(e,t,n,s){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,s)},ye.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 fo,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 G=this.startNodeAt(t,n);G.tag=e,G.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(G,"TaggedTemplateExpression")}return e},ye.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(Ze.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(Ze.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()}},ye.parseExprAtomDefault=function(){this.unexpected()},ye.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()},ye.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")},ye.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")},ye.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")},ye.parseParenExpression=function(){this.expect(S.parenL);var e=this.parseExpression();return this.expect(S.parenR),e},ye.shouldParseArrow=function(e){return!this.canInsertSemicolon()},ye.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 fo,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 G=this.startNodeAt(n,s);return G.expression=r,this.finishNode(G,"ParenthesizedExpression")}else return r},ye.parseParenItem=function(e){return e},ye.parseParenArrowList=function(e,t,n,s){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,s)};var lk=[];ye.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=lk,this.finishNode(e,"NewExpression")},ye.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,`
25
87
  `),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
26
- `),cooked:this.value},this.next(),n.tail=this.type===S.backQuote,this.finishNode(n,"TemplateElement")},ge.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")},ge.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)&&!Tt.test(this.input.slice(this.lastTokEnd,this.start))},ge.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")},ge.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")},ge.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")},ge.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()},ge.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")},ge.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},ge.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(Gc(t,s.generator)|co|(n?uy: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")},ge.parseArrowExpression=function(e,t,n,s){var r=this.yieldPos,o=this.awaitPos,c=this.awaitIdentPos;return this.enterScope(Gc(n,!1)|qc),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")},ge.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,py),e.body=this.parseBlock(!1,void 0,c&&!o),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=p}this.exitScope()},ge.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},ge.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,Kc,t?null:n)}},ge.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},ge.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&uo)&&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"))}},ge.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},ge.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},ge.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},ge.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")},ge.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 mo=Ye.prototype;mo.raise=function(e,t){var n=Wc(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},mo.raiseRecoverable=mo.raise,mo.curPosition=function(){if(this.options.locations)return new Rr(this.curLine,this.pos-this.lineStart)};var fs=Ye.prototype,ik=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]};fs.enterScope=function(e){this.scopeStack.push(new ik(e))},fs.exitScope=function(){this.scopeStack.pop()},fs.treatFunctionsAsVarInScope=function(e){return e.flags&Pr||!this.inModule&&e.flags&Gi},fs.declareName=function(e,t,n){var s=!1;if(t===Zn){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&Gi&&delete this.undefinedExports[e]}else if(t===hy){var o=this.currentScope();o.lexical.push(e)}else if(t===dy){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&cy&&p.lexical[0]===e)||!this.treatFunctionsAsVarInScope(p)&&p.functions.indexOf(e)>-1){s=!0;break}if(p.var.push(e),this.inModule&&p.flags&Gi&&delete this.undefinedExports[e],p.flags&uo)break}s&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")},fs.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},fs.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},fs.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(uo|Ki|js))return t}},fs.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(uo|Ki|js)&&!(t.flags&qc))return t}};var Zi=function(t,n,s){this.type="",this.start=n,this.end=0,t.options.locations&&(this.loc=new qi(t,s)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[n,0])},Xi=Ye.prototype;Xi.startNode=function(){return new Zi(this,this.start,this.startLoc)},Xi.startNodeAt=function(e,t){return new Zi(this,e,t)};function gy(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}Xi.finishNode=function(e,t){return gy.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Xi.finishNodeAt=function(e,t,n,s){return gy.call(this,e,t,n,s)},Xi.copyNode=function(e){var t=new Zi(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var ak="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",yy="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",_y=yy+" Extended_Pictographic",by=_y,vy=by+" EBase EComp EMod EPres ExtPict",wy=vy,ok=wy,lk={9:yy,10:_y,11:by,12:vy,13:wy,14:ok},ck="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",uk={9:"",10:"",11:"",12:"",13:"",14:ck},Sy="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",xy="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",Ey=xy+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ky=Ey+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Cy=ky+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Ay=Cy+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",dk=Ay+" "+ak,hk={9:xy,10:Ey,11:ky,12:Cy,13:Ay,14:dk},Ty={};function pk(e){var t=Ty[e]={binary:ps(lk[e]+" "+Sy),binaryOfStrings:ps(uk[e]),nonBinary:{General_Category:ps(Sy),Script:ps(hk[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 Jc=0,Iy=[9,10,11,12,13,14];Jc<Iy.length;Jc+=1){var fk=Iy[Jc];pk(fk)}var ce=Ye.prototype,go=function(t,n){this.parent=t,this.base=n||this};go.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},go.prototype.sibling=function(){return new go(this.parent,this.base)};var On=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=Ty[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};On.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)},On.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},On.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},On.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},On.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)},On.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)},On.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)},On.prototype.eat=function(t,n){return n===void 0&&(n=!1),this.current(n)===t?(this.advance(n),!0):!1},On.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},ce.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 mk(e){for(var t in e)return!0;return!1}ce.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&mk(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},ce.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")}},ce.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new go(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")},ce.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},ce.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},ce.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},ce.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},ce.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},ce.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},ce.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)},ce.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},ce.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},ce.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},ce.regexp_eatModifiers=function(e){for(var t="",n=0;(n=e.current())!==-1&&gk(n);)t+=Yn(n),e.advance();return t};function gk(e){return e===105||e===109||e===115}ce.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)},ce.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},ce.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Ry(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Ry(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}ce.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!Ry(n);)e.advance();return e.pos!==t},ce.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},ce.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}},ce.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},ce.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Yn(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Yn(e.lastIntValue);return!0}return!1},ce.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),yk(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function yk(e){return pn(e,!0)||e===36||e===95}ce.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),_k(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function _k(e){return Kn(e,!0)||e===36||e===95||e===8204||e===8205}ce.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)},ce.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},ce.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},ce.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)},ce.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},ce.regexp_eatZero=function(e){return e.current()===48&&!yo(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1},ce.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},ce.regexp_eatControlLetter=function(e){var t=e.current();return Py(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Py(e){return e>=65&&e<=90||e>=97&&e<=122}ce.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)&&bk(e.lastIntValue))return!0;s&&e.raise("Invalid unicode escape"),e.pos=n}return!1};function bk(e){return e>=0&&e<=1114111}ce.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},ce.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 Dy=0,Xn=1,sn=2;ce.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(vk(t))return e.lastIntValue=-1,e.advance(),Xn;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===sn&&e.raise("Invalid property name"),s;e.raise("Invalid property name")}return Dy};function vk(e){return e===100||e===68||e===115||e===83||e===119||e===87}ce.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),Xn}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r)}return Dy},ce.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){Ir(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value")},ce.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return Xn;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return sn;e.raise("Invalid property name")},ce.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Oy(t=e.current());)e.lastStringValue+=Yn(t),e.advance();return e.lastStringValue!==""};function Oy(e){return Py(e)||e===95}ce.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";wk(t=e.current());)e.lastStringValue+=Yn(t),e.advance();return e.lastStringValue!==""};function wk(e){return Oy(e)||yo(e)}ce.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},ce.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===sn&&e.raise("Negated character class may contain strings"),!0}return!1},ce.regexp_classContents=function(e){return e.current()===93?Xn:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),Xn)},ce.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")}}},ce.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||Ly(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},ce.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)},ce.regexp_classSetExpression=function(e){var t=Xn,n;if(!this.regexp_eatClassSetRange(e))if(n=this.regexp_eatClassSetOperand(e)){n===sn&&(t=sn);for(var s=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){n!==sn&&(t=Xn);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===sn&&(t=sn)}},ce.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},ce.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?Xn:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},ce.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===sn&&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},ce.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},ce.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===sn&&(t=sn);return t},ce.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?Xn:sn},ce.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()&&Sk(n)||xk(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function Sk(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 xk(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}ce.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Ek(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Ek(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}ce.regexp_eatClassControlLetter=function(e){var t=e.current();return yo(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},ce.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},ce.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;yo(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function yo(e){return e>=48&&e<=57}ce.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Ny(n=e.current());)e.lastIntValue=16*e.lastIntValue+By(n),e.advance();return e.pos!==t};function Ny(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function By(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}ce.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},ce.regexp_eatOctalDigit=function(e){var t=e.current();return Ly(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Ly(e){return e>=48&&e<=55}ce.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var s=0;s<t;++s){var r=e.current();if(!Ny(r))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+By(r),e.advance()}return!0};var _o=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new qi(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},Ie=Ye.prototype;Ie.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 _o(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Ie.getToken=function(){return this.next(),new _o(this)},typeof Symbol<"u"&&(Ie[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===S.eof,value:t}}}}),Ie.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())},Ie.readToken=function(e){return pn(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Ie.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},Ie.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=sy(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())},Ie.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&&!Us(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())},Ie.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&&Hc.test(String.fromCharCode(e)))++this.pos;else break e}}},Ie.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)},Ie.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))},Ie.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)},Ie.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)},Ie.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)},Ie.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(S.assign,2):this.finishOp(S.bitwiseXOR,1)},Ie.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||Tt.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)},Ie.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))},Ie.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)},Ie.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)},Ie.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),pn(t,!0)||t===92))return this.finishToken(S.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Yn(t)+"'")},Ie.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 '"+Yn(e)+"'")},Ie.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Ie.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(Tt.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 On(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})},Ie.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 kk(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function My(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}Ie.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=My(this.input.slice(t,this.pos)),++this.pos):pn(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,n)},Ie.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=My(this.input.slice(t,this.pos));return++this.pos,pn(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")),pn(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var o=kk(this.input.slice(t,this.pos),n);return this.finishToken(S.num,o)},Ie.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},Ie.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)):(Us(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(S.string,t)};var Fy={};Ie.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Fy)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Ie.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Fy;this.raise(e,t)},Ie.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(Us(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+=`
27
- `;break;default:e+=String.fromCharCode(n);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Ie.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]===`
88
+ `),cooked:this.value},this.next(),n.tail=this.type===S.backQuote,this.finishNode(n,"TemplateElement")},ye.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")},ye.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)&&!Dt.test(this.input.slice(this.lastTokEnd,this.start))},ye.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")},ye.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")},ye.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")},ye.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()},ye.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")},ye.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},ye.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(Yc(t,s.generator)|uo|(n?py: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")},ye.parseArrowExpression=function(e,t,n,s){var r=this.yieldPos,o=this.awaitPos,c=this.awaitIdentPos;return this.enterScope(Yc(n,!1)|Kc),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")},ye.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,gy),e.body=this.parseBlock(!1,void 0,c&&!o),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=p}this.exitScope()},ye.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},ye.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,Zc,t?null:n)}},ye.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},ye.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&ho)&&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"))}},ye.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},ye.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},ye.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},ye.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")},ye.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 go=st.prototype;go.raise=function(e,t){var n=qc(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},go.raiseRecoverable=go.raise,go.curPosition=function(){if(this.options.locations)return new Dr(this.curLine,this.pos-this.lineStart)};var ms=st.prototype,ck=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]};ms.enterScope=function(e){this.scopeStack.push(new ck(e))},ms.exitScope=function(){this.scopeStack.pop()},ms.treatFunctionsAsVarInScope=function(e){return e.flags&Or||!this.inModule&&e.flags&Yi},ms.declareName=function(e,t,n){var s=!1;if(t===Jn){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&Yi&&delete this.undefinedExports[e]}else if(t===my){var o=this.currentScope();o.lexical.push(e)}else if(t===fy){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&hy&&p.lexical[0]===e)||!this.treatFunctionsAsVarInScope(p)&&p.functions.indexOf(e)>-1){s=!0;break}if(p.var.push(e),this.inModule&&p.flags&Yi&&delete this.undefinedExports[e],p.flags&ho)break}s&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")},ms.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},ms.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},ms.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(ho|Zi|Hs))return t}},ms.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(ho|Zi|Hs)&&!(t.flags&Kc))return t}};var Ji=function(t,n,s){this.type="",this.start=n,this.end=0,t.options.locations&&(this.loc=new Ki(t,s)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[n,0])},Qi=st.prototype;Qi.startNode=function(){return new Ji(this,this.start,this.startLoc)},Qi.startNodeAt=function(e,t){return new Ji(this,e,t)};function by(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}Qi.finishNode=function(e,t){return by.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Qi.finishNodeAt=function(e,t,n,s){return by.call(this,e,t,n,s)},Qi.copyNode=function(e){var t=new Ji(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var uk="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",vy="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",wy=vy+" Extended_Pictographic",Sy=wy,xy=Sy+" EBase EComp EMod EPres ExtPict",Ey=xy,dk=Ey,hk={9:vy,10:wy,11:Sy,12:xy,13:Ey,14:dk},pk="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",fk={9:"",10:"",11:"",12:"",13:"",14:pk},ky="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",Cy="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",Ay=Cy+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Ty=Ay+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Iy=Ty+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Ry=Iy+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",mk=Ry+" "+uk,gk={9:Cy,10:Ay,11:Ty,12:Iy,13:Ry,14:mk},Py={};function yk(e){var t=Py[e]={binary:fs(hk[e]+" "+ky),binaryOfStrings:fs(fk[e]),nonBinary:{General_Category:fs(ky),Script:fs(gk[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 eu=0,Dy=[9,10,11,12,13,14];eu<Dy.length;eu+=1){var _k=Dy[eu];yk(_k)}var ue=st.prototype,yo=function(t,n){this.parent=t,this.base=n||this};yo.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},yo.prototype.sibling=function(){return new yo(this.parent,this.base)};var Ln=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=Py[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};Ln.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)},Ln.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},Ln.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},Ln.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},Ln.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)},Ln.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)},Ln.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)},Ln.prototype.eat=function(t,n){return n===void 0&&(n=!1),this.current(n)===t?(this.advance(n),!0):!1},Ln.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 bk(e){for(var t in e)return!0;return!1}ue.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&bk(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 yo(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&&vk(n);)t+=Xn(n),e.advance();return t};function vk(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 Oy(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Oy(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&&!Oy(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+=Xn(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Xn(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),wk(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function wk(e){return gn(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),Sk(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function Sk(e){return Zn(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&&!_o(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 Ny(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Ny(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)&&xk(e.lastIntValue))return!0;s&&e.raise("Invalid unicode escape"),e.pos=n}return!1};function xk(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 By=0,Qn=1,on=2;ue.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Ek(t))return e.lastIntValue=-1,e.advance(),Qn;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===on&&e.raise("Invalid property name"),s;e.raise("Invalid property name")}return By};function Ek(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),Qn}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r)}return By},ue.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){Pr(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 Qn;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return on;e.raise("Invalid property name")},ue.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Ly(t=e.current());)e.lastStringValue+=Xn(t),e.advance();return e.lastStringValue!==""};function Ly(e){return Ny(e)||e===95}ue.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";kk(t=e.current());)e.lastStringValue+=Xn(t),e.advance();return e.lastStringValue!==""};function kk(e){return Ly(e)||_o(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===on&&e.raise("Negated character class may contain strings"),!0}return!1},ue.regexp_classContents=function(e){return e.current()===93?Qn:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),Qn)},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||$y(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=Qn,n;if(!this.regexp_eatClassSetRange(e))if(n=this.regexp_eatClassSetOperand(e)){n===on&&(t=on);for(var s=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){n!==on&&(t=Qn);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===on&&(t=on)}},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)?Qn: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===on&&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)===on&&(t=on);return t},ue.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?Qn:on},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()&&Ck(n)||Ak(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function Ck(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 Ak(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 Tk(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Tk(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 _o(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;_o(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function _o(e){return e>=48&&e<=57}ue.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;My(n=e.current());)e.lastIntValue=16*e.lastIntValue+Fy(n),e.advance();return e.pos!==t};function My(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Fy(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 $y(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function $y(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(!My(r))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+Fy(r),e.advance()}return!0};var bo=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Ki(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},Be=st.prototype;Be.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 bo(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Be.getToken=function(){return this.next(),new bo(this)},typeof Symbol<"u"&&(Be[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===S.eof,value:t}}}}),Be.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())},Be.readToken=function(e){return gn(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Be.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},Be.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=ay(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())},Be.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&&!Vs(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())},Be.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&&zc.test(String.fromCharCode(e)))++this.pos;else break e}}},Be.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)},Be.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))},Be.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)},Be.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)},Be.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)},Be.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(S.assign,2):this.finishOp(S.bitwiseXOR,1)},Be.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||Dt.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)},Be.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))},Be.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)},Be.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)},Be.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),gn(t,!0)||t===92))return this.finishToken(S.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Xn(t)+"'")},Be.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 '"+Xn(e)+"'")},Be.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Be.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(Dt.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 Ln(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})},Be.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 Ik(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Uy(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}Be.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=Uy(this.input.slice(t,this.pos)),++this.pos):gn(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,n)},Be.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=Uy(this.input.slice(t,this.pos));return++this.pos,gn(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")),gn(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var o=Ik(this.input.slice(t,this.pos),n);return this.finishToken(S.num,o)},Be.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},Be.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)):(Vs(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(S.string,t)};var jy={};Be.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===jy)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Be.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw jy;this.raise(e,t)},Be.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(Vs(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}},Be.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]===`
28
90
  `&&++this.pos;case`
29
- `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},Ie.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
30
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Yn(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 Us(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},Ie.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,"Bad character escape sequence"),n},Ie.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(Kn(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?pn:Kn)(c,s)||this.invalidStringToken(o,"Invalid Unicode escape"),e+=Yn(c),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Ie.readWord=function(){var e=this.readWord1(),t=S.name;return this.keywords.test(e)&&(t=oo[e]),this.finishToken(t,e)};var $y="8.15.0";Ye.acorn={Parser:Ye,version:$y,defaultOptions:lo,Position:Rr,SourceLocation:qi,getLineInfo:Wc,Node:Zi,TokenType:Ne,tokTypes:S,keywordTypes:oo,TokContext:nn,tokContexts:Ve,isIdentifierChar:Kn,isIdentifierStart:pn,Token:_o,isNewLine:Us,lineBreak:Tt,lineBreakG:ny,nonASCIIwhitespace:Hc};function bo(e,t){return Ye.parse(e,t)}function Ck(e,t,n){return Ye.parseExpressionAt(e,t,n)}function Ak(e,t){return Ye.tokenizer(e,t)}const Tk=Object.freeze(Object.defineProperty({__proto__:null,Node:Zi,Parser:Ye,Position:Rr,SourceLocation:qi,TokContext:nn,Token:_o,TokenType:Ne,defaultOptions:lo,getLineInfo:Wc,isIdentifierChar:Kn,isIdentifierStart:pn,isNewLine:Us,keywordTypes:oo,lineBreak:Tt,lineBreakG:ny,nonASCIIwhitespace:Hc,parse:bo,parseExpressionAt:Ck,tokContexts:Ve,tokTypes:S,tokenizer:Ak,version:$y},Symbol.toStringTag,{value:"Module"})),Uy=/\bawait\b/,Ik=/\basync\b/,jy=new RegExp("(?<![.\\w])await\\s+(?=[\\w$(\"'\\[`!~+\\-/])","g"),Rk=new RegExp("(?<![.\\w])async\\s+(?=function[\\s*(])","g"),Pk=new RegExp("(?<![.\\w])async\\s+(?=\\()","g"),Dk=new RegExp("(?<![.\\w])async\\s+(?=\\w+\\s*=>)","g");function Ok(e,t="topLevelOnly"){const n=t==="full";if(!n&&!Uy.test(e)||n&&!Uy.test(e)&&!Ik.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),E=e.slice(g,p.start).lastIndexOf("async");if(E>=0){const C=g+E;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]===`
31
- `||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,E=e.slice(g,p.left.start).indexOf("await");if(E>=0){const C=g+E;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=bo(e,{ecmaVersion:"latest",sourceType:"script",allowAwaitOutsideFunction:!0})}catch{r=bo(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(jy,"");return s=s.replace(Rk,""),s=s.replace(Pk,""),s=s.replace(Dk,""),s}return e.replace(jy,"")}}const Nk=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 Ht=null,Ji=null,Vy=ac,ms=null;function Hy(e){ms=e}function Wy(e){Vy=e}async function Qi(e){if(!Ht){if(typeof window<"u"&&window.__esbuild){Ht=window.__esbuild;return}if(typeof window<"u"&&window.__esbuildInitPromise&&(await window.__esbuildInitPromise,window.__esbuild)){Ht=window.__esbuild;return}return Ji||(Ji=(async()=>{try{const t=await za(QS);await t.initialize({wasmURL:(e==null?void 0:e.wasmURL)||Vy}),Ht=t}catch(t){throw Ji=null,new Error(`esbuild: initialization failed -- ${t}`)}})(),Ji)}}async function zy(e,t){ns();try{if(Ht||await Qi(),!Ht)throw new Error("esbuild: engine not ready");return await Ht.transform(e,t)}finally{_n()}}async function Qc(e){if(Ht||await Qi(),!Ht)throw new Error("esbuild: engine not ready");ns();try{const t=zk(e.external,e.platform,e.conditions),n=[...e.plugins||[]];t&&n.push(t);let s=e.entryPoints;if(s&&ms){const d=e.absWorkingDir||vo();s=s.map(p=>Vk(p,d))}const r=e.absWorkingDir||vo(),o=e.write!==!1,c=await Ht.build({...e,entryPoints:s,plugins:n,write:!1,absWorkingDir:r});if(Wk(c),o&&c.outputFiles&&ms)for(const d of c.outputFiles){const p=d.path.startsWith("/")?d.path:r+"/"+d.path,y=p.substring(0,p.lastIndexOf("/"));y&&!ms.existsSync(y)&&ms.mkdirSync(y,{recursive:!0}),ms.writeFileSync(p,d.text)}return c}finally{_n()}}function qy(e,t){if(!Ht)throw new Error("esbuild: engine not ready");return Ht.formatMessages(e,t)}const Gy="0.21.5";async function Ky(e){ns();try{Ht||await Qi()}finally{_n()}let t=!1;return{async rebuild(){if(t)throw new Error("Build context already disposed");return Qc(e)},async watch(s){},async serve(s){return{host:"localhost",port:0}},async cancel(){},async dispose(){t=!0}}}function Yy(){}async function Zy(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(`
32
- `)}function Xy(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(`
33
- `)}function Jy(e,t){return{code:e,map:"",warnings:[]}}function Qy(e){return{errors:[],warnings:[],outputFiles:[]}}const Bk={initialize:Qi,transform:zy,transformSync:Jy,build:Qc,buildSync:Qy,context:Ky,stop:Yy,formatMessages:qy,analyzeMetafile:Zy,analyzeMetafileSync:Xy,version:Gy,setVolume:Hy,setWasmUrl:Wy},Lk=["node","browser","require","module","import","default"],Mk=["browser","module","import","node","require","default"];function Or(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=Or(o,t,n);if(c)return c}}const s=t==="browser"?Mk:Lk;for(const r of s){const o=e[r];if(o!==void 0){const c=Or(o,t,n);if(c)return c}}}}function Fk(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 E=x+"/package.json";if(!e.existsSync(E))return null;try{const C=e.readFileSync(E,"utf8"),T=JSON.parse(C);let N=null;if(y?N=$k(e,T,x,y,n,r,o):N=Uk(e,T,x,n,r,o),N)return{resolvedPath:N,fromVolume:!0}}catch{}return null}function $k(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=Or(p,o,c);if(y){const g=n+"/"+y.replace(/^\.\//,""),x=Nn(e,g,["",".js",".ts",".mjs"]);if(x)return x}}}return Nn(e,n+"/"+s,r)}function Uk(e,t,n,s,r,o){if(t.exports){const d=typeof t.exports=="object"&&!Array.isArray(t.exports)&&t.exports["."]||t.exports,p=Or(d,r,o);if(p){const y=n+"/"+p.replace(/^\.\//,""),g=Nn(e,y,["",".js",".ts",".mjs"]);if(g)return g}}const c=t.module||t.main||"index.js";return Nn(e,n+"/"+c.replace(/^\.\//,""),s)}function jk(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=Or(g,r,o);if(x){const E=c+"/"+x.replace(/^\.\//,""),C=Nn(e,E,["",...n]);if(C)return C}}for(const x of Object.keys(y.imports)){const E=x.indexOf("*");if(E===-1)continue;const C=x.slice(0,E),T=x.slice(E+1);if(t.startsWith(C)&&t.endsWith(T)&&t.length>=C.length+T.length){const N=T.length?t.slice(C.length,-T.length):t.slice(C.length),j=Or(y.imports[x],r,o);if(j){const q=j.replace(/\*/g,N),J=c+"/"+q.replace(/^\.\//,""),Y=Nn(e,J,["",...n]);if(Y)return Y}}}}}catch{}const p=c.substring(0,c.lastIndexOf("/"))||"/";if(p===c)break;c=p}return null}function Nn(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 vo(){return typeof globalThis<"u"&&globalThis.process&&typeof globalThis.process.cwd=="function"?globalThis.process.cwd():"/"}function Vk(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 Hk(e){const t=e.split("/").filter(Boolean),n=[];for(const s of t)s===".."?n.pop():s!=="."&&n.push(s);return"/"+n.join("/")}function Wk(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 zk(e,t,n){if(!ms)return null;const s=ms;return{name:"volume-loader",setup(r){const o=r,c=["",...I],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 N=g.split("/"),q=N[0].startsWith("@")?N.slice(0,2).join("/"):N[0],J=d.get(q);if(J===!0)return{external:!0};if(J===void 0){const Y=[];if(x){let F=x.substring(0,x.lastIndexOf("/"));for(;F&&F!=="/";)Y.push(F+"/node_modules/"+q),F=F.substring(0,F.lastIndexOf("/"))||"/"}Y.push("/node_modules/"+q),Y.push("/project/node_modules/"+q);let W=!1;for(const F of Y)if(s.existsSync(F)){try{const ne=JSON.parse(s.readFileSync(F+"/package.json","utf8"));(ne.napi||ne.binary||ne.gypfile)&&(W=!0)}catch{}break}if(d.set(q,W),W)return{external:!0}}}if(g.startsWith("node_modules/")){const N="/"+g,j=Nn(s,N,c);return j?p(j):{external:!0}}if(g.startsWith("/")){const N=Nn(s,g,c);return N?p(N):{external:!0}}if(g.startsWith(".")){let N=g;x&&(N=x.substring(0,x.lastIndexOf("/"))+"/"+g);const j=Hk(N),q=Nn(s,j,c);if(q)return p(q);for(const J of[".ts",".tsx",".js",".jsx"]){const Y=Nn(s,j+"/index"+J,[""]);if(Y)return p(Y)}}if(g.startsWith("#")){const N=x?x.substring(0,x.lastIndexOf("/")):vo(),j=jk(s,g,c,N,t,n);return j?p(j):{external:!0}}if(e&&e.some(N=>g===N||g.startsWith(N+"/")))return{external:!0};const E=x?x.substring(0,x.lastIndexOf("/")):vo(),C=Fk(s,g,c,E,t,n);if(C)return{path:C.resolvedPath,pluginData:{fromVolume:!0}};const T=g.replace(/^node:/,"");if(Nk.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=Ok(T,"topLevelOnly"));const N=C.lastIndexOf("."),j=N>=0?C.substring(N):"";let J=M[j];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}`}]}}})}}}C0=Object.freeze(Object.defineProperty({__proto__:null,analyzeMetafile:Zy,analyzeMetafileSync:Xy,build:Qc,buildSync:Qy,context:Ky,default:Bk,formatMessages:qy,initialize:Qi,setVolume:Hy,setWasmUrl:Wy,stop:Yy,transform:zy,transformSync:Jy,version:Gy},Symbol.toStringTag,{value:"Module"}));function qk(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Gk(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 e_={exports:{}},Kk={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 t_=Gk(Tk);(function(e){const t=Kk,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,E=p.TokenType,C=new x("<tag",!1),T=new x("</tag",!1),N=new x("<tag>...</tag>",!0,!0),j={tc_oTag:C,tc_cTag:T,tc_expr:N},q={jsxName:new E("jsxName"),jsxText:new E("jsxText",{beforeExpr:!0}),jsxTagStart:new E("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new E("jsxTagEnd")};q.jsxTagStart.updateContext=function(){this.context.push(N),this.context.push(C),this.exprAllowed=!1},q.jsxTagEnd.updateContext=function(J){let Y=this.context.pop();Y===C&&J===g.slash||Y===T?(this.context.pop(),this.exprAllowed=this.curContext()===N):this.exprAllowed=!0},y={tokContexts:j,tokTypes:q},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(t_).tokTypes},configurable:!0,enumerable:!0});function d(p,y){const g=y.acorn||t_,x=o(g),E=g.tokTypes,C=x.tokTypes,T=g.tokContexts,N=x.tokContexts.tc_oTag,j=x.tokContexts.tc_cTag,q=x.tokContexts.tc_expr,J=g.isNewLine,Y=g.isIdentifierStart,W=g.isIdentifierChar;return class extends y{static get acornJsx(){return x}jsx_readToken(){let F="",ne=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let P=this.input.charCodeAt(this.pos);switch(P){case 60:case 123:return this.pos===this.start?P===60&&this.exprAllowed?(++this.pos,this.finishToken(C.jsxTagStart)):this.getTokenFromCode(P):(F+=this.input.slice(ne,this.pos),this.finishToken(C.jsxText,F));case 38:F+=this.input.slice(ne,this.pos),F+=this.jsx_readEntity(),ne=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(P===62?"&gt;":"&rbrace;")+'` or `{"'+this.input[this.pos]+'"}`?');default:J(P)?(F+=this.input.slice(ne,this.pos),F+=this.jsx_readNewLine(!0),ne=this.pos):++this.pos}}}jsx_readNewLine(F){let ne=this.input.charCodeAt(this.pos),P;return++this.pos,ne===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,P=F?`
91
+ `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},Be.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 Xn(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 Vs(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},Be.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,"Bad character escape sequence"),n},Be.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(Zn(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?gn:Zn)(c,s)||this.invalidStringToken(o,"Invalid Unicode escape"),e+=Xn(c),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Be.readWord=function(){var e=this.readWord1(),t=S.name;return this.keywords.test(e)&&(t=lo[e]),this.finishToken(t,e)};var Vy="8.15.0";st.acorn={Parser:st,version:Vy,defaultOptions:co,Position:Dr,SourceLocation:Ki,getLineInfo:qc,Node:Ji,TokenType:Ue,tokTypes:S,keywordTypes:lo,TokContext:an,tokContexts:Ze,isIdentifierChar:Zn,isIdentifierStart:gn,Token:bo,isNewLine:Vs,lineBreak:Dt,lineBreakG:iy,nonASCIIwhitespace:zc};function vo(e,t){return st.parse(e,t)}function Rk(e,t,n){return st.parseExpressionAt(e,t,n)}function Pk(e,t){return st.tokenizer(e,t)}const Dk=Object.freeze(Object.defineProperty({__proto__:null,Node:Ji,Parser:st,Position:Dr,SourceLocation:Ki,TokContext:an,Token:bo,TokenType:Ue,defaultOptions:co,getLineInfo:qc,isIdentifierChar:Zn,isIdentifierStart:gn,isNewLine:Vs,keywordTypes:lo,lineBreak:Dt,lineBreakG:iy,nonASCIIwhitespace:zc,parse:vo,parseExpressionAt:Rk,tokContexts:Ze,tokTypes:S,tokenizer:Pk,version:Vy},Symbol.toStringTag,{value:"Module"})),Hy=/\bawait\b/,Ok=/\basync\b/,Wy=new RegExp("(?<![.\\w])await\\s+(?=[\\w$(\"'\\[`!~+\\-/])","g"),Nk=new RegExp("(?<![.\\w])async\\s+(?=function[\\s*(])","g"),Bk=new RegExp("(?<![.\\w])async\\s+(?=\\()","g"),Lk=new RegExp("(?<![.\\w])async\\s+(?=\\w+\\s*=>)","g");function Mk(e,t="topLevelOnly"){const n=t==="full";if(!n&&!Hy.test(e)||n&&!Hy.test(e)&&!Ok.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=vo(e,{ecmaVersion:"latest",sourceType:"script",allowAwaitOutsideFunction:!0})}catch{r=vo(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(Wy,"");return s=s.replace(Nk,""),s=s.replace(Bk,""),s=s.replace(Lk,""),s}return e.replace(Wy,"")}}const Fk=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 qt=null,ea=null,zy=lc,gs=null;function qy(e){gs=e}function Gy(e){zy=e}async function ta(e){if(!qt){if(typeof window<"u"&&window.__esbuild){qt=window.__esbuild;return}if(typeof window<"u"&&window.__esbuildInitPromise&&(await window.__esbuildInitPromise,window.__esbuild)){qt=window.__esbuild;return}return ea||(ea=(async()=>{try{const t=await qa(sx);await t.initialize({wasmURL:(e==null?void 0:e.wasmURL)||zy}),qt=t}catch(t){throw ea=null,new Error(`esbuild: initialization failed -- ${t}`)}})(),ea)}}async function Ky(e,t){rs();try{if(qt||await ta(),!qt)throw new Error("esbuild: engine not ready");return await qt.transform(e,t)}finally{wn()}}async function tu(e){if(qt||await ta(),!qt)throw new Error("esbuild: engine not ready");rs();try{const t=Yk(e.external,e.platform,e.conditions),n=[...e.plugins||[]];t&&n.push(t);let s=e.entryPoints;if(s&&gs){const d=e.absWorkingDir||wo();s=s.map(p=>qk(p,d))}const r=e.absWorkingDir||wo(),o=e.write!==!1,c=await qt.build({...e,entryPoints:s,plugins:n,write:!1,absWorkingDir:r});if(Kk(c),o&&c.outputFiles&&gs)for(const d of c.outputFiles){const p=d.path.startsWith("/")?d.path:r+"/"+d.path,y=p.substring(0,p.lastIndexOf("/"));y&&!gs.existsSync(y)&&gs.mkdirSync(y,{recursive:!0}),gs.writeFileSync(p,d.text)}return c}finally{wn()}}function Yy(e,t){if(!qt)throw new Error("esbuild: engine not ready");return qt.formatMessages(e,t)}const Zy="0.21.5";async function Xy(e){rs();try{qt||await ta()}finally{wn()}let t=!1;return{async rebuild(){if(t)throw new Error("Build context already disposed");return tu(e)},async watch(s){},async serve(s){return{host:"localhost",port:0}},async cancel(){},async dispose(){t=!0}}}function Jy(){}async function Qy(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 e_(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 t_(e,t){return{code:e,map:"",warnings:[]}}function n_(e){return{errors:[],warnings:[],outputFiles:[]}}const $k={initialize:ta,transform:Ky,transformSync:t_,build:tu,buildSync:n_,context:Xy,stop:Jy,formatMessages:Yy,analyzeMetafile:Qy,analyzeMetafileSync:e_,version:Zy,setVolume:qy,setWasmUrl:Gy},Uk=["node","browser","require","module","import","default"],jk=["browser","module","import","node","require","default"];function Br(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=Br(o,t,n);if(c)return c}}const s=t==="browser"?jk:Uk;for(const r of s){const o=e[r];if(o!==void 0){const c=Br(o,t,n);if(c)return c}}}}function Vk(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=Hk(e,T,x,y,n,r,o):L=Wk(e,T,x,n,r,o),L)return{resolvedPath:L,fromVolume:!0}}catch{}return null}function Hk(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=Br(p,o,c);if(y){const g=n+"/"+y.replace(/^\.\//,""),x=Mn(e,g,["",".js",".ts",".mjs"]);if(x)return x}}}return Mn(e,n+"/"+s,r)}function Wk(e,t,n,s,r,o){if(t.exports){const d=typeof t.exports=="object"&&!Array.isArray(t.exports)&&t.exports["."]||t.exports,p=Br(d,r,o);if(p){const y=n+"/"+p.replace(/^\.\//,""),g=Mn(e,y,["",".js",".ts",".mjs"]);if(g)return g}}const c=t.module||t.main||"index.js";return Mn(e,n+"/"+c.replace(/^\.\//,""),s)}function zk(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=Br(g,r,o);if(x){const k=c+"/"+x.replace(/^\.\//,""),C=Mn(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=Br(y.imports[x],r,o);if(V){const G=V.replace(/\*/g,L),J=c+"/"+G.replace(/^\.\//,""),X=Mn(e,J,["",...n]);if(X)return X}}}}}catch{}const p=c.substring(0,c.lastIndexOf("/"))||"/";if(p===c)break;c=p}return null}function Mn(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 wo(){return typeof globalThis<"u"&&globalThis.process&&typeof globalThis.process.cwd=="function"?globalThis.process.cwd():"/"}function qk(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 Gk(e){const t=e.split("/").filter(Boolean),n=[];for(const s of t)s===".."?n.pop():s!=="."&&n.push(s);return"/"+n.join("/")}function Kk(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 Yk(e,t,n){if(!gs)return null;const s=gs;return{name:"volume-loader",setup(r){const o=r,c=["",...I],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("/"),G=L[0].startsWith("@")?L.slice(0,2).join("/"):L[0],J=d.get(G);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/"+G),$=$.substring(0,$.lastIndexOf("/"))||"/"}X.push("/node_modules/"+G),X.push("/project/node_modules/"+G);let q=!1;for(const $ of X)if(s.existsSync($)){try{const te=JSON.parse(s.readFileSync($+"/package.json","utf8"));(te.napi||te.binary||te.gypfile)&&(q=!0)}catch{}break}if(d.set(G,q),q)return{external:!0}}}if(g.startsWith("node_modules/")){const L="/"+g,V=Mn(s,L,c);return V?p(V):{external:!0}}if(g.startsWith("/")){const L=Mn(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=Gk(L),G=Mn(s,V,c);if(G)return p(G);for(const J of[".ts",".tsx",".js",".jsx"]){const X=Mn(s,V+"/index"+J,[""]);if(X)return p(X)}}if(g.startsWith("#")){const L=x?x.substring(0,x.lastIndexOf("/")):wo(),V=zk(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("/")):wo(),C=Vk(s,g,c,k,t,n);if(C)return{path:C.resolvedPath,pluginData:{fromVolume:!0}};const T=g.replace(/^node:/,"");if(Fk.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=Mk(T,"topLevelOnly"));const L=C.lastIndexOf("."),V=L>=0?C.substring(L):"";let J=M[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}`}]}}})}}}I0=Object.freeze(Object.defineProperty({__proto__:null,analyzeMetafile:Qy,analyzeMetafileSync:e_,build:tu,buildSync:n_,context:Xy,default:$k,formatMessages:Yy,initialize:ta,setVolume:qy,setWasmUrl:Gy,stop:Jy,transform:Ky,transformSync:t_,version:Zy},Symbol.toStringTag,{value:"Module"}));function Zk(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Xk(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 s_={exports:{}},Jk={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 r_=Xk(Dk);(function(e){const t=Jk,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},G={jsxName:new k("jsxName"),jsxText:new k("jsxText",{beforeExpr:!0}),jsxTagStart:new k("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new k("jsxTagEnd")};G.jsxTagStart.updateContext=function(){this.context.push(L),this.context.push(C),this.exprAllowed=!1},G.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:G},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(r_).tokTypes},configurable:!0,enumerable:!0});function d(p,y){const g=y.acorn||r_,x=o(g),k=g.tokTypes,C=x.tokTypes,T=g.tokContexts,L=x.tokContexts.tc_oTag,V=x.tokContexts.tc_cTag,G=x.tokContexts.tc_expr,J=g.isNewLine,X=g.isIdentifierStart,q=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 P=this.input.charCodeAt(this.pos);switch(P){case 60:case 123:return this.pos===this.start?P===60&&this.exprAllowed?(++this.pos,this.finishToken(C.jsxTagStart)):this.getTokenFromCode(P):($+=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 `"+(P===62?"&gt;":"&rbrace;")+'` or `{"'+this.input[this.pos]+'"}`?');default:J(P)?($+=this.input.slice(te,this.pos),$+=this.jsx_readNewLine(!0),te=this.pos):++this.pos}}}jsx_readNewLine($){let te=this.input.charCodeAt(this.pos),P;return++this.pos,te===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,P=$?`
34
96
  `:`\r
35
- `):P=String.fromCharCode(ne),this.options.locations&&(++this.curLine,this.lineStart=this.pos),P}jsx_readString(F){let ne="",P=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let D=this.input.charCodeAt(this.pos);if(D===F)break;D===38?(ne+=this.input.slice(P,this.pos),ne+=this.jsx_readEntity(),P=this.pos):J(D)?(ne+=this.input.slice(P,this.pos),ne+=this.jsx_readNewLine(!1),P=this.pos):++this.pos}return ne+=this.input.slice(P,this.pos++),this.finishToken(E.string,ne)}jsx_readEntity(){let F="",ne=0,P,D=this.input[this.pos];D!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let L=++this.pos;for(;this.pos<this.input.length&&ne++<10;){if(D=this.input[this.pos++],D===";"){F[0]==="#"?F[1]==="x"?(F=F.substr(2),n.test(F)&&(P=String.fromCharCode(parseInt(F,16)))):(F=F.substr(1),s.test(F)&&(P=String.fromCharCode(parseInt(F,10)))):P=t[F];break}F+=D}return P||(this.pos=L,"&")}jsx_readWord(){let F,ne=this.pos;do F=this.input.charCodeAt(++this.pos);while(W(F)||F===45);return this.finishToken(C.jsxName,this.input.slice(ne,this.pos))}jsx_parseIdentifier(){let F=this.startNode();return this.type===C.jsxName?F.name=this.value:this.type.keyword?F.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(F,"JSXIdentifier")}jsx_parseNamespacedName(){let F=this.start,ne=this.startLoc,P=this.jsx_parseIdentifier();if(!p.allowNamespaces||!this.eat(E.colon))return P;var D=this.startNodeAt(F,ne);return D.namespace=P,D.name=this.jsx_parseIdentifier(),this.finishNode(D,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===C.jsxTagEnd)return"";let F=this.start,ne=this.startLoc,P=this.jsx_parseNamespacedName();for(this.type===E.dot&&P.type==="JSXNamespacedName"&&!p.allowNamespacedObjects&&this.unexpected();this.eat(E.dot);){let D=this.startNodeAt(F,ne);D.object=P,D.property=this.jsx_parseIdentifier(),P=this.finishNode(D,"JSXMemberExpression")}return P}jsx_parseAttributeValue(){switch(this.type){case E.braceL:let F=this.jsx_parseExpressionContainer();return F.expression.type==="JSXEmptyExpression"&&this.raise(F.start,"JSX attributes must only be assigned a non-empty expression"),F;case C.jsxTagStart:case E.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let F=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(F,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let F=this.startNode();return this.next(),F.expression=this.type===E.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(E.braceR),this.finishNode(F,"JSXExpressionContainer")}jsx_parseAttribute(){let F=this.startNode();return this.eat(E.braceL)?(this.expect(E.ellipsis),F.argument=this.parseMaybeAssign(),this.expect(E.braceR),this.finishNode(F,"JSXSpreadAttribute")):(F.name=this.jsx_parseNamespacedName(),F.value=this.eat(E.eq)?this.jsx_parseAttributeValue():null,this.finishNode(F,"JSXAttribute"))}jsx_parseOpeningElementAt(F,ne){let P=this.startNodeAt(F,ne);P.attributes=[];let D=this.jsx_parseElementName();for(D&&(P.name=D);this.type!==E.slash&&this.type!==C.jsxTagEnd;)P.attributes.push(this.jsx_parseAttribute());return P.selfClosing=this.eat(E.slash),this.expect(C.jsxTagEnd),this.finishNode(P,D?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(F,ne){let P=this.startNodeAt(F,ne),D=this.jsx_parseElementName();return D&&(P.name=D),this.expect(C.jsxTagEnd),this.finishNode(P,D?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(F,ne){let P=this.startNodeAt(F,ne),D=[],L=this.jsx_parseOpeningElementAt(F,ne),U=null;if(!L.selfClosing){e:for(;;)switch(this.type){case C.jsxTagStart:if(F=this.start,ne=this.startLoc,this.next(),this.eat(E.slash)){U=this.jsx_parseClosingElementAt(F,ne);break e}D.push(this.jsx_parseElementAt(F,ne));break;case C.jsxText:D.push(this.parseExprAtom());break;case E.braceL:D.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}c(U.name)!==c(L.name)&&this.raise(U.start,"Expected corresponding JSX closing tag for <"+c(L.name)+">")}let O=L.name?"Element":"Fragment";return P["opening"+O]=L,P["closing"+O]=U,P.children=D,this.type===E.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(P,"JSX"+O)}jsx_parseText(){let F=this.parseLiteral(this.value);return F.type="JSXText",F}jsx_parseElement(){let F=this.start,ne=this.startLoc;return this.next(),this.jsx_parseElementAt(F,ne)}parseExprAtom(F){return this.type===C.jsxText?this.jsx_parseText():this.type===C.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(F)}readToken(F){let ne=this.curContext();if(ne===q)return this.jsx_readToken();if(ne===N||ne===j){if(Y(F))return this.jsx_readWord();if(F==62)return++this.pos,this.finishToken(C.jsxTagEnd);if((F===34||F===39)&&ne==N)return this.jsx_readString(F)}return F===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(C.jsxTagStart)):super.readToken(F)}updateContext(F){if(this.type==E.braceL){var ne=this.curContext();ne==N?this.context.push(T.b_expr):ne==q?this.context.push(T.b_tmpl):super.updateContext(F),this.exprAllowed=!0}else if(this.type===E.slash&&F===C.jsxTagStart)this.context.length-=2,this.context.push(j),this.exprAllowed=!1;else return super.updateContext(F)}}}})(e_);var Yk=e_.exports;const Zk=qk(Yk),n_=Ye.extend(Zk());let eu=null,ea=null;async function wo(){return eu||ea||(ea=(async()=>{try{const e=await za(ex);return eu=e,e}catch(e){throw ea=null,new Error(`rollup: failed to load @rollup/browser from CDN -- ${e}`)}})(),ea)}const s_=ef;async function r_(e){return(await wo()).rollup(e)}async function i_(e){return(await wo()).watch(e)}function a_(e){return e}function tu(e,t){const n={ecmaVersion:"latest",sourceType:"module",allowReturnOutsideFunction:(t==null?void 0:t.allowReturnOutsideFunction)??!1,locations:!0};if(t!=null&&t.jsx)return n_.parse(e,n);try{return bo(e,n)}catch{return n_.parse(e,n)}}async function o_(e,t){return tu(e,{allowReturnOutsideFunction:t==null?void 0:t.allowReturnOutsideFunction,jsx:t==null?void 0:t.jsx})}function Xk(){return""}Object.freeze(Object.defineProperty({__proto__:null,VERSION:s_,default:{VERSION:s_,rollup:r_,watch:i_,defineConfig:a_,parseAst:tu,parseAstAsync:o_,loadRollup:wo},defineConfig:a_,getPackageBase:Xk,loadRollup:wo,parseAst:tu,parseAstAsync:o_,rollup:r_,watch:i_},Symbol.toStringTag,{value:"Module"}));function l_(){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 c_(){return[]}function u_(){return{code_and_metadata_size:0,bytecode_and_metadata_size:0,external_script_source_size:0}}function d_(){return null}function h_(){return""}function p_(e){}function f_(){}function m_(){}function g_(){return 0}function y_(e){return new TextEncoder().encode(JSON.stringify(e))}function __(e){return JSON.parse(new TextDecoder().decode(e))}const Vs=function(){};Vs.prototype.writeHeader=function(){},Vs.prototype.writeValue=function(t){},Vs.prototype.releaseBuffer=function(){return new Uint8Array(0)};const Nr=function(t){};Nr.prototype.readHeader=function(){return!0},Nr.prototype.readValue=function(){return null};const nu=function(){this&&Vs.call(this)};Object.setPrototypeOf(nu.prototype,Vs.prototype);const su=function(t){this&&Nr.call(this,t)};Object.setPrototypeOf(su.prototype,Nr.prototype);function b_(){return{onInit:()=>{},onSettled:()=>{},onBefore:()=>{},onAfter:()=>{},createHook:()=>({enable:()=>{},disable:()=>{}})}}Object.freeze(Object.defineProperty({__proto__:null,DefaultDeserializer:su,DefaultSerializer:nu,Deserializer:Nr,Serializer:Vs,cachedDataVersionTag:g_,default:{getHeapStatistics:l_,getHeapSpaceStatistics:c_,getHeapCodeStatistics:u_,getHeapSnapshot:d_,writeHeapSnapshot:h_,setFlagsFromString:p_,takeCoverage:f_,stopCoverage:m_,cachedDataVersionTag:g_,serialize:y_,deserialize:__,Serializer:Vs,Deserializer:Nr,DefaultSerializer:nu,DefaultDeserializer:su,promiseHooks:b_},deserialize:__,getHeapCodeStatistics:u_,getHeapSnapshot:d_,getHeapSpaceStatistics:c_,getHeapStatistics:l_,promiseHooks:b_,serialize:y_,setFlagsFromString:p_,stopCoverage:m_,takeCoverage:f_,writeHeapSnapshot:h_},Symbol.toStringTag,{value:"Module"}));let Br=0;function Jk(){return Br}function Qk(e){Br=e}P0=function(){Br=0};const v_=Symbol("keypressDecoder");function eC(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===`
36
- `?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 ru(e,t){if(!e||typeof e.on!="function"||e[v_])return;e[v_]=!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=eC(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 ta(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 na(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 tt=function(t){if(this){if(se.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"){Br++,ns();const n=this.input,s=this;this.terminal?(typeof this.input.setRawMode=="function"&&this.input.setRawMode(!0),ru(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(tt.prototype,se.prototype),tt.prototype._refreshLine=function(){this.output&&typeof this.output.write=="function"&&this.output.write(this.line)},tt.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)}},tt.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=ta(this._lineBuffer,this.cursor),this._refreshLine();return}if(n.ctrl&&n.name==="right"||n.meta&&n.name==="f"){this.cursor=na(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=ta(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=na(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}}},tt.prototype._onData=function(t){for(const n of t)if(n===`
37
- `||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())},tt.prototype.prompt=function(t){this.output&&typeof this.output.write=="function"&&this.output.write(this._promptStr),t||(this.cursor=0,this.line="",this._lineBuffer="")},tt.prototype.setPrompt=function(t){this._promptStr=t},tt.prototype.getPrompt=function(){return this._promptStr},tt.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)}},tt.prototype.pause=function(){return this.input&&typeof this.input.pause=="function"&&this.input.pause(),this.emit("pause"),this},tt.prototype.resume=function(){return this.input&&typeof this.input.resume=="function"&&this.input.resume(),this.emit("resume"),this},tt.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"&&(Br=Math.max(0,Br-1),_n());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"&&(tt.prototype[Symbol.dispose]=function(){this.close()}),tt.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=ta(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=ta(this._lineBuffer,this.cursor):this.cursor=Math.max(0,this.cursor-1);return}if(n.name==="right"){n.ctrl||n.meta?this.cursor=na(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=ta(this._lineBuffer,this.cursor);return}if(n.meta&&n.name==="f"){this.cursor=na(this._lineBuffer,this.cursor);return}if(n.meta&&n.name==="d"){const r=na(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)}},tt.prototype.clearLine=function(t){this._lineBuffer="",this.line="",this.cursor=0,this.output&&typeof this.output.clearLine=="function"&&this.output.clearLine(t??0)},tt.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}},tt.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 iu(e,t){return e&&typeof e=="object"&&!("on"in e)&&!("read"in e)?new tt(e):new tt({input:e,output:t})}function w_(e,t,n){return e&&typeof e.clearLine=="function"?e.clearLine(t,n):(n&&n(),!0)}function S_(e,t){return e&&typeof e.write=="function"&&e.write("\x1B[J"),t&&t(),!0}function x_(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 E_(e,t,n,s){return e&&typeof e.moveCursor=="function"?e.moveCursor(t,n,s):(s&&s(),!0)}class tC{constructor(t,n){V(this,"_stream"),V(this,"_buffer"),V(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 k_={createInterface(e){const t=iu(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:tC};Object.freeze(Object.defineProperty({__proto__:null,Interface:tt,clearLine:w_,clearScreenDown:S_,createInterface:iu,cursorTo:x_,default:{Interface:tt,createInterface:iu,clearLine:w_,clearScreenDown:S_,cursorTo:x_,moveCursor:E_,emitKeypressEvents:ru,promises:k_},emitKeypressEvents:ru,getActiveInterfaceCount:Jk,moveCursor:E_,promises:k_,resetActiveInterfaceCount:P0,setActiveInterfaceCount:Qk},Symbol.toStringTag,{value:"Module"}));const Jn=function(t,n){this&&(se.call(this),this.authorized=!1,this.encrypted=!0)};Object.setPrototypeOf(Jn.prototype,se.prototype),Jn.prototype.getPeerCertificate=function(t){return{}},Jn.prototype.getCipher=function(){return null},Jn.prototype.getProtocol=function(){return null},Jn.prototype.setServername=function(t){},Jn.prototype.renegotiate=function(t,n){return!1};const Bn=function(t,n){this&&se.call(this)};Object.setPrototypeOf(Bn.prototype,se.prototype),Bn.prototype.listen=function(...t){return this},Bn.prototype.close=function(t){return this},Bn.prototype.address=function(){return null},Bn.prototype.getTicketKeys=function(){return new Uint8Array(0)},Bn.prototype.setTicketKeys=function(t){},Bn.prototype.setSecureContext=function(t){};function C_(e,t){return new Bn}function A_(e,t){const n=new Jn;return t&&setTimeout(t,0),n}function T_(e){return{}}const I_=()=>["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"],R_="auto",P_="TLSv1.3",D_="TLSv1.2",O_=[];Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_ECDH_CURVE:R_,DEFAULT_MAX_VERSION:P_,DEFAULT_MIN_VERSION:D_,Server:Bn,TLSSocket:Jn,connect:A_,createSecureContext:T_,createServer:C_,default:{TLSSocket:Jn,Server:Bn,createServer:C_,connect:A_,createSecureContext:T_,getCiphers:I_,DEFAULT_ECDH_CURVE:R_,DEFAULT_MAX_VERSION:P_,DEFAULT_MIN_VERSION:D_,rootCertificates:O_},getCiphers:I_,rootCertificates:O_},Symbol.toStringTag,{value:"Module"}));const St=function(){this&&se.call(this)};Object.setPrototypeOf(St.prototype,se.prototype),St.prototype.close=function(t){t&&setTimeout(t,0)},St.prototype.destroy=function(t,n){},Object.defineProperty(St.prototype,"destroyed",{get(){return!1},configurable:!0}),Object.defineProperty(St.prototype,"encrypted",{get(){return!1},configurable:!0}),Object.defineProperty(St.prototype,"closed",{get(){return!1},configurable:!0}),St.prototype.ping=function(t){return!1},St.prototype.ref=function(){},St.prototype.unref=function(){},St.prototype.setTimeout=function(t,n){};const So=function(){this&&St.call(this)};Object.setPrototypeOf(So.prototype,St.prototype);const au=function(){this&&St.call(this)};Object.setPrototypeOf(au.prototype,St.prototype);const fn=function(){this&&se.call(this)};Object.setPrototypeOf(fn.prototype,se.prototype),fn.prototype.close=function(t,n){},Object.defineProperty(fn.prototype,"id",{get(){return 0},configurable:!0}),Object.defineProperty(fn.prototype,"pending",{get(){return!1},configurable:!0}),Object.defineProperty(fn.prototype,"destroyed",{get(){return!1},configurable:!0}),Object.defineProperty(fn.prototype,"closed",{get(){return!1},configurable:!0}),fn.prototype.priority=function(t){},fn.prototype.setTimeout=function(t,n){},fn.prototype.end=function(t,n,s){};const ou=function(){this&&se.call(this)};Object.setPrototypeOf(ou.prototype,se.prototype);const sa=function(){this&&se.call(this)};Object.setPrototypeOf(sa.prototype,se.prototype),sa.prototype.writeHead=function(t,n){return this},sa.prototype.end=function(t){};function N_(e,t){return new se}function B_(e,t){return new se}function L_(e,t,n){return new So}const M_={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 F_(){return{}}function $_(e){return new Uint8Array(0)}function U_(e){return{}}const j_=Symbol("sensitiveHeaders");Object.freeze(Object.defineProperty({__proto__:null,ClientHttp2Session:So,Http2ServerRequest:ou,Http2ServerResponse:sa,Http2Session:St,Http2Stream:fn,ServerHttp2Session:au,connect:L_,constants:M_,createSecureServer:B_,createServer:N_,default:{Http2Session:St,ClientHttp2Session:So,ServerHttp2Session:au,Http2Stream:fn,Http2ServerRequest:ou,Http2ServerResponse:sa,createServer:N_,createSecureServer:B_,connect:L_,constants:M_,getDefaultSettings:F_,getPackedSettings:$_,getUnpackedSettings:U_,sensitiveHeaders:j_},getDefaultSettings:F_,getPackedSettings:$_,getUnpackedSettings:U_,sensitiveHeaders:j_},Symbol.toStringTag,{value:"Module"}));const V_=!0,H_=!0,W_=!1,Qn=function(){this&&(se.call(this),this.id=0,this.process=null)};Object.setPrototypeOf(Qn.prototype,se.prototype),Qn.prototype.send=function(t,n){return!1},Qn.prototype.kill=function(t){},Qn.prototype.disconnect=function(){},Qn.prototype.isDead=function(){return!1},Qn.prototype.isConnected=function(){return!1};const z_=null,q_={},G_={},K_=1,lu=2;let Y_=lu;function Z_(e){return new Qn}function X_(e){e&&setTimeout(e,0)}function J_(e){}function Q_(e){}const gs=new se,eb=gs.on.bind(gs),tb=gs.once.bind(gs),nb=gs.emit.bind(gs),sb=gs.removeListener.bind(gs);Object.freeze(Object.defineProperty({__proto__:null,SCHED_NONE:K_,SCHED_RR:lu,Worker:Qn,default:{isMaster:V_,isPrimary:H_,isWorker:W_,Worker:Qn,worker:z_,workers:q_,fork:Z_,disconnect:X_,settings:G_,SCHED_NONE:K_,SCHED_RR:lu,schedulingPolicy:Y_,setupMaster:J_,setupPrimary:Q_,on:eb,once:tb,emit:nb,removeListener:sb},disconnect:X_,emit:nb,fork:Z_,isMaster:V_,isPrimary:H_,isWorker:W_,on:eb,once:tb,removeListener:sb,schedulingPolicy:Y_,settings:G_,setupMaster:J_,setupPrimary:Q_,worker:z_,workers:q_},Symbol.toStringTag,{value:"Module"}));const nt=function(){this&&se.call(this)};Object.setPrototypeOf(nt.prototype,se.prototype),nt.prototype.bind=function(t,n,s){return s&&setTimeout(s,0),this},nt.prototype.close=function(t){t&&setTimeout(t,0)},nt.prototype.send=function(t,n,s,r,o,c){c&&setTimeout(()=>c(null,0),0)},nt.prototype.address=function(){return{address:"0.0.0.0",family:"IPv4",port:0}},nt.prototype.setBroadcast=function(t){},nt.prototype.setTTL=function(t){return t},nt.prototype.setMulticastTTL=function(t){return t},nt.prototype.setMulticastLoopback=function(t){return t},nt.prototype.setMulticastInterface=function(t){},nt.prototype.addMembership=function(t,n){},nt.prototype.dropMembership=function(t,n){},nt.prototype.ref=function(){return this},nt.prototype.unref=function(){return this},nt.prototype.setRecvBufferSize=function(t){},nt.prototype.setSendBufferSize=function(t){},nt.prototype.getRecvBufferSize=function(){return 0},nt.prototype.getSendBufferSize=function(){return 0};function rb(e,t){return new nt}Object.freeze(Object.defineProperty({__proto__:null,Socket:nt,createSocket:rb,default:{Socket:nt,createSocket:rb}},Symbol.toStringTag,{value:"Module"}));const Hs=function(t,n){this&&(this._src=t)};Hs.prototype.runInThisContext=function(t){return(0,eval)(this._src)},Hs.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)},Hs.prototype.runInContext=function(t,n){return this.runInNewContext(t,n)},Hs.prototype.createCachedData=function(){return new Uint8Array(0)};function ib(e,t){return e??{}}function ab(e){return!0}function ob(e,t){return(0,eval)(e)}function cu(e,t,n){return new Hs(e).runInNewContext(t)}function lb(e,t,n){return cu(e,t)}function cb(e,t,n){return new Function(...t??[],e)}const rn=function(t,n){};rn.prototype.link=function(t){return Promise.resolve()},rn.prototype.evaluate=function(t){return Promise.resolve()},Object.defineProperty(rn.prototype,"status",{get(){return"unlinked"},configurable:!0}),Object.defineProperty(rn.prototype,"identifier",{get(){return""},configurable:!0}),Object.defineProperty(rn.prototype,"context",{get(){return{}},configurable:!0}),Object.defineProperty(rn.prototype,"namespace",{get(){return{}},configurable:!0});const uu=function(t,n){this&&rn.call(this,t,n)};Object.setPrototypeOf(uu.prototype,rn.prototype);const xo=function(t,n){this&&rn.call(this,t,n)};Object.setPrototypeOf(xo.prototype,rn.prototype),xo.prototype.setExport=function(t,n){},Object.freeze(Object.defineProperty({__proto__:null,Module:rn,Script:Hs,SourceTextModule:uu,SyntheticModule:xo,compileFunction:cb,createContext:ib,default:{Script:Hs,createContext:ib,isContext:ab,runInThisContext:ob,runInNewContext:cu,runInContext:lb,compileFunction:cb,Module:rn,SourceTextModule:uu,SyntheticModule:xo},isContext:ab,runInContext:lb,runInNewContext:cu,runInThisContext:ob},Symbol.toStringTag,{value:"Module"}));const Ws=function(){this&&se.call(this)};Object.setPrototypeOf(Ws.prototype,se.prototype),Ws.prototype.connect=function(){},Ws.prototype.connectToMainThread=function(){},Ws.prototype.disconnect=function(){},Ws.prototype.post=function(t,n,s){s&&setTimeout(()=>s(null,{}),0)};function ub(e,t,n){}function db(){}function hb(){}function pb(){}const fb=globalThis.console;Object.freeze(Object.defineProperty({__proto__:null,Session:Ws,close:db,console:fb,default:{Session:Ws,open:ub,close:db,url:hb,waitForDebugger:pb,console:fb},open:ub,url:hb,waitForDebugger:pb},Symbol.toStringTag,{value:"Module"}));const zs=function(t,n){};zs.prototype.runInAsyncScope=function(t,n,...s){return t.apply(n,s)},zs.prototype.emitDestroy=function(){return this},zs.prototype.asyncId=function(){return 0},zs.prototype.triggerAsyncId=function(){return 0},zs.bind=function(t,n){return t};const qs=function(){this&&(this._store=void 0)};qs.prototype.disable=function(){},qs.prototype.getStore=function(){return this._store},qs.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}},qs.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}},qs.prototype.enterWith=function(t){this._store=t};function mb(e){const t={enable(){return t},disable(){return t}};return t}function gb(){return 0}function yb(){return{}}function _b(){return 0}Object.freeze(Object.defineProperty({__proto__:null,AsyncLocalStorage:qs,AsyncResource:zs,createHook:mb,default:{AsyncResource:zs,AsyncLocalStorage:qs,createHook:mb,executionAsyncId:gb,executionAsyncResource:yb,triggerAsyncId:_b},executionAsyncId:gb,executionAsyncResource:yb,triggerAsyncId:_b},Symbol.toStringTag,{value:"Module"}));const an=function(){this&&(se.call(this),this.members=[])};Object.setPrototypeOf(an.prototype,se.prototype),an.prototype.add=function(t){this.members.push(t)},an.prototype.remove=function(t){const n=this.members.indexOf(t);n>=0&&this.members.splice(n,1)},an.prototype.bind=function(t){return t},an.prototype.intercept=function(t){return t},an.prototype.run=function(t){return t()},an.prototype.dispose=function(){this.members.length=0},an.prototype.enter=function(){},an.prototype.exit=function(){};function bb(){return new an}let vb=null;Object.freeze(Object.defineProperty({__proto__:null,Domain:an,active:vb,create:bb,default:{Domain:an,create:bb,active:vb}},Symbol.toStringTag,{value:"Module"}));const ys=function(t){this&&(this.name=t,this._listeners=[])};Object.defineProperty(ys.prototype,"hasSubscribers",{get(){return this._listeners.length>0},configurable:!0}),ys.prototype.subscribe=function(t){this._listeners.push(t)},ys.prototype.unsubscribe=function(t){const n=this._listeners.indexOf(t);return n===-1?!1:(this._listeners.splice(n,1),!0)},ys.prototype.publish=function(t){for(const n of this._listeners)try{n(t,this.name)}catch{}};const ra=new Map;function du(e){return ra.has(e)||ra.set(e,new ys(e)),ra.get(e)}function wb(e){var t;return((t=ra.get(e))==null?void 0:t.hasSubscribers)??!1}function Sb(e,t){du(e).subscribe(t)}function xb(e,t){var n;return((n=ra.get(e))==null?void 0:n.unsubscribe(t))??!1}Object.freeze(Object.defineProperty({__proto__:null,Channel:ys,DiagChannel:ys,channel:du,default:{channel:du,hasSubscribers:wb,subscribe:Sb,unsubscribe:xb,Channel:ys},hasSubscribers:wb,subscribe:Sb,unsubscribe:xb},Symbol.toStringTag,{value:"Module"}));const Re=globalThis.console;Re.log.bind(Re),Re.error.bind(Re),Re.warn.bind(Re),Re.info.bind(Re),Re.debug.bind(Re),Re.trace.bind(Re),Re.dir.bind(Re),Re.time.bind(Re),Re.timeEnd.bind(Re),Re.timeLog.bind(Re),Re.clear.bind(Re),Re.count.bind(Re),Re.countReset.bind(Re),Re.group.bind(Re),Re.groupCollapsed.bind(Re),Re.groupEnd.bind(Re),Re.table.bind(Re),Re.assert.bind(Re);const Eb=Symbol.for("repl-sloppy"),kb=Symbol.for("repl-strict"),hu=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(hu.prototype,SyntaxError.prototype);const Ln=function(t){this&&(se.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(Ln.prototype,se.prototype),Ln.prototype.setPrompt=function(t){this._prompt=t},Ln.prototype.getPrompt=function(){return this._prompt},Ln.prototype.displayPrompt=function(t){},Ln.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})},Ln.prototype.close=function(){this.emit("exit"),this.emit("close")},Ln.prototype.setupHistory=function(t,n){n(null,this)};function Cb(e){return new Ln(e)}Object.freeze(Object.defineProperty({__proto__:null,REPLServer:Ln,REPL_MODE_SLOPPY:Eb,REPL_MODE_STRICT:kb,Recoverable:hu,default:{start:Cb,REPLServer:Ln,Recoverable:hu,REPL_MODE_SLOPPY:Eb,REPL_MODE_STRICT:kb},start:Cb},Symbol.toStringTag,{value:"Module"}));const _s=function(t){this&&(this.name=t,this._controller=new AbortController,this.signal=this._controller.signal)};_s.prototype.diagnostic=function(t){globalThis.console.log(`# ${t}`)},_s.prototype.plan=function(t){},_s.prototype.todo=function(t){globalThis.console.log(`# TODO${t?": "+t:""}`)},_s.prototype.skip=function(t){globalThis.console.log(`# SKIP${t?": "+t:""}`)},_s.prototype.abort=function(){this._controller.abort()};function Ab(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 Eo(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 _s(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 Tb(e){try{e()}catch{}}function Ib(e){try{e()}catch{}}function Rb(e){try{e()}catch{}}function Pb(e){try{e()}catch{}}function Db(e,t){e&&globalThis.console.log(`# SKIP - ${e}`)}function Ob(e,t){e&&globalThis.console.log(`# TODO - ${e}`)}const pu={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=pu.fn(n||s);return e[t]=r,r},reset(){},restoreAll(){}};Object.freeze(Object.defineProperty({__proto__:null,TestContext:_s,after:Ib,afterEach:Pb,before:Tb,beforeEach:Rb,default:{describe:Ab,it:Eo,test:Eo,before:Tb,after:Ib,beforeEach:Rb,afterEach:Pb,skip:Db,todo:Ob,mock:pu,TestContext:_s},describe:Ab,it:Eo,mock:pu,skip:Db,test:Eo,todo:Ob},Symbol.toStringTag,{value:"Module"}));const ia=function(t){this&&(this.categories=t.join(","),this.enabled=!1)};ia.prototype.enable=function(){},ia.prototype.disable=function(){};function Nb(e){return new ia(e.categories)}function Bb(){}Object.freeze(Object.defineProperty({__proto__:null,Tracing:ia,createTracing:Nb,default:{createTracing:Nb,getEnabledCategories:Bb,Tracing:ia},getEnabledCategories:Bb},Symbol.toStringTag,{value:"Module"}));const we=0,nC=2,Fe=8,Lb=20,fu=28,Mb=29,sC=31,mu=44,pt=52,rC=54,iC=55,aC=70,Fb=0,$b=1,Ub=2,jb=3,gu=0,ko=3,Co=4,Vb=7,yu=1,oC=1,lC=2,cC=4,uC=8,dC=0,hC=1,pC=2,fC=0,_u=0x0000000000000002n,bu=0x0000000000000040n,mC=0x0000000000000004n,gC=0x0000000000000020n,yC=0x0000000000004000n,_C=0x0000000000002000n,bC=0x0000000000000200n,vC=0x0000000000000400n,wC=0x0000000004000000n,SC=0x0000000002000000n,xC=0x0000000000010000n,EC=0x0000000000020000n,kC=0x0000000000040000n,CC=0x0000000001000000n,AC=0x0000000000008000n,Hb=0x0000000000200000n,TC=0x0000000000400000n,IC=0x1fffffffn,Wb=_u|yC|_C|bC|vC|wC|SC|xC|EC|kC|CC|AC|Hb,RC=_u|bu|mC|gC|Hb|TC,PC=1,DC=2;class Ao extends Error{constructor(t){super(`WASI exit(${t})`),V(this,"code"),this.code=t}}function ye(e){return function(...t){try{return e.apply(this,t)}catch(n){if(n instanceof Ao)throw n;const s=n==null?void 0:n.code;return s==="ENOENT"?mu:s==="EEXIST"?Lb:s==="EISDIR"?sC:s==="ENOTDIR"?rC:s==="ENOTEMPTY"?iC:s==="EACCES"||s==="EPERM"?nC:Mb}}}function Mn(e,t){if(t.startsWith("/"))return zb(t);const n=e.endsWith("/")?e+t:e+"/"+t;return zb(n)}function zb(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 bs=new TextEncoder,qb=new TextDecoder,Gb=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:_u}),p.set(1,{kind:1,path:"",rights:bu}),p.set(2,{kind:2,path:"",rights:bu});const g=[];for(const[P,D]of Object.entries(o)){const L=y++;p.set(L,{kind:3,path:D,rights:Wb}),g.push({fd:L,virtualPath:P,realPath:D})}let x=null,E=null;const C=()=>{if(x||E&&(x=E.exports.memory,x))return x;throw new Error("WASI: WebAssembly.Memory not available")},T=()=>new DataView(C().buffer),N=()=>new Uint8Array(C().buffer);let j="",q="";const J=(P,D)=>{const L=D.lastIndexOf(`
38
- `);if(L<0)return D;const U=D.substring(0,L);return P===1?console.log(U):console.error(U),D.substring(L+1)},Y=(P,D)=>qb.decode(new Uint8Array(C().buffer,P,D)),W=P=>{P.dirty&&d&&P.path&&P.data&&(d.writeFileSync(P.path,P.data),P.dirty=!1)},F={args_get:ye((P,D)=>{const L=T(),U=N();for(const O of s){L.setUint32(P,D,!0),P+=4;const te=bs.encode(O+"\0");U.set(te,D),D+=te.length}return we}),args_sizes_get:ye((P,D)=>{const L=T();L.setUint32(P,s.length,!0);let U=0;for(const O of s)U+=bs.encode(O+"\0").length;return L.setUint32(D,U,!0),we}),environ_get:ye((P,D)=>{const L=Object.entries(r),U=T(),O=N();for(const[te,le]of L){U.setUint32(P,D,!0),P+=4;const oe=bs.encode(`${te}=${le}\0`);O.set(oe,D),D+=oe.length}return we}),environ_sizes_get:ye((P,D)=>{const L=Object.entries(r),U=T();U.setUint32(P,L.length,!0);let O=0;for(const[te,le]of L)O+=bs.encode(`${te}=${le}\0`).length;return U.setUint32(D,O,!0),we}),clock_res_get:ye((P,D)=>{const L=T();switch(P){case Fb:L.setBigUint64(D,BigInt(1e6),!0);break;case $b:case Ub:case jb:L.setBigUint64(D,BigInt(1e3),!0);break;default:return fu}return we}),clock_time_get:ye((P,D,L)=>{const U=T();switch(P){case Fb:{const O=BigInt(Date.now())*BigInt(1e6);U.setBigUint64(L,O,!0);break}case $b:case Ub:case jb:{const O=performance.now(),te=Math.trunc(O),le=Math.floor((O-te)*1e3),oe=BigInt(te)*BigInt(1e9)+BigInt(le)*BigInt(1e6);U.setBigUint64(L,oe,!0);break}default:return fu}return we}),fd_advise:ye((P,D,L,U)=>we),fd_allocate:ye((P,D,L)=>pt),fd_close:ye(P=>{const D=p.get(P);return D?(D.kind===4&&W(D),p.delete(P),we):Fe}),fd_datasync:ye(P=>{const D=p.get(P);return D?(D.kind===4&&W(D),we):Fe}),fd_fdstat_get:ye((P,D)=>{const L=p.get(P);if(!L)return Fe;const U=T();let O=gu,te=0,le=L.rights,oe=0n;switch(L.kind){case 0:case 1:case 2:O=gu;break;case 3:O=ko,oe=IC;break;case 4:O=Co,L.flags&&L.flags&yu&&(te|=yu);break}return U.setUint8(D,O),U.setUint16(D+2,te,!0),U.setBigUint64(D+8,le,!0),U.setBigUint64(D+16,oe,!0),we}),fd_fdstat_set_flags:ye((P,D)=>pt),fd_fdstat_set_rights:ye((P,D,L)=>pt),fd_filestat_get:ye((P,D)=>{const L=p.get(P);if(!L)return Fe;const U=T();let O=0n,te=gu,le=0n,oe=0n,fe=0n,me=0n,Be=1n;if(L.kind===4){if(O=BigInt(L.data?L.data.length:0),te=Co,d&&L.path)try{const Ee=d.statSync(L.path);le=BigInt(Math.floor(Ee.mtimeMs))*BigInt(1e6),oe=BigInt(Math.floor(Ee.atimeMs))*BigInt(1e6),fe=BigInt(Math.floor(Ee.ctimeMs))*BigInt(1e6),Ee.ino&&(me=BigInt(Ee.ino)),Ee.nlink&&(Be=BigInt(Ee.nlink))}catch{}}else L.kind===3&&(te=ko);return U.setBigUint64(D,0n,!0),U.setBigUint64(D+8,me,!0),U.setUint8(D+16,te),U.setBigUint64(D+24,Be,!0),U.setBigUint64(D+32,O,!0),U.setBigUint64(D+40,oe,!0),U.setBigUint64(D+48,le,!0),U.setBigUint64(D+56,fe,!0),we}),fd_filestat_set_size:ye((P,D)=>{const L=p.get(P);if(!L||L.kind!==4)return Fe;const U=Number(D);if(!L.data)L.data=new Uint8Array(U);else if(L.data.length!==U){const O=new Uint8Array(U);O.set(L.data.subarray(0,Math.min(L.data.length,U))),L.data=O}return L.dirty=!0,we}),fd_filestat_set_times:ye((P,D,L,U)=>we),fd_pread:ye((P,D,L,U,O)=>{const te=p.get(P);if(!te||te.kind!==4)return Fe;if(!te.data)return T().setUint32(O,0,!0),we;const le=T();let oe=Number(U),fe=0;for(let me=0;me<L;me++){const Be=le.getUint32(D+me*8,!0),Ee=le.getUint32(D+me*8+4,!0),st=Math.min(Ee,te.data.length-oe);if(st<=0)break;N().set(te.data.subarray(oe,oe+st),Be),oe+=st,fe+=st}return le.setUint32(O,fe,!0),we}),fd_prestat_get:ye((P,D)=>{const L=p.get(P);if(!L||L.kind!==3)return Fe;const U=g.find(le=>le.fd===P);if(!U)return Fe;const O=T(),te=bs.encode(U.virtualPath).length;return O.setUint8(D,fC),O.setUint32(D+4,te,!0),we}),fd_prestat_dir_name:ye((P,D,L)=>{const U=p.get(P);if(!U||U.kind!==3)return Fe;const O=g.find(oe=>oe.fd===P);if(!O)return Fe;const te=bs.encode(O.virtualPath),le=Math.min(te.length,L);return N().set(te.subarray(0,le),D),we}),fd_pwrite:ye((P,D,L,U,O)=>{const te=p.get(P);if(!te||te.kind!==4)return Fe;const le=T();let oe=Number(U),fe=0;for(let me=0;me<L;me++){const Be=le.getUint32(D+me*8,!0),Ee=le.getUint32(D+me*8+4,!0),st=new Uint8Array(C().buffer,Be,Ee),xt=oe+Ee;if(!te.data||te.data.length<xt){const es=new Uint8Array(xt);te.data&&es.set(te.data),te.data=es}te.data.set(st,oe),oe+=Ee,fe+=Ee}return te.dirty=!0,le.setUint32(O,fe,!0),we}),fd_read:ye((P,D,L,U)=>{const O=p.get(P);if(!O)return Fe;const te=T();if(O.kind===0)return te.setUint32(U,0,!0),we;if(O.kind!==4)return Fe;if(!O.data)return te.setUint32(U,0,!0),we;let le=0,oe=O.offset??0;for(let fe=0;fe<L;fe++){const me=te.getUint32(D+fe*8,!0),Be=te.getUint32(D+fe*8+4,!0),Ee=Math.min(Be,O.data.length-oe);if(Ee<=0)break;N().set(O.data.subarray(oe,oe+Ee),me),oe+=Ee,le+=Ee}return O.offset=oe,te.setUint32(U,le,!0),we}),fd_readdir:ye((P,D,L,U,O)=>{const te=p.get(P);if(!te||te.kind!==3&&te.kind!==4)return Fe;if(!d)return pt;let le;try{le=d.readdirSync(te.path)}catch{return Mb}const oe=T(),fe=N();let me=D;const Be=D+L,Ee=Number(U);for(let st=Ee;st<le.length;st++){const xt=le[st],es=bs.encode(xt);if(24+es.length,me+24>Be)break;oe.setBigUint64(me,BigInt(st+1),!0),oe.setBigUint64(me+8,BigInt(st+1),!0),oe.setUint32(me+16,es.length,!0);let Wr=Co;try{const zt=d.statSync(Mn(te.path,xt));zt.isDirectory()?Wr=ko:zt.isSymbolicLink()&&(Wr=Vb)}catch{}oe.setUint8(me+20,Wr);const ts=Math.min(es.length,Be-(me+24));ts>0&&fe.set(es.subarray(0,ts),me+24),me+=24+ts}return oe.setUint32(O,me-D,!0),we}),fd_renumber:ye((P,D)=>{const L=p.get(P);if(!L)return Fe;if(p.has(D)){const U=p.get(D);U.kind===4&&W(U)}return p.set(D,L),p.delete(P),we}),fd_seek:ye((P,D,L,U)=>{const O=p.get(P);if(!O)return Fe;if(O.kind===0||O.kind===1||O.kind===2)return aC;if(O.kind===3)return Fe;const te=O.data?O.data.length:0;let le=O.offset??0;const oe=Number(D);switch(L){case dC:le=oe;break;case hC:le+=oe;break;case pC:le=te+oe;break;default:return fu}return le<0&&(le=0),O.offset=le,T().setBigUint64(U,BigInt(le),!0),we}),fd_sync:ye(P=>{const D=p.get(P);return D?(D.kind===4&&W(D),we):Fe}),fd_tell:ye((P,D)=>{const L=p.get(P);return!L||L.kind!==4?Fe:(T().setBigUint64(D,BigInt(L.offset??0),!0),we)}),fd_write:ye((P,D,L,U)=>{const O=p.get(P);if(!O)return Fe;const te=T();if(O.kind===1||O.kind===2){let fe=0;for(let me=0;me<L;me++){const Be=te.getUint32(D+me*8,!0),Ee=te.getUint32(D+me*8+4,!0),st=new Uint8Array(C().buffer,Be,Ee),xt=qb.decode(st);O.kind===1?(j+=xt,j=J(1,j)):(q+=xt,q=J(2,q)),fe+=Ee}return te.setUint32(U,fe,!0),we}if(O.kind!==4)return Fe;let le=0,oe=O.flags&&O.flags&yu?O.data?O.data.length:0:O.offset??0;for(let fe=0;fe<L;fe++){const me=te.getUint32(D+fe*8,!0),Be=te.getUint32(D+fe*8+4,!0),Ee=new Uint8Array(C().buffer,me,Be),st=oe+Be;if(!O.data||O.data.length<st){const xt=new Uint8Array(st);O.data&&xt.set(O.data),O.data=xt}O.data.set(Ee,oe),oe+=Be,le+=Be}return O.offset=oe,O.dirty=!0,te.setUint32(U,le,!0),we}),path_create_directory:ye((P,D,L)=>{if(!d)return pt;const U=p.get(P);if(!U)return Fe;const O=Y(D,L),te=Mn(U.path,O);return d.mkdirSync(te,{recursive:!0}),we}),path_filestat_get:ye((P,D,L,U,O)=>{if(!d)return pt;const te=p.get(P);if(!te)return Fe;const le=Y(L,U),oe=Mn(te.path,le),fe=d.statSync(oe),me=T();let Be=Co;fe.isDirectory()?Be=ko:fe.isSymbolicLink()&&(Be=Vb);const Ee=BigInt(Math.floor(fe.mtimeMs))*BigInt(1e6),st=BigInt(Math.floor(fe.atimeMs))*BigInt(1e6),xt=BigInt(Math.floor(fe.ctimeMs))*BigInt(1e6);return me.setBigUint64(O,0n,!0),me.setBigUint64(O+8,BigInt(fe.ino??0),!0),me.setUint8(O+16,Be),me.setBigUint64(O+24,BigInt(fe.nlink??1),!0),me.setBigUint64(O+32,BigInt(fe.size),!0),me.setBigUint64(O+40,st,!0),me.setBigUint64(O+48,Ee,!0),me.setBigUint64(O+56,xt,!0),we}),path_filestat_set_times:ye((P,D,L,U,O,te,le)=>we),path_link:ye((P,D,L,U,O,te,le)=>pt),path_open:ye((P,D,L,U,O,te,le,oe,fe)=>{if(!d)return pt;const me=p.get(P);if(!me)return Fe;const Be=Y(L,U),Ee=Mn(me.path,Be),st=(O&lC)!==0,xt=(O&oC)!==0,es=(O&cC)!==0,Wr=(O&uC)!==0;let ts=d.existsSync(Ee);if(es&&ts)return Lb;if(st){if(!ts)if(xt)d.mkdirSync(Ee,{recursive:!0});else return mu;const ws=y++;return p.set(ws,{kind:3,path:Ee,rights:Wb}),T().setUint32(fe,ws,!0),we}let zt;if(ts&&!Wr){zt=d.readFileSync(Ee);const ws=new Uint8Array(zt.length);ws.set(zt),zt=ws}else if(xt||Wr)ts||d.writeFileSync(Ee,new Uint8Array(0)),zt=new Uint8Array(0);else{if(!ts)return mu;zt=d.readFileSync(Ee);const ws=new Uint8Array(zt.length);ws.set(zt),zt=ws}const Nv=y++;return p.set(Nv,{kind:4,path:Ee,rights:RC,data:zt,offset:0,dirty:!1,flags:oe}),T().setUint32(fe,Nv,!0),we}),path_readlink:ye((P,D,L,U,O,te)=>{if(!d||!d.readlinkSync)return pt;const le=p.get(P);if(!le)return Fe;const oe=Y(D,L),fe=Mn(le.path,oe),me=d.readlinkSync(fe),Be=bs.encode(me),Ee=Math.min(Be.length,O);return N().set(Be.subarray(0,Ee),U),T().setUint32(te,Ee,!0),we}),path_remove_directory:ye((P,D,L)=>{if(!d)return pt;const U=p.get(P);if(!U)return Fe;const O=Y(D,L),te=Mn(U.path,O);return d.rmdirSync(te),we}),path_rename:ye((P,D,L,U,O,te)=>{if(!d)return pt;const le=p.get(P),oe=p.get(U);if(!le||!oe)return Fe;const fe=Y(D,L),me=Y(O,te),Be=Mn(le.path,fe),Ee=Mn(oe.path,me);return d.renameSync(Be,Ee),we}),path_symlink:ye((P,D,L,U,O)=>{if(!d||!d.symlinkSync)return pt;const te=p.get(L);if(!te)return Fe;const le=Y(P,D),oe=Y(U,O),fe=Mn(te.path,oe);return d.symlinkSync(le,fe),we}),path_unlink_file:ye((P,D,L)=>{if(!d)return pt;const U=p.get(P);if(!U)return Fe;const O=Y(D,L),te=Mn(U.path,O);return d.unlinkSync(te),we}),poll_oneoff:ye((P,D,L,U)=>{const O=T();let te=0;for(let le=0;le<L;le++){const oe=P+le*48,fe=D+te*32,me=O.getBigUint64(oe,!0),Be=O.getUint8(oe+8);O.setBigUint64(fe,me,!0),O.setUint16(fe+8,we,!0),O.setUint8(fe+10,Be),(Be===PC||Be===DC)&&(O.setBigUint64(fe+16,BigInt(1),!0),O.setUint16(fe+24,0,!0)),te++}return O.setUint32(U,te,!0),we}),proc_exit:ye(P=>{throw j&&(console.log(j),j=""),q&&(console.error(q),q=""),new Ao(P)}),proc_raise:ye(P=>pt),sched_yield:ye(()=>we),random_get:ye((P,D)=>{const L=new Uint8Array(C().buffer,P,D);return crypto.getRandomValues(L),we}),sock_recv:ye(()=>pt),sock_send:ye(()=>pt),sock_shutdown:ye(()=>pt),sock_accept:ye(()=>pt)},ne=this;ne.wasiImport=F,ne.start=function(D){E=D,x=D.exports.memory;const L=D.exports._start;if(typeof L!="function")throw new Error("WASI: instance has no _start export");try{L()}catch(U){if(U instanceof Ao){if(c)return U.code;throw U}throw U}finally{j&&(console.log(j),j=""),q&&(console.error(q),q="")}return 0},ne.initialize=function(D){E=D,x=D.exports.memory;const L=D.exports._initialize;typeof L=="function"&&L()},ne.getImportObject=function(){return{wasi_snapshot_preview1:F}}};Object.freeze(Object.defineProperty({__proto__:null,ExitStatus:Ao,WASI:Gb,default:{WASI:Gb}},Symbol.toStringTag,{value:"Module"}));function Kb(){return!1}function Yb(e){throw new Error("Single Executable Applications (SEA) are not supported in the browser")}function Zb(e){throw new Error("Single Executable Applications (SEA) are not supported in the browser")}function Xb(e){throw new Error("Single Executable Applications (SEA) are not supported in the browser")}Object.freeze(Object.defineProperty({__proto__:null,default:{isSea:Kb,getAsset:Yb,getAssetAsBlob:Zb,getRawAsset:Xb},getAsset:Yb,getAssetAsBlob:Zb,getRawAsset:Xb,isSea:Kb},Symbol.toStringTag,{value:"Module"}));const Gs=function(){};Gs.prototype.run=function(...t){throw new Error("node:sqlite is not supported in the browser environment")},Gs.prototype.get=function(...t){throw new Error("node:sqlite is not supported in the browser environment")},Gs.prototype.all=function(...t){throw new Error("node:sqlite is not supported in the browser environment")},Gs.prototype.expandedSQL=function(){return""},Gs.prototype.sourceSQL=function(){return""};const Lr=function(t,n){if(this)throw new Error("node:sqlite is not supported in the browser environment")};Lr.prototype.close=function(){},Lr.prototype.exec=function(t){},Lr.prototype.prepare=function(t){throw new Error("node:sqlite is not supported in the browser environment")},Lr.prototype.open=function(){},Object.freeze(Object.defineProperty({__proto__:null,DatabaseSync:Lr,StatementSync:Gs,default:{DatabaseSync:Lr,StatementSync:Gs}},Symbol.toStringTag,{value:"Module"}));const Mr=function(t){this&&se.call(this)};Object.setPrototypeOf(Mr.prototype,se.prototype),Mr.prototype.close=function(){this.emit("close")},Mr.prototype.destroy=function(t){this.emit("close")},Object.defineProperty(Mr.prototype,"address",{get:function(){return{address:"0.0.0.0",family:"IPv4",port:0}},configurable:!0});const Fr=function(){this&&se.call(this)};Object.setPrototypeOf(Fr.prototype,se.prototype),Fr.prototype.close=function(){this.emit("close")},Fr.prototype.destroy=function(t){this.emit("close")},Object.defineProperty(Fr.prototype,"destroyed",{get:function(){return!1},configurable:!0});const To=function(){this&&se.call(this)};Object.setPrototypeOf(To.prototype,se.prototype),Object.defineProperty(To.prototype,"id",{get:function(){return 0},configurable:!0}),Object.freeze(Object.defineProperty({__proto__:null,QuicEndpoint:Mr,QuicSession:Fr,QuicStream:To,default:{QuicEndpoint:Mr,QuicSession:Fr,QuicStream:To}},Symbol.toStringTag,{value:"Module"}));const it=function(t){if(!this)return;const n=t.message??`${Jb(t.actual)} ${t.operator??"=="} ${Jb(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(it.prototype,Error.prototype);function Jb(e){try{return JSON.stringify(e)}catch{return String(e)}}function Ks(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(!Ks(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)||!Ks(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(Ks(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)||!Ks(e[r],t[r]))return!1;return!0}return!1}function mn(e,t,n){if(e)throw n instanceof Error?n:(n!==void 0&&(t.message=n),new it(t))}function Je(e,t){mn(!e,{actual:e,expected:!0,operator:"==",stackStartFn:Je},t??"Value is falsy")}Je.ok=function e(t,n){mn(!t,{actual:t,expected:!0,operator:"==",stackStartFn:e},n??"Value is falsy")},Je.equal=function e(t,n,s){mn(t!=n,{actual:t,expected:n,operator:"==",stackStartFn:e},s)},Je.notEqual=function e(t,n,s){mn(t==n,{actual:t,expected:n,operator:"!=",stackStartFn:e},s)},Je.strictEqual=function e(t,n,s){mn(t!==n,{actual:t,expected:n,operator:"===",stackStartFn:e},s)},Je.notStrictEqual=function e(t,n,s){mn(t===n,{actual:t,expected:n,operator:"!==",stackStartFn:e},s)},Je.deepEqual=function e(t,n,s){mn(!Ks(t,n),{actual:t,expected:n,operator:"deepEqual",stackStartFn:e},s)},Je.deepStrictEqual=function e(t,n,s){mn(!Ks(t,n),{actual:t,expected:n,operator:"deepStrictEqual",stackStartFn:e},s)},Je.notDeepStrictEqual=function e(t,n,s){mn(Ks(t,n),{actual:t,expected:n,operator:"notDeepStrictEqual",stackStartFn:e},s)},Je.throws=function e(t,n,s){let r=!1,o;try{t()}catch(c){r=!0,o=c}if(!r)throw new it({message:typeof n=="string"?n:s??"Expected function to throw",operator:"throws",stackStartFn:e});n!==void 0&&typeof n!="string"&&Qb(o,n,s,e)},Je.doesNotThrow=function e(t,n,s){try{t()}catch(r){if(n===void 0||typeof n=="string")throw new it({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 it({message:s??"Unexpected matching throw",actual:r,expected:n,operator:"doesNotThrow",stackStartFn:e})}else if(typeof n=="function"&&r instanceof n)throw new it({message:s??"Unexpected throw of matching type",actual:r,expected:n,operator:"doesNotThrow",stackStartFn:e})}},Je.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 it({message:typeof n=="string"?n:s??"Expected rejection",operator:"rejects",stackStartFn:e});n!==void 0&&typeof n!="string"&&Qb(c,n,s,e)},Je.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 it({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 it({message:s??"Unexpected matching rejection",actual:o,expected:n,operator:"doesNotReject",stackStartFn:e})}else if(typeof n=="function"&&o instanceof n)throw new it({message:s??"Unexpected rejection of matching type",actual:o,expected:n,operator:"doesNotReject",stackStartFn:e})}},Je.fail=function e(t,n,s,r){throw arguments.length<=1?new it({message:typeof t=="string"?t:"Failed",stackStartFn:e}):new it({message:s,actual:t,expected:n,operator:r??"fail",stackStartFn:e})},Je.match=function e(t,n,s){mn(!n.test(t),{actual:t,expected:n,operator:"match",stackStartFn:e},s)},Je.doesNotMatch=function e(t,n,s){mn(n.test(t),{actual:t,expected:n,operator:"doesNotMatch",stackStartFn:e},s)},Je.ifError=function e(t){if(t!=null)throw t instanceof Error?t:new it({message:`ifError received unwanted value: ${t}`,actual:t,expected:null,operator:"ifError",stackStartFn:e})},Je.AssertionError=it,Je.strict=Je;function Qb(e,t,n,s){if(t instanceof RegExp){const r=e instanceof Error?e.message:String(e);if(!t.test(r))throw new it({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 it({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 it({message:n??"Error message mismatch",actual:c,expected:r.message,operator:"throws",stackStartFn:s})}else if(c!==r.message)throw new it({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 it({message:n??"Error code mismatch",actual:o.code,expected:r.code,operator:"throws",stackStartFn:s})}}Object.freeze(Object.defineProperty({__proto__:null,AssertionError:it,assert:Je,default:Je},Symbol.toStringTag,{value:"Module"}));const Lt=36,aa=1,oa=26,OC=38,NC=700,ev=72,tv=128,nv="-";function sv(e,t,n){let s=n?Math.floor(e/NC):e>>1;s+=Math.floor(s/t);let r=0;for(;s>(Lt-aa)*oa>>1;)s=Math.floor(s/(Lt-aa)),r+=Lt;return Math.floor(r+(Lt-aa+1)*s/(s+OC))}function BC(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:Lt}function rv(e,t){return e+22+75*(e<26?1:0)-0}function vu(e){const t=[];let n=0,s=tv,r=ev,o=e.lastIndexOf(nv);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=Lt;for(;;){if(c>=e.length)throw new RangeError("Invalid input");const x=BC(e.charCodeAt(c++));if(x>=Lt)throw new RangeError("Invalid input");if(x>Math.floor((2147483647-n)/p))throw new RangeError("Overflow");n+=x*p;const E=y<=r?aa:y>=r+oa?oa:y-r;if(x<E)break;if(p>Math.floor(2147483647/(Lt-E)))throw new RangeError("Overflow");p*=Lt-E,y+=Lt}const g=t.length+1;if(r=sv(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 wu(e){const t=[],n=Array.from(e).map(p=>p.codePointAt(0));let s=tv,r=0,o=ev;for(const p of n)p<128&&t.push(String.fromCharCode(p));let c=t.length;const d=c;for(d>0&&t.push(nv);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=Lt;for(;;){const E=x<=o?aa:x>=o+oa?oa:x-o;if(g<E)break;t.push(String.fromCharCode(rv(E+(g-E)%(Lt-E)))),g=Math.floor((g-E)/(Lt-E)),x+=Lt}t.push(String.fromCharCode(rv(g))),o=sv(r,c+1,c===d),r=0,++c}}++r,++s}return t.join("")}function iv(e){return e.split(".").map(t=>t.startsWith("xn--")?vu(t.slice(4)):t).join(".")}function av(e){return e.split(".").map(t=>/[^\x00-\x7E]/.test(t)?"xn--"+wu(t):t).join(".")}const ov={decode:e=>Array.from(e).map(t=>t.codePointAt(0)),encode:e=>String.fromCodePoint(...e)},lv="2.3.1";Object.freeze(Object.defineProperty({__proto__:null,decode:vu,default:{decode:vu,encode:wu,toUnicode:iv,toASCII:av,ucs2:ov,version:lv},encode:wu,toASCII:av,toUnicode:iv,ucs2:ov,version:lv},Symbol.toStringTag,{value:"Module"})),new Proxy({},{get(e,t){},ownKeys(){return[]},getOwnPropertyDescriptor(e,t){},has(e,t){return!1}});function LC(){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,E,C=!1,T;if(g.then(N=>{E=N,x=!0},N=>{T=N,C=!0}),x){r=E,o=!0,p(E);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)})}),V(this,"_syncValue"),V(this,"_syncResolved",!1),V(this,"_syncRejected",!1),V(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}LC();function Su(e){const t={};for(const n of Object.keys(e))t[n]=e[n];return t}Su(T0),Su(ZS),Su(HS);const cv=Symbol("Comlink.proxy"),MC=Symbol("Comlink.endpoint"),FC=Symbol("Comlink.releaseProxy"),xu=Symbol("Comlink.finalizer"),Io=Symbol("Comlink.thrown"),uv=e=>typeof e=="object"&&e!==null||typeof e=="function",$C={canHandle:e=>uv(e)&&e[cv],serialize(e){const{port1:t,port2:n}=new MessageChannel;return hv(e,t),[n,[n]]},deserialize(e){return e.start(),fv(e)}},UC={canHandle:e=>uv(e)&&Io 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}},dv=new Map([["proxy",$C],["throw",UC]]);function jC(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function hv(e,t=globalThis,n=["*"]){t.addEventListener("message",function s(r){if(!r||!r.data)return;if(!jC(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(Ys);let y;try{const g=d.slice(0,-1).reduce((E,C)=>E[C],e),x=d.reduce((E,C)=>E[C],e);switch(c){case"GET":y=x;break;case"SET":g[d.slice(-1)[0]]=Ys(r.data.value),y=!0;break;case"APPLY":y=x.apply(g,p);break;case"CONSTRUCT":{const E=new x(...p);y=GC(E)}break;case"ENDPOINT":{const{port1:E,port2:C}=new MessageChannel;hv(e,C),y=qC(E,[E])}break;case"RELEASE":y=void 0;break;default:return}}catch(g){y={value:g,[Io]:0}}Promise.resolve(y).catch(g=>({value:g,[Io]:0})).then(g=>{const[x,E]=Oo(g);t.postMessage(Object.assign(Object.assign({},x),{id:o}),E),c==="RELEASE"&&(t.removeEventListener("message",s),pv(t),xu in e&&typeof e[xu]=="function"&&e[xu]())}).catch(g=>{const[x,E]=Oo({value:new TypeError("Unserializable return value"),[Io]:0});t.postMessage(Object.assign(Object.assign({},x),{id:o}),E)})}),t.start&&t.start()}function VC(e){return e.constructor.name==="MessagePort"}function pv(e){VC(e)&&e.close()}function fv(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)}}),Eu(e,n,[],t)}function Ro(e){if(e)throw new Error("Proxy has been released and is not useable")}function mv(e){return $r(e,new Map,{type:"RELEASE"}).then(()=>{pv(e)})}const Po=new WeakMap,Do="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(Po.get(e)||0)-1;Po.set(e,t),t===0&&mv(e)});function HC(e,t){const n=(Po.get(t)||0)+1;Po.set(t,n),Do&&Do.register(e,t,e)}function WC(e){Do&&Do.unregister(e)}function Eu(e,t,n=[],s=function(){}){let r=!1;const o=new Proxy(s,{get(c,d){if(Ro(r),d===FC)return()=>{WC(o),mv(e),t.clear(),r=!0};if(d==="then"){if(n.length===0)return{then:()=>o};const p=$r(e,t,{type:"GET",path:n.map(y=>y.toString())}).then(Ys);return p.then.bind(p)}return Eu(e,t,[...n,d])},set(c,d,p){Ro(r);const[y,g]=Oo(p);return $r(e,t,{type:"SET",path:[...n,d].map(x=>x.toString()),value:y},g).then(Ys)},apply(c,d,p){Ro(r);const y=n[n.length-1];if(y===MC)return $r(e,t,{type:"ENDPOINT"}).then(Ys);if(y==="bind")return Eu(e,t,n.slice(0,-1));const[g,x]=gv(p);return $r(e,t,{type:"APPLY",path:n.map(E=>E.toString()),argumentList:g},x).then(Ys)},construct(c,d){Ro(r);const[p,y]=gv(d);return $r(e,t,{type:"CONSTRUCT",path:n.map(g=>g.toString()),argumentList:p},y).then(Ys)}});return HC(o,e),o}function zC(e){return Array.prototype.concat.apply([],e)}function gv(e){const t=e.map(Oo);return[t.map(n=>n[0]),zC(t.map(n=>n[1]))]}const yv=new WeakMap;function qC(e,t){return yv.set(e,t),e}function GC(e){return Object.assign(e,{[cv]:!0})}function Oo(e){for(const[t,n]of dv)if(n.canHandle(e)){const[s,r]=n.serialize(e);return[{type:"HANDLER",name:t,value:s},r]}return[{type:"RAW",value:e},yv.get(e)||[]]}function Ys(e){switch(e.type){case"HANDLER":return dv.get(e.name).deserialize(e.value);case"RAW":return e.value}}function $r(e,t,n,s){return new Promise(r=>{const o=KC();t.set(o,r),e.start&&e.start(),e.postMessage(Object.assign({id:o},n),s)})}function KC(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}E0=class extends se{constructor(e,t){super(),V(this,"pid"),V(this,"worker"),V(this,"command"),V(this,"args"),V(this,"parentPid"),V(this,"_state","starting"),V(this,"_exitCode"),V(this,"_stdout",""),V(this,"_stderr",""),V(this,"_exitHoldCount",0),V(this,"_deferredExit",null),V(this,"_shellDoneHoldCount",0),V(this,"_deferredShellDone",null),V(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 YC=`"use strict";
97
+ `):P=String.fromCharCode(te),this.options.locations&&(++this.curLine,this.lineStart=this.pos),P}jsx_readString($){let te="",P=++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(P,this.pos),te+=this.jsx_readEntity(),P=this.pos):J(D)?(te+=this.input.slice(P,this.pos),te+=this.jsx_readNewLine(!1),P=this.pos):++this.pos}return te+=this.input.slice(P,this.pos++),this.finishToken(k.string,te)}jsx_readEntity(){let $="",te=0,P,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($)&&(P=String.fromCharCode(parseInt($,16)))):($=$.substr(1),s.test($)&&(P=String.fromCharCode(parseInt($,10)))):P=t[$];break}$+=D}return P||(this.pos=F,"&")}jsx_readWord(){let $,te=this.pos;do $=this.input.charCodeAt(++this.pos);while(q($)||$===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,P=this.jsx_parseIdentifier();if(!p.allowNamespaces||!this.eat(k.colon))return P;var D=this.startNodeAt($,te);return D.namespace=P,D.name=this.jsx_parseIdentifier(),this.finishNode(D,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===C.jsxTagEnd)return"";let $=this.start,te=this.startLoc,P=this.jsx_parseNamespacedName();for(this.type===k.dot&&P.type==="JSXNamespacedName"&&!p.allowNamespacedObjects&&this.unexpected();this.eat(k.dot);){let D=this.startNodeAt($,te);D.object=P,D.property=this.jsx_parseIdentifier(),P=this.finishNode(D,"JSXMemberExpression")}return P}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 P=this.startNodeAt($,te);P.attributes=[];let D=this.jsx_parseElementName();for(D&&(P.name=D);this.type!==k.slash&&this.type!==C.jsxTagEnd;)P.attributes.push(this.jsx_parseAttribute());return P.selfClosing=this.eat(k.slash),this.expect(C.jsxTagEnd),this.finishNode(P,D?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt($,te){let P=this.startNodeAt($,te),D=this.jsx_parseElementName();return D&&(P.name=D),this.expect(C.jsxTagEnd),this.finishNode(P,D?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt($,te){let P=this.startNodeAt($,te),D=[],F=this.jsx_parseOpeningElementAt($,te),j=null;if(!F.selfClosing){e:for(;;)switch(this.type){case C.jsxTagStart:if($=this.start,te=this.startLoc,this.next(),this.eat(k.slash)){j=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(j.name)!==c(F.name)&&this.raise(j.start,"Expected corresponding JSX closing tag for <"+c(F.name)+">")}let O=F.name?"Element":"Fragment";return P["opening"+O]=F,P["closing"+O]=j,P.children=D,this.type===k.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(P,"JSX"+O)}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===G)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==G?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($)}}}})(s_);var Qk=s_.exports;const eC=Zk(Qk),i_=st.extend(eC());let nu=null,na=null;async function So(){return nu||na||(na=(async()=>{try{const e=await qa(rx);return nu=e,e}catch(e){throw na=null,new Error(`rollup: failed to load @rollup/browser from CDN -- ${e}`)}})(),na)}const a_=sf;async function o_(e){return(await So()).rollup(e)}async function l_(e){return(await So()).watch(e)}function c_(e){return e}function su(e,t){const n={ecmaVersion:"latest",sourceType:"module",allowReturnOutsideFunction:(t==null?void 0:t.allowReturnOutsideFunction)??!1,locations:!0};if(t!=null&&t.jsx)return i_.parse(e,n);try{return vo(e,n)}catch{return i_.parse(e,n)}}async function u_(e,t){return su(e,{allowReturnOutsideFunction:t==null?void 0:t.allowReturnOutsideFunction,jsx:t==null?void 0:t.jsx})}function tC(){return""}Object.freeze(Object.defineProperty({__proto__:null,VERSION:a_,default:{VERSION:a_,rollup:o_,watch:l_,defineConfig:c_,parseAst:su,parseAstAsync:u_,loadRollup:So},defineConfig:c_,getPackageBase:tC,loadRollup:So,parseAst:su,parseAstAsync:u_,rollup:o_,watch:l_},Symbol.toStringTag,{value:"Module"}));function d_(){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 h_(){return[]}function p_(){return{code_and_metadata_size:0,bytecode_and_metadata_size:0,external_script_source_size:0}}function f_(){return null}function m_(){return""}function g_(e){}function y_(){}function __(){}function b_(){return 0}function v_(e){return new TextEncoder().encode(JSON.stringify(e))}function w_(e){return JSON.parse(new TextDecoder().decode(e))}const Ws=function(){};Ws.prototype.writeHeader=function(){},Ws.prototype.writeValue=function(t){},Ws.prototype.releaseBuffer=function(){return new Uint8Array(0)};const Lr=function(t){};Lr.prototype.readHeader=function(){return!0},Lr.prototype.readValue=function(){return null};const ru=function(){this&&Ws.call(this)};Object.setPrototypeOf(ru.prototype,Ws.prototype);const iu=function(t){this&&Lr.call(this,t)};Object.setPrototypeOf(iu.prototype,Lr.prototype);function S_(){return{onInit:()=>{},onSettled:()=>{},onBefore:()=>{},onAfter:()=>{},createHook:()=>({enable:()=>{},disable:()=>{}})}}Object.freeze(Object.defineProperty({__proto__:null,DefaultDeserializer:iu,DefaultSerializer:ru,Deserializer:Lr,Serializer:Ws,cachedDataVersionTag:b_,default:{getHeapStatistics:d_,getHeapSpaceStatistics:h_,getHeapCodeStatistics:p_,getHeapSnapshot:f_,writeHeapSnapshot:m_,setFlagsFromString:g_,takeCoverage:y_,stopCoverage:__,cachedDataVersionTag:b_,serialize:v_,deserialize:w_,Serializer:Ws,Deserializer:Lr,DefaultSerializer:ru,DefaultDeserializer:iu,promiseHooks:S_},deserialize:w_,getHeapCodeStatistics:p_,getHeapSnapshot:f_,getHeapSpaceStatistics:h_,getHeapStatistics:d_,promiseHooks:S_,serialize:v_,setFlagsFromString:g_,stopCoverage:__,takeCoverage:y_,writeHeapSnapshot:m_},Symbol.toStringTag,{value:"Module"}));let Mr=0;function nC(){return Mr}function sC(e){Mr=e}N0=function(){Mr=0};const x_=Symbol("keypressDecoder");function rC(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 au(e,t){if(!e||typeof e.on!="function"||e[x_])return;e[x_]=!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=rC(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 sa(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 ra(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"){Mr++,rs();const n=this.input,s=this;this.terminal?(typeof this.input.setRawMode=="function"&&this.input.setRawMode(!0),au(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=sa(this._lineBuffer,this.cursor),this._refreshLine();return}if(n.ctrl&&n.name==="right"||n.meta&&n.name==="f"){this.cursor=ra(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=sa(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=ra(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"&&(Mr=Math.max(0,Mr-1),wn());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=sa(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=sa(this._lineBuffer,this.cursor):this.cursor=Math.max(0,this.cursor-1);return}if(n.name==="right"){n.ctrl||n.meta?this.cursor=ra(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=sa(this._lineBuffer,this.cursor);return}if(n.meta&&n.name==="f"){this.cursor=ra(this._lineBuffer,this.cursor);return}if(n.meta&&n.name==="d"){const r=ra(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 ou(e,t){return e&&typeof e=="object"&&!("on"in e)&&!("read"in e)?new lt(e):new lt({input:e,output:t})}function E_(e,t,n){return e&&typeof e.clearLine=="function"?e.clearLine(t,n):(n&&n(),!0)}function k_(e,t){return e&&typeof e.write=="function"&&e.write("\x1B[J"),t&&t(),!0}function C_(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 A_(e,t,n,s){return e&&typeof e.moveCursor=="function"?e.moveCursor(t,n,s):(s&&s(),!0)}class iC{constructor(t,n){H(this,"_stream"),H(this,"_buffer"),H(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 T_={createInterface(e){const t=ou(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:iC};Object.freeze(Object.defineProperty({__proto__:null,Interface:lt,clearLine:E_,clearScreenDown:k_,createInterface:ou,cursorTo:C_,default:{Interface:lt,createInterface:ou,clearLine:E_,clearScreenDown:k_,cursorTo:C_,moveCursor:A_,emitKeypressEvents:au,promises:T_},emitKeypressEvents:au,getActiveInterfaceCount:nC,moveCursor:A_,promises:T_,resetActiveInterfaceCount:N0,setActiveInterfaceCount:sC},Symbol.toStringTag,{value:"Module"}));const es=function(t,n){this&&(ne.call(this),this.authorized=!1,this.encrypted=!0)};Object.setPrototypeOf(es.prototype,ne.prototype),es.prototype.getPeerCertificate=function(t){return{}},es.prototype.getCipher=function(){return null},es.prototype.getProtocol=function(){return null},es.prototype.setServername=function(t){},es.prototype.renegotiate=function(t,n){return!1};const Fn=function(t,n){this&&ne.call(this)};Object.setPrototypeOf(Fn.prototype,ne.prototype),Fn.prototype.listen=function(...t){return this},Fn.prototype.close=function(t){return this},Fn.prototype.address=function(){return null},Fn.prototype.getTicketKeys=function(){return new Uint8Array(0)},Fn.prototype.setTicketKeys=function(t){},Fn.prototype.setSecureContext=function(t){};function I_(e,t){return new Fn}function R_(e,t){const n=new es;return t&&setTimeout(t,0),n}function P_(e){return{}}const D_=()=>["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"],O_="auto",N_="TLSv1.3",B_="TLSv1.2",L_=[];Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_ECDH_CURVE:O_,DEFAULT_MAX_VERSION:N_,DEFAULT_MIN_VERSION:B_,Server:Fn,TLSSocket:es,connect:R_,createSecureContext:P_,createServer:I_,default:{TLSSocket:es,Server:Fn,createServer:I_,connect:R_,createSecureContext:P_,getCiphers:D_,DEFAULT_ECDH_CURVE:O_,DEFAULT_MAX_VERSION:N_,DEFAULT_MIN_VERSION:B_,rootCertificates:L_},getCiphers:D_,rootCertificates:L_},Symbol.toStringTag,{value:"Module"}));const Ct=function(){this&&ne.call(this)};Object.setPrototypeOf(Ct.prototype,ne.prototype),Ct.prototype.close=function(t){t&&setTimeout(t,0)},Ct.prototype.destroy=function(t,n){},Object.defineProperty(Ct.prototype,"destroyed",{get(){return!1},configurable:!0}),Object.defineProperty(Ct.prototype,"encrypted",{get(){return!1},configurable:!0}),Object.defineProperty(Ct.prototype,"closed",{get(){return!1},configurable:!0}),Ct.prototype.ping=function(t){return!1},Ct.prototype.ref=function(){},Ct.prototype.unref=function(){},Ct.prototype.setTimeout=function(t,n){};const xo=function(){this&&Ct.call(this)};Object.setPrototypeOf(xo.prototype,Ct.prototype);const lu=function(){this&&Ct.call(this)};Object.setPrototypeOf(lu.prototype,Ct.prototype);const yn=function(){this&&ne.call(this)};Object.setPrototypeOf(yn.prototype,ne.prototype),yn.prototype.close=function(t,n){},Object.defineProperty(yn.prototype,"id",{get(){return 0},configurable:!0}),Object.defineProperty(yn.prototype,"pending",{get(){return!1},configurable:!0}),Object.defineProperty(yn.prototype,"destroyed",{get(){return!1},configurable:!0}),Object.defineProperty(yn.prototype,"closed",{get(){return!1},configurable:!0}),yn.prototype.priority=function(t){},yn.prototype.setTimeout=function(t,n){},yn.prototype.end=function(t,n,s){};const cu=function(){this&&ne.call(this)};Object.setPrototypeOf(cu.prototype,ne.prototype);const ia=function(){this&&ne.call(this)};Object.setPrototypeOf(ia.prototype,ne.prototype),ia.prototype.writeHead=function(t,n){return this},ia.prototype.end=function(t){};function M_(e,t){return new ne}function F_(e,t){return new ne}function $_(e,t,n){return new xo}const U_={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 j_(){return{}}function V_(e){return new Uint8Array(0)}function H_(e){return{}}const W_=Symbol("sensitiveHeaders");Object.freeze(Object.defineProperty({__proto__:null,ClientHttp2Session:xo,Http2ServerRequest:cu,Http2ServerResponse:ia,Http2Session:Ct,Http2Stream:yn,ServerHttp2Session:lu,connect:$_,constants:U_,createSecureServer:F_,createServer:M_,default:{Http2Session:Ct,ClientHttp2Session:xo,ServerHttp2Session:lu,Http2Stream:yn,Http2ServerRequest:cu,Http2ServerResponse:ia,createServer:M_,createSecureServer:F_,connect:$_,constants:U_,getDefaultSettings:j_,getPackedSettings:V_,getUnpackedSettings:H_,sensitiveHeaders:W_},getDefaultSettings:j_,getPackedSettings:V_,getUnpackedSettings:H_,sensitiveHeaders:W_},Symbol.toStringTag,{value:"Module"}));const z_=!0,q_=!0,G_=!1,ts=function(){this&&(ne.call(this),this.id=0,this.process=null)};Object.setPrototypeOf(ts.prototype,ne.prototype),ts.prototype.send=function(t,n){return!1},ts.prototype.kill=function(t){},ts.prototype.disconnect=function(){},ts.prototype.isDead=function(){return!1},ts.prototype.isConnected=function(){return!1};const K_=null,Y_={},Z_={},X_=1,uu=2;let J_=uu;function Q_(e){return new ts}function eb(e){e&&setTimeout(e,0)}function tb(e){}function nb(e){}const ys=new ne,sb=ys.on.bind(ys),rb=ys.once.bind(ys),ib=ys.emit.bind(ys),ab=ys.removeListener.bind(ys);Object.freeze(Object.defineProperty({__proto__:null,SCHED_NONE:X_,SCHED_RR:uu,Worker:ts,default:{isMaster:z_,isPrimary:q_,isWorker:G_,Worker:ts,worker:K_,workers:Y_,fork:Q_,disconnect:eb,settings:Z_,SCHED_NONE:X_,SCHED_RR:uu,schedulingPolicy:J_,setupMaster:tb,setupPrimary:nb,on:sb,once:rb,emit:ib,removeListener:ab},disconnect:eb,emit:ib,fork:Q_,isMaster:z_,isPrimary:q_,isWorker:G_,on:sb,once:rb,removeListener:ab,schedulingPolicy:J_,settings:Z_,setupMaster:tb,setupPrimary:nb,worker:K_,workers:Y_},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 ob(e,t){return new ct}Object.freeze(Object.defineProperty({__proto__:null,Socket:ct,createSocket:ob,default:{Socket:ct,createSocket:ob}},Symbol.toStringTag,{value:"Module"}));const zs=function(t,n){this&&(this._src=t)};zs.prototype.runInThisContext=function(t){return(0,eval)(this._src)},zs.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)},zs.prototype.runInContext=function(t,n){return this.runInNewContext(t,n)},zs.prototype.createCachedData=function(){return new Uint8Array(0)};function lb(e,t){return e??{}}function cb(e){return!0}function ub(e,t){return(0,eval)(e)}function du(e,t,n){return new zs(e).runInNewContext(t)}function db(e,t,n){return du(e,t)}function hb(e,t,n){return new Function(...t??[],e)}const ln=function(t,n){};ln.prototype.link=function(t){return Promise.resolve()},ln.prototype.evaluate=function(t){return Promise.resolve()},Object.defineProperty(ln.prototype,"status",{get(){return"unlinked"},configurable:!0}),Object.defineProperty(ln.prototype,"identifier",{get(){return""},configurable:!0}),Object.defineProperty(ln.prototype,"context",{get(){return{}},configurable:!0}),Object.defineProperty(ln.prototype,"namespace",{get(){return{}},configurable:!0});const hu=function(t,n){this&&ln.call(this,t,n)};Object.setPrototypeOf(hu.prototype,ln.prototype);const Eo=function(t,n){this&&ln.call(this,t,n)};Object.setPrototypeOf(Eo.prototype,ln.prototype),Eo.prototype.setExport=function(t,n){},Object.freeze(Object.defineProperty({__proto__:null,Module:ln,Script:zs,SourceTextModule:hu,SyntheticModule:Eo,compileFunction:hb,createContext:lb,default:{Script:zs,createContext:lb,isContext:cb,runInThisContext:ub,runInNewContext:du,runInContext:db,compileFunction:hb,Module:ln,SourceTextModule:hu,SyntheticModule:Eo},isContext:cb,runInContext:db,runInNewContext:du,runInThisContext:ub},Symbol.toStringTag,{value:"Module"}));const qs=function(){this&&ne.call(this)};Object.setPrototypeOf(qs.prototype,ne.prototype),qs.prototype.connect=function(){},qs.prototype.connectToMainThread=function(){},qs.prototype.disconnect=function(){},qs.prototype.post=function(t,n,s){s&&setTimeout(()=>s(null,{}),0)};function pb(e,t,n){}function fb(){}function mb(){}function gb(){}const yb=globalThis.console;Object.freeze(Object.defineProperty({__proto__:null,Session:qs,close:fb,console:yb,default:{Session:qs,open:pb,close:fb,url:mb,waitForDebugger:gb,console:yb},open:pb,url:mb,waitForDebugger:gb},Symbol.toStringTag,{value:"Module"}));const Gs=function(t,n){};Gs.prototype.runInAsyncScope=function(t,n,...s){return t.apply(n,s)},Gs.prototype.emitDestroy=function(){return this},Gs.prototype.asyncId=function(){return 0},Gs.prototype.triggerAsyncId=function(){return 0},Gs.bind=function(t,n){return t};const Ks=function(){this&&(this._store=void 0)};Ks.prototype.disable=function(){},Ks.prototype.getStore=function(){return this._store},Ks.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}},Ks.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}},Ks.prototype.enterWith=function(t){this._store=t};function _b(e){const t={enable(){return t},disable(){return t}};return t}function bb(){return 0}function vb(){return{}}function wb(){return 0}Object.freeze(Object.defineProperty({__proto__:null,AsyncLocalStorage:Ks,AsyncResource:Gs,createHook:_b,default:{AsyncResource:Gs,AsyncLocalStorage:Ks,createHook:_b,executionAsyncId:bb,executionAsyncResource:vb,triggerAsyncId:wb},executionAsyncId:bb,executionAsyncResource:vb,triggerAsyncId:wb},Symbol.toStringTag,{value:"Module"}));const cn=function(){this&&(ne.call(this),this.members=[])};Object.setPrototypeOf(cn.prototype,ne.prototype),cn.prototype.add=function(t){this.members.push(t)},cn.prototype.remove=function(t){const n=this.members.indexOf(t);n>=0&&this.members.splice(n,1)},cn.prototype.bind=function(t){return t},cn.prototype.intercept=function(t){return t},cn.prototype.run=function(t){return t()},cn.prototype.dispose=function(){this.members.length=0},cn.prototype.enter=function(){},cn.prototype.exit=function(){};function Sb(){return new cn}let xb=null;Object.freeze(Object.defineProperty({__proto__:null,Domain:cn,active:xb,create:Sb,default:{Domain:cn,create:Sb,active:xb}},Symbol.toStringTag,{value:"Module"}));const _s=function(t){this&&(this.name=t,this._listeners=[])};Object.defineProperty(_s.prototype,"hasSubscribers",{get(){return this._listeners.length>0},configurable:!0}),_s.prototype.subscribe=function(t){this._listeners.push(t)},_s.prototype.unsubscribe=function(t){const n=this._listeners.indexOf(t);return n===-1?!1:(this._listeners.splice(n,1),!0)},_s.prototype.publish=function(t){for(const n of this._listeners)try{n(t,this.name)}catch{}};const aa=new Map;function pu(e){return aa.has(e)||aa.set(e,new _s(e)),aa.get(e)}function Eb(e){var t;return((t=aa.get(e))==null?void 0:t.hasSubscribers)??!1}function kb(e,t){pu(e).subscribe(t)}function Cb(e,t){var n;return((n=aa.get(e))==null?void 0:n.unsubscribe(t))??!1}Object.freeze(Object.defineProperty({__proto__:null,Channel:_s,DiagChannel:_s,channel:pu,default:{channel:pu,hasSubscribers:Eb,subscribe:kb,unsubscribe:Cb,Channel:_s},hasSubscribers:Eb,subscribe:kb,unsubscribe:Cb},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 Ab=Symbol.for("repl-sloppy"),Tb=Symbol.for("repl-strict"),fu=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(fu.prototype,SyntaxError.prototype);const $n=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($n.prototype,ne.prototype),$n.prototype.setPrompt=function(t){this._prompt=t},$n.prototype.getPrompt=function(){return this._prompt},$n.prototype.displayPrompt=function(t){},$n.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})},$n.prototype.close=function(){this.emit("exit"),this.emit("close")},$n.prototype.setupHistory=function(t,n){n(null,this)};function Ib(e){return new $n(e)}Object.freeze(Object.defineProperty({__proto__:null,REPLServer:$n,REPL_MODE_SLOPPY:Ab,REPL_MODE_STRICT:Tb,Recoverable:fu,default:{start:Ib,REPLServer:$n,Recoverable:fu,REPL_MODE_SLOPPY:Ab,REPL_MODE_STRICT:Tb},start:Ib},Symbol.toStringTag,{value:"Module"}));const bs=function(t){this&&(this.name=t,this._controller=new AbortController,this.signal=this._controller.signal)};bs.prototype.diagnostic=function(t){globalThis.console.log(`# ${t}`)},bs.prototype.plan=function(t){},bs.prototype.todo=function(t){globalThis.console.log(`# TODO${t?": "+t:""}`)},bs.prototype.skip=function(t){globalThis.console.log(`# SKIP${t?": "+t:""}`)},bs.prototype.abort=function(){this._controller.abort()};function Rb(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 ko(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 bs(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 Pb(e){try{e()}catch{}}function Db(e){try{e()}catch{}}function Ob(e){try{e()}catch{}}function Nb(e){try{e()}catch{}}function Bb(e,t){e&&globalThis.console.log(`# SKIP - ${e}`)}function Lb(e,t){e&&globalThis.console.log(`# TODO - ${e}`)}const mu={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=mu.fn(n||s);return e[t]=r,r},reset(){},restoreAll(){}};Object.freeze(Object.defineProperty({__proto__:null,TestContext:bs,after:Db,afterEach:Nb,before:Pb,beforeEach:Ob,default:{describe:Rb,it:ko,test:ko,before:Pb,after:Db,beforeEach:Ob,afterEach:Nb,skip:Bb,todo:Lb,mock:mu,TestContext:bs},describe:Rb,it:ko,mock:mu,skip:Bb,test:ko,todo:Lb},Symbol.toStringTag,{value:"Module"}));const oa=function(t){this&&(this.categories=t.join(","),this.enabled=!1)};oa.prototype.enable=function(){},oa.prototype.disable=function(){};function Mb(e){return new oa(e.categories)}function Fb(){}Object.freeze(Object.defineProperty({__proto__:null,Tracing:oa,createTracing:Mb,default:{createTracing:Mb,getEnabledCategories:Fb,Tracing:oa},getEnabledCategories:Fb},Symbol.toStringTag,{value:"Module"}));const Ae=0,aC=2,qe=8,$b=20,gu=28,Ub=29,oC=31,yu=44,vt=52,lC=54,cC=55,uC=70,jb=0,Vb=1,Hb=2,Wb=3,_u=0,Co=3,Ao=4,zb=7,bu=1,dC=1,hC=2,pC=4,fC=8,mC=0,gC=1,yC=2,_C=0,vu=0x0000000000000002n,wu=0x0000000000000040n,bC=0x0000000000000004n,vC=0x0000000000000020n,wC=0x0000000000004000n,SC=0x0000000000002000n,xC=0x0000000000000200n,EC=0x0000000000000400n,kC=0x0000000004000000n,CC=0x0000000002000000n,AC=0x0000000000010000n,TC=0x0000000000020000n,IC=0x0000000000040000n,RC=0x0000000001000000n,PC=0x0000000000008000n,qb=0x0000000000200000n,DC=0x0000000000400000n,OC=0x1fffffffn,Gb=vu|wC|SC|xC|EC|kC|CC|AC|TC|IC|RC|PC|qb,NC=vu|wu|bC|vC|qb|DC,BC=1,LC=2;class To extends Error{constructor(t){super(`WASI exit(${t})`),H(this,"code"),this.code=t}}function _e(e){return function(...t){try{return e.apply(this,t)}catch(n){if(n instanceof To)throw n;const s=n==null?void 0:n.code;return s==="ENOENT"?yu:s==="EEXIST"?$b:s==="EISDIR"?oC:s==="ENOTDIR"?lC:s==="ENOTEMPTY"?cC:s==="EACCES"||s==="EPERM"?aC:Ub}}}function Un(e,t){if(t.startsWith("/"))return Kb(t);const n=e.endsWith("/")?e+t:e+"/"+t;return Kb(n)}function Kb(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 vs=new TextEncoder,Yb=new TextDecoder,Zb=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:vu}),p.set(1,{kind:1,path:"",rights:wu}),p.set(2,{kind:2,path:"",rights:wu});const g=[];for(const[P,D]of Object.entries(o)){const F=y++;p.set(F,{kind:3,path:D,rights:Gb}),g.push({fd:F,virtualPath:P,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="",G="";const J=(P,D)=>{const F=D.lastIndexOf(`
100
+ `);if(F<0)return D;const j=D.substring(0,F);return P===1?console.log(j):console.error(j),D.substring(F+1)},X=(P,D)=>Yb.decode(new Uint8Array(C().buffer,P,D)),q=P=>{P.dirty&&d&&P.path&&P.data&&(d.writeFileSync(P.path,P.data),P.dirty=!1)},$={args_get:_e((P,D)=>{const F=T(),j=L();for(const O of s){F.setUint32(P,D,!0),P+=4;const Q=vs.encode(O+"\0");j.set(Q,D),D+=Q.length}return Ae}),args_sizes_get:_e((P,D)=>{const F=T();F.setUint32(P,s.length,!0);let j=0;for(const O of s)j+=vs.encode(O+"\0").length;return F.setUint32(D,j,!0),Ae}),environ_get:_e((P,D)=>{const F=Object.entries(r),j=T(),O=L();for(const[Q,ce]of F){j.setUint32(P,D,!0),P+=4;const le=vs.encode(`${Q}=${ce}\0`);O.set(le,D),D+=le.length}return Ae}),environ_sizes_get:_e((P,D)=>{const F=Object.entries(r),j=T();j.setUint32(P,F.length,!0);let O=0;for(const[Q,ce]of F)O+=vs.encode(`${Q}=${ce}\0`).length;return j.setUint32(D,O,!0),Ae}),clock_res_get:_e((P,D)=>{const F=T();switch(P){case jb:F.setBigUint64(D,BigInt(1e6),!0);break;case Vb:case Hb:case Wb:F.setBigUint64(D,BigInt(1e3),!0);break;default:return gu}return Ae}),clock_time_get:_e((P,D,F)=>{const j=T();switch(P){case jb:{const O=BigInt(Date.now())*BigInt(1e6);j.setBigUint64(F,O,!0);break}case Vb:case Hb:case Wb:{const O=performance.now(),Q=Math.trunc(O),ce=Math.floor((O-Q)*1e3),le=BigInt(Q)*BigInt(1e9)+BigInt(ce)*BigInt(1e6);j.setBigUint64(F,le,!0);break}default:return gu}return Ae}),fd_advise:_e((P,D,F,j)=>Ae),fd_allocate:_e((P,D,F)=>vt),fd_close:_e(P=>{const D=p.get(P);return D?(D.kind===4&&q(D),p.delete(P),Ae):qe}),fd_datasync:_e(P=>{const D=p.get(P);return D?(D.kind===4&&q(D),Ae):qe}),fd_fdstat_get:_e((P,D)=>{const F=p.get(P);if(!F)return qe;const j=T();let O=_u,Q=0,ce=F.rights,le=0n;switch(F.kind){case 0:case 1:case 2:O=_u;break;case 3:O=Co,le=OC;break;case 4:O=Ao,F.flags&&F.flags&bu&&(Q|=bu);break}return j.setUint8(D,O),j.setUint16(D+2,Q,!0),j.setBigUint64(D+8,ce,!0),j.setBigUint64(D+16,le,!0),Ae}),fd_fdstat_set_flags:_e((P,D)=>vt),fd_fdstat_set_rights:_e((P,D,F)=>vt),fd_filestat_get:_e((P,D)=>{const F=p.get(P);if(!F)return qe;const j=T();let O=0n,Q=_u,ce=0n,le=0n,fe=0n,me=0n,Ve=1n;if(F.kind===4){if(O=BigInt(F.data?F.data.length:0),Q=Ao,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),fe=BigInt(Math.floor(Ie.ctimeMs))*BigInt(1e6),Ie.ino&&(me=BigInt(Ie.ino)),Ie.nlink&&(Ve=BigInt(Ie.nlink))}catch{}}else F.kind===3&&(Q=Co);return j.setBigUint64(D,0n,!0),j.setBigUint64(D+8,me,!0),j.setUint8(D+16,Q),j.setBigUint64(D+24,Ve,!0),j.setBigUint64(D+32,O,!0),j.setBigUint64(D+40,le,!0),j.setBigUint64(D+48,ce,!0),j.setBigUint64(D+56,fe,!0),Ae}),fd_filestat_set_size:_e((P,D)=>{const F=p.get(P);if(!F||F.kind!==4)return qe;const j=Number(D);if(!F.data)F.data=new Uint8Array(j);else if(F.data.length!==j){const O=new Uint8Array(j);O.set(F.data.subarray(0,Math.min(F.data.length,j))),F.data=O}return F.dirty=!0,Ae}),fd_filestat_set_times:_e((P,D,F,j)=>Ae),fd_pread:_e((P,D,F,j,O)=>{const Q=p.get(P);if(!Q||Q.kind!==4)return qe;if(!Q.data)return T().setUint32(O,0,!0),Ae;const ce=T();let le=Number(j),fe=0;for(let me=0;me<F;me++){const Ve=ce.getUint32(D+me*8,!0),Ie=ce.getUint32(D+me*8+4,!0),ut=Math.min(Ie,Q.data.length-le);if(ut<=0)break;L().set(Q.data.subarray(le,le+ut),Ve),le+=ut,fe+=ut}return ce.setUint32(O,fe,!0),Ae}),fd_prestat_get:_e((P,D)=>{const F=p.get(P);if(!F||F.kind!==3)return qe;const j=g.find(ce=>ce.fd===P);if(!j)return qe;const O=T(),Q=vs.encode(j.virtualPath).length;return O.setUint8(D,_C),O.setUint32(D+4,Q,!0),Ae}),fd_prestat_dir_name:_e((P,D,F)=>{const j=p.get(P);if(!j||j.kind!==3)return qe;const O=g.find(le=>le.fd===P);if(!O)return qe;const Q=vs.encode(O.virtualPath),ce=Math.min(Q.length,F);return L().set(Q.subarray(0,ce),D),Ae}),fd_pwrite:_e((P,D,F,j,O)=>{const Q=p.get(P);if(!Q||Q.kind!==4)return qe;const ce=T();let le=Number(j),fe=0;for(let me=0;me<F;me++){const Ve=ce.getUint32(D+me*8,!0),Ie=ce.getUint32(D+me*8+4,!0),ut=new Uint8Array(C().buffer,Ve,Ie),At=le+Ie;if(!Q.data||Q.data.length<At){const ns=new Uint8Array(At);Q.data&&ns.set(Q.data),Q.data=ns}Q.data.set(ut,le),le+=Ie,fe+=Ie}return Q.dirty=!0,ce.setUint32(O,fe,!0),Ae}),fd_read:_e((P,D,F,j)=>{const O=p.get(P);if(!O)return qe;const Q=T();if(O.kind===0)return Q.setUint32(j,0,!0),Ae;if(O.kind!==4)return qe;if(!O.data)return Q.setUint32(j,0,!0),Ae;let ce=0,le=O.offset??0;for(let fe=0;fe<F;fe++){const me=Q.getUint32(D+fe*8,!0),Ve=Q.getUint32(D+fe*8+4,!0),Ie=Math.min(Ve,O.data.length-le);if(Ie<=0)break;L().set(O.data.subarray(le,le+Ie),me),le+=Ie,ce+=Ie}return O.offset=le,Q.setUint32(j,ce,!0),Ae}),fd_readdir:_e((P,D,F,j,O)=>{const Q=p.get(P);if(!Q||Q.kind!==3&&Q.kind!==4)return qe;if(!d)return vt;let ce;try{ce=d.readdirSync(Q.path)}catch{return Ub}const le=T(),fe=L();let me=D;const Ve=D+F,Ie=Number(j);for(let ut=Ie;ut<ce.length;ut++){const At=ce[ut],ns=vs.encode(At);if(24+ns.length,me+24>Ve)break;le.setBigUint64(me,BigInt(ut+1),!0),le.setBigUint64(me+8,BigInt(ut+1),!0),le.setUint32(me+16,ns.length,!0);let qr=Ao;try{const Kt=d.statSync(Un(Q.path,At));Kt.isDirectory()?qr=Co:Kt.isSymbolicLink()&&(qr=zb)}catch{}le.setUint8(me+20,qr);const ss=Math.min(ns.length,Ve-(me+24));ss>0&&fe.set(ns.subarray(0,ss),me+24),me+=24+ss}return le.setUint32(O,me-D,!0),Ae}),fd_renumber:_e((P,D)=>{const F=p.get(P);if(!F)return qe;if(p.has(D)){const j=p.get(D);j.kind===4&&q(j)}return p.set(D,F),p.delete(P),Ae}),fd_seek:_e((P,D,F,j)=>{const O=p.get(P);if(!O)return qe;if(O.kind===0||O.kind===1||O.kind===2)return uC;if(O.kind===3)return qe;const Q=O.data?O.data.length:0;let ce=O.offset??0;const le=Number(D);switch(F){case mC:ce=le;break;case gC:ce+=le;break;case yC:ce=Q+le;break;default:return gu}return ce<0&&(ce=0),O.offset=ce,T().setBigUint64(j,BigInt(ce),!0),Ae}),fd_sync:_e(P=>{const D=p.get(P);return D?(D.kind===4&&q(D),Ae):qe}),fd_tell:_e((P,D)=>{const F=p.get(P);return!F||F.kind!==4?qe:(T().setBigUint64(D,BigInt(F.offset??0),!0),Ae)}),fd_write:_e((P,D,F,j)=>{const O=p.get(P);if(!O)return qe;const Q=T();if(O.kind===1||O.kind===2){let fe=0;for(let me=0;me<F;me++){const Ve=Q.getUint32(D+me*8,!0),Ie=Q.getUint32(D+me*8+4,!0),ut=new Uint8Array(C().buffer,Ve,Ie),At=Yb.decode(ut);O.kind===1?(V+=At,V=J(1,V)):(G+=At,G=J(2,G)),fe+=Ie}return Q.setUint32(j,fe,!0),Ae}if(O.kind!==4)return qe;let ce=0,le=O.flags&&O.flags&bu?O.data?O.data.length:0:O.offset??0;for(let fe=0;fe<F;fe++){const me=Q.getUint32(D+fe*8,!0),Ve=Q.getUint32(D+fe*8+4,!0),Ie=new Uint8Array(C().buffer,me,Ve),ut=le+Ve;if(!O.data||O.data.length<ut){const At=new Uint8Array(ut);O.data&&At.set(O.data),O.data=At}O.data.set(Ie,le),le+=Ve,ce+=Ve}return O.offset=le,O.dirty=!0,Q.setUint32(j,ce,!0),Ae}),path_create_directory:_e((P,D,F)=>{if(!d)return vt;const j=p.get(P);if(!j)return qe;const O=X(D,F),Q=Un(j.path,O);return d.mkdirSync(Q,{recursive:!0}),Ae}),path_filestat_get:_e((P,D,F,j,O)=>{if(!d)return vt;const Q=p.get(P);if(!Q)return qe;const ce=X(F,j),le=Un(Q.path,ce),fe=d.statSync(le),me=T();let Ve=Ao;fe.isDirectory()?Ve=Co:fe.isSymbolicLink()&&(Ve=zb);const Ie=BigInt(Math.floor(fe.mtimeMs))*BigInt(1e6),ut=BigInt(Math.floor(fe.atimeMs))*BigInt(1e6),At=BigInt(Math.floor(fe.ctimeMs))*BigInt(1e6);return me.setBigUint64(O,0n,!0),me.setBigUint64(O+8,BigInt(fe.ino??0),!0),me.setUint8(O+16,Ve),me.setBigUint64(O+24,BigInt(fe.nlink??1),!0),me.setBigUint64(O+32,BigInt(fe.size),!0),me.setBigUint64(O+40,ut,!0),me.setBigUint64(O+48,Ie,!0),me.setBigUint64(O+56,At,!0),Ae}),path_filestat_set_times:_e((P,D,F,j,O,Q,ce)=>Ae),path_link:_e((P,D,F,j,O,Q,ce)=>vt),path_open:_e((P,D,F,j,O,Q,ce,le,fe)=>{if(!d)return vt;const me=p.get(P);if(!me)return qe;const Ve=X(F,j),Ie=Un(me.path,Ve),ut=(O&hC)!==0,At=(O&dC)!==0,ns=(O&pC)!==0,qr=(O&fC)!==0;let ss=d.existsSync(Ie);if(ns&&ss)return $b;if(ut){if(!ss)if(At)d.mkdirSync(Ie,{recursive:!0});else return yu;const Ss=y++;return p.set(Ss,{kind:3,path:Ie,rights:Gb}),T().setUint32(fe,Ss,!0),Ae}let Kt;if(ss&&!qr){Kt=d.readFileSync(Ie);const Ss=new Uint8Array(Kt.length);Ss.set(Kt),Kt=Ss}else if(At||qr)ss||d.writeFileSync(Ie,new Uint8Array(0)),Kt=new Uint8Array(0);else{if(!ss)return yu;Kt=d.readFileSync(Ie);const Ss=new Uint8Array(Kt.length);Ss.set(Kt),Kt=Ss}const Mv=y++;return p.set(Mv,{kind:4,path:Ie,rights:NC,data:Kt,offset:0,dirty:!1,flags:le}),T().setUint32(fe,Mv,!0),Ae}),path_readlink:_e((P,D,F,j,O,Q)=>{if(!d||!d.readlinkSync)return vt;const ce=p.get(P);if(!ce)return qe;const le=X(D,F),fe=Un(ce.path,le),me=d.readlinkSync(fe),Ve=vs.encode(me),Ie=Math.min(Ve.length,O);return L().set(Ve.subarray(0,Ie),j),T().setUint32(Q,Ie,!0),Ae}),path_remove_directory:_e((P,D,F)=>{if(!d)return vt;const j=p.get(P);if(!j)return qe;const O=X(D,F),Q=Un(j.path,O);return d.rmdirSync(Q),Ae}),path_rename:_e((P,D,F,j,O,Q)=>{if(!d)return vt;const ce=p.get(P),le=p.get(j);if(!ce||!le)return qe;const fe=X(D,F),me=X(O,Q),Ve=Un(ce.path,fe),Ie=Un(le.path,me);return d.renameSync(Ve,Ie),Ae}),path_symlink:_e((P,D,F,j,O)=>{if(!d||!d.symlinkSync)return vt;const Q=p.get(F);if(!Q)return qe;const ce=X(P,D),le=X(j,O),fe=Un(Q.path,le);return d.symlinkSync(ce,fe),Ae}),path_unlink_file:_e((P,D,F)=>{if(!d)return vt;const j=p.get(P);if(!j)return qe;const O=X(D,F),Q=Un(j.path,O);return d.unlinkSync(Q),Ae}),poll_oneoff:_e((P,D,F,j)=>{const O=T();let Q=0;for(let ce=0;ce<F;ce++){const le=P+ce*48,fe=D+Q*32,me=O.getBigUint64(le,!0),Ve=O.getUint8(le+8);O.setBigUint64(fe,me,!0),O.setUint16(fe+8,Ae,!0),O.setUint8(fe+10,Ve),(Ve===BC||Ve===LC)&&(O.setBigUint64(fe+16,BigInt(1),!0),O.setUint16(fe+24,0,!0)),Q++}return O.setUint32(j,Q,!0),Ae}),proc_exit:_e(P=>{throw V&&(console.log(V),V=""),G&&(console.error(G),G=""),new To(P)}),proc_raise:_e(P=>vt),sched_yield:_e(()=>Ae),random_get:_e((P,D)=>{const F=new Uint8Array(C().buffer,P,D);return crypto.getRandomValues(F),Ae}),sock_recv:_e(()=>vt),sock_send:_e(()=>vt),sock_shutdown:_e(()=>vt),sock_accept:_e(()=>vt)},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(j){if(j instanceof To){if(c)return j.code;throw j}throw j}finally{V&&(console.log(V),V=""),G&&(console.error(G),G="")}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:To,WASI:Zb,default:{WASI:Zb}},Symbol.toStringTag,{value:"Module"}));function Xb(){return!1}function Jb(e){throw new Error("Single Executable Applications (SEA) are not supported in the browser")}function Qb(e){throw new Error("Single Executable Applications (SEA) are not supported in the browser")}function ev(e){throw new Error("Single Executable Applications (SEA) are not supported in the browser")}Object.freeze(Object.defineProperty({__proto__:null,default:{isSea:Xb,getAsset:Jb,getAssetAsBlob:Qb,getRawAsset:ev},getAsset:Jb,getAssetAsBlob:Qb,getRawAsset:ev,isSea:Xb},Symbol.toStringTag,{value:"Module"}));const Ys=function(){};Ys.prototype.run=function(...t){throw new Error("node:sqlite is not supported in the browser environment")},Ys.prototype.get=function(...t){throw new Error("node:sqlite is not supported in the browser environment")},Ys.prototype.all=function(...t){throw new Error("node:sqlite is not supported in the browser environment")},Ys.prototype.expandedSQL=function(){return""},Ys.prototype.sourceSQL=function(){return""};const Fr=function(t,n){if(this)throw new Error("node:sqlite is not supported in the browser environment")};Fr.prototype.close=function(){},Fr.prototype.exec=function(t){},Fr.prototype.prepare=function(t){throw new Error("node:sqlite is not supported in the browser environment")},Fr.prototype.open=function(){},Object.freeze(Object.defineProperty({__proto__:null,DatabaseSync:Fr,StatementSync:Ys,default:{DatabaseSync:Fr,StatementSync:Ys}},Symbol.toStringTag,{value:"Module"}));const $r=function(t){this&&ne.call(this)};Object.setPrototypeOf($r.prototype,ne.prototype),$r.prototype.close=function(){this.emit("close")},$r.prototype.destroy=function(t){this.emit("close")},Object.defineProperty($r.prototype,"address",{get:function(){return{address:"0.0.0.0",family:"IPv4",port:0}},configurable:!0});const Ur=function(){this&&ne.call(this)};Object.setPrototypeOf(Ur.prototype,ne.prototype),Ur.prototype.close=function(){this.emit("close")},Ur.prototype.destroy=function(t){this.emit("close")},Object.defineProperty(Ur.prototype,"destroyed",{get:function(){return!1},configurable:!0});const Io=function(){this&&ne.call(this)};Object.setPrototypeOf(Io.prototype,ne.prototype),Object.defineProperty(Io.prototype,"id",{get:function(){return 0},configurable:!0}),Object.freeze(Object.defineProperty({__proto__:null,QuicEndpoint:$r,QuicSession:Ur,QuicStream:Io,default:{QuicEndpoint:$r,QuicSession:Ur,QuicStream:Io}},Symbol.toStringTag,{value:"Module"}));const ht=function(t){if(!this)return;const n=t.message??`${tv(t.actual)} ${t.operator??"=="} ${tv(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 tv(e){try{return JSON.stringify(e)}catch{return String(e)}}function Zs(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(!Zs(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)||!Zs(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(Zs(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)||!Zs(e[r],t[r]))return!1;return!0}return!1}function _n(e,t,n){if(e)throw n instanceof Error?n:(n!==void 0&&(t.message=n),new ht(t))}function at(e,t){_n(!e,{actual:e,expected:!0,operator:"==",stackStartFn:at},t??"Value is falsy")}at.ok=function e(t,n){_n(!t,{actual:t,expected:!0,operator:"==",stackStartFn:e},n??"Value is falsy")},at.equal=function e(t,n,s){_n(t!=n,{actual:t,expected:n,operator:"==",stackStartFn:e},s)},at.notEqual=function e(t,n,s){_n(t==n,{actual:t,expected:n,operator:"!=",stackStartFn:e},s)},at.strictEqual=function e(t,n,s){_n(t!==n,{actual:t,expected:n,operator:"===",stackStartFn:e},s)},at.notStrictEqual=function e(t,n,s){_n(t===n,{actual:t,expected:n,operator:"!==",stackStartFn:e},s)},at.deepEqual=function e(t,n,s){_n(!Zs(t,n),{actual:t,expected:n,operator:"deepEqual",stackStartFn:e},s)},at.deepStrictEqual=function e(t,n,s){_n(!Zs(t,n),{actual:t,expected:n,operator:"deepStrictEqual",stackStartFn:e},s)},at.notDeepStrictEqual=function e(t,n,s){_n(Zs(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"&&nv(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"&&nv(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){_n(!n.test(t),{actual:t,expected:n,operator:"match",stackStartFn:e},s)},at.doesNotMatch=function e(t,n,s){_n(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 nv(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 $t=36,la=1,ca=26,MC=38,FC=700,sv=72,rv=128,iv="-";function av(e,t,n){let s=n?Math.floor(e/FC):e>>1;s+=Math.floor(s/t);let r=0;for(;s>($t-la)*ca>>1;)s=Math.floor(s/($t-la)),r+=$t;return Math.floor(r+($t-la+1)*s/(s+MC))}function $C(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:$t}function ov(e,t){return e+22+75*(e<26?1:0)-0}function Su(e){const t=[];let n=0,s=rv,r=sv,o=e.lastIndexOf(iv);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=$t;for(;;){if(c>=e.length)throw new RangeError("Invalid input");const x=$C(e.charCodeAt(c++));if(x>=$t)throw new RangeError("Invalid input");if(x>Math.floor((2147483647-n)/p))throw new RangeError("Overflow");n+=x*p;const k=y<=r?la:y>=r+ca?ca:y-r;if(x<k)break;if(p>Math.floor(2147483647/($t-k)))throw new RangeError("Overflow");p*=$t-k,y+=$t}const g=t.length+1;if(r=av(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 xu(e){const t=[],n=Array.from(e).map(p=>p.codePointAt(0));let s=rv,r=0,o=sv;for(const p of n)p<128&&t.push(String.fromCharCode(p));let c=t.length;const d=c;for(d>0&&t.push(iv);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=$t;for(;;){const k=x<=o?la:x>=o+ca?ca:x-o;if(g<k)break;t.push(String.fromCharCode(ov(k+(g-k)%($t-k)))),g=Math.floor((g-k)/($t-k)),x+=$t}t.push(String.fromCharCode(ov(g))),o=av(r,c+1,c===d),r=0,++c}}++r,++s}return t.join("")}function lv(e){return e.split(".").map(t=>t.startsWith("xn--")?Su(t.slice(4)):t).join(".")}function cv(e){return e.split(".").map(t=>/[^\x00-\x7E]/.test(t)?"xn--"+xu(t):t).join(".")}const uv={decode:e=>Array.from(e).map(t=>t.codePointAt(0)),encode:e=>String.fromCodePoint(...e)},dv="2.3.1";Object.freeze(Object.defineProperty({__proto__:null,decode:Su,default:{decode:Su,encode:xu,toUnicode:lv,toASCII:cv,ucs2:uv,version:dv},encode:xu,toASCII:cv,toUnicode:lv,ucs2:uv,version:dv},Symbol.toStringTag,{value:"Module"})),new Proxy({},{get(e,t){},ownKeys(){return[]},getOwnPropertyDescriptor(e,t){},has(e,t){return!1}});function UC(){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)})}),H(this,"_syncValue"),H(this,"_syncResolved",!1),H(this,"_syncRejected",!1),H(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}UC();function Eu(e){const t={};for(const n of Object.keys(e))t[n]=e[n];return t}Eu(P0),Eu(ex),Eu(GS);const hv=Symbol("Comlink.proxy"),jC=Symbol("Comlink.endpoint"),VC=Symbol("Comlink.releaseProxy"),ku=Symbol("Comlink.finalizer"),Ro=Symbol("Comlink.thrown"),pv=e=>typeof e=="object"&&e!==null||typeof e=="function",HC={canHandle:e=>pv(e)&&e[hv],serialize(e){const{port1:t,port2:n}=new MessageChannel;return mv(e,t),[n,[n]]},deserialize(e){return e.start(),yv(e)}},WC={canHandle:e=>pv(e)&&Ro 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}},fv=new Map([["proxy",HC],["throw",WC]]);function zC(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function mv(e,t=globalThis,n=["*"]){t.addEventListener("message",function s(r){if(!r||!r.data)return;if(!zC(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(Xs);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]]=Xs(r.data.value),y=!0;break;case"APPLY":y=x.apply(g,p);break;case"CONSTRUCT":{const k=new x(...p);y=XC(k)}break;case"ENDPOINT":{const{port1:k,port2:C}=new MessageChannel;mv(e,C),y=ZC(k,[k])}break;case"RELEASE":y=void 0;break;default:return}}catch(g){y={value:g,[Ro]:0}}Promise.resolve(y).catch(g=>({value:g,[Ro]:0})).then(g=>{const[x,k]=No(g);t.postMessage(Object.assign(Object.assign({},x),{id:o}),k),c==="RELEASE"&&(t.removeEventListener("message",s),gv(t),ku in e&&typeof e[ku]=="function"&&e[ku]())}).catch(g=>{const[x,k]=No({value:new TypeError("Unserializable return value"),[Ro]:0});t.postMessage(Object.assign(Object.assign({},x),{id:o}),k)})}),t.start&&t.start()}function qC(e){return e.constructor.name==="MessagePort"}function gv(e){qC(e)&&e.close()}function yv(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)}}),Cu(e,n,[],t)}function Po(e){if(e)throw new Error("Proxy has been released and is not useable")}function _v(e){return jr(e,new Map,{type:"RELEASE"}).then(()=>{gv(e)})}const Do=new WeakMap,Oo="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(Do.get(e)||0)-1;Do.set(e,t),t===0&&_v(e)});function GC(e,t){const n=(Do.get(t)||0)+1;Do.set(t,n),Oo&&Oo.register(e,t,e)}function KC(e){Oo&&Oo.unregister(e)}function Cu(e,t,n=[],s=function(){}){let r=!1;const o=new Proxy(s,{get(c,d){if(Po(r),d===VC)return()=>{KC(o),_v(e),t.clear(),r=!0};if(d==="then"){if(n.length===0)return{then:()=>o};const p=jr(e,t,{type:"GET",path:n.map(y=>y.toString())}).then(Xs);return p.then.bind(p)}return Cu(e,t,[...n,d])},set(c,d,p){Po(r);const[y,g]=No(p);return jr(e,t,{type:"SET",path:[...n,d].map(x=>x.toString()),value:y},g).then(Xs)},apply(c,d,p){Po(r);const y=n[n.length-1];if(y===jC)return jr(e,t,{type:"ENDPOINT"}).then(Xs);if(y==="bind")return Cu(e,t,n.slice(0,-1));const[g,x]=bv(p);return jr(e,t,{type:"APPLY",path:n.map(k=>k.toString()),argumentList:g},x).then(Xs)},construct(c,d){Po(r);const[p,y]=bv(d);return jr(e,t,{type:"CONSTRUCT",path:n.map(g=>g.toString()),argumentList:p},y).then(Xs)}});return GC(o,e),o}function YC(e){return Array.prototype.concat.apply([],e)}function bv(e){const t=e.map(No);return[t.map(n=>n[0]),YC(t.map(n=>n[1]))]}const vv=new WeakMap;function ZC(e,t){return vv.set(e,t),e}function XC(e){return Object.assign(e,{[hv]:!0})}function No(e){for(const[t,n]of fv)if(n.canHandle(e)){const[s,r]=n.serialize(e);return[{type:"HANDLER",name:t,value:s},r]}return[{type:"RAW",value:e},vv.get(e)||[]]}function Xs(e){switch(e.type){case"HANDLER":return fv.get(e.name).deserialize(e.value);case"RAW":return e.value}}function jr(e,t,n,s){return new Promise(r=>{const o=JC();t.set(o,r),e.start&&e.start(),e.postMessage(Object.assign({id:o},n),s)})}function JC(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}A0=class extends ne{constructor(e,t){super(),H(this,"pid"),H(this,"worker"),H(this,"command"),H(this,"args"),H(this,"parentPid"),H(this,"_state","starting"),H(this,"_exitCode"),H(this,"_stdout",""),H(this,"_stderr",""),H(this,"_exitHoldCount",0),H(this,"_deferredExit",null),H(this,"_shellDoneHoldCount",0),H(this,"_deferredShellDone",null),H(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 QC=`"use strict";
39
101
  (() => {
40
102
  var __create = Object.create;
41
103
  var __defProp = Object.defineProperty;
@@ -46249,13 +46311,13 @@ comlink/dist/esm/comlink.mjs:
46249
46311
  * SPDX-License-Identifier: Apache-2.0
46250
46312
  *)
46251
46313
  */
46252
- `;Ko=function(){try{return typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"}catch{return!1}};const Zs=264,la=0,No=4,Bo=8,ku=12,Ur=16,_v=248,Lo=1,bv=2,Xs=16,Cu=16384,ZC=Cu*Zs,jr=Xs+ZC,XC=64*1024*1024;S0=class{constructor(e=XC){if(V(this,"_buffer"),V(this,"_view"),V(this,"_int32"),V(this,"_uint8"),V(this,"_pathEncoder",new TextEncoder),V(this,"_pathDecoder",new TextDecoder),!Ko())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>=Cu||jr+s+t.byteLength>this._buffer.byteLength)return!1;const o=s;this._uint8.set(t,jr+o);const c=Xs+n*Zs;this._view.setUint32(c+la,Lo),this._view.setUint32(c+No,o),this._view.setUint32(c+Bo,t.byteLength),this._view.setUint32(c+ku,Date.now()/1e3|0);const d=this._pathEncoder.encode(e),p=Math.min(d.byteLength,_v-1);return this._uint8.set(d.subarray(0,p),c+Ur),this._uint8[c+Ur+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>=Cu)return!1;if(this._findEntry(e)!==-1)return!0;const n=Xs+t*Zs;this._view.setUint32(n+la,Lo|bv),this._view.setUint32(n+No,0),this._view.setUint32(n+Bo,0),this._view.setUint32(n+ku,Date.now()/1e3|0);const s=this._pathEncoder.encode(e),r=Math.min(s.byteLength,_v-1);return this._uint8.set(s.subarray(0,r),n+Ur),this._uint8[n+Ur+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=Xs+t*Zs;return this._view.setUint32(n+la,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=Xs+t*Zs,s=this._view.getUint32(n+la);if(!(s&Lo)||s&bv)return null;const r=this._view.getUint32(n+No),o=this._view.getUint32(n+Bo);return new Uint8Array(this._uint8.slice(jr+r,jr+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=Xs+s*Zs;if(!(this._view.getUint32(r+la)&Lo))continue;let c=!0;for(let d=0;d<n.byteLength;d++)if(this._uint8[r+Ur+d]!==n[d]){c=!1;break}if(c&&this._uint8[r+Ur+n.byteLength]===0)return s}return-1}_updateEntry(e,t,n){if(jr+n+t.byteLength>this._buffer.byteLength)return!1;const s=Xs+e*Zs,r=n;return this._uint8.set(t,jr+r),this._view.setUint32(s+No,r),this._view.setUint32(s+Bo,t.byteLength),this._view.setUint32(s+ku,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 Fn=4096,Au=64,JC=0,QC=1,eA=2,tA=Au*Fn*4+4,nA=Au*Fn;x0=class{constructor(e=tA){if(V(this,"_buffer"),V(this,"_int32"),V(this,"_uint8"),!Ko())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<Au;t++)Atomics.store(this._int32,t*Fn,JC);Atomics.store(this._int32,nA,0)}get buffer(){return this._buffer}writeResult(e,t,n){const s=e*Fn;Atomics.store(this._int32,s+1,t);const o=new TextEncoder().encode(n),c=(Fn-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,QC),Atomics.notify(this._int32,s)}writeError(e,t,n){const s=e*Fn;Atomics.store(this._int32,s+1,t);const o=new TextEncoder().encode(n),c=(Fn-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,eA),Atomics.notify(this._int32,s)}};const Tu=10,vv=50;fa=(a=class extends se{constructor(e){super(),V(this,"_processes",new Map),V(this,"_nextPid",100),V(this,"_volume"),V(this,"_vfsBridge",null),V(this,"_sharedBuffer",null),V(this,"_syncBuffer",null),V(this,"_serverPorts",new Map),V(this,"_childPids",new Map),V(this,"_httpCallbacks",new Map),V(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>=vv)throw new Error(`Process limit exceeded (max ${vv})`);if(e.parentPid!==void 0){let d=0,p=e.parentPid;for(;p!==void 0&&d<Tu;){const y=this._processes.get(p);p=y==null?void 0:y.parentPid,d++}if(d>=Tu)throw new Error(`Process tree depth limit exceeded (max ${Tu})`)}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 E0(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(!fa._workerBlobUrl){const e=new Blob([YC],{type:"application/javascript"});fa._workerBlobUrl=URL.createObjectURL(e)}return new Worker(fa._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=(Fn-3)*4,r=o=>{try{const c=new Int32Array(this._syncBuffer),d=t.syncSlot*Fn;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*Fn,E=g.encode(o.stdout),C=Math.min(E.byteLength,s);Atomics.store(y,x+1,d),Atomics.store(y,x+2,C);const T=new Uint8Array(this._syncBuffer),N=(x+3)*4;T.set(E.subarray(0,C),N),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{}}},V(a,"_workerBlobUrl",null),a);const Iu=4*1024*1024;k0=class{constructor(e){V(this,"_volume"),V(this,"_broadcaster",null),V(this,"_sharedVFS",null),V(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<=Iu)return[{chunkIndex:0,totalChunks:1,data:e.data,manifest:e.manifest}];const n=[],s=new Uint8Array(e.data),r=Math.ceil(t/Iu);let o=0;for(let c=0;c<r;c++){const d=Math.min(o+Iu,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 sA=k;function rA(e){return e.replace(/\//g,"%2f")}class Vr{constructor(t={}){V(this,"baseUrl"),V(this,"metadataStore"),this.baseUrl=(t.endpoint||sA).replace(/\/+$/,""),this.metadataStore=t.metadataCache||new Map}async fetchManifest(t){const n=this.metadataStore.get(t);if(n)return n;const s=`${this.baseUrl}/${rA(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:Vr,default:Vr},Symbol.toStringTag,{value:"Module"}));const iA=/^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/;function ca(e){const t=e.match(iA);return t?{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),prerelease:t[4]}:null}function Wt(e,t){const n=ca(e),s=ca(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 Mo(e,t){const n=ca(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=>Mo(e,r.trim()));if(t.includes(" - ")){const[r,o]=t.split(" - ").map(c=>c.trim());return Wt(e,r)>=0&&Wt(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"),aA(e,c,d)});if(t.startsWith("^")){const r=Js(t.slice(1)),o=ca(r);return!o||n.major!==o.major||o.major===0&&(o.minor!==0&&n.minor!==o.minor||o.minor===0&&n.minor!==0)?!1:Wt(e,r)>=0}if(t.startsWith("~")){const r=Js(t.slice(1)),o=ca(r);return o?n.major===o.major&&n.minor===o.minor&&Wt(e,r)>=0:!1}if(t.startsWith(">="))return Wt(e,Js(t.slice(2).trim()))>=0;if(t.startsWith(">"))return Wt(e,Js(t.slice(1).trim()))>0;if(t.startsWith("<="))return Wt(e,Js(t.slice(2).trim()))<=0;if(t.startsWith("<"))return Wt(e,Js(t.slice(1).trim()))<0;if(t.startsWith("="))return Wt(e,Js(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=>Mo(e,r));if(/^\d+\.\d+\.\d+/.test(t)){const r=t.match(/^(\d+\.\d+\.\d+(?:-[^\s]+)?)/);if(r)return Wt(e,r[1])===0}return Wt(e,t)===0}function Js(e){const t=e.replace(/[xX*]/g,"0").split(".");for(;t.length<3;)t.push("0");return t.join(".")}function aA(e,t,n){const s=Wt(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 oA(e,t){const n=[...e].sort((s,r)=>Wt(r,s));for(const s of n)if(Mo(s,t))return s;return null}function lA(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 cA(e,t="latest",n={}){const r={registry:n.registry||new Vr,completed:new Map,inFlight:new Set,config:n};return await Ru(e,t,r),r.completed}async function uA(e,t={}){const s={registry:t.registry||new Vr,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 Ru(o,c,s);return s.completed}async function Ru(e,t,n){var s,r;const{registry:o,completed:c,inFlight:d,config:p}=n,y=lA(t),g=e,x=(y==null?void 0:y.realName)??e;t=(y==null?void 0:y.realRange)??t;const E=`${g}@${t}`;if(!d.has(E)){if(c.has(g)){const C=c.get(g);return Mo(C.version,t),void 0}d.add(E);try{(s=p.onProgress)==null||s.call(p,`Resolving ${x}@${t}`);const C=await o.fetchManifest(x),T=Object.keys(C.versions);let N;if(t==="latest"||t==="*")N=C["dist-tags"].latest;else if(C["dist-tags"][t])N=C["dist-tags"][t];else{const W=oA(T,t);if(!W)throw new Error(`Could not find a version of "${x}" matching "${t}"`);N=W}const j=C.versions[N];c.set(g,{name:g,version:N,tarballUrl:j.dist.tarball,dependencies:j.dependencies||{},shasum:j.dist.shasum});const q={};if(j.peerDependencies){const W=j.peerDependenciesMeta||{};for(const[F,ne]of Object.entries(j.peerDependencies))(r=W[F])!=null&&r.optional||(q[F]=ne)}if(j.dependencies&&Object.assign(q,j.dependencies),j.optionalDependencies)if(p.optionalDependencies)Object.assign(q,j.optionalDependencies);else for(const[W,F]of Object.entries(j.optionalDependencies))W.includes("wasm32-wasi")&&(q[W]=F);const J=Object.entries(q),Y=8;for(let W=0;W<J.length;W+=Y){const F=J.slice(W,W+Y);await Promise.all(F.map(([ne,P])=>Ru(ne,P,n)))}}finally{d.delete(E)}}}const dA=`
46314
+ `;Yo=function(){try{return typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"}catch{return!1}};const Js=264,ua=0,Bo=4,Lo=8,Au=12,Vr=16,wv=248,Mo=1,Sv=2,Qs=16,Tu=16384,eA=Tu*Js,Hr=Qs+eA,tA=64*1024*1024;k0=class{constructor(e=tA){if(H(this,"_buffer"),H(this,"_view"),H(this,"_int32"),H(this,"_uint8"),H(this,"_pathEncoder",new TextEncoder),H(this,"_pathDecoder",new TextDecoder),!Yo())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>=Tu||Hr+s+t.byteLength>this._buffer.byteLength)return!1;const o=s;this._uint8.set(t,Hr+o);const c=Qs+n*Js;this._view.setUint32(c+ua,Mo),this._view.setUint32(c+Bo,o),this._view.setUint32(c+Lo,t.byteLength),this._view.setUint32(c+Au,Date.now()/1e3|0);const d=this._pathEncoder.encode(e),p=Math.min(d.byteLength,wv-1);return this._uint8.set(d.subarray(0,p),c+Vr),this._uint8[c+Vr+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>=Tu)return!1;if(this._findEntry(e)!==-1)return!0;const n=Qs+t*Js;this._view.setUint32(n+ua,Mo|Sv),this._view.setUint32(n+Bo,0),this._view.setUint32(n+Lo,0),this._view.setUint32(n+Au,Date.now()/1e3|0);const s=this._pathEncoder.encode(e),r=Math.min(s.byteLength,wv-1);return this._uint8.set(s.subarray(0,r),n+Vr),this._uint8[n+Vr+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=Qs+t*Js;return this._view.setUint32(n+ua,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=Qs+t*Js,s=this._view.getUint32(n+ua);if(!(s&Mo)||s&Sv)return null;const r=this._view.getUint32(n+Bo),o=this._view.getUint32(n+Lo);return new Uint8Array(this._uint8.slice(Hr+r,Hr+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=Qs+s*Js;if(!(this._view.getUint32(r+ua)&Mo))continue;let c=!0;for(let d=0;d<n.byteLength;d++)if(this._uint8[r+Vr+d]!==n[d]){c=!1;break}if(c&&this._uint8[r+Vr+n.byteLength]===0)return s}return-1}_updateEntry(e,t,n){if(Hr+n+t.byteLength>this._buffer.byteLength)return!1;const s=Qs+e*Js,r=n;return this._uint8.set(t,Hr+r),this._view.setUint32(s+Bo,r),this._view.setUint32(s+Lo,t.byteLength),this._view.setUint32(s+Au,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 jn=4096,Iu=64,nA=0,sA=1,rA=2,iA=Iu*jn*4+4,aA=Iu*jn;C0=class{constructor(e=iA){if(H(this,"_buffer"),H(this,"_int32"),H(this,"_uint8"),!Yo())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<Iu;t++)Atomics.store(this._int32,t*jn,nA);Atomics.store(this._int32,aA,0)}get buffer(){return this._buffer}writeResult(e,t,n){const s=e*jn;Atomics.store(this._int32,s+1,t);const o=new TextEncoder().encode(n),c=(jn-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,sA),Atomics.notify(this._int32,s)}writeError(e,t,n){const s=e*jn;Atomics.store(this._int32,s+1,t);const o=new TextEncoder().encode(n),c=(jn-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,rA),Atomics.notify(this._int32,s)}};const Ru=10,xv=50;ga=(a=class extends ne{constructor(e){super(),H(this,"_processes",new Map),H(this,"_nextPid",100),H(this,"_volume"),H(this,"_vfsBridge",null),H(this,"_sharedBuffer",null),H(this,"_syncBuffer",null),H(this,"_serverPorts",new Map),H(this,"_childPids",new Map),H(this,"_httpCallbacks",new Map),H(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>=xv)throw new Error(`Process limit exceeded (max ${xv})`);if(e.parentPid!==void 0){let d=0,p=e.parentPid;for(;p!==void 0&&d<Ru;){const y=this._processes.get(p);p=y==null?void 0:y.parentPid,d++}if(d>=Ru)throw new Error(`Process tree depth limit exceeded (max ${Ru})`)}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 A0(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(!ga._workerBlobUrl){const e=new Blob([QC],{type:"application/javascript"});ga._workerBlobUrl=URL.createObjectURL(e)}return new Worker(ga._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=(jn-3)*4,r=o=>{try{const c=new Int32Array(this._syncBuffer),d=t.syncSlot*jn;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*jn,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{}}},H(a,"_workerBlobUrl",null),a);const Pu=4*1024*1024;T0=class{constructor(e){H(this,"_volume"),H(this,"_broadcaster",null),H(this,"_sharedVFS",null),H(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<=Pu)return[{chunkIndex:0,totalChunks:1,data:e.data,manifest:e.manifest}];const n=[],s=new Uint8Array(e.data),r=Math.ceil(t/Pu);let o=0;for(let c=0;c<r;c++){const d=Math.min(o+Pu,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 oA=E;function lA(e){return e.replace(/\//g,"%2f")}class Wr{constructor(t={}){H(this,"baseUrl"),H(this,"metadataStore"),this.baseUrl=(t.endpoint||oA).replace(/\/+$/,""),this.metadataStore=t.metadataCache||new Map}async fetchManifest(t){const n=this.metadataStore.get(t);if(n)return n;const s=`${this.baseUrl}/${lA(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:Wr,default:Wr},Symbol.toStringTag,{value:"Module"}));const cA=/^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/;function da(e){const t=e.match(cA);return t?{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),prerelease:t[4]}:null}function Gt(e,t){const n=da(e),s=da(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 Fo(e,t){const n=da(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=>Fo(e,r.trim()));if(t.includes(" - ")){const[r,o]=t.split(" - ").map(c=>c.trim());return Gt(e,r)>=0&&Gt(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"),uA(e,c,d)});if(t.startsWith("^")){const r=er(t.slice(1)),o=da(r);return!o||n.major!==o.major||o.major===0&&(o.minor!==0&&n.minor!==o.minor||o.minor===0&&n.minor!==0)?!1:Gt(e,r)>=0}if(t.startsWith("~")){const r=er(t.slice(1)),o=da(r);return o?n.major===o.major&&n.minor===o.minor&&Gt(e,r)>=0:!1}if(t.startsWith(">="))return Gt(e,er(t.slice(2).trim()))>=0;if(t.startsWith(">"))return Gt(e,er(t.slice(1).trim()))>0;if(t.startsWith("<="))return Gt(e,er(t.slice(2).trim()))<=0;if(t.startsWith("<"))return Gt(e,er(t.slice(1).trim()))<0;if(t.startsWith("="))return Gt(e,er(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=>Fo(e,r));if(/^\d+\.\d+\.\d+/.test(t)){const r=t.match(/^(\d+\.\d+\.\d+(?:-[^\s]+)?)/);if(r)return Gt(e,r[1])===0}return Gt(e,t)===0}function er(e){const t=e.replace(/[xX*]/g,"0").split(".");for(;t.length<3;)t.push("0");return t.join(".")}function uA(e,t,n){const s=Gt(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 dA(e,t){const n=[...e].sort((s,r)=>Gt(r,s));for(const s of n)if(Fo(s,t))return s;return null}function hA(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 pA(e,t="latest",n={}){const r={registry:n.registry||new Wr,completed:new Map,inFlight:new Set,config:n};return await Du(e,t,r),r.completed}async function fA(e,t={}){const s={registry:t.registry||new Wr,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 Du(o,c,s);return s.completed}async function Du(e,t,n){var s,r;const{registry:o,completed:c,inFlight:d,config:p}=n,y=hA(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 Fo(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 q=dA(T,t);if(!q)throw new Error(`Could not find a version of "${x}" matching "${t}"`);L=q}const V=C.versions[L];c.set(g,{name:g,version:L,tarballUrl:V.dist.tarball,dependencies:V.dependencies||{},shasum:V.dist.shasum});const G={};if(V.peerDependencies){const q=V.peerDependenciesMeta||{};for(const[$,te]of Object.entries(V.peerDependencies))(r=q[$])!=null&&r.optional||(G[$]=te)}if(V.dependencies&&Object.assign(G,V.dependencies),V.optionalDependencies)if(p.optionalDependencies)Object.assign(G,V.optionalDependencies);else for(const[q,$]of Object.entries(V.optionalDependencies))q.includes("wasm32-wasi")&&(G[q]=$);const J=Object.entries(G),X=8;for(let q=0;q<J.length;q+=X){const $=J.slice(q,q+X);await Promise.all($.map(([te,P])=>Du(te,P,n)))}}finally{d.delete(k)}}}const mA=`
46253
46315
  "use strict";
46254
46316
 
46255
46317
  // CDN URLs (injected at build time)
46256
46318
 
46257
- const ESBUILD_ESM_URL = "${tf}";
46258
- const ESBUILD_WASM_URL = "${ac}";
46319
+ const ESBUILD_ESM_URL = "${rf}";
46320
+ const ESBUILD_WASM_URL = "${lc}";
46259
46321
  const PAKO_URL = "${R}";
46260
46322
 
46261
46323
  const cdnImport = new Function("url", "return import(url)");
@@ -46586,21 +46648,28 @@ const endpoint = {
46586
46648
  };
46587
46649
 
46588
46650
  miniExpose(endpoint);
46589
- `;let Hr=null;function hA(){try{if(!Hr){const e=new Blob([dA],{type:"application/javascript"});Hr=URL.createObjectURL(e)}return new Worker(Hr)}catch{return null}}function pA(){Hr&&(URL.revokeObjectURL(Hr),Hr=null)}class fA{constructor(t={}){V(this,"workers",[]),V(this,"waitQueue",[]),V(this,"nextId",0),V(this,"config"),V(this,"idleTimer",null),V(this,"disposed",!1),V(this,"broken",!1);const n=typeof navigator<"u"&&navigator.hardwareConcurrency||4;this.config={minWorkers:t.minWorkers??1,maxWorkers:t.maxWorkers??Math.min(n,Q.MAX_WORKERS_CAP),idleTimeoutMs:t.idleTimeoutMs??Ss.WORKER_IDLE_TIMEOUT,warmUpOnCreate:t.warmUpOnCreate??!0},this.idleTimer=setInterval(()=>this.reapIdle(),Ss.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(),pA()}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=hA();if(!t)return null;try{const n=fv(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=Ss.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 mA{constructor(t){V(this,"queue",[]),V(this,"pool"),V(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 Pu=(e=>(e[e.HIGH=0]="HIGH",e[e.NORMAL=1]="NORMAL",e[e.LOW=2]="LOW",e))(Pu||{});let ua=null,da=null,Fo=!1,gA;function yA(){return typeof Worker<"u"&&typeof Blob<"u"&&typeof URL<"u"&&typeof URL.createObjectURL=="function"}function _A(){if(da)return da;if(!yA())throw Fo=!0,new Error("Workers not available");return ua=new fA(gA),da=new mA(ua),da}async function bA(e){const{convertFileDirect:t,prepareTransformer:n}=await Promise.resolve().then(()=>RA);await n();const s=await t(e.source,e.filePath);return{type:"transform",id:e.id,code:s,warnings:[]}}async function vA(e){const t=await Promise.resolve().then(()=>B1),{parseTarArchive:n}=await Promise.resolve().then(()=>kA),{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 E=y.split("/").filter(Boolean);if(E.length<=e.stripComponents)continue;y=E.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 wA(e){const t=await Promise.resolve().then(()=>C0);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 wv(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`task-${Date.now()}-${Math.random().toString(36).slice(2)}`}async function Sv(e){if(Fo)return xv(e);try{return await _A().submit(e)}catch(t){return Fo||console.debug("[offload] Falling back to main thread:",t instanceof Error?t.message:t),SA(),xv(e)}}function SA(){Fo=!0,ua&&(ua.dispose(),ua=null),da=null}async function xv(e){switch(e.type){case"transform":return bA(e);case"extract":return vA(e);case"build":return wA(e);default:throw new Error(`Unknown task type: ${e.type}`)}}function $o(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 Ev(e,t,n){const s=$o(e,t,n).trim();return parseInt(s,8)||0}function xA(e){switch(e){case"0":case"\0":case"":return"file";case"5":return"directory";case"1":case"2":return"link";default:return"other"}}function*EA(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=$o(s,0,100);if(!o)continue;const c=Ev(s,100,8),d=Ev(s,124,12),p=String.fromCharCode(s[156]),y=$o(s,157,100),g=$o(s,345,155),x=g?`${g}/${o}`:o,E=xA(p);let C;E==="file"&&(C=d>0?e.slice(n,n+d):new Uint8Array(0),d>0&&(n+=Math.ceil(d/512)*512)),yield{filepath:x,kind:E,byteSize:d,fileMode:c,payload:C,linkDestination:E==="link"?y:void 0}}}async function kv(e,t,n,s={}){var r,o;(r=s.onProgress)==null||r.call(s,`Fetching ${e}...`);const c=await Sv({type:"extract",id:wv(),tarballUrl:e,stripComponents:s.stripComponents??1,priority:Pu.NORMAL,expectedShasum:s.expectedShasum}),d=[];for(const p of c.files){if(s.filter&&!s.filter(p.path))continue;const y=lt(n,p.path),g=tr(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 kA=Object.freeze(Object.defineProperty({__proto__:null,downloadAndExtract:kv,parseTarArchive:EA},Symbol.toStringTag,{value:"Module"})),Du=typeof window<"u";async function Ou(){if(Du&&!window.__esbuildEngine)return window.__esbuildReady||(window.__esbuildReady=(async()=>{try{const e=await za(tf),t=e.default||e;try{await t.initialize({wasmURL:ac})}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 CA(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 Cv(e,t){return e.endsWith(".jsx")?"jsx":e.endsWith(".ts")?"ts":e.endsWith(".tsx")?"tsx":e.endsWith(".mjs")?"js":CA(t)?"jsx":"js"}async function Av(e,t){if(!Du)return e;let s=(await Sv({type:"transform",id:wv(),source:e,filePath:t,options:{loader:Cv(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:Pu.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 AA(e,t){if(!Du)return e;window.__esbuildEngine||await Ou();const n=window.__esbuildEngine;if(!n)throw new Error("esbuild engine not available");const s=Cv(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 TA(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 Nu(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 Bu(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 Tv(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(...Tv(e,r)):(s.endsWith(".js")||s.endsWith(".mjs")||s.endsWith(".jsx"))&&n.push(r)}catch{}}}catch{}return n}function IA(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 Iv(e,t,n){let s=0;const r=Tv(e,t);n==null||n(` Converting ${r.length} files in ${t}...`);const o=IA(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){Nu(g)&&(e.writeFileSync(y,Bu(g)),s++);return}if(y.endsWith(".mjs")){Nu(g)&&(e.writeFileSync(y,Bu(g)),s++);return}if(TA(y,g)){const x=await Av(g,y);e.writeFileSync(y,x),s++}else Nu(g)&&(e.writeFileSync(y,Bu(g)),s++)}catch{}}))}return s}const RA=Object.freeze(Object.defineProperty({__proto__:null,convertFile:Av,convertFileDirect:AA,convertPackage:Iv,prepareTransformer:Ou},Symbol.toStringTag,{value:"Module"}));function PA(e,t){return t?typeof t=="string"?{[e.includes("/")?e.split("/").pop():e]:t}:t:{}}function Rv(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 Pv=!1;Zo=class{constructor(e,t={}){V(this,"vol"),V(this,"registryClient"),V(this,"workingDir"),V(this,"_snapshotCache"),this.vol=e,this.registryClient=new Vr(t),this.workingDir=t.cwd||"/",this._snapshotCache=t.snapshotCache??null}async install(e,t,n={}){const{onProgress:s}=n,r=Rv(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 cA(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||lt(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?pe(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 E of x)if(E.path.includes("/node_modules/")){if(E.kind==="directory")this.vol.existsSync(E.path)||this.vol.mkdirSync(E.path,{recursive:!0});else if(E.kind==="file"&&E.data){const C=E.path.substring(0,E.path.lastIndexOf("/"))||"/";C!=="/"&&!this.vol.existsSync(C)&&this.vol.mkdirSync(C,{recursive:!0}),this.vol.writeFileSync(E.path,m(E.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 uA(o,d),y=await this.materializePackages(p,t);if(this._snapshotCache&&c&&y.length>0)try{const x={entries:this.vol.toSnapshot().entries.filter(E=>E.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=lt(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=lt(e,s),o=this.vol.readdirSync(r);for(const c of o){const d=lt(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=lt(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=lt(this.workingDir,"node_modules");this.vol.mkdirSync(r,{recursive:!0});const o=[];for(const[p,y]of e){const g=lt(r,p),x=lt(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&&!Pv&&(typeof Worker>"u"&&(n==null||n("Preparing module transformer..."),await Ou()),Pv=!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:E})=>{if(n==null||n(` Fetching ${g}@${x.version}...`),await kv(x.tarballUrl,this.vol,E,{stripComponents:1,expectedShasum:x.shasum}),c)try{const C=await Iv(this.vol,E,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,E),s.push(g)}))}return this.writeLockFile(e),s}createBinStubs(e,t,n){try{const s=lt(n,"package.json");if(!this.vol.existsSync(s))return;const r=JSON.parse(this.vol.readFileSync(s,"utf8")),o=PA(t,r.bin),c=lt(e,".bin");for(const[d,p]of Object.entries(o)){this.vol.mkdirSync(c,{recursive:!0});const y=lt(n,p);this.vol.writeFileSync(lt(c,d),`node "${y}" "$@"
46590
- `)}}catch{}}writeLockFile(e){const t={};for(const[s,r]of e)t[s]={version:r.version,resolved:r.tarballUrl};const n=lt(this.workingDir,"node_modules",".package-lock.json");this.vol.writeFileSync(n,JSON.stringify(t,null,2))}async patchManifest(e,t,n){const s=lt(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))}},I0=async function(e,t,n){return new Zo(t).install(e,void 0,n)},Object.freeze(Object.defineProperty({__proto__:null,DependencyInstaller:Zo,RegistryClient:Vr,install:I0,splitSpecifier:Rv},Symbol.toStringTag,{value:"Module"}));const DA=new TextEncoder;rd=(i=class extends se{constructor(e={}){super(),V(this,"registry",new Map),V(this,"baseUrl"),V(this,"opts"),V(this,"channel",null),V(this,"swReady",!1),V(this,"heartbeat",null),V(this,"_processManager",null),V(this,"_workerWsConns",new Map),V(this,"_previewScript",null),V(this,"_swAuthToken",null),V(this,"_wsBridgeToken",null),V(this,"_wsBridge",null),V(this,"_wsConns",new Map),this.opts=e,this.baseUrl=typeof location<"u"?e.baseUrl||`${location.protocol}//${location.host}`:e.baseUrl||"http://localhost",bi((t,n)=>this.register(n,t)),vi(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:H.from(`No server on port ${e}`)};try{const c=r?H.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:H.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"})},Ss.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(rd.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:E,originalUrl:C}=d;let T=d.url;const N=this._normalizeSwUrl(T,g);N!==null&&N!==T&&(T=N);try{if(E)await this.handleStreaming(c,p,y,T,g,x);else{const j=await this.handleRequest(p,y,T,g,x);if(j.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 W=await fetch(C),F=await W.arrayBuffer(),ne={};W.headers.forEach((D,L)=>{ne[L]=D});const P=F.byteLength>0?h(new Uint8Array(F)):"";(t=this.channel)==null||t.port1.postMessage({type:"response",id:c,data:{statusCode:W.status,statusMessage:W.statusText||"OK",headers:ne,bodyBase64:P}});return}}catch{}let q="";if((n=j.body)!=null&&n.length){const J=j.body instanceof Uint8Array?j.body:new Uint8Array(0);q=h(J)}(s=this.channel)==null||s.port1.postMessage({type:"response",id:c,data:{statusCode:j.statusCode,statusMessage:j.statusMessage,headers:j.headers,bodyBase64:q}})}}catch(j){(r=this.channel)==null||r.port1.postMessage({type:"response",id:c,error:j instanceof Error?j.message:"Unknown error"})}}}async handleStreaming(e,t,n,s,r,o){var c,d,p,y,g,x;const E=this.registry.get(t);if(!E){(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=E.server;if(typeof C.handleStreamingRequest=="function"){const T=o?H.from(new Uint8Array(o)):void 0;await C.handleStreamingRequest(n,s,r,T,(N,j,q)=>{var J;(J=this.channel)==null||J.port1.postMessage({type:"stream-start",id:e,data:{statusCode:N,statusMessage:j,headers:q}})},N=>{var j;const q=typeof N=="string"?DA.encode(N):N;(j=this.channel)==null||j.port1.postMessage({type:"stream-chunk",id:e,data:{chunkBase64:h(q)}})},()=>{var N;(N=this.channel)==null||N.port1.postMessage({type:"stream-end",id:e})})}else{const T=o?H.from(new Uint8Array(o)):void 0,N=await E.server.dispatchRequest(n,s,r,T);if((p=this.channel)==null||p.port1.postMessage({type:"stream-start",id:e,data:{statusCode:N.statusCode,statusMessage:N.statusMessage,headers:N.headers}}),(y=N.body)!=null&&y.length){const j=N.body instanceof Uint8Array?N.body:new Uint8Array(0);(g=this.channel)==null||g.port1.postMessage({type:"stream-chunk",id:e,data:{chunkBase64:h(j)}})}(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=_i(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,N)=>{const j=typeof C=="string"?H.from(C):new Uint8Array(C),q=typeof T=="function"?T:N;if(!x&&new TextDecoder().decode(j).startsWith("HTTP/1.1 101"))return x=!0,y.postMessage({kind:"ws-open",uid:e,token:this._wsBridgeToken}),q&&queueMicrotask(()=>q(null)),!0;const J=new Uint8Array(g.length+j.length);for(J.set(g,0),J.set(j,g.length),g=J;g.length>=2;){const Y=wi(g);if(!Y)break;switch(g=g.slice(Y.consumed),Y.op){case ie.TEXT:{const W=new TextDecoder().decode(Y.data);y.postMessage({kind:"ws-message",uid:e,data:W,type:"text",token:this._wsBridgeToken});break}case ie.BINARY:y.postMessage({kind:"ws-message",uid:e,data:Array.from(Y.data),type:"binary",token:this._wsBridgeToken});break;case ie.CLOSE:{const W=Y.data.length>=2?Y.data[0]<<8|Y.data[1]:1e3;y.postMessage({kind:"ws-closed",uid:e,code:W,token:this._wsBridgeToken});break}case ie.PING:p._feedData(H.from(hn(ie.PONG,Y.data,!0)));break}}return q&&queueMicrotask(()=>q(null)),!0};const E=()=>{g=new Uint8Array(0);try{p.destroy()}catch{}};this._wsConns.set(e,{socket:p,cleanup:E})}_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=ie.BINARY):(p=new TextEncoder().encode(String(t)),y=ie.TEXT);const g=hn(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=ie.BINARY):(o=new TextEncoder().encode(String(t)),c=ie.TEXT);const d=hn(c,o,!0);r.socket._feedData(H.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=hn(ie.CLOSE,o,!0);try{r.socket._feedData(H.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})}}},V(i,"DEBUG",!1),i);let Lu=null;A0=function(e){return Lu||(Lu=new rd(e)),Lu},O0=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)}},N0=class extends se{constructor(e=4194304){super(),V(this,"_abortController",new AbortController),V(this,"_resolve"),V(this,"_stdout",""),V(this,"_stderr",""),V(this,"_exitCode",null),V(this,"_sendStdinFn",null),V(this,"_killFn",null),V(this,"_maxOutputBytes"),V(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 OA={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"},NA=e=>`\x1B[36mnodepod\x1B[0m:\x1B[34m${e}\x1B[0m$ `;B0=class{constructor(e){V(this,"_term",null),V(this,"_fitAddon",null),V(this,"_dataDisposable",null),V(this,"_resizeHandler",null),V(this,"_lineBuffer",""),V(this,"_history",[]),V(this,"_historyIndex",-1),V(this,"_savedLine",""),V(this,"_running",!1),V(this,"_cwd","/"),V(this,"_promptFn"),V(this,"_theme"),V(this,"_opts"),V(this,"_wiring",null),this._opts=e,this._theme=e.theme??OA,this._promptFn=e.prompt??NA}_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
46591
- `);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??_e.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
46651
+ `;let zr=null;function gA(){try{if(!zr){const e=new Blob([mA],{type:"application/javascript"});zr=URL.createObjectURL(e)}return new Worker(zr)}catch{return null}}function yA(){zr&&(URL.revokeObjectURL(zr),zr=null)}class _A{constructor(t={}){H(this,"workers",[]),H(this,"waitQueue",[]),H(this,"nextId",0),H(this,"config"),H(this,"idleTimer",null),H(this,"disposed",!1),H(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??xs.WORKER_IDLE_TIMEOUT,warmUpOnCreate:t.warmUpOnCreate??!0},this.idleTimer=setInterval(()=>this.reapIdle(),xs.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(),yA()}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=gA();if(!t)return null;try{const n=yv(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=xs.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 bA{constructor(t){H(this,"queue",[]),H(this,"pool"),H(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 Ou=(e=>(e[e.HIGH=0]="HIGH",e[e.NORMAL=1]="NORMAL",e[e.LOW=2]="LOW",e))(Ou||{});let ha=null,pa=null,$o=!1,vA;function wA(){return typeof Worker<"u"&&typeof Blob<"u"&&typeof URL<"u"&&typeof URL.createObjectURL=="function"}function SA(){if(pa)return pa;if(!wA())throw $o=!0,new Error("Workers not available");return ha=new _A(vA),pa=new bA(ha),pa}async function xA(e){const{convertFileDirect:t,prepareTransformer:n}=await Promise.resolve().then(()=>NA);await n();const s=await t(e.source,e.filePath);return{type:"transform",id:e.id,code:s,warnings:[]}}async function EA(e){const t=await Promise.resolve().then(()=>$1),{parseTarArchive:n}=await Promise.resolve().then(()=>IA),{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 kA(e){const t=await Promise.resolve().then(()=>I0);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 Ev(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`task-${Date.now()}-${Math.random().toString(36).slice(2)}`}async function kv(e){if($o)return Cv(e);try{return await SA().submit(e)}catch(t){return $o||console.debug("[offload] Falling back to main thread:",t instanceof Error?t.message:t),CA(),Cv(e)}}function CA(){$o=!0,ha&&(ha.dispose(),ha=null),pa=null}async function Cv(e){switch(e.type){case"transform":return xA(e);case"extract":return EA(e);case"build":return kA(e);default:throw new Error(`Unknown task type: ${e.type}`)}}function Uo(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 Av(e,t,n){const s=Uo(e,t,n).trim();return parseInt(s,8)||0}function AA(e){switch(e){case"0":case"\0":case"":return"file";case"5":return"directory";case"1":case"2":return"link";default:return"other"}}function*TA(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=Uo(s,0,100);if(!o)continue;const c=Av(s,100,8),d=Av(s,124,12),p=String.fromCharCode(s[156]),y=Uo(s,157,100),g=Uo(s,345,155),x=g?`${g}/${o}`:o,k=AA(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 Tv(e,t,n,s={}){var r,o;(r=s.onProgress)==null||r.call(s,`Fetching ${e}...`);const c=await kv({type:"extract",id:Ev(),tarballUrl:e,stripComponents:s.stripComponents??1,priority:Ou.NORMAL,expectedShasum:s.expectedShasum}),d=[];for(const p of c.files){if(s.filter&&!s.filter(p.path))continue;const y=mt(n,p.path),g=sr(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 IA=Object.freeze(Object.defineProperty({__proto__:null,downloadAndExtract:Tv,parseTarArchive:TA},Symbol.toStringTag,{value:"Module"})),Nu=typeof window<"u";async function Bu(){if(Nu&&!window.__esbuildEngine)return window.__esbuildReady||(window.__esbuildReady=(async()=>{try{const e=await qa(rf),t=e.default||e;try{await t.initialize({wasmURL:lc})}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 RA(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 Iv(e,t){return e.endsWith(".jsx")?"jsx":e.endsWith(".ts")?"ts":e.endsWith(".tsx")?"tsx":e.endsWith(".mjs")?"js":RA(t)?"jsx":"js"}async function Rv(e,t){if(!Nu)return e;let s=(await kv({type:"transform",id:Ev(),source:e,filePath:t,options:{loader:Iv(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:Ou.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 PA(e,t){if(!Nu)return e;window.__esbuildEngine||await Bu();const n=window.__esbuildEngine;if(!n)throw new Error("esbuild engine not available");const s=Iv(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 DA(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 Lu(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 Mu(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 Pv(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(...Pv(e,r)):(s.endsWith(".js")||s.endsWith(".mjs")||s.endsWith(".jsx"))&&n.push(r)}catch{}}}catch{}return n}function OA(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 Dv(e,t,n){let s=0;const r=Pv(e,t);n==null||n(` Converting ${r.length} files in ${t}...`);const o=OA(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){Lu(g)&&(e.writeFileSync(y,Mu(g)),s++);return}if(y.endsWith(".mjs")){Lu(g)&&(e.writeFileSync(y,Mu(g)),s++);return}if(DA(y,g)){const x=await Rv(g,y);e.writeFileSync(y,x),s++}else Lu(g)&&(e.writeFileSync(y,Mu(g)),s++)}catch{}}))}return s}const NA=Object.freeze(Object.defineProperty({__proto__:null,convertFile:Rv,convertFileDirect:PA,convertPackage:Dv,prepareTransformer:Bu},Symbol.toStringTag,{value:"Module"}));function BA(e,t){return t?typeof t=="string"?{[e.includes("/")?e.split("/").pop():e]:t}:t:{}}function Ov(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 Nv=!1;Xo=class{constructor(e,t={}){H(this,"vol"),H(this,"registryClient"),H(this,"workingDir"),H(this,"_snapshotCache"),this.vol=e,this.registryClient=new Wr(t),this.workingDir=t.cwd||"/",this._snapshotCache=t.snapshotCache??null}async install(e,t,n={}){const{onProgress:s}=n,r=Ov(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 pA(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||mt(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?be(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 fA(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=mt(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=mt(e,s),o=this.vol.readdirSync(r);for(const c of o){const d=mt(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=mt(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=mt(this.workingDir,"node_modules");this.vol.mkdirSync(r,{recursive:!0});const o=[];for(const[p,y]of e){const g=mt(r,p),x=mt(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&&!Nv&&(typeof Worker>"u"&&(n==null||n("Preparing module transformer..."),await Bu()),Nv=!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 Tv(x.tarballUrl,this.vol,k,{stripComponents:1,expectedShasum:x.shasum}),c)try{const C=await Dv(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=mt(n,"package.json");if(!this.vol.existsSync(s))return;const r=JSON.parse(this.vol.readFileSync(s,"utf8")),o=BA(t,r.bin),c=mt(e,".bin");for(const[d,p]of Object.entries(o)){this.vol.mkdirSync(c,{recursive:!0});const y=mt(n,p);this.vol.writeFileSync(mt(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=mt(this.workingDir,"node_modules",".package-lock.json");this.vol.writeFileSync(n,JSON.stringify(t,null,2))}async patchManifest(e,t,n){const s=mt(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))}},D0=async function(e,t,n){return new Xo(t).install(e,void 0,n)},Object.freeze(Object.defineProperty({__proto__:null,DependencyInstaller:Xo,RegistryClient:Wr,install:D0,splitSpecifier:Ov},Symbol.toStringTag,{value:"Module"}));const LA=new TextEncoder;ad=(i=class extends ne{constructor(e={}){super(),H(this,"registry",new Map),H(this,"baseUrl"),H(this,"opts"),H(this,"channel",null),H(this,"swReady",!1),H(this,"heartbeat",null),H(this,"_processManager",null),H(this,"_workerWsConns",new Map),H(this,"_previewScript",null),H(this,"_swAuthToken",null),H(this,"_wsBridgeToken",null),H(this,"_wsBridge",null),H(this,"_wsConns",new Map),this.opts=e,this.baseUrl=typeof location<"u"?e.baseUrl||`${location.protocol}//${location.host}`:e.baseUrl||"http://localhost",wi((t,n)=>this.register(n,t)),Si(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:W.from(`No server on port ${e}`)};try{const c=r?W.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:W.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"})},xs.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(ad.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 q=await fetch(C),$=await q.arrayBuffer(),te={};q.headers.forEach((D,F)=>{te[F]=D});const P=$.byteLength>0?h(new Uint8Array($)):"";(t=this.channel)==null||t.port1.postMessage({type:"response",id:c,data:{statusCode:q.status,statusMessage:q.statusText||"OK",headers:te,bodyBase64:P}});return}}catch{}let G="";if((n=V.body)!=null&&n.length){const J=V.body instanceof Uint8Array?V.body:new Uint8Array(0);G=h(J)}(s=this.channel)==null||s.port1.postMessage({type:"response",id:c,data:{statusCode:V.statusCode,statusMessage:V.statusMessage,headers:V.headers,bodyBase64:G}})}}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?W.from(new Uint8Array(o)):void 0;await C.handleStreamingRequest(n,s,r,T,(L,V,G)=>{var J;(J=this.channel)==null||J.port1.postMessage({type:"stream-start",id:e,data:{statusCode:L,statusMessage:V,headers:G}})},L=>{var V;const G=typeof L=="string"?LA.encode(L):L;(V=this.channel)==null||V.port1.postMessage({type:"stream-chunk",id:e,data:{chunkBase64:h(G)}})},()=>{var L;(L=this.channel)==null||L.port1.postMessage({type:"stream-end",id:e})})}else{const T=o?W.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=vi(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"?W.from(C):new Uint8Array(C),G=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}),G&&queueMicrotask(()=>G(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=xi(g);if(!X)break;switch(g=g.slice(X.consumed),X.op){case oe.TEXT:{const q=new TextDecoder().decode(X.data);y.postMessage({kind:"ws-message",uid:e,data:q,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 q=X.data.length>=2?X.data[0]<<8|X.data[1]:1e3;y.postMessage({kind:"ws-closed",uid:e,code:q,token:this._wsBridgeToken});break}case oe.PING:p._feedData(W.from(mn(oe.PONG,X.data,!0)));break}}return G&&queueMicrotask(()=>G(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=mn(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=mn(c,o,!0);r.socket._feedData(W.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=mn(oe.CLOSE,o,!0);try{r.socket._feedData(W.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})}}},H(i,"DEBUG",!1),i);let Fu=null;R0=function(e){return Fu||(Fu=new ad(e)),Fu},L0=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)}},M0=class extends ne{constructor(e=4194304){super(),H(this,"_abortController",new AbortController),H(this,"_resolve"),H(this,"_stdout",""),H(this,"_stderr",""),H(this,"_exitCode",null),H(this,"_sendStdinFn",null),H(this,"_killFn",null),H(this,"_maxOutputBytes"),H(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 MA={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"},FA=e=>`\x1B[36mnodepod\x1B[0m:\x1B[34m${e}\x1B[0m$ `;F0=class{constructor(e){H(this,"_term",null),H(this,"_fitAddon",null),H(this,"_dataDisposable",null),H(this,"_resizeHandler",null),H(this,"_lineBuffer",""),H(this,"_history",[]),H(this,"_historyIndex",-1),H(this,"_savedLine",""),H(this,"_running",!1),H(this,"_cwd","/"),H(this,"_promptFn"),H(this,"_theme"),H(this,"_opts"),H(this,"_wiring",null),this._opts=e,this._theme=e.theme??MA,this._promptFn=e.prompt??FA}_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
46592
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===`
46593
46655
  `)this._term.write(`\r
46594
46656
  `),o(`
46595
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===`
46596
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
46597
- `+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 BA=["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 Dv(e){e!==null&&[...BA,...e]}const LA="nodepod-snapshots",vs="snapshots",MA=1,Ov=10080*60*1e3;function FA(){return typeof indexedDB>"u"?Promise.resolve(null):new Promise(e=>{try{const t=indexedDB.open(LA,MA);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(vs)||n.createObjectStore(vs)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null)}catch{e(null)}})}function $A(e,t){return new Promise((n,s)=>{const c=e.transaction(vs,"readonly").objectStore(vs).get(t);c.onsuccess=()=>n(c.result??null),c.onerror=()=>s(c.error)})}function UA(e,t,n){return new Promise((s,r)=>{const o=e.transaction(vs,"readwrite");o.objectStore(vs).put(n,t),o.oncomplete=()=>s(),o.onerror=()=>r(o.error)})}function jA(e){try{const s=e.transaction(vs,"readwrite").objectStore(vs).openCursor(),r=Date.now();s.onsuccess=()=>{const o=s.result;if(!o)return;const c=o.value;c!=null&&c.createdAt&&r-c.createdAt>Ov&&o.delete(),o.continue()}}catch{}}async function VA(){const e=await FA();return e?(jA(e),{async get(t){try{const n=await $A(e,t);return!(n!=null&&n.snapshot)||n.createdAt&&Date.now()-n.createdAt>Ov?null:n.snapshot}catch{return null}},async set(t,n){try{await UA(e,t,{snapshot:n,createdAt:Date.now()})}catch{}},close(){try{e.close()}catch{}}}):null}rl=(l=class{constructor(e,t,n,s,r){if(V(this,"fs"),V(this,"_volume"),V(this,"_packages"),V(this,"_proxy"),V(this,"_cwd"),V(this,"_processManager"),V(this,"_vfsBridge"),V(this,"_sharedVFS",null),V(this,"_syncChannel",null),V(this,"_unwatchVFS",null),V(this,"_handler"),this._volume=e,this._packages=t,this._proxy=n,this._cwd=s,this._handler=r,this.fs=new O0(e),this._processManager=new fa(e),this._vfsBridge=new k0(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(),Ko()){try{this._sharedVFS=new S0,this._processManager.setSharedBuffer(this._sharedVFS.buffer),this._vfsBridge.setSharedVFS(this._sharedVFS)}catch{}try{this._syncChannel=new x0,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,E)=>{const C=E?typeof E=="string"?E:E.toString("utf8"):null,T=await this._processManager.dispatchHttpRequest(c,y,g,x,C),N=T.body instanceof ArrayBuffer?H.from(new Uint8Array(T.body)):H.from(T.body);return{statusCode:T.statusCode,statusMessage:T.statusMessage,headers:T.headers,body:N}}};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 D0(e.memory);n.startMonitoring();const s=new _a(n);let r=null;if(e.enableSnapshotCache!==!1)try{r=await VA()}catch{}const o=new Zo(s,{snapshotCache:r}),c=A0({onServerReady:e.onServerReady});e.allowedFetchDomains===null?Dv(null):Dv(e.allowedFetchDomains??[]);const d=new rl(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 N0,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}
46598
- `),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 B0(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 E=o();let C=!1,T=!1;function N(){T||(T=!0,t.write(`\r
46599
- `))}await y();const j=d;let q=!1;const J=W=>{E===r&&q&&(C=!0,N(),t._writeOutput(W))},Y=W=>{E===r&&q&&(C=!0,N(),t._writeOutput(W,!0))};return j.on("stdout",J),j.on("stderr",Y),s=W=>j.sendStdin(W),x.signal.addEventListener("abort",()=>{this._processManager.kill(j.pid,"SIGINT")},{once:!0}),j.exec({type:"exec",filePath:"",args:[],cwd:this._cwd,isShell:!0,shellCommand:g,persistent:!0}),q=!0,new Promise(W=>{const F=()=>{j.removeListener("shell-done",ne),j.removeListener("exit",P),j.removeListener("stdout",J),j.removeListener("stderr",Y)},ne=(D,L,U)=>{F();const O=E!==r;O||(s=null);const te=x.signal.aborted;if(!te&&!C&&!O){const le=String(L??""),oe=String(U??"");(le||oe)&&N(),le&&t._writeOutput(le),oe&&t._writeOutput(oe,!0)}n===x&&(n=null),!te&&!O&&(T||t.write(`\r
46600
- `),t._setRunning(!1),t._writePrompt()),W()},P=(D,L,U)=>{F();const O=E!==r;O||(s=null);const te=x.signal.aborted;if(!te&&!C&&!O){const le=String(L??""),oe=String(U??"");(le||oe)&&N(),le&&t._writeOutput(le),oe&&t._writeOutput(oe,!0)}n===x&&(n=null),!te&&!O&&(T||t.write(`\r
46601
- `),t._setRunning(!1),t._writePrompt()),W()};j.on("shell-done",ne),j.on("exit",P)})},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?rl.SHALLOW_EXCLUDE_DIRS:void 0)}async restore(e,t){const n=(t==null?void 0:t.autoInstall)??!0,s=_a.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}},V(l,"SHALLOW_EXCLUDE_DIRS",new Set(["node_modules",".cache",".npm"])),l)})();const at="[CodeSandbox:Runtime]";class FS{constructor(i){this.nodepod=null,this.serverProcess=null,this.originalFiles={},this.currentFiles={},this.terminalOutput=[],this.status="initializing",this.error=null,this.previewUrl=null,this.onProgress=null,this.onOutput=null,this.onServerReady=null,this.config={workdir:"/app",port:3e3,...i},console.log(at,"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}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}async boot(){const i=performance.now();console.log(at,"boot() started");try{this.emitProgress("initializing","Booting runtime environment...",5);const l=this.config.port??3e3;console.log(at,"boot: calling Nodepod.boot()",{swUrl:"/__sw__.js",workdir:this.config.workdir,port:l}),console.log(at,"boot: SharedArrayBuffer available?",typeof SharedArrayBuffer<"u"),console.log(at,"boot: Worker available?",typeof Worker<"u");const u=performance.now();this.nodepod=await rl.boot({swUrl:"/__sw__.js",workdir:this.config.workdir,env:this.config.env,onServerReady:(_,b)=>{var v;console.log(at,"onServerReady fired!",{readyPort:_,url:b,expectedPort:l}),_===l&&(this.previewUrl=this.rewritePreviewUrl(b),console.log(at,"previewUrl set to:",this.previewUrl),this.emitProgress("ready","Application is running",100),(v=this.onServerReady)==null||v.call(this,_,this.previewUrl))}}),console.log(at,`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(at,`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(at,`boot: verify file "${v}" exists:`,w),w){const k=await this.nodepod.fs.readFile(v,"utf-8");console.log(at,`boot: verify file "${v}" has ${k.length} chars`)}}}catch(_){console.warn(at,"boot: file verification failed:",_)}if(this.config.files["package.json"]){this.emitProgress("installing","Installing dependencies...",40);const _=performance.now();await this.installDependencies(),console.log(at,`boot: installDependencies completed in ${(performance.now()-_).toFixed(0)}ms`),this.emitProgress("installing","Dependencies installed",70)}else console.log(at,"boot: no package.json found, skipping install");this.emitProgress("starting","Starting application...",75);const m=performance.now();await this.startServer(),console.log(at,`boot: startServer returned in ${(performance.now()-m).toFixed(0)}ms`),console.log(at,`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 k=(b=this.nodepod)==null?void 0:b.port(l);console.log(at,`boot: fallback check @${_}ms, port(${l}) =`,k,"status =",this.status),k?(this.previewUrl=this.rewritePreviewUrl(k),console.log(at,"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(at,"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);throw console.error(at,"boot: FATAL ERROR:",l),this.error=u,this.emitProgress("error",`Error: ${u}`,0),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(`
46602
- $ ${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}`)}),this.serverProcess.on("exit",f=>{this.appendOutput(`
46603
- 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))})}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)}}const EO=`# .ranger — Project Manifest
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 $A=["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 Bv(e){e!==null&&[...$A,...e]}const UA="nodepod-snapshots",ws="snapshots",jA=1,Lv=10080*60*1e3;function VA(){return typeof indexedDB>"u"?Promise.resolve(null):new Promise(e=>{try{const t=indexedDB.open(UA,jA);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(ws)||n.createObjectStore(ws)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null)}catch{e(null)}})}function HA(e,t){return new Promise((n,s)=>{const c=e.transaction(ws,"readonly").objectStore(ws).get(t);c.onsuccess=()=>n(c.result??null),c.onerror=()=>s(c.error)})}function WA(e,t,n){return new Promise((s,r)=>{const o=e.transaction(ws,"readwrite");o.objectStore(ws).put(n,t),o.oncomplete=()=>s(),o.onerror=()=>r(o.error)})}function zA(e){try{const s=e.transaction(ws,"readwrite").objectStore(ws).openCursor(),r=Date.now();s.onsuccess=()=>{const o=s.result;if(!o)return;const c=o.value;c!=null&&c.createdAt&&r-c.createdAt>Lv&&o.delete(),o.continue()}}catch{}}async function qA(){const e=await VA();return e?(zA(e),{async get(t){try{const n=await HA(e,t);return!(n!=null&&n.snapshot)||n.createdAt&&Date.now()-n.createdAt>Lv?null:n.snapshot}catch{return null}},async set(t,n){try{await WA(e,t,{snapshot:n,createdAt:Date.now()})}catch{}},close(){try{e.close()}catch{}}}):null}il=(l=class{constructor(e,t,n,s,r){if(H(this,"fs"),H(this,"_volume"),H(this,"_packages"),H(this,"_proxy"),H(this,"_cwd"),H(this,"_processManager"),H(this,"_vfsBridge"),H(this,"_sharedVFS",null),H(this,"_syncChannel",null),H(this,"_unwatchVFS",null),H(this,"_handler"),this._volume=e,this._packages=t,this._proxy=n,this._cwd=s,this._handler=r,this.fs=new L0(e),this._processManager=new ga(e),this._vfsBridge=new T0(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(),Yo()){try{this._sharedVFS=new k0,this._processManager.setSharedBuffer(this._sharedVFS.buffer),this._vfsBridge.setSharedVFS(this._sharedVFS)}catch{}try{this._syncChannel=new C0,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?W.from(new Uint8Array(T.body)):W.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 B0(e.memory);n.startMonitoring();const s=new va(n);let r=null;if(e.enableSnapshotCache!==!1)try{r=await qA()}catch{}const o=new Xo(s,{snapshotCache:r}),c=R0({onServerReady:e.onServerReady});e.allowedFetchDomains===null?Bv(null):Bv(e.allowedFetchDomains??[]);const d=new il(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 M0,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 F0(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 G=!1;const J=q=>{k===r&&G&&(C=!0,L(),t._writeOutput(q))},X=q=>{k===r&&G&&(C=!0,L(),t._writeOutput(q,!0))};return V.on("stdout",J),V.on("stderr",X),s=q=>V.sendStdin(q),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}),G=!0,new Promise(q=>{const $=()=>{V.removeListener("shell-done",te),V.removeListener("exit",P),V.removeListener("stdout",J),V.removeListener("stderr",X)},te=(D,F,j)=>{$();const O=k!==r;O||(s=null);const Q=x.signal.aborted;if(!Q&&!C&&!O){const ce=String(F??""),le=String(j??"");(ce||le)&&L(),ce&&t._writeOutput(ce),le&&t._writeOutput(le,!0)}n===x&&(n=null),!Q&&!O&&(T||t.write(`\r
46662
+ `),t._setRunning(!1),t._writePrompt()),q()},P=(D,F,j)=>{$();const O=k!==r;O||(s=null);const Q=x.signal.aborted;if(!Q&&!C&&!O){const ce=String(F??""),le=String(j??"");(ce||le)&&L(),ce&&t._writeOutput(ce),le&&t._writeOutput(le,!0)}n===x&&(n=null),!Q&&!O&&(T||t.write(`\r
46663
+ `),t._setRunning(!1),t._writePrompt()),q()};V.on("shell-done",te),V.on("exit",P)})},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?il.SHALLOW_EXCLUDE_DIRS:void 0)}async restore(e,t){const n=(t==null?void 0:t.autoInstall)??!0,s=va.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}},H(l,"SHALLOW_EXCLUDE_DIRS",new Set(["node_modules",".cache",".npm"])),l)})();const pt="[CodeSandbox:Runtime]";class VS{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 il.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 Sn="https://api.github.com",NO=new Set([".js",".jsx",".ts",".tsx",".json",".html",".htm",".css",".scss",".sass",".less",".md",".mdx",".txt",".yml",".yaml",".toml",".xml",".svg",".env",".gitignore",".eslintrc",".prettierrc",".sh",".bash",".zsh",".py",".rb",".go",".rs",".java",".kt",".c",".cpp",".h",".hpp",".cs",".php",".sql",".graphql",".lock",".mjs",".cjs",".mts",".cts",".vue",".svelte",".astro"]),BO=new Set(["node_modules",".git","dist","build",".next",".cache","__pycache__",".venv","venv","coverage",".nyc_output"]),LO=5e5;class Nd{constructor(i){this.token=i}async cloneRepo(i,l){var R;const{owner:u,repo:h,branch:m="main",path:f}=i;l==null||l(5,"Fetching repository structure...");const _=`${Sn}/repos/${u}/${h}/git/trees/${m}?recursive=1`,v=await(await this.fetch(_)).json();if(!v.tree)throw new Error(`Failed to fetch repo tree: ${v.message||"Unknown error"}`);const w=[];for(const I of v.tree){if(I.type!=="blob"||f&&!I.path.startsWith(f))continue;const M=I.path.split("/");if(M.some(z=>BO.has(z))||I.size>LO)continue;const B="."+((R=I.path.split(".").pop())==null?void 0:R.toLowerCase()),N=M[M.length-1];(NO.has(B)||N.startsWith(".")||!N.includes("."))&&w.push({path:I.path,sha:I.sha,size:I.size})}l==null||l(15,`Found ${w.length} files to fetch...`);const E={},A=20;for(let I=0;I<w.length;I+=A){const M=w.slice(I,I+A),B=await Promise.all(M.map(async z=>{try{const U=`${Sn}/repos/${u}/${h}/contents/${z.path}?ref=${m}`,se=await(await this.fetch(U)).json();if(se.encoding==="base64"&&se.content){const ge=atob(se.content.replace(/\n/g,""));return{path:f?z.path.replace(new RegExp(`^${f}/?`),""):z.path,content:ge}}return null}catch{return null}}));for(const z of B)z&&(E[z.path]=z.content);const N=15+Math.round((I+M.length)/w.length*80);l==null||l(N,`Fetching files... (${Math.min(I+A,w.length)}/${w.length})`)}return l==null||l(100,`Loaded ${Object.keys(E).length} files`),E}async createPR(i){const{owner:l,repo:u,branch:h,baseBranch:m="main",changes:f,message:_,title:b,body:v}=i,A=(await(await this.fetch(`${Sn}/repos/${l}/${u}/git/ref/heads/${m}`)).json()).object.sha;await this.fetch(`${Sn}/repos/${l}/${u}/git/refs`,{method:"POST",body:JSON.stringify({ref:`refs/heads/${h}`,sha:A})});for(const[M,B]of Object.entries(f)){let N;try{N=(await(await this.fetch(`${Sn}/repos/${l}/${u}/contents/${M}?ref=${h}`)).json()).sha}catch{}await this.fetch(`${Sn}/repos/${l}/${u}/contents/${M}`,{method:"PUT",body:JSON.stringify({message:_,content:btoa(B),branch:h,...N?{sha:N}:{}})})}const I=await(await this.fetch(`${Sn}/repos/${l}/${u}/pulls`,{method:"POST",body:JSON.stringify({title:b,body:v||`Changes from code sandbox.
46669
+
46670
+ Modified files:
46671
+ ${Object.keys(f).map(M=>`- ${M}`).join(`
46672
+ `)}`,head:h,base:m})})).json();return{number:I.number,url:I.html_url,branch:h}}async commit(i){const{owner:l,repo:u,branch:h,baseBranch:m="main",changes:f,message:_}=i,w=(await(await this.fetch(`${Sn}/repos/${l}/${u}/git/ref/heads/${m}`)).json()).object.sha;try{await this.fetch(`${Sn}/repos/${l}/${u}/git/refs`,{method:"POST",body:JSON.stringify({ref:`refs/heads/${h}`,sha:w})})}catch{}for(const[E,A]of Object.entries(f)){let R;try{R=(await(await this.fetch(`${Sn}/repos/${l}/${u}/contents/${E}?ref=${h}`)).json()).sha}catch{}await this.fetch(`${Sn}/repos/${l}/${u}/contents/${E}`,{method:"PUT",body:JSON.stringify({message:_,content:btoa(A),branch:h,...R?{sha:R}:{}})})}return h}async fetch(i,l){const u=await fetch(i,{...l,headers:{Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json","Content-Type":"application/json",...(l==null?void 0:l.headers)||{}}});if(!u.ok){const h=await u.text();throw new Error(`GitHub API error ${u.status}: ${h}`)}return u}}const MO=`# .ranger — Project Manifest
46604
46673
  # This file provides context to the Ranger AI agent about project structure,
46605
46674
  # conventions, and schemas. Update this file when you add new files, routes,
46606
46675
  # or database tables.
@@ -46735,7 +46804,7 @@ To deploy to production with Postgres:
46735
46804
  4. Replace TEXT for timestamps → TIMESTAMP WITH TIME ZONE
46736
46805
  5. Add connection pooling config to config.js
46737
46806
  6. Everything else (repos, routes, middleware) stays the same
46738
- `,kO=`# =============================================================================
46807
+ `,FO=`# =============================================================================
46739
46808
  # Environment Configuration
46740
46809
  # Copy to .env and fill in values for your deployment
46741
46810
  # =============================================================================
@@ -46755,7 +46824,7 @@ JWT_EXPIRES_IN=24h
46755
46824
 
46756
46825
  # CORS
46757
46826
  CORS_ORIGIN=*
46758
- `,CO=`/**
46827
+ `,$O=`/**
46759
46828
  * config.js — Centralized configuration.
46760
46829
  *
46761
46830
  * Reads from process.env with sensible defaults for the sandbox.
@@ -46771,7 +46840,7 @@ var config = {
46771
46840
  };
46772
46841
 
46773
46842
  module.exports = config;
46774
- `,AO=`/**
46843
+ `,UO=`/**
46775
46844
  * db/database.js — SQLite database via sql.js (WASM).
46776
46845
  *
46777
46846
  * Provides a Postgres-compatible interface:
@@ -46951,7 +47020,7 @@ module.exports = {
46951
47020
  exec: exec,
46952
47021
  lastInsertRowId: lastInsertRowId,
46953
47022
  };
46954
- `,TO=`/**
47023
+ `,jO=`/**
46955
47024
  * Migration 001 — Initial schema.
46956
47025
  *
46957
47026
  * Creates the core tables with proper types, constraints, and indexes.
@@ -47018,7 +47087,7 @@ module.exports = [
47018
47087
  \`,
47019
47088
  },
47020
47089
  ];
47021
- `,IO=`/**
47090
+ `,VO=`/**
47022
47091
  * db/repositories/userRepository.js — User data access layer.
47023
47092
  *
47024
47093
  * All database queries for the users table. Uses parameterized SQL.
@@ -47110,7 +47179,7 @@ module.exports = {
47110
47179
  findAll: findAll,
47111
47180
  count: count,
47112
47181
  };
47113
- `,RO=`/**
47182
+ `,HO=`/**
47114
47183
  * db/repositories/itemRepository.js — Item data access layer.
47115
47184
  *
47116
47185
  * All database queries for the items table. Uses parameterized SQL.
@@ -47251,7 +47320,7 @@ module.exports = {
47251
47320
  remove: remove,
47252
47321
  getStats: getStats,
47253
47322
  };
47254
- `,PO=`/**
47323
+ `,WO=`/**
47255
47324
  * middleware/auth.js — JWT authentication.
47256
47325
  *
47257
47326
  * In the sandbox, JWT is a base64-encoded JSON payload (no crypto).
@@ -47364,7 +47433,7 @@ module.exports = {
47364
47433
  authenticate: authenticate,
47365
47434
  requireRole: requireRole,
47366
47435
  };
47367
- `,DO=`/**
47436
+ `,zO=`/**
47368
47437
  * middleware/errorHandler.js — Global error handling.
47369
47438
  *
47370
47439
  * - notFound: 404 handler that serves index.html for SPA routes
@@ -47412,7 +47481,7 @@ module.exports = {
47412
47481
  notFound: notFound,
47413
47482
  errorHandler: errorHandler,
47414
47483
  };
47415
- `,OO=`/**
47484
+ `,qO=`/**
47416
47485
  * middleware/staticFiles.js — Static file serving for Nodepod.
47417
47486
  *
47418
47487
  * Nodepod doesn't support express.static() or res.sendFile().
@@ -47470,7 +47539,7 @@ function serveStatic(req, res, next) {
47470
47539
  }
47471
47540
 
47472
47541
  module.exports = serveStatic;
47473
- `,NO=`/**
47542
+ `,GO=`/**
47474
47543
  * middleware/validate.js — Request validation helpers.
47475
47544
  *
47476
47545
  * Simple validation middleware factory. For production, consider
@@ -47521,7 +47590,7 @@ module.exports = {
47521
47590
  requireFields: requireFields,
47522
47591
  allowedValues: allowedValues,
47523
47592
  };
47524
- `,BO=`/**
47593
+ `,KO=`/**
47525
47594
  * routes/auth.js — Authentication endpoints.
47526
47595
  *
47527
47596
  * POST /api/auth/register — Create new account
@@ -47622,7 +47691,7 @@ router.get('/me', auth.authenticate, function(req, res) {
47622
47691
  });
47623
47692
 
47624
47693
  module.exports = router;
47625
- `,LO=`/**
47694
+ `,YO=`/**
47626
47695
  * routes/items.js — Item CRUD endpoints.
47627
47696
  *
47628
47697
  * All routes require authentication (JWT).
@@ -47767,7 +47836,7 @@ router.delete('/:id', function(req, res) {
47767
47836
  });
47768
47837
 
47769
47838
  module.exports = router;
47770
- `,MO=`/**
47839
+ `,ZO=`/**
47771
47840
  * server.js — Express application entry point.
47772
47841
  *
47773
47842
  * Middleware chain:
@@ -47855,7 +47924,7 @@ db.initialize().then(function() {
47855
47924
  console.error('[FATAL] Failed to initialize database:', err && err.message ? err.message : err);
47856
47925
  console.error('[FATAL] Stack:', err && err.stack ? err.stack : 'no stack');
47857
47926
  });
47858
- `,FO=`<!DOCTYPE html>
47927
+ `,XO=`<!DOCTYPE html>
47859
47928
  <html lang="en">
47860
47929
  <head>
47861
47930
  <meta charset="UTF-8">
@@ -47878,6 +47947,7 @@ db.initialize().then(function() {
47878
47947
  <script src="https://unpkg.com/@remix-run/router@1.21.0/dist/router.umd.min.js"><\/script>
47879
47948
  <script src="https://unpkg.com/react-router@6.28.0/dist/umd/react-router.production.min.js"><\/script>
47880
47949
  <script src="https://unpkg.com/react-router-dom@6.28.0/dist/umd/react-router-dom.production.min.js"><\/script>
47950
+ <script src="https://unpkg.com/chart.js@4.4.0/dist/chart.umd.js"><\/script>
47881
47951
  <link rel="stylesheet" href="/styles.css">
47882
47952
  </head>
47883
47953
  <body class="bg-gray-50 min-h-screen antialiased">
@@ -47895,6 +47965,7 @@ db.initialize().then(function() {
47895
47965
  <script src="/components/Navbar.js"><\/script>
47896
47966
  <script src="/components/ItemCard.js"><\/script>
47897
47967
  <script src="/components/ItemForm.js"><\/script>
47968
+ <script src="/components/StatsChart.js"><\/script>
47898
47969
 
47899
47970
  <!-- Pages -->
47900
47971
  <script src="/pages/WelcomePage.js"><\/script>
@@ -47905,7 +47976,84 @@ db.initialize().then(function() {
47905
47976
  <!-- App (must be last) -->
47906
47977
  <script src="/App.js"><\/script>
47907
47978
  </body>
47908
- </html>`,$O=`.fade-in {
47979
+ </html>`,JO=`/*
47980
+ * Ranger Theme Variables — chart colors and design tokens.
47981
+ * HSL values stored WITHOUT hsl() wrapper; consume as: color: hsl(var(--chart-1));
47982
+ */
47983
+
47984
+ /* --- Light mode (default) ----------------------------------------------- */
47985
+ :root {
47986
+ --text-primary: #1a1a1a;
47987
+ --text-secondary: #565869;
47988
+ --text-tertiary: #8e8ea0;
47989
+ --surface-primary: #ffffff;
47990
+ --surface-secondary: #f9fafb;
47991
+ --surface-tertiary: #f3f4f6;
47992
+ --border-light: #e5e7eb;
47993
+ --border-medium: #d1d5db;
47994
+ --border-heavy: #9ca3af;
47995
+ --background: 0 0% 100%;
47996
+ --foreground: 0 0% 3.9%;
47997
+ --card: 0 0% 100%;
47998
+ --card-foreground: 0 0% 3.9%;
47999
+ --primary: 0 0% 9%;
48000
+ --primary-foreground: 0 0% 98%;
48001
+ --secondary: 0 0% 96.1%;
48002
+ --secondary-foreground: 0 0% 9%;
48003
+ --muted: 0 0% 96.1%;
48004
+ --muted-foreground: 0 0% 45.1%;
48005
+ --accent: 0 0% 96.1%;
48006
+ --accent-foreground: 0 0% 9%;
48007
+ --destructive: 0 84.2% 60.2%;
48008
+ --destructive-foreground: 0 0% 98%;
48009
+ --border: 0 0% 89.8%;
48010
+ --input: 0 0% 89.8%;
48011
+ --ring: 0 0% 3.9%;
48012
+ --radius: 0.5rem;
48013
+ --chart-1: 12 76% 61%;
48014
+ --chart-2: 173 58% 39%;
48015
+ --chart-3: 197 37% 24%;
48016
+ --chart-4: 43 74% 66%;
48017
+ --chart-5: 27 87% 67%;
48018
+ }
48019
+
48020
+ /* --- Dark mode ---------------------------------------------------------- */
48021
+ .dark {
48022
+ --text-primary: #f3f4f6;
48023
+ --text-secondary: #d1d5db;
48024
+ --text-tertiary: #6b7280;
48025
+ --surface-primary: #111827;
48026
+ --surface-secondary: #1f2937;
48027
+ --surface-tertiary: #374151;
48028
+ --border-light: #3a3a3b;
48029
+ --border-medium: #4b5563;
48030
+ --border-heavy: #6b7280;
48031
+ --background: 0 0% 7%;
48032
+ --foreground: 0 0% 98%;
48033
+ --card: 0 0% 3.9%;
48034
+ --card-foreground: 0 0% 98%;
48035
+ --primary: 0 0% 98%;
48036
+ --primary-foreground: 0 0% 9%;
48037
+ --secondary: 0 0% 14.9%;
48038
+ --secondary-foreground: 0 0% 98%;
48039
+ --muted: 0 0% 14.9%;
48040
+ --muted-foreground: 0 0% 63.9%;
48041
+ --accent: 0 0% 14.9%;
48042
+ --accent-foreground: 0 0% 98%;
48043
+ --destructive: 0 62.8% 40.6%;
48044
+ --destructive-foreground: 0 0% 98%;
48045
+ --border: 0 0% 14.9%;
48046
+ --input: 0 0% 14.9%;
48047
+ --ring: 0 0% 83.1%;
48048
+ --chart-1: 220 70% 50%;
48049
+ --chart-2: 160 60% 45%;
48050
+ --chart-3: 30 80% 55%;
48051
+ --chart-4: 280 65% 60%;
48052
+ --chart-5: 340 75% 55%;
48053
+ }
48054
+
48055
+ /* --- Animations --------------------------------------------------------- */
48056
+ .fade-in {
47909
48057
  animation: fadeIn 0.3s ease-out;
47910
48058
  }
47911
48059
  @keyframes fadeIn {
@@ -47933,7 +48081,7 @@ db.initialize().then(function() {
47933
48081
  from { opacity: 0; transform: translateY(-16px) scale(0.95); }
47934
48082
  to { opacity: 1; transform: translateY(0) scale(1); }
47935
48083
  }
47936
- `,UO=`/**
48084
+ `,QO=`/**
47937
48085
  * lib/api.js — API client.
47938
48086
  *
47939
48087
  * Wraps fetch() with:
@@ -47999,7 +48147,7 @@ window.ApiClient = (function() {
47999
48147
  del: function(path) { return request(path, { method: 'DELETE' }); },
48000
48148
  };
48001
48149
  })();
48002
- `,jO=`/**
48150
+ `,eN=`/**
48003
48151
  * store/AuthContext.js — Authentication state management.
48004
48152
  *
48005
48153
  * Provides:
@@ -48136,7 +48284,7 @@ window.useAuth = function useAuth() {
48136
48284
  if (!context) throw new Error('useAuth must be used within AuthProvider');
48137
48285
  return context;
48138
48286
  };
48139
- `,VO=`/**
48287
+ `,tN=`/**
48140
48288
  * store/AppContext.js — Application state management.
48141
48289
  *
48142
48290
  * Manages items, loading states, filters, and toasts.
@@ -48321,7 +48469,7 @@ window.useApp = function useApp() {
48321
48469
  if (!context) throw new Error('useApp must be used within AppProvider');
48322
48470
  return context;
48323
48471
  };
48324
- `,HO=`var h = React.createElement;
48472
+ `,nN=`var h = React.createElement;
48325
48473
 
48326
48474
  /**
48327
48475
  * Toast — Notification toast displayed at top-right.
@@ -48346,7 +48494,7 @@ window.Toast = function Toast(props) {
48346
48494
  })
48347
48495
  );
48348
48496
  };
48349
- `,WO=`var h = React.createElement;
48497
+ `,sN=`var h = React.createElement;
48350
48498
  var RR = ReactRouterDOM;
48351
48499
 
48352
48500
  /**
@@ -48402,7 +48550,7 @@ window.Navbar = function Navbar() {
48402
48550
  )
48403
48551
  );
48404
48552
  };
48405
- `,zO=`var h = React.createElement;
48553
+ `,rN=`var h = React.createElement;
48406
48554
 
48407
48555
  var STATUS_STYLES = {
48408
48556
  todo: { bg: 'bg-gray-100', text: 'text-gray-600', label: 'To Do' },
@@ -48460,7 +48608,7 @@ window.ItemCard = function ItemCard(props) {
48460
48608
  )
48461
48609
  );
48462
48610
  };
48463
- `,qO=`var h = React.createElement;
48611
+ `,iN=`var h = React.createElement;
48464
48612
 
48465
48613
  /**
48466
48614
  * ItemForm — Create or edit an item.
@@ -48573,7 +48721,7 @@ window.ItemForm = function ItemForm(props) {
48573
48721
  )
48574
48722
  );
48575
48723
  };
48576
- `,GO=`var h = React.createElement;
48724
+ `,aN=`var h = React.createElement;
48577
48725
  var RR = ReactRouterDOM;
48578
48726
 
48579
48727
  /**
@@ -48665,7 +48813,7 @@ function _featureCard(title, desc, icon) {
48665
48813
  h('p', { className: 'text-sm text-gray-500' }, desc)
48666
48814
  );
48667
48815
  }
48668
- `,KO=`var h = React.createElement;
48816
+ `,oN=`var h = React.createElement;
48669
48817
  var RR = ReactRouterDOM;
48670
48818
 
48671
48819
  /**
@@ -48747,7 +48895,7 @@ window.LoginPage = function LoginPage() {
48747
48895
  )
48748
48896
  );
48749
48897
  };
48750
- `,YO=`var h = React.createElement;
48898
+ `,lN=`var h = React.createElement;
48751
48899
  var RR = ReactRouterDOM;
48752
48900
 
48753
48901
  /**
@@ -48841,7 +48989,126 @@ window.RegisterPage = function RegisterPage() {
48841
48989
  )
48842
48990
  );
48843
48991
  };
48844
- `,ZO=`var h = React.createElement;
48992
+ `,cN=`var h = React.createElement;
48993
+
48994
+ /**
48995
+ * StatsChart — Renders a doughnut chart of item status distribution
48996
+ * using Chart.js with Ranger theme CSS variables (--chart-1 through --chart-5).
48997
+ *
48998
+ * Props:
48999
+ * stats — { total, byStatus: { todo, in_progress, done }, byPriority: { low, medium, high } }
49000
+ *
49001
+ * Uses the global Chart class from chart.js UMD CDN.
49002
+ */
49003
+ window.StatsChart = function StatsChart(props) {
49004
+ var stats = props.stats || { total: 0, byStatus: {}, byPriority: {} };
49005
+ var canvasRef = React.useRef(null);
49006
+ var chartRef = React.useRef(null);
49007
+
49008
+ /**
49009
+ * Read a CSS custom property value from :root and convert to usable color.
49010
+ * Ranger stores HSL values without the hsl() wrapper (e.g. "12 76% 61%"),
49011
+ * so we wrap them: hsl(12 76% 61%).
49012
+ */
49013
+ function getChartColor(varName, fallback) {
49014
+ var raw = getComputedStyle(document.documentElement)
49015
+ .getPropertyValue(varName)
49016
+ .trim();
49017
+ if (!raw) return fallback;
49018
+ if (raw.startsWith('#') || raw.startsWith('rgb') || raw.startsWith('hsl(')) {
49019
+ return raw;
49020
+ }
49021
+ return 'hsl(' + raw + ')';
49022
+ }
49023
+
49024
+ React.useEffect(function () {
49025
+ if (!canvasRef.current) return;
49026
+
49027
+ if (chartRef.current) {
49028
+ chartRef.current.destroy();
49029
+ chartRef.current = null;
49030
+ }
49031
+
49032
+ var todo = (stats.byStatus && stats.byStatus.todo) || 0;
49033
+ var inProgress = (stats.byStatus && stats.byStatus.in_progress) || 0;
49034
+ var done = (stats.byStatus && stats.byStatus.done) || 0;
49035
+
49036
+ if (todo + inProgress + done === 0) return;
49037
+
49038
+ var colors = [
49039
+ getChartColor('--chart-1', 'hsl(12 76% 61%)'),
49040
+ getChartColor('--chart-2', 'hsl(173 58% 39%)'),
49041
+ getChartColor('--chart-3', 'hsl(197 37% 24%)'),
49042
+ ];
49043
+
49044
+ chartRef.current = new Chart(canvasRef.current, {
49045
+ type: 'doughnut',
49046
+ data: {
49047
+ labels: ['To Do', 'In Progress', 'Done'],
49048
+ datasets: [
49049
+ {
49050
+ data: [todo, inProgress, done],
49051
+ backgroundColor: colors,
49052
+ borderWidth: 0,
49053
+ hoverOffset: 6,
49054
+ },
49055
+ ],
49056
+ },
49057
+ options: {
49058
+ responsive: true,
49059
+ maintainAspectRatio: false,
49060
+ cutout: '65%',
49061
+ plugins: {
49062
+ legend: {
49063
+ position: 'bottom',
49064
+ labels: {
49065
+ padding: 16,
49066
+ usePointStyle: true,
49067
+ pointStyleWidth: 8,
49068
+ font: { size: 12 },
49069
+ color: getChartColor('--text-secondary', '#565869'),
49070
+ },
49071
+ },
49072
+ tooltip: {
49073
+ backgroundColor: 'rgba(0,0,0,0.8)',
49074
+ titleFont: { size: 13 },
49075
+ bodyFont: { size: 12 },
49076
+ padding: 10,
49077
+ cornerRadius: 8,
49078
+ },
49079
+ },
49080
+ },
49081
+ });
49082
+
49083
+ return function () {
49084
+ if (chartRef.current) {
49085
+ chartRef.current.destroy();
49086
+ chartRef.current = null;
49087
+ }
49088
+ };
49089
+ }, [stats.byStatus && stats.byStatus.todo,
49090
+ stats.byStatus && stats.byStatus.in_progress,
49091
+ stats.byStatus && stats.byStatus.done]);
49092
+
49093
+ var hasData =
49094
+ ((stats.byStatus && stats.byStatus.todo) || 0) +
49095
+ ((stats.byStatus && stats.byStatus.in_progress) || 0) +
49096
+ ((stats.byStatus && stats.byStatus.done) || 0) > 0;
49097
+
49098
+ return h(
49099
+ 'div',
49100
+ { className: 'bg-white rounded-lg border border-gray-200 p-4 card-hover' },
49101
+ h('h3', { className: 'text-sm font-semibold text-gray-700 mb-3' }, 'Status Distribution'),
49102
+ hasData
49103
+ ? h('div', { style: { height: '200px', position: 'relative' } },
49104
+ h('canvas', { ref: canvasRef })
49105
+ )
49106
+ : h('div', { className: 'flex items-center justify-center h-48 text-gray-400 text-sm' },
49107
+ 'No data to display'
49108
+ )
49109
+ );
49110
+ };
49111
+ `,uN=`var h = React.createElement;
48845
49112
  var RR = ReactRouterDOM;
48846
49113
 
48847
49114
  /**
@@ -48933,6 +49200,11 @@ window.DashboardPage = function DashboardPage() {
48933
49200
  _statCard('Done', stats.byStatus.done || 0, 'bg-emerald-50')
48934
49201
  ),
48935
49202
 
49203
+ // Chart — doughnut showing status distribution
49204
+ h('div', { className: 'mb-6' },
49205
+ h(window.StatsChart, { stats: stats })
49206
+ ),
49207
+
48936
49208
  // Filters
48937
49209
  h('div', { className: 'flex gap-2 mb-4' },
48938
49210
  _filterSelect('Status', app.filters.status, ['todo', 'in_progress', 'done'],
@@ -48994,7 +49266,7 @@ function _filterSelect(label, value, options, onChange) {
48994
49266
  })
48995
49267
  );
48996
49268
  }
48997
- `,XO=`var h = React.createElement;
49269
+ `,dN=`var h = React.createElement;
48998
49270
  var RR = ReactRouterDOM;
48999
49271
 
49000
49272
  /**
@@ -49074,7 +49346,7 @@ function App() {
49074
49346
 
49075
49347
  // Mount
49076
49348
  ReactDOM.createRoot(document.getElementById('root')).render(h(App));
49077
- `,JO=`# ===========================================================================
49349
+ `,hN=`# ===========================================================================
49078
49350
  # Dockerfile — Production-ready multi-stage build
49079
49351
  #
49080
49352
  # Supports two modes:
@@ -49141,7 +49413,7 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \\
49141
49413
  CMD wget -qO- http://localhost:3000/api/health || exit 1
49142
49414
 
49143
49415
  CMD ["node", "server.js"]
49144
- `,QO=`node_modules
49416
+ `,pN=`node_modules
49145
49417
  npm-debug.log*
49146
49418
  .env
49147
49419
  .env.local
@@ -49151,7 +49423,7 @@ npm-debug.log*
49151
49423
  .DS_Store
49152
49424
  *.md
49153
49425
  !README.md
49154
- `,eN=`# docker-compose.yml — Local development and production deployment
49426
+ `,fN=`# docker-compose.yml — Local development and production deployment
49155
49427
  #
49156
49428
  # Usage:
49157
49429
  # SQLite (default): docker compose up
@@ -49202,7 +49474,7 @@ services:
49202
49474
  volumes:
49203
49475
  app-data:
49204
49476
  pg-data:
49205
- `,tN=`# Starter App
49477
+ `,mN=`# Starter App
49206
49478
 
49207
49479
  A production-ready full-stack application built with **Express.js** and **React**.
49208
49480
 
@@ -49433,7 +49705,7 @@ code changes** in your route/repository layer.
49433
49705
  ## License
49434
49706
 
49435
49707
  MIT
49436
- `,nN=`# Contributing
49708
+ `,gN=`# Contributing
49437
49709
 
49438
49710
  Thank you for considering contributing to this project.
49439
49711
 
@@ -49593,7 +49865,7 @@ When adding new features:
49593
49865
  - [ ] New files are listed in \`.ranger\` manifest
49594
49866
  - [ ] Tests pass locally
49595
49867
  - [ ] No hardcoded secrets or credentials
49596
- `,sN=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),rN={entryCommand:"node server.js",port:3e3,files:{".ranger":EO,"package.json":sN,".env.example":kO,"config.js":CO,"server.js":MO,Dockerfile:JO,".dockerignore":QO,"docker-compose.yml":eN,"README.md":tN,"CONTRIBUTING.md":nN,"db/database.js":AO,"db/migrations/001_initial.js":TO,"db/repositories/userRepository.js":IO,"db/repositories/itemRepository.js":RO,"middleware/auth.js":PO,"middleware/errorHandler.js":DO,"middleware/staticFiles.js":OO,"middleware/validate.js":NO,"routes/auth.js":BO,"routes/items.js":LO,"public/index.html":FO,"public/styles.css":$O,"public/lib/api.js":UO,"public/store/AuthContext.js":jO,"public/store/AppContext.js":VO,"public/components/Toast.js":HO,"public/components/Navbar.js":WO,"public/components/ItemCard.js":zO,"public/components/ItemForm.js":qO,"public/pages/WelcomePage.js":GO,"public/pages/LoginPage.js":KO,"public/pages/RegisterPage.js":YO,"public/pages/DashboardPage.js":ZO,"public/App.js":XO}},iN=`const express = require('express');
49868
+ `,yN=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),_N={entryCommand:"node server.js",port:3e3,files:{".ranger":MO,"package.json":yN,".env.example":FO,"config.js":$O,"server.js":ZO,Dockerfile:hN,".dockerignore":pN,"docker-compose.yml":fN,"README.md":mN,"CONTRIBUTING.md":gN,"db/database.js":UO,"db/migrations/001_initial.js":jO,"db/repositories/userRepository.js":VO,"db/repositories/itemRepository.js":HO,"middleware/auth.js":WO,"middleware/errorHandler.js":zO,"middleware/staticFiles.js":qO,"middleware/validate.js":GO,"routes/auth.js":KO,"routes/items.js":YO,"public/index.html":XO,"public/styles.css":JO,"public/lib/api.js":QO,"public/store/AuthContext.js":eN,"public/store/AppContext.js":tN,"public/components/Toast.js":nN,"public/components/Navbar.js":sN,"public/components/ItemCard.js":rN,"public/components/ItemForm.js":iN,"public/components/StatsChart.js":cN,"public/pages/WelcomePage.js":aN,"public/pages/LoginPage.js":oN,"public/pages/RegisterPage.js":lN,"public/pages/DashboardPage.js":uN,"public/App.js":dN}},bN=`const express = require('express');
49597
49869
  const fs = require('fs');
49598
49870
  const path = require('path');
49599
49871
  const app = express();
@@ -49705,7 +49977,7 @@ app.use(serveStatic);
49705
49977
  app.listen(PORT, function() {
49706
49978
  console.log('Server running on port ' + PORT);
49707
49979
  });
49708
- `,aN=`<!DOCTYPE html>
49980
+ `,vN=`<!DOCTYPE html>
49709
49981
  <html lang="en">
49710
49982
  <head>
49711
49983
  <meta charset="UTF-8">
@@ -49726,7 +49998,7 @@ app.listen(PORT, function() {
49726
49998
  <script src="/components/UserDetail.js"><\/script>
49727
49999
  <script src="/App.js"><\/script>
49728
50000
  </body>
49729
- </html>`,oN=`.tab-active {
50001
+ </html>`,wN=`.tab-active {
49730
50002
  border-bottom: 2px solid #3b82f6;
49731
50003
  color: #3b82f6;
49732
50004
  }
@@ -49741,7 +50013,7 @@ app.listen(PORT, function() {
49741
50013
  from { opacity: 0; transform: translateY(8px); }
49742
50014
  to { opacity: 1; transform: translateY(0); }
49743
50015
  }
49744
- `,lN=`var e = React.createElement;
50016
+ `,SN=`var e = React.createElement;
49745
50017
 
49746
50018
  /**
49747
50019
  * PostCard — Renders a single post as a clickable card.
@@ -49763,7 +50035,7 @@ window.PostCard = function PostCard(props) {
49763
50035
  e('p', { className: 'text-sm text-gray-500 line-clamp-2' }, post.body)
49764
50036
  );
49765
50037
  };
49766
- `,cN=`var e = React.createElement;
50038
+ `,xN=`var e = React.createElement;
49767
50039
 
49768
50040
  /**
49769
50041
  * UserCard — Renders a user profile card with avatar.
@@ -49791,7 +50063,7 @@ window.UserCard = function UserCard(props) {
49791
50063
  )
49792
50064
  );
49793
50065
  };
49794
- `,uN=`var e = React.createElement;
50066
+ `,EN=`var e = React.createElement;
49795
50067
 
49796
50068
  /**
49797
50069
  * CommentCard — Renders a single comment.
@@ -49810,7 +50082,7 @@ window.CommentCard = function CommentCard(props) {
49810
50082
  e('p', { className: 'text-sm text-gray-600' }, c.body)
49811
50083
  );
49812
50084
  };
49813
- `,dN=`var e = React.createElement;
50085
+ `,kN=`var e = React.createElement;
49814
50086
 
49815
50087
  /**
49816
50088
  * PostDetail — Full post view with comments.
@@ -49852,7 +50124,7 @@ window.PostDetail = function PostDetail(props) {
49852
50124
  : e('p', { className: 'text-gray-400 text-sm' }, 'No comments found.')
49853
50125
  );
49854
50126
  };
49855
- `,hN=`var e = React.createElement;
50127
+ `,CN=`var e = React.createElement;
49856
50128
 
49857
50129
  /**
49858
50130
  * UserDetail — Full user profile with their posts.
@@ -49915,7 +50187,7 @@ window.UserDetail = function UserDetail(props) {
49915
50187
  : e('p', { className: 'text-gray-400 text-sm' }, 'No posts found.')
49916
50188
  );
49917
50189
  };
49918
- `,pN=`var e = React.createElement;
50190
+ `,AN=`var e = React.createElement;
49919
50191
 
49920
50192
  /**
49921
50193
  * App — Main application component.
@@ -50066,9 +50338,5 @@ function App() {
50066
50338
 
50067
50339
  // Mount
50068
50340
  ReactDOM.createRoot(document.getElementById('root')).render(e(App));
50069
- `,$S={"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":iN,"public/index.html":aN,"public/styles.css":oN,"public/App.js":pN,"public/components/PostCard.js":lN,"public/components/UserCard.js":cN,"public/components/CommentCard.js":uN,"public/components/PostDetail.js":dN,"public/components/UserDetail.js":hN}},"fullstack-starter":rN};function US(a){return $S[a]||null}function fN(){return Object.keys($S)}function jS(a){const{files:i,template:l,entryCommand:u,port:h,env:m,onFileChange:f,onServerReady:_,onProgress:b,onError:v}=a,w=K.useRef(null),k=K.useRef(!1),[A,R]=K.useState({status:"initializing",progress:{stage:"initializing",message:"Preparing...",percent:0},previewUrl:null,terminalOutput:[],files:{},error:null}),[I,M]=K.useState(null),[$,B]=K.useState([]),z=K.useCallback(()=>{if(i)return{files:i,entryCommand:u||"node server.js",port:h||3e3};if(l){const Q=US(l);if(Q)return{files:Q.files,entryCommand:u||Q.entryCommand,port:h||Q.port}}return{files:{},entryCommand:u||"node server.js",port:h||3e3}},[i,l,u,h]);K.useEffect(()=>{if(k.current)return;k.current=!0;const Q=z();if(Object.keys(Q.files).length===0)return;const he=new FS({files:Q.files,entryCommand:Q.entryCommand,port:Q.port,env:m});w.current=he,R(ee=>({...ee,files:Q.files}));const ie=Object.keys(Q.files),Se=ie.find(ee=>ee==="server.js")||ie.find(ee=>ee==="index.js")||ie.find(ee=>ee.endsWith(".js"))||ie[0];return Se&&(M(Se),B([Se])),he.setProgressCallback(ee=>{R(pe=>({...pe,status:ee.stage,progress:ee,previewUrl:he.getPreviewUrl(),error:ee.stage==="error"?ee.message:pe.error})),b==null||b(ee),ee.stage==="error"&&(v==null||v(ee.message))}),he.setOutputCallback(ee=>{R(pe=>({...pe,terminalOutput:[...pe.terminalOutput,ee]}))}),he.setServerReadyCallback((ee,pe)=>{R(Pe=>({...Pe,previewUrl:pe,status:"ready"})),_==null||_(ee,pe)}),he.boot().catch(ee=>{const pe=ee instanceof Error?ee.message:String(ee);v==null||v(pe)}),()=>{he.teardown(),w.current=null}},[]);const G=K.useCallback(async(Q,he)=>{const ie=w.current;if(ie){try{await ie.writeFile(Q,he)}catch(Se){console.error(`Failed to write file ${Q}:`,Se)}R(Se=>({...Se,files:{...Se.files,[Q]:he}})),f==null||f(Q,he)}},[f]),Z=K.useCallback(Q=>{M(Q),B(he=>he.includes(Q)?he:[...he,Q])},[]),ae=K.useCallback(Q=>{B(he=>{const ie=he.filter(Se=>Se!==Q);return I===Q&&M(ie.length>0?ie[ie.length-1]:null),ie})},[I]),_e=K.useCallback(async()=>{const Q=w.current;Q&&await Q.restart()},[]),re=K.useCallback(()=>{var Q;return((Q=w.current)==null?void 0:Q.getChangedFiles())??{}},[]);return{state:A,selectedFile:I,openFiles:$,handleFileChange:G,handleSelectFile:Z,handleCloseFile:ae,restart:_e,getChangedFiles:re,runtime:w}}function mN(a){const{className:i="",height:l="100vh",port:u=3e3}=a,{state:h,selectedFile:m,openFiles:f,handleFileChange:_,handleSelectFile:b,handleCloseFile:v,restart:w}=jS(a),k=K.useMemo(()=>RS(h.files),[h.files]),A=h.status!=="ready"&&h.status!=="error",[R,I]=K.useState("code"),M=!!h.previewUrl;K.useEffect(()=>{M&&I("preview")},[M]);const $=K.useCallback(B=>{b(B),I("code")},[b]);return X.jsxs("div",{className:`sb-root relative w-full bg-sb-bg text-sb-text overflow-hidden flex flex-col ${i}`,style:{height:l},children:[A&&X.jsx(LS,{progress:h.progress}),X.jsx(yN,{activeView:R,onViewChange:I,previewUrl:h.previewUrl,port:u,onRefresh:w}),X.jsxs("div",{className:"flex-1 relative overflow-hidden min-h-0",children:[X.jsx(Pd.div,{className:"absolute inset-0",initial:!1,animate:{opacity:R==="code"?1:0,pointerEvents:R==="code"?"auto":"none"},transition:{duration:.15},children:X.jsx(bN,{fileTree:k,files:h.files,selectedFile:m,openFiles:f,terminalOutput:h.terminalOutput,onSelectFile:$,onCloseFile:v,onFileChange:_})}),X.jsx(Pd.div,{className:"absolute inset-0",initial:!1,animate:{opacity:R==="preview"?1:0,pointerEvents:R==="preview"?"auto":"none"},transition:{duration:.15},children:X.jsx(BS,{url:h.previewUrl})})]})]})}function gN(a,i){if(!a)return"";const l=a.match(/\/__(?:preview|virtual)__\/\d+(\/.*)?$/),u=(l==null?void 0:l[1])??"/";return`localhost:${i}${u}`}function yN({activeView:a,onViewChange:i,previewUrl:l,port:u,onRefresh:h}){const m=gN(l,u);return X.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:[X.jsx(MS,{selected:a,onSelect:i}),X.jsx("div",{className:"flex-1 min-w-0",children:a==="preview"?X.jsxs("div",{className:"flex items-center gap-1.5",children:[X.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:X.jsx(_N,{})}),X.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..."})]}):X.jsx("div",{className:"text-xs text-sb-text-muted px-1 truncate",children:"Editor"})})]})}function _N(){return X.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[X.jsx("polyline",{points:"23 4 23 10 17 10"}),X.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})}function bN({fileTree:a,files:i,selectedFile:l,openFiles:u,terminalOutput:h,onSelectFile:m,onCloseFile:f,onFileChange:_}){return X.jsx("div",{className:"h-full w-full",children:X.jsxs(qr,{children:[X.jsx(qr.Pane,{preferredSize:200,minSize:120,maxSize:350,children:X.jsx(PS,{files:a,selectedFile:l,onSelectFile:m})}),X.jsx(qr.Pane,{children:X.jsxs(qr,{vertical:!0,children:[X.jsx(qr.Pane,{preferredSize:"70%",children:X.jsx(OS,{files:i,activeFile:l,openFiles:u,onSelectFile:m,onCloseFile:f,onFileChange:_})}),X.jsx(qr.Pane,{preferredSize:"30%",minSize:60,children:X.jsx(NS,{output:h})})]})})]})})}const bn="https://api.github.com",vN=new Set([".js",".jsx",".ts",".tsx",".json",".html",".htm",".css",".scss",".sass",".less",".md",".mdx",".txt",".yml",".yaml",".toml",".xml",".svg",".env",".gitignore",".eslintrc",".prettierrc",".sh",".bash",".zsh",".py",".rb",".go",".rs",".java",".kt",".c",".cpp",".h",".hpp",".cs",".php",".sql",".graphql",".lock",".mjs",".cjs",".mts",".cts",".vue",".svelte",".astro"]),wN=new Set(["node_modules",".git","dist","build",".next",".cache","__pycache__",".venv","venv","coverage",".nyc_output"]),SN=5e5;class xN{constructor(i){this.token=i}async cloneRepo(i,l){var R;const{owner:u,repo:h,branch:m="main",path:f}=i;l==null||l(5,"Fetching repository structure...");const _=`${bn}/repos/${u}/${h}/git/trees/${m}?recursive=1`,v=await(await this.fetch(_)).json();if(!v.tree)throw new Error(`Failed to fetch repo tree: ${v.message||"Unknown error"}`);const w=[];for(const I of v.tree){if(I.type!=="blob"||f&&!I.path.startsWith(f))continue;const M=I.path.split("/");if(M.some(z=>wN.has(z))||I.size>SN)continue;const $="."+((R=I.path.split(".").pop())==null?void 0:R.toLowerCase()),B=M[M.length-1];(vN.has($)||B.startsWith(".")||!B.includes("."))&&w.push({path:I.path,sha:I.sha,size:I.size})}l==null||l(15,`Found ${w.length} files to fetch...`);const k={},A=20;for(let I=0;I<w.length;I+=A){const M=w.slice(I,I+A),$=await Promise.all(M.map(async z=>{try{const G=`${bn}/repos/${u}/${h}/contents/${z.path}?ref=${m}`,ae=await(await this.fetch(G)).json();if(ae.encoding==="base64"&&ae.content){const _e=atob(ae.content.replace(/\n/g,""));return{path:f?z.path.replace(new RegExp(`^${f}/?`),""):z.path,content:_e}}return null}catch{return null}}));for(const z of $)z&&(k[z.path]=z.content);const B=15+Math.round((I+M.length)/w.length*80);l==null||l(B,`Fetching files... (${Math.min(I+A,w.length)}/${w.length})`)}return l==null||l(100,`Loaded ${Object.keys(k).length} files`),k}async createPR(i){const{owner:l,repo:u,branch:h,baseBranch:m="main",changes:f,message:_,title:b,body:v}=i,A=(await(await this.fetch(`${bn}/repos/${l}/${u}/git/ref/heads/${m}`)).json()).object.sha;await this.fetch(`${bn}/repos/${l}/${u}/git/refs`,{method:"POST",body:JSON.stringify({ref:`refs/heads/${h}`,sha:A})});for(const[M,$]of Object.entries(f)){let B;try{B=(await(await this.fetch(`${bn}/repos/${l}/${u}/contents/${M}?ref=${h}`)).json()).sha}catch{}await this.fetch(`${bn}/repos/${l}/${u}/contents/${M}`,{method:"PUT",body:JSON.stringify({message:_,content:btoa($),branch:h,...B?{sha:B}:{}})})}const I=await(await this.fetch(`${bn}/repos/${l}/${u}/pulls`,{method:"POST",body:JSON.stringify({title:b,body:v||`Changes from code sandbox.
50070
-
50071
- Modified files:
50072
- ${Object.keys(f).map(M=>`- ${M}`).join(`
50073
- `)}`,head:h,base:m})})).json();return{number:I.number,url:I.html_url,branch:h}}async commit(i){const{owner:l,repo:u,branch:h,baseBranch:m="main",changes:f,message:_}=i,w=(await(await this.fetch(`${bn}/repos/${l}/${u}/git/ref/heads/${m}`)).json()).object.sha;try{await this.fetch(`${bn}/repos/${l}/${u}/git/refs`,{method:"POST",body:JSON.stringify({ref:`refs/heads/${h}`,sha:w})})}catch{}for(const[k,A]of Object.entries(f)){let R;try{R=(await(await this.fetch(`${bn}/repos/${l}/${u}/contents/${k}?ref=${h}`)).json()).sha}catch{}await this.fetch(`${bn}/repos/${l}/${u}/contents/${k}`,{method:"PUT",body:JSON.stringify({message:_,content:btoa(A),branch:h,...R?{sha:R}:{}})})}return h}async fetch(i,l){const u=await fetch(i,{...l,headers:{Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json","Content-Type":"application/json",...(l==null?void 0:l.headers)||{}}});if(!u.ok){const h=await u.text();throw new Error(`GitHub API error ${u.status}: ${h}`)}return u}}exports.BootOverlay=LS;exports.CodeEditor=OS;exports.CodeSandbox=mN;exports.FileTree=PS;exports.GitService=xN;exports.NodepodRuntime=FS;exports.Preview=BS;exports.Terminal=NS;exports.ViewSlider=MS;exports.buildFileTree=RS;exports.getTemplate=US;exports.listTemplates=fN;exports.useRuntime=jS;
50341
+ `,HS={"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":bN,"public/index.html":vN,"public/styles.css":wN,"public/App.js":AN,"public/components/PostCard.js":SN,"public/components/UserCard.js":xN,"public/components/CommentCard.js":EN,"public/components/PostDetail.js":kN,"public/components/UserDetail.js":CN}},"fullstack-starter":_N};function WS(a){return HS[a]||null}function TN(){return Object.keys(HS)}const Es="[CodeSandbox:useRuntime]",$0=5e3;function IN(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 zS(a){const{files:i,github:l,gitToken:u,template:h,entryCommand:m,port:f,env:_,onFileChange:b,onServerReady:v,onProgress:w,onError:E,onSandboxError:A}=a,R=K.useRef(null),I=K.useRef(!1),M=K.useRef(A);M.current=A;const B=K.useRef(null),N=K.useRef(null),[z,U]=K.useState({status:"initializing",progress:{stage:"initializing",message:"Preparing...",percent:0},previewUrl:null,terminalOutput:[],files:{},originalFiles:{},fileChanges:{},error:null,errors:[]}),[Y,se]=K.useState(null),[ge,ee]=K.useState([]),ae=K.useCallback(ie=>{var pe;U(ve=>({...ve,errors:[...ve.errors,ie]})),(pe=M.current)==null||pe.call(M,ie)},[]),Oe=K.useCallback(async ie=>{const pe=R.current;pe&&await pe.reportError(ie),ae(ie)},[ae]),oe=K.useCallback(()=>{if(i)return{files:i,entryCommand:m||"node server.js",port:f||3e3};if(h){const ie=WS(h);if(ie)return{files:ie.files,entryCommand:m||ie.entryCommand,port:f||ie.port}}return l?null:{files:{},entryCommand:m||"node server.js",port:f||3e3}},[i,h,l,m,f]),je=K.useCallback((ie,pe,ve)=>{const Ee=new VS({files:ie,entryCommand:pe,port:ve,env:_});R.current=Ee,U(Te=>({...Te,files:ie}));const ke=Object.keys(ie),Ne=ke.find(Te=>Te==="server.js")||ke.find(Te=>Te==="index.js")||ke.find(Te=>Te.endsWith(".js"))||ke[0];return Ne&&(se(Ne),ee([Ne])),Ee.setProgressCallback(Te=>{U(Ke=>({...Ke,status:Te.stage,progress:Te,previewUrl:Ee.getPreviewUrl(),error:Te.stage==="error"?Te.message:Ke.error})),w==null||w(Te),Te.stage==="error"&&(E==null||E(Te.message))}),Ee.setOutputCallback(Te=>{U(Ke=>({...Ke,terminalOutput:[...Ke.terminalOutput,Te]}))}),Ee.setServerReadyCallback((Te,Ke)=>{U(De=>({...De,previewUrl:Ke,status:"ready"})),v==null||v(Te,Ke)}),Ee.setErrorCallback(ae),Ee.boot().catch(Te=>{const Ke=Te instanceof Error?Te.message:String(Te);E==null||E(Ke)}),Ee},[_,w,E,v,ae]),re=K.useCallback(async(ie,pe)=>{var ve;try{const{owner:Ee,repo:ke,branch:Ne="main"}=ie,Te=await fetch(`https://api.github.com/repos/${Ee}/${ke}/git/ref/heads/${Ne}`,{headers:{Authorization:`Bearer ${pe}`,Accept:"application/vnd.github.v3+json"}});return Te.ok?((ve=(await Te.json()).object)==null?void 0:ve.sha)??null:null}catch{return null}},[]),be=K.useCallback(async ie=>{const pe=R.current;if(!pe)return;const ve=pe.getCurrentFiles();let Ee=!1;for(const[Ne,Te]of Object.entries(ie))if(ve[Ne]!==Te)try{await pe.writeFile(Ne,Te),Ee=!0,console.log(Es,`updated file: ${Ne}`)}catch(Ke){console.warn(Es,`failed to write ${Ne}:`,Ke)}const ke=IN(ve,ie);if(U(Ne=>({...Ne,originalFiles:ve,files:ie,fileChanges:ke})),Ee){console.log(Es,`files changed — restarting server (${Object.keys(ke).length} files differ)`);try{await pe.restart()}catch(Ne){console.error(Es,"restart failed:",Ne)}}},[]),Me=K.useCallback((ie,pe)=>{N.current&&clearInterval(N.current),console.log(Es,"starting branch polling",{owner:ie.owner,repo:ie.repo,branch:ie.branch||"main",interval:$0}),N.current=setInterval(async()=>{const ve=await re(ie,pe);if(ve)if(B.current&&ve!==B.current){console.log(Es,"new commit detected:",ve),B.current=ve;const Ee=new Nd(pe);try{const ke=await Ee.cloneRepo(ie);await be(ke)}catch(ke){console.error(Es,"failed to fetch updated files:",ke)}}else B.current||(B.current=ve)},$0)},[re,be]);K.useEffect(()=>{if(I.current)return;I.current=!0;const ie=oe();if(ie){if(Object.keys(ie.files).length===0)return;je(ie.files,ie.entryCommand,ie.port)}else if(l&&u){const pe=m||"node server.js",ve=f||3e3;U(ke=>({...ke,progress:{stage:"initializing",message:"Cloning repository from GitHub...",percent:5}})),new Nd(u).cloneRepo(l,(ke,Ne)=>{U(Te=>({...Te,progress:{stage:"initializing",message:Ne,percent:ke}}))}).then(ke=>{var Te;let Ne=pe;if(!m&&ke["package.json"])try{const Ke=JSON.parse(ke["package.json"]);(Te=Ke.scripts)!=null&&Te.start&&(Ne=Ke.scripts.start)}catch{}je(ke,Ne,ve),Me(l,u)}).catch(ke=>{const Ne=ke instanceof Error?ke.message:String(ke);console.error(Es,"GitHub clone failed:",ke),U(Te=>({...Te,status:"error",error:Ne,progress:{stage:"error",message:Ne,percent:0}})),E==null||E(Ne)})}return()=>{var pe;(pe=R.current)==null||pe.teardown(),R.current=null,N.current&&(clearInterval(N.current),N.current=null)}},[]);const xe=K.useCallback(async(ie,pe)=>{const ve=R.current;if(ve){try{await ve.writeFile(ie,pe)}catch(Ee){console.error(`Failed to write file ${ie}:`,Ee)}U(Ee=>{const ke={...Ee.files,[ie]:pe},Ne={...Ee.fileChanges};return ie in Ee.originalFiles?Ee.originalFiles[ie]!==pe?Ne[ie]="modified":delete Ne[ie]:Ne[ie]="new",{...Ee,files:ke,fileChanges:Ne}}),b==null||b(ie,pe)}},[b]),Ce=K.useCallback(ie=>{se(ie),ee(pe=>pe.includes(ie)?pe:[...pe,ie])},[]),ze=K.useCallback(ie=>{ee(pe=>{const ve=pe.filter(Ee=>Ee!==ie);return Y===ie&&se(ve.length>0?ve[ve.length-1]:null),ve})},[Y]),Re=K.useCallback(async()=>{const ie=R.current;ie&&await ie.restart()},[]),tt=K.useCallback(()=>{var ie;return((ie=R.current)==null?void 0:ie.getChangedFiles())??{}},[]);return{state:z,selectedFile:Y,openFiles:ge,handleFileChange:xe,handleSelectFile:Ce,handleCloseFile:ze,handleBrowserError:Oe,restart:Re,getChangedFiles:tt,runtime:R}}function RN(a){const{className:i="",height:l="100vh",port:u=3e3}=a,{state:h,selectedFile:m,openFiles:f,handleFileChange:_,handleSelectFile:b,handleCloseFile:v,handleBrowserError:w,restart:E}=zS(a),A=K.useMemo(()=>NS(h.files),[h.files]),R=h.status!=="ready"&&h.status!=="error",[I,M]=K.useState("code"),B=!!h.previewUrl;K.useEffect(()=>{B&&M("preview")},[B]);const N=K.useCallback(z=>{b(z),M("code")},[b]);return Z.jsxs("div",{className:`sb-root relative w-full bg-sb-bg text-sb-text overflow-hidden flex flex-col ${i}`,style:{height:l},children:[R&&Z.jsx(US,{progress:h.progress}),Z.jsx(DN,{activeView:I,onViewChange:M,previewUrl:h.previewUrl,port:u,onRefresh:E}),Z.jsxs("div",{className:"flex-1 relative overflow-hidden min-h-0",children:[Z.jsx(Od.div,{className:"absolute inset-0",initial:!1,animate:{opacity:I==="code"?1:0,pointerEvents:I==="code"?"auto":"none"},transition:{duration:.15},children:Z.jsx(NN,{fileTree:A,files:h.files,originalFiles:h.originalFiles,fileChanges:h.fileChanges,selectedFile:m,openFiles:f,terminalOutput:h.terminalOutput,onSelectFile:N,onCloseFile:v,onFileChange:_})}),Z.jsx(Od.div,{className:"absolute inset-0",initial:!1,animate:{opacity:I==="preview"?1:0,pointerEvents:I==="preview"?"auto":"none"},transition:{duration:.15},children:Z.jsx($S,{url:h.previewUrl,onBrowserError:w})})]})]})}function PN(a,i){if(!a)return"";const l=a.match(/\/__(?:preview|virtual)__\/\d+(\/.*)?$/),u=(l==null?void 0:l[1])??"/";return`localhost:${i}${u}`}function DN({activeView:a,onViewChange:i,previewUrl:l,port:u,onRefresh:h}){const m=PN(l,u);return Z.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:[Z.jsx(jS,{selected:a,onSelect:i}),Z.jsx("div",{className:"flex-1 min-w-0",children:a==="preview"?Z.jsxs("div",{className:"flex items-center gap-1.5",children:[Z.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:Z.jsx(ON,{})}),Z.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..."})]}):Z.jsx("div",{className:"text-xs text-sb-text-muted px-1 truncate",children:"Editor"})})]})}function ON(){return Z.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Z.jsx("polyline",{points:"23 4 23 10 17 10"}),Z.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})}function NN({fileTree:a,files:i,originalFiles:l,fileChanges:u,selectedFile:h,openFiles:m,terminalOutput:f,onSelectFile:_,onCloseFile:b,onFileChange:v}){return Z.jsx("div",{className:"h-full w-full",children:Z.jsxs(Kr,{children:[Z.jsx(Kr.Pane,{preferredSize:200,minSize:120,maxSize:350,children:Z.jsx(BS,{files:a,selectedFile:h,onSelectFile:_,fileChanges:u})}),Z.jsx(Kr.Pane,{children:Z.jsxs(Kr,{vertical:!0,children:[Z.jsx(Kr.Pane,{preferredSize:"70%",children:Z.jsx(MS,{files:i,originalFiles:l,fileChanges:u,activeFile:h,openFiles:m,onSelectFile:_,onCloseFile:b,onFileChange:v})}),Z.jsx(Kr.Pane,{preferredSize:"30%",minSize:60,children:Z.jsx(FS,{output:f})})]})})]})})}exports.BootOverlay=US;exports.CodeEditor=MS;exports.CodeSandbox=RN;exports.FileTree=BS;exports.GitService=Nd;exports.NodepodRuntime=VS;exports.Preview=$S;exports.Terminal=FS;exports.ViewSlider=jS;exports.buildFileTree=NS;exports.getTemplate=WS;exports.listTemplates=TN;exports.useRuntime=zS;
50074
50342
  //# sourceMappingURL=index.cjs.map