@nywqs/scada-engine 2.0.1 → 2.0.2
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/scada-engine.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(Fe,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("echarts"),require("@antv/x6")):typeof define=="function"&&define.amd?define(["exports","vue","echarts","@antv/x6"],n):(Fe=typeof globalThis<"u"?globalThis:Fe||self,n(Fe.ScadaEngine={},Fe.Vue,Fe.echarts,Fe.X6))})(this,function(Fe,n,Rt,yt){"use strict";var cB=Object.defineProperty;var ky=Fe=>{throw TypeError(Fe)};var dB=(Fe,n,Rt)=>n in Fe?cB(Fe,n,{enumerable:!0,configurable:!0,writable:!0,value:Rt}):Fe[n]=Rt;var Pe=(Fe,n,Rt)=>dB(Fe,typeof n!="symbol"?n+"":n,Rt),Bu=(Fe,n,Rt)=>n.has(Fe)||ky("Cannot "+Rt);var ue=(Fe,n,Rt)=>(Bu(Fe,n,"read from private field"),Rt?Rt.call(Fe):n.get(Fe)),dt=(Fe,n,Rt)=>n.has(Fe)?ky("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(Fe):n.set(Fe,Rt),Qe=(Fe,n,Rt,yt)=>(Bu(Fe,n,"write to private field"),yt?yt.call(Fe,Rt):n.set(Fe,Rt),Rt),Ye=(Fe,n,Rt)=>(Bu(Fe,n,"access private method"),Rt);var ds=(Fe,n,Rt,yt)=>({set _(Fo){Qe(Fe,n,Fo,Rt)},get _(){return ue(Fe,n,yt)}});/*!
|
|
2
|
-
* @nywqs/scada-engine v2.0.
|
|
2
|
+
* @nywqs/scada-engine v2.0.2
|
|
3
3
|
* Copyright (c) 2025 leoncheng
|
|
4
4
|
* Licensed under proprietary license - see LICENSE file
|
|
5
5
|
* Contact: nywqs@outlook.com
|
|
@@ -2688,7 +2688,7 @@ ${t}
|
|
|
2688
2688
|
border-top: 1px solid var(--n-tab-border-color);
|
|
2689
2689
|
`),K("tabs-pad",`
|
|
2690
2690
|
border-top: 1px solid var(--n-tab-border-color);
|
|
2691
|
-
`)])])])]),Yl=jS,aA=Object.assign(Object.assign({},Xe.props),{value:[String,Number],defaultValue:[String,Number],trigger:{type:String,default:"click"},type:{type:String,default:"bar"},closable:Boolean,justifyContent:String,size:{type:String,default:"medium"},placement:{type:String,default:"top"},tabStyle:[String,Object],tabClass:String,addTabStyle:[String,Object],addTabClass:String,barWidth:Number,paneClass:String,paneStyle:[String,Object],paneWrapperClass:String,paneWrapperStyle:[String,Object],addable:[Boolean,Object],tabsPadding:{type:Number,default:0},animated:Boolean,onBeforeLeave:Function,onAdd:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClose:[Function,Array],labelSize:String,activeName:[String,Number],onActiveNameChange:[Function,Array]}),sA=n.defineComponent({name:"Tabs",props:aA,slots:Object,setup(e,{slots:t}){var r,o,i,a;process.env.NODE_ENV!=="production"&&n.watchEffect(()=>{e.labelSize!==void 0&&Dt("tabs","`label-size` is deprecated, please use `size` instead."),e.activeName!==void 0&&Dt("tabs","`active-name` is deprecated, please use `value` instead."),e.onActiveNameChange!==void 0&&Dt("tabs","`on-active-name-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:s,inlineThemeDisabled:l}=st(e),c=Xe("Tabs","-tabs",iA,F2,e,s),d=n.ref(null),u=n.ref(null),f=n.ref(null),h=n.ref(null),g=n.ref(null),p=n.ref(null),m=n.ref(!0),v=n.ref(!0),y=Fi(e,["labelSize","size"]),b=Fi(e,["activeName","value"]),S=n.ref((o=(r=b.value)!==null&&r!==void 0?r:e.defaultValue)!==null&&o!==void 0?o:t.default?(a=(i=pn(t.default())[0])===null||i===void 0?void 0:i.props)===null||a===void 0?void 0:a.name:null),_=Zt(b,S),C={id:0},A=n.computed(()=>{if(!(!e.justifyContent||e.type==="card"))return{display:"flex",justifyContent:e.justifyContent}});n.watch(_,()=>{C.id=0,B(),P()});function k(){var J;const{value:V}=_;return V===null?null:(J=d.value)===null||J===void 0?void 0:J.querySelector(`[data-name="${V}"]`)}function T(J){if(e.type==="card")return;const{value:V}=u;if(!V)return;const me=V.style.opacity==="0";if(J){const ee=`${s.value}-tabs-bar--disabled`,{barWidth:F,placement:oe}=e;if(J.dataset.disabled==="true"?V.classList.add(ee):V.classList.remove(ee),["top","bottom"].includes(oe)){if(R(["top","maxHeight","height"]),typeof F=="number"&&J.offsetWidth>=F){const w=Math.floor((J.offsetWidth-F)/2)+J.offsetLeft;V.style.left=`${w}px`,V.style.maxWidth=`${F}px`}else V.style.left=`${J.offsetLeft}px`,V.style.maxWidth=`${J.offsetWidth}px`;V.style.width="8192px",me&&(V.style.transition="none"),V.offsetWidth,me&&(V.style.transition="",V.style.opacity="1")}else{if(R(["left","maxWidth","width"]),typeof F=="number"&&J.offsetHeight>=F){const w=Math.floor((J.offsetHeight-F)/2)+J.offsetTop;V.style.top=`${w}px`,V.style.maxHeight=`${F}px`}else V.style.top=`${J.offsetTop}px`,V.style.maxHeight=`${J.offsetHeight}px`;V.style.height="8192px",me&&(V.style.transition="none"),V.offsetHeight,me&&(V.style.transition="",V.style.opacity="1")}}}function I(){if(e.type==="card")return;const{value:J}=u;J&&(J.style.opacity="0")}function R(J){const{value:V}=u;if(V)for(const me of J)V.style[me]=""}function B(){if(e.type==="card")return;const J=k();J?T(J):I()}function P(){var J;const V=(J=g.value)===null||J===void 0?void 0:J.$el;if(!V)return;const me=k();if(!me)return;const{scrollLeft:ee,offsetWidth:F}=V,{offsetLeft:oe,offsetWidth:w}=me;ee>oe?V.scrollTo({top:0,left:oe,behavior:"smooth"}):oe+w>ee+F&&V.scrollTo({top:0,left:oe+w-F,behavior:"smooth"})}const O=n.ref(null);let N=0,$=null;function q(J){const V=O.value;if(V){N=J.getBoundingClientRect().height;const me=`${N}px`,ee=()=>{V.style.height=me,V.style.maxHeight=me};$?(ee(),$(),$=null):$=ee}}function z(J){const V=O.value;if(V){const me=J.getBoundingClientRect().height,ee=()=>{document.body.offsetHeight,V.style.maxHeight=`${me}px`,V.style.height=`${Math.max(N,me)}px`};$?($(),$=null,ee()):$=ee}}function L(){const J=O.value;if(J){J.style.maxHeight="",J.style.height="";const{paneWrapperStyle:V}=e;if(typeof V=="string")J.style.cssText=V;else if(V){const{maxHeight:me,height:ee}=V;me!==void 0&&(J.style.maxHeight=me),ee!==void 0&&(J.style.height=ee)}}}const te={value:[]},j=n.ref("next");function se(J){const V=_.value;let me="next";for(const ee of te.value){if(ee===V)break;if(ee===J){me="prev";break}}j.value=me,D(J)}function D(J){const{onActiveNameChange:V,onUpdateValue:me,"onUpdate:value":ee}=e;V&&He(V,J),me&&He(me,J),ee&&He(ee,J),S.value=J}function U(J){const{onClose:V}=e;V&&He(V,J)}function xe(){const{value:J}=u;if(!J)return;const V="transition-disabled";J.classList.add(V),B(),J.classList.remove(V)}const X=n.ref(null);function Ce({transitionDisabled:J}){const V=d.value;if(!V)return;J&&V.classList.add("transition-disabled");const me=k();me&&X.value&&(X.value.style.width=`${me.offsetWidth}px`,X.value.style.height=`${me.offsetHeight}px`,X.value.style.transform=`translateX(${me.offsetLeft-Lt(getComputedStyle(V).paddingLeft)}px)`,J&&X.value.offsetWidth),J&&V.classList.remove("transition-disabled")}n.watch([_],()=>{e.type==="segment"&&n.nextTick(()=>{Ce({transitionDisabled:!1})})}),n.onMounted(()=>{e.type==="segment"&&Ce({transitionDisabled:!0})});let ne=0;function Y(J){var V;if(J.contentRect.width===0&&J.contentRect.height===0||ne===J.contentRect.width)return;ne=J.contentRect.width;const{type:me}=e;if((me==="line"||me==="bar")&&xe(),me!=="segment"){const{placement:ee}=e;_e((ee==="top"||ee==="bottom"?(V=g.value)===null||V===void 0?void 0:V.$el:p.value)||null)}}const be=Yl(Y,64);n.watch([()=>e.justifyContent,()=>e.size],()=>{n.nextTick(()=>{const{type:J}=e;(J==="line"||J==="bar")&&xe()})});const ce=n.ref(!1);function pe(J){var V;const{target:me,contentRect:{width:ee,height:F}}=J,oe=me.parentElement.parentElement.offsetWidth,w=me.parentElement.parentElement.offsetHeight,{placement:x}=e;if(!ce.value)x==="top"||x==="bottom"?oe<ee&&(ce.value=!0):w<F&&(ce.value=!0);else{const{value:E}=h;if(!E)return;x==="top"||x==="bottom"?oe-ee>E.$el.offsetWidth&&(ce.value=!1):w-F>E.$el.offsetHeight&&(ce.value=!1)}_e(((V=g.value)===null||V===void 0?void 0:V.$el)||null)}const he=Yl(pe,64);function Te(){const{onAdd:J}=e;J&&J(),n.nextTick(()=>{const V=k(),{value:me}=g;!V||!me||me.scrollTo({left:V.offsetLeft,top:0,behavior:"smooth"})})}function _e(J){if(!J)return;const{placement:V}=e;if(V==="top"||V==="bottom"){const{scrollLeft:me,scrollWidth:ee,offsetWidth:F}=J;m.value=me<=0,v.value=me+F>=ee}else{const{scrollTop:me,scrollHeight:ee,offsetHeight:F}=J;m.value=me<=0,v.value=me+F>=ee}}const Z=Yl(J=>{_e(J.target)},64);n.provide(Gl,{triggerRef:n.toRef(e,"trigger"),tabStyleRef:n.toRef(e,"tabStyle"),tabClassRef:n.toRef(e,"tabClass"),addTabStyleRef:n.toRef(e,"addTabStyle"),addTabClassRef:n.toRef(e,"addTabClass"),paneClassRef:n.toRef(e,"paneClass"),paneStyleRef:n.toRef(e,"paneStyle"),mergedClsPrefixRef:s,typeRef:n.toRef(e,"type"),closableRef:n.toRef(e,"closable"),valueRef:_,tabChangeIdRef:C,onBeforeLeaveRef:n.toRef(e,"onBeforeLeave"),activateTab:se,handleClose:U,handleAdd:Te}),lf(()=>{B(),P()}),n.watchEffect(()=>{const{value:J}=f;if(!J)return;const{value:V}=s,me=`${V}-tabs-nav-scroll-wrapper--shadow-start`,ee=`${V}-tabs-nav-scroll-wrapper--shadow-end`;m.value?J.classList.remove(me):J.classList.add(me),v.value?J.classList.remove(ee):J.classList.add(ee)});const fe={syncBarPosition:()=>{B()}},ie=()=>{Ce({transitionDisabled:!0})},re=n.computed(()=>{const{value:J}=y,{type:V}=e,me={card:"Card",bar:"Bar",line:"Line",segment:"Segment"}[V],ee=`${J}${me}`,{self:{barColor:F,closeIconColor:oe,closeIconColorHover:w,closeIconColorPressed:x,tabColor:E,tabBorderColor:M,paneTextColor:W,tabFontWeight:Q,tabBorderRadius:we,tabFontWeightActive:ae,colorSegment:ge,fontWeightStrong:Be,tabColorSegment:H,closeSize:ve,closeIconSize:Ae,closeColorHover:Le,closeColorPressed:We,closeBorderRadius:Ve,[Me("panePadding",J)]:Ue,[Me("tabPadding",ee)]:De,[Me("tabPaddingVertical",ee)]:Ke,[Me("tabGap",ee)]:et,[Me("tabGap",`${ee}Vertical`)]:ct,[Me("tabTextColor",V)]:bt,[Me("tabTextColorActive",V)]:Pt,[Me("tabTextColorHover",V)]:G,[Me("tabTextColorDisabled",V)]:le,[Me("tabFontSize",J)]:ze},common:{cubicBezierEaseInOut:je}}=c.value;return{"--n-bezier":je,"--n-color-segment":ge,"--n-bar-color":F,"--n-tab-font-size":ze,"--n-tab-text-color":bt,"--n-tab-text-color-active":Pt,"--n-tab-text-color-disabled":le,"--n-tab-text-color-hover":G,"--n-pane-text-color":W,"--n-tab-border-color":M,"--n-tab-border-radius":we,"--n-close-size":ve,"--n-close-icon-size":Ae,"--n-close-color-hover":Le,"--n-close-color-pressed":We,"--n-close-border-radius":Ve,"--n-close-icon-color":oe,"--n-close-icon-color-hover":w,"--n-close-icon-color-pressed":x,"--n-tab-color":E,"--n-tab-font-weight":Q,"--n-tab-font-weight-active":ae,"--n-tab-padding":De,"--n-tab-padding-vertical":Ke,"--n-tab-gap":et,"--n-tab-gap-vertical":ct,"--n-pane-padding-left":zt(Ue,"left"),"--n-pane-padding-right":zt(Ue,"right"),"--n-pane-padding-top":zt(Ue,"top"),"--n-pane-padding-bottom":zt(Ue,"bottom"),"--n-font-weight-strong":Be,"--n-tab-color-segment":H}}),ye=l?vt("tabs",n.computed(()=>`${y.value[0]}${e.type[0]}`),re,e):void 0;return Object.assign({mergedClsPrefix:s,mergedValue:_,renderedNames:new Set,segmentCapsuleElRef:X,tabsPaneWrapperRef:O,tabsElRef:d,barElRef:u,addTabInstRef:h,xScrollInstRef:g,scrollWrapperElRef:f,addTabFixed:ce,tabWrapperStyle:A,handleNavResize:be,mergedSize:y,handleScroll:Z,handleTabsResize:he,cssVars:l?void 0:re,themeClass:ye==null?void 0:ye.themeClass,animationDirection:j,renderNameListRef:te,yScrollElRef:p,handleSegmentResize:ie,onAnimationBeforeLeave:q,onAnimationEnter:z,onAnimationAfterEnter:L,onRender:ye==null?void 0:ye.onRender},fe)},render(){const{mergedClsPrefix:e,type:t,placement:r,addTabFixed:o,addable:i,mergedSize:a,renderNameListRef:s,onRender:l,paneWrapperClass:c,paneWrapperStyle:d,$slots:{default:u,prefix:f,suffix:h}}=this;l==null||l();const g=u?pn(u()).filter(C=>C.type.__TAB_PANE__===!0):[],p=u?pn(u()).filter(C=>C.type.__TAB__===!0):[],m=!p.length,v=t==="card",y=t==="segment",b=!v&&!y&&this.justifyContent;s.value=[];const S=()=>{const C=n.h("div",{style:this.tabWrapperStyle,class:`${e}-tabs-wrapper`},b?null:n.h("div",{class:`${e}-tabs-scroll-padding`,style:r==="top"||r==="bottom"?{width:`${this.tabsPadding}px`}:{height:`${this.tabsPadding}px`}}),m?g.map((A,k)=>(s.value.push(A.props.name),Xl(n.h(Kl,Object.assign({},A.props,{internalCreatedByPane:!0,internalLeftPadded:k!==0&&(!b||b==="center"||b==="start"||b==="end")}),A.children?{default:A.children.tab}:void 0)))):p.map((A,k)=>(s.value.push(A.props.name),Xl(k!==0&&!b?ug(A):A))),!o&&i&&v?dg(i,(m?g.length:p.length)!==0):null,b?null:n.h("div",{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}));return n.h("div",{ref:"tabsElRef",class:`${e}-tabs-nav-scroll-content`},v&&i?n.h(Hr,{onResize:this.handleTabsResize},{default:()=>C}):C,v?n.h("div",{class:`${e}-tabs-pad`}):null,v?null:n.h("div",{ref:"barElRef",class:`${e}-tabs-bar`}))},_=y?"top":r;return n.h("div",{class:[`${e}-tabs`,this.themeClass,`${e}-tabs--${t}-type`,`${e}-tabs--${a}-size`,b&&`${e}-tabs--flex`,`${e}-tabs--${_}`],style:this.cssVars},n.h("div",{class:[`${e}-tabs-nav--${t}-type`,`${e}-tabs-nav--${_}`,`${e}-tabs-nav`]},lt(f,C=>C&&n.h("div",{class:`${e}-tabs-nav__prefix`},C)),y?n.h(Hr,{onResize:this.handleSegmentResize},{default:()=>n.h("div",{class:`${e}-tabs-rail`,ref:"tabsElRef"},n.h("div",{class:`${e}-tabs-capsule`,ref:"segmentCapsuleElRef"},n.h("div",{class:`${e}-tabs-wrapper`},n.h("div",{class:`${e}-tabs-tab`}))),m?g.map((C,A)=>(s.value.push(C.props.name),n.h(Kl,Object.assign({},C.props,{internalCreatedByPane:!0,internalLeftPadded:A!==0}),C.children?{default:C.children.tab}:void 0))):p.map((C,A)=>(s.value.push(C.props.name),A===0?C:ug(C))))}):n.h(Hr,{onResize:this.handleNavResize},{default:()=>n.h("div",{class:`${e}-tabs-nav-scroll-wrapper`,ref:"scrollWrapperElRef"},["top","bottom"].includes(_)?n.h(mv,{ref:"xScrollInstRef",onScroll:this.handleScroll},{default:S}):n.h("div",{class:`${e}-tabs-nav-y-scroll`,onScroll:this.handleScroll,ref:"yScrollElRef"},S()))}),o&&i&&v?dg(i,!0):null,lt(h,C=>C&&n.h("div",{class:`${e}-tabs-nav__suffix`},C))),m&&(this.animated&&(_==="top"||_==="bottom")?n.h("div",{ref:"tabsPaneWrapperRef",style:d,class:[`${e}-tabs-pane-wrapper`,c]},cg(g,this.mergedValue,this.renderedNames,this.onAnimationBeforeLeave,this.onAnimationEnter,this.onAnimationAfterEnter,this.animationDirection)):cg(g,this.mergedValue,this.renderedNames)))}});function cg(e,t,r,o,i,a,s){const l=[];return e.forEach(c=>{const{name:d,displayDirective:u,"display-directive":f}=c.props,h=p=>u===p||f===p,g=t===d;if(c.key!==void 0&&(c.key=d),g||h("show")||h("show:lazy")&&r.has(d)){r.has(d)||r.add(d);const p=!h("if");l.push(p?n.withDirectives(c,[[n.vShow,g]]):c)}}),s?n.h(n.TransitionGroup,{name:`${s}-transition`,onBeforeLeave:o,onEnter:i,onAfterEnter:a},{default:()=>l}):l}function dg(e,t){return n.h(Kl,{ref:"addTabInstRef",key:"__addable",name:"__addable",internalCreatedByPane:!0,internalAddable:!0,internalLeftPadded:t,disabled:typeof e=="object"&&e.disabled})}function ug(e){const t=n.cloneVNode(e);return t.props?t.props.internalLeftPadded=!0:t.props={internalLeftPadded:!0},t}function Xl(e){return Array.isArray(e.dynamicProps)?e.dynamicProps.includes("internalLeftPadded")||e.dynamicProps.push("internalLeftPadded"):e.dynamicProps=["internalLeftPadded"],e}const lA={version:"2.0.1"},cA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},dA=n.defineComponent({name:"ArrowRedoOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",cA,r[0]||(r[0]=[n.createElementVNode("path",{d:"M448 256L272 88v96C103.57 184 64 304.77 64 424c48.61-62.24 91.6-96 208-96v96z",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1)]))}}),uA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},fA=n.defineComponent({name:"ArrowUndoOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",uA,r[0]||(r[0]=[n.createElementVNode("path",{d:"M240 424v-96c116.4 0 159.39 33.76 208 96c0-119.23-39.57-240-208-240V88L64 256z",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1)]))}}),hA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Ao=n.defineComponent({name:"CloseOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",hA,r[0]||(r[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 368L144 144"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 144L144 368"},null,-1)]))}}),pA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},gA=n.defineComponent({name:"DownloadOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",pA,r[0]||(r[0]=[n.createElementVNode("path",{d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M176 272l80 80l80-80"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 48v288"},null,-1)]))}}),mA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},fg=n.defineComponent({name:"EyeOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",mA,r[0]||(r[0]=[n.createElementVNode("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),n.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)]))}}),bA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},yA=n.defineComponent({name:"FolderOpenOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",bA,r[0]||(r[0]=[n.createElementVNode("path",{d:"M64 192v-72a40 40 0 0 1 40-40h75.89a40 40 0 0 1 22.19 6.72l27.84 18.56a40 40 0 0 0 22.19 6.72H408a40 40 0 0 1 40 40v40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),n.createElementVNode("path",{d:"M479.9 226.55L463.68 392a40 40 0 0 1-39.93 40H88.25a40 40 0 0 1-39.93-40L32.1 226.55A32 32 0 0 1 64 192h384.1a32 32 0 0 1 31.8 34.55z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)]))}}),vA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},wA=n.defineComponent({name:"GitNetworkOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",vA,r[0]||(r[0]=[n.createStaticVNode('<circle cx="128" cy="96" r="48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></circle><circle cx="256" cy="416" r="48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></circle><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M256 256v112"></path><circle cx="384" cy="96" r="48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></circle><path d="M128 144c0 74.67 68.92 112 128 112" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path><path d="M384 144c0 74.67-68.92 112-128 112" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path>',6)]))}}),xA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},hg=n.defineComponent({name:"InformationCircleOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",xA,r[0]||(r[0]=[n.createElementVNode("path",{d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),n.createElementVNode("path",{d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26z",fill:"currentColor"},null,-1)]))}}),CA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},SA=n.defineComponent({name:"SaveOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",CA,r[0]||(r[0]=[n.createElementVNode("path",{d:"M380.93 57.37A32 32 0 0 0 358.3 48H94.22A46.21 46.21 0 0 0 48 94.22v323.56A46.21 46.21 0 0 0 94.22 464h323.56A46.36 46.36 0 0 0 464 417.78V153.7a32 32 0 0 0-9.37-22.63zM256 416a64 64 0 1 1 64-64a63.92 63.92 0 0 1-64 64zm48-224H112a16 16 0 0 1-16-16v-64a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16v64a16 16 0 0 1-16 16z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)]))}}),_A={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},pg=n.defineComponent({name:"SearchOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",_A,r[0]||(r[0]=[n.createElementVNode("path",{d:"M221.09 64a157.09 157.09 0 1 0 157.09 157.09A157.1 157.1 0 0 0 221.09 64z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M338.29 338.29L448 448"},null,-1)]))}}),kA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},EA=n.defineComponent({name:"ServerOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",kA,r[0]||(r[0]=[n.createElementVNode("ellipse",{cx:"256",cy:"128",rx:"192",ry:"80",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),n.createElementVNode("path",{d:"M448 214c0 44.18-86 80-192 80S64 258.18 64 214",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),n.createElementVNode("path",{d:"M448 300c0 44.18-86 80-192 80S64 344.18 64 300",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),n.createElementVNode("path",{d:"M64 127.24v257.52C64 428.52 150 464 256 464s192-35.48 192-79.24V127.24",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1)]))}}),TA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Jl=n.defineComponent({name:"TrashOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",TA,r[0]||(r[0]=[n.createStaticVNode('<path d="M112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M80 112h352" fill="currentColor"></path><path d="M192 112V72h0a23.93 23.93 0 0 1 24-24h80a23.93 23.93 0 0 1 24 24h0v40" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M256 176v224"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M184 176l8 224"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M328 176l-8 224"></path>',6)]))}}),AA={class:"scada-header"},PA={class:"header-left"},IA={class:"header-center"},RA={class:"header-right"},NA=n.defineComponent({__name:"Header",props:{selectedNodesCount:{default:0}},emits:["save","import","workflow","preview","export","dataSource","undo","redo","alignLeft","alignCenter","alignRight","alignTop","alignMiddle","alignBottom","distributeHorizontal","distributeVertical"],setup(e,{emit:t}){const r=lA.version,o={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},i=n.defineComponent({render:()=>n.h("svg",o,[n.h("line",{x1:"4",y1:"2",x2:"4",y2:"22"}),n.h("rect",{x:"4",y:"6",width:"16",height:"4",rx:"1"}),n.h("rect",{x:"4",y:"14",width:"10",height:"4",rx:"1"})])}),a=n.defineComponent({render:()=>n.h("svg",o,[n.h("line",{x1:"12",y1:"2",x2:"12",y2:"22"}),n.h("rect",{x:"4",y:"6",width:"16",height:"4",rx:"1"}),n.h("rect",{x:"7",y:"14",width:"10",height:"4",rx:"1"})])}),s=n.defineComponent({render:()=>n.h("svg",o,[n.h("line",{x1:"20",y1:"2",x2:"20",y2:"22"}),n.h("rect",{x:"4",y:"6",width:"16",height:"4",rx:"1"}),n.h("rect",{x:"10",y:"14",width:"10",height:"4",rx:"1"})])}),l=n.defineComponent({render:()=>n.h("svg",o,[n.h("line",{x1:"2",y1:"4",x2:"22",y2:"4"}),n.h("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),n.h("rect",{x:"14",y:"4",width:"4",height:"10",rx:"1"})])}),c=n.defineComponent({render:()=>n.h("svg",o,[n.h("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),n.h("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),n.h("rect",{x:"14",y:"7",width:"4",height:"10",rx:"1"})])}),d=n.defineComponent({render:()=>n.h("svg",o,[n.h("line",{x1:"2",y1:"20",x2:"22",y2:"20"}),n.h("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),n.h("rect",{x:"14",y:"10",width:"4",height:"10",rx:"1"})])}),u=n.defineComponent({render:()=>n.h("svg",o,[n.h("rect",{x:"3",y:"6",width:"4",height:"12",rx:"1"}),n.h("rect",{x:"10",y:"6",width:"4",height:"12",rx:"1"}),n.h("rect",{x:"17",y:"6",width:"4",height:"12",rx:"1"})])}),f=n.defineComponent({render:()=>n.h("svg",o,[n.h("rect",{x:"6",y:"3",width:"12",height:"4",rx:"1"}),n.h("rect",{x:"6",y:"10",width:"12",height:"4",rx:"1"}),n.h("rect",{x:"6",y:"17",width:"12",height:"4",rx:"1"})])}),h=e,g=t,p=[{label:"导出 PNG 图片",key:"png"},{label:"导出 SVG 图片",key:"svg"},{label:"导出 JSON 配置",key:"json"}],m=v=>{g("export",v)};return(v,y)=>{const b=wn,S=Wt,_=Ct,C=Kk,A=m2;return n.openBlock(),n.createElementBlock("header",AA,[n.createElementVNode("div",PA,[n.renderSlot(v.$slots,"left",{},()=>[y[15]||(y[15]=n.createElementVNode("h1",{class:"logo"},"SCADA 组态引擎",-1)),n.createVNode(b,{type:"info",size:"small"},{default:n.withCtx(()=>[n.createTextVNode("v"+n.toDisplayString(n.unref(r)),1)]),_:1})],!0)]),n.createElementVNode("div",IA,[h.selectedNodesCount>=2?(n.openBlock(),n.createBlock(C,{key:0},{default:n.withCtx(()=>[n.createVNode(_,{class:"toolbar-btn",onClick:y[0]||(y[0]=k=>g("alignLeft")),title:"左对齐",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(i)},null,8,["component"])]),_:1}),n.createVNode(_,{class:"toolbar-btn",onClick:y[1]||(y[1]=k=>g("alignCenter")),title:"水平居中",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(a)},null,8,["component"])]),_:1}),n.createVNode(_,{class:"toolbar-btn",onClick:y[2]||(y[2]=k=>g("alignRight")),title:"右对齐",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(s)},null,8,["component"])]),_:1}),n.createVNode(_,{class:"toolbar-btn",onClick:y[3]||(y[3]=k=>g("alignTop")),title:"顶部对齐",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(l)},null,8,["component"])]),_:1}),n.createVNode(_,{class:"toolbar-btn",onClick:y[4]||(y[4]=k=>g("alignMiddle")),title:"垂直居中",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(c)},null,8,["component"])]),_:1}),n.createVNode(_,{class:"toolbar-btn",onClick:y[5]||(y[5]=k=>g("alignBottom")),title:"底部对齐",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(d)},null,8,["component"])]),_:1})]),_:1})):n.createCommentVNode("",!0),h.selectedNodesCount>=3?(n.openBlock(),n.createBlock(C,{key:1},{default:n.withCtx(()=>[n.createVNode(_,{class:"toolbar-btn",onClick:y[6]||(y[6]=k=>g("distributeHorizontal")),title:"横向分布",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(u)},null,8,["component"])]),_:1}),n.createVNode(_,{class:"toolbar-btn",onClick:y[7]||(y[7]=k=>g("distributeVertical")),title:"纵向分布",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(f)},null,8,["component"])]),_:1})]),_:1})):n.createCommentVNode("",!0)]),n.createElementVNode("div",RA,[n.createVNode(C,null,{default:n.withCtx(()=>[n.createVNode(_,{class:"header-btn",onClick:y[8]||(y[8]=k=>g("undo")),title:"撤销 (Ctrl+Z)"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(fA))]),_:1})]),_:1}),n.createVNode(_,{class:"header-btn",onClick:y[9]||(y[9]=k=>g("redo")),title:"重做 (Ctrl+Shift+Z)"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(dA))]),_:1})]),_:1})]),_:1}),n.createVNode(_,{class:"header-btn",onClick:y[10]||(y[10]=k=>g("dataSource")),title:"数据源管理"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(EA))]),_:1})]),default:n.withCtx(()=>[y[16]||(y[16]=n.createTextVNode(" 数据源 ",-1))]),_:1}),n.createVNode(_,{class:"header-btn",onClick:y[11]||(y[11]=k=>g("workflow")),title:"流程编排"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(wA))]),_:1})]),default:n.withCtx(()=>[y[17]||(y[17]=n.createTextVNode(" 流程编排 ",-1))]),_:1}),n.createVNode(_,{class:"header-btn",onClick:y[12]||(y[12]=k=>g("import")),title:"导入"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(yA))]),_:1})]),default:n.withCtx(()=>[y[18]||(y[18]=n.createTextVNode(" 导入 ",-1))]),_:1}),n.createVNode(A,{options:p,trigger:"click",onSelect:m},{default:n.withCtx(()=>[n.createVNode(_,{class:"header-btn",title:"导出"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(gA))]),_:1})]),default:n.withCtx(()=>[y[19]||(y[19]=n.createTextVNode(" 导出 ",-1))]),_:1})]),_:1}),n.createVNode(_,{class:"header-btn",onClick:y[13]||(y[13]=k=>g("preview")),title:"预览"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(fg))]),_:1})]),default:n.withCtx(()=>[y[20]||(y[20]=n.createTextVNode(" 预览 ",-1))]),_:1}),n.createVNode(_,{class:"header-btn",onClick:y[14]||(y[14]=k=>g("save")),title:"保存",type:"primary"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(SA))]),_:1})]),default:n.withCtx(()=>[y[21]||(y[21]=n.createTextVNode(" 保存 ",-1))]),_:1})])])}}}),gt=(e,t)=>{const r=e.__vccOpts||e;for(const[o,i]of t)r[o]=i;return r},Ql=gt(NA,[["__scopeId","data-v-cad16ed2"]]),wr="#31d0c6",xr="#fff",Cr=2,qt=4,$A="#999999",OA="#0f172a",BA="#1e293b",gg=[{id:"basic",name:"基础仪表盘",config:{min:0,max:100,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.3,"#67e0e3"],[.7,"#37a2da"],[1,"#fd666d"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value}"}}},{id:"temperature",name:"温度仪表盘",config:{min:-20,max:50,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.2,"#2563eb"],[.5,"#22c55e"],[.8,"#f59e0b"],[1,"#ef4444"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:10,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value}°C"}}},{id:"humidity",name:"湿度仪表盘",config:{min:0,max:100,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.3,"#fbbf24"],[.7,"#3b82f6"],[1,"#1e40af"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value}%"}}},{id:"speed",name:"速度仪表盘",config:{min:0,max:200,splitNumber:10,startAngle:225,endAngle:-45,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.4,"#10b981"],[.7,"#f59e0b"],[1,"#ef4444"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value} km/h"}}},{id:"pressure",name:"压力仪表盘",config:{min:0,max:10,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.5,"#22c55e"],[.8,"#f59e0b"],[1,"#dc2626"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value} MPa"}}},{id:"rpm",name:"转速仪表盘",config:{min:0,max:8e3,splitNumber:8,startAngle:225,endAngle:-45,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.6,"#06b6d4"],[.85,"#eab308"],[1,"#dc2626"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value} RPM"}}},{id:"battery",name:"电池仪表盘",config:{min:0,max:100,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.2,"#dc2626"],[.5,"#f59e0b"],[1,"#22c55e"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:10,fontSize:12,color:"#999"},title:{offsetCenter:[0,"80%"],fontSize:12,color:"#999"},detail:{fontSize:20,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value}%"}}},{id:"power",name:"功率仪表盘",config:{min:0,max:100,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.3,"#64748b"],[.7,"#3b82f6"],[1,"#8b5cf6"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:10,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:12,color:"#999"},detail:{fontSize:20,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value} kW"}}}];function MA(e){return gg.find(t=>t.id===e)}const mg={metadata:{id:"echarts-gauge",name:"仪表盘",category:"iot",icon:"📈",description:"ECharts 仪表盘数据展示组件,支持丰富的配置选项",version:"1.0.0"},shape:"echarts-vue",component:gt(n.defineComponent({__name:"EChartsGauge",props:{node:{}},setup(e){const t=e,r=n.ref();let o=null;const i=()=>t.node?t.node.getData?t.node.getData():t.node.data||{}:{},a=()=>{r.value&&(o&&o.dispose(),o=Lu.init(r.value),s())},s=()=>{if(!o)return;const l=i(),c=l.presetId||"basic",d=MA(c),u={tooltip:{formatter:"{a} <br/>{b} : {c}%"},series:[{name:l.name||"Pressure",type:"gauge",data:[{value:l.value??50,name:l.title||"SCORE"}]}]};d&&d.config&&Object.assign(u.series[0],d.config),o.setOption(u,!0)};return n.watch(()=>{var l;return(l=t.node)==null?void 0:l.data},(l,c)=>{s()},{deep:!0}),n.watch(()=>{var l,c;return(c=(l=t.node)==null?void 0:l.data)==null?void 0:c.presetId},(l,c)=>{l!==c&&s()}),n.watch(()=>{var l;return(l=t.node)==null?void 0:l.size},()=>{if(o&&t.node){const l=t.node.getSize?t.node.getSize():t.node.size||{width:200,height:200};o.resize({width:l.width,height:l.height})}},{deep:!0}),n.onMounted(()=>{setTimeout(()=>{a(),t.node&&typeof t.node.on=="function"&&t.node.on("change:data",({current:l})=>{s()})},100)}),n.onUnmounted(()=>{o&&(o.dispose(),o=null)}),(l,c)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"chartRef",ref:r,class:"echarts-gauge-component",style:{width:"100%",height:"100%"}},null,512))}}),[["__scopeId","data-v-3a9c4466"]]),width:200,height:200,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"echarts-gauge",presetId:"basic",value:50,title:"SCORE",name:"Pressure"},ports:{groups:{top:{position:"top",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}},right:{position:"right",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}},bottom:{position:"bottom",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}},left:{position:"left",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"presetId",label:"仪表盘类型",type:"select",path:"data.presetId",defaultValue:"basic",options:gg.map(e=>({label:e.name,value:e.id})),description:"选择预设的仪表盘类型,会自动应用对应的配置"},{key:"value",label:"当前值",type:"number",path:"data.value",defaultValue:50,description:"仪表盘当前显示值",bindable:!0},{key:"title",label:"标题",type:"text",path:"data.title",defaultValue:"SCORE",description:"仪表盘标题"},{key:"name",label:"系列名称",type:"text",path:"data.name",defaultValue:"Pressure",description:"显示在 tooltip 中的系列名称"}],points:[{id:"value",name:"当前值",description:"仪表盘当前显示的数值",dataType:"number",defaultValue:50,required:!0,range:{min:0,max:100}},{id:"min",name:"最小值",description:"仪表盘刻度最小值",dataType:"number",defaultValue:0,required:!1},{id:"max",name:"最大值",description:"仪表盘刻度最大值",dataType:"number",defaultValue:100,required:!1},{id:"title",name:"标题",description:"仪表盘显示标题",dataType:"string",defaultValue:"SCORE",required:!1}]},bg=[{id:"basic",name:"基础折线图",config:{smooth:!1,lineStyle:{width:2,color:"#5470c6"},areaStyle:null,symbol:"circle",symbolSize:6,radius:"100%"}},{id:"smooth",name:"平滑曲线",config:{smooth:!0,lineStyle:{width:2,color:"#91cc75"},areaStyle:null,symbol:"circle",symbolSize:6}},{id:"area",name:"区域折线图",config:{smooth:!1,lineStyle:{width:2,color:"#5470c6"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(84, 112, 198, 0.3)"},{offset:1,color:"rgba(84, 112, 198, 0.05)"}]}},symbol:"circle",symbolSize:6}},{id:"smooth-area",name:"平滑区域图",config:{smooth:!0,lineStyle:{width:2,color:"#91cc75"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(145, 204, 117, 0.3)"},{offset:1,color:"rgba(145, 204, 117, 0.05)"}]}},symbol:"circle",symbolSize:6}},{id:"dashed",name:"虚线折线图",config:{smooth:!1,lineStyle:{width:2,color:"#fac858",type:"dashed"},areaStyle:null,symbol:"circle",symbolSize:6}},{id:"step",name:"阶梯折线图",config:{smooth:!1,step:"middle",lineStyle:{width:2,color:"#ee6666"},areaStyle:null,symbol:"circle",symbolSize:6}}];function zA(e){return bg.find(t=>t.id===e)}const yg={metadata:{id:"echarts-line",name:"折线图",category:"iot",icon:"📉",description:"ECharts 折线图数据展示组件,支持时序数据可视化",version:"1.0.0"},shape:"echarts-line-vue",component:n.defineComponent({__name:"EChartsLine",props:{node:{}},setup(e){const t=e,r=n.ref();let o=null;const i=()=>t.node?t.node.getData?t.node.getData():t.node.data||{}:{},a=()=>{r.value&&(o=Lu.init(r.value),s())},s=()=>{if(!o)return;const l=i(),c=l.presetId||"basic",d=zA(c),u={title:{text:l.title||"数据趋势",left:"center",top:10,textStyle:{color:"#fff",fontSize:14}},tooltip:{trigger:"axis",backgroundColor:"rgba(0, 0, 0, 0.7)",borderColor:"#333",textStyle:{color:"#fff"}},grid:{left:"10%",right:"10%",top:"20%",bottom:"15%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:l.xAxisData||["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],axisLine:{lineStyle:{color:"#999"}},axisLabel:{color:"#999"}},yAxis:{type:"value",axisLine:{lineStyle:{color:"#999"}},axisLabel:{color:"#999"},splitLine:{lineStyle:{color:"rgba(255, 255, 255, 0.1)"}}},series:[{name:l.seriesName||"Data",type:"line",data:l.seriesData||[120,200,150,80,70,110,130]}]};d&&d.config&&Object.assign(u.series[0],d.config),o.setOption(u,!0)};return n.onMounted(()=>{setTimeout(()=>{a(),t.node&&typeof t.node.on=="function"&&t.node.on("change:data",({current:l})=>{s()})},100)}),n.onUnmounted(()=>{o&&(o.dispose(),o=null)}),(l,c)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"chartContainer",ref:r,style:{width:"100%",height:"100%"}},null,512))}}),width:400,height:300,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"echarts-line",presetId:"basic",title:"数据趋势",xAxisData:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],seriesData:[120,200,150,80,70,110,130],seriesName:"Data"},ports:{groups:{top:{position:"top",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}},right:{position:"right",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}},bottom:{position:"bottom",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}},left:{position:"left",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"presetId",label:"折线图类型",type:"select",path:"data.presetId",defaultValue:"basic",options:bg.map(e=>({label:e.name,value:e.id})),description:"选择预设的折线图类型"},{key:"title",label:"图表标题",type:"text",path:"data.title",defaultValue:"数据趋势",description:"折线图标题"},{key:"seriesName",label:"系列名称",type:"text",path:"data.seriesName",defaultValue:"Data",description:"显示在 tooltip 和 legend 中的系列名称"}],points:[{id:"series_data",name:"系列数据",description:"折线图Y轴数据数组",dataType:"json",defaultValue:[120,200,150,80,70,110,130],required:!0},{id:"x_axis_data",name:"X轴数据",description:"折线图X轴标签数组",dataType:"json",defaultValue:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],required:!1},{id:"title",name:"图表标题",description:"折线图显示标题",dataType:"string",defaultValue:"数据趋势",required:!1}]},DA=Object.freeze(Object.defineProperty({__proto__:null,EChartsGaugeComponent:mg,EChartsLineComponent:yg},Symbol.toStringTag,{value:"Module"}));function vg(e){const t=yt.Markup.getForeignObjectMarkup();return e?[{tagName:e,selector:"body"},t]:[t]}yt.Graph.registerNode("vue-shape",{view:"vue-shape-view",markup:vg(),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}},propHooks(e){if(e.markup==null){const t=e.primer;if(t){e.markup=vg(t);let r={};switch(t){case"circle":r={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":r={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"};break}e.attrs=yt.ObjectExt.merge({},{body:Object.assign({refWidth:null,refHeight:null},r)},e.attrs||{})}}return e}},!0);var FA=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]]);return r};const wg={};function VA(e){const{shape:t,component:r,inherit:o}=e,i=FA(e,["shape","component","inherit"]);if(!t)throw new Error("should specify shape in config");wg[t]={component:r},yt.Graph.registerNode(t,Object.assign({inherit:o||"vue-shape"},i),!0)}n.reactive({});class Qn extends yt.NodeView{getComponentContainer(){return this.selectors&&this.selectors.foContent}confirmUpdate(t){const r=super.confirmUpdate(t);return this.handleAction(r,Qn.action,()=>{this.renderVueComponent()})}targetId(){return`${this.graph.view.cid}:${this.cell.id}`}renderVueComponent(){this.unmountVueComponent();const t=this.getComponentContainer(),r=this.cell,o=this.graph;if(t){const{component:i}=wg[r.shape];i&&(this.vm=n.createApp({render(){return n.h(i,{node:r,graph:o})},provide(){return{getNode:()=>r,getGraph:()=>o}}}),this.vm.mount(t))}}unmountVueComponent(){const t=this.getComponentContainer();return this.vm&&(this.vm.unmount(),this.vm=null),t&&(t.innerHTML=""),t}onMouseDown(t,r,o){const i=t.target;if(i.tagName.toLowerCase()==="input"){const s=i.getAttribute("type");if(s==null||["text","password","number","email","search","tel","url"].includes(s))return}super.onMouseDown(t,r,o)}unmount(){return this.unmountVueComponent(),super.unmount(),this}}Qn.action="vue",Qn.config({bootstrap:[Qn.action],actions:{component:Qn.action}}),yt.NodeView.registry.register("vue-shape-view",Qn,!0);const Zl=[{key:"animationEnabled",label:"启用动画",type:"boolean",path:"data.animation.enabled",defaultValue:!1,description:"是否启用动画效果",bindable:!0},{key:"animationType",label:"动画类型",type:"select",path:"data.animation.type",defaultValue:"none",options:[{label:"无动画",value:"none"},{label:"闪烁",value:"blink"},{label:"缩放",value:"scale"},{label:"旋转",value:"rotate"},{label:"浮动",value:"float"},{label:"脉冲",value:"pulse"},{label:"流动",value:"speed-flow"},{label:"颜色变化",value:"color"}],description:"组件动画效果类型",bindable:!1},{key:"animationDuration",label:"动画时长(ms)",type:"number",path:"data.animation.duration",defaultValue:1e3,min:100,max:5e3,step:100,description:"动画完成一次所需时间",bindable:!1},{key:"animationLoop",label:"循环播放",type:"boolean",path:"data.animation.loop",defaultValue:!0,description:"是否循环播放动画",bindable:!1}];class LA{constructor(){Pe(this,"registry",{});Pe(this,"lazyRegistry",new Map);Pe(this,"loadingPromises",new Map);this.registerDefaultComponents(),this.registerLazyComponents()}registerDefaultComponents(){this.register(mg),this.register(yg)}registerLazyComponents(){Object.entries(Object.assign({})).forEach(([r,o])=>{const i=`__module__${r}`;this.lazyRegistry.set(i,{loader:async()=>{const a=await o();return Object.values(a).forEach(s=>{if(s&&typeof s=="object"&&s.metadata){const l=s,c=l.metadata.id;this.registry[c]||(this.registry[c]=l,this.registerVueShape(l))}}),{default:{}}},loading:!1,loaded:!1})})}registerVueShape(t){if(t.component)try{VA({shape:t.shape,width:t.width,height:t.height,component:t.component,ports:t.ports})}catch{}}register(t){const{id:r}=t.metadata;this.registry[r]&&console.warn(`组件 ${r} 已存在,将被覆盖`),this.registry[r]=t,this.registerVueShape(t)}registerLazy(t,r){this.lazyRegistry.has(t)&&console.warn(`懒加载组件 ${t} 已存在,将被覆盖`),this.lazyRegistry.set(t,{loader:r,loading:!1,loaded:!1})}registerBatch(t){t.forEach(r=>this.register(r))}async getComponent(t){if(this.registry[t])return this.registry[t];const r=this.lazyRegistry.get(t);if(r)return this.loadComponent(t,r)}getComponentSync(t){return this.registry[t]}async loadComponent(t,r){if(r.loaded&&r.config)return r.config;if(r.loading){const i=this.loadingPromises.get(t);if(i)return i}r.loading=!0;const o=(async()=>{try{if(!r.loader)throw new Error(`组件 ${t} 没有 loader`);const a=(await r.loader()).default;return r.config=a,r.loaded=!0,r.loading=!1,this.registry[t]=a,this.registerVueShape(a),this.loadingPromises.delete(t),a}catch(i){throw r.loading=!1,this.loadingPromises.delete(t),console.error(`[懒加载] 组件 ${t} 加载失败:`,i),i}})();return this.loadingPromises.set(t,o),o}async preloadComponent(t){const r=this.lazyRegistry.get(t);if(!r||r.loaded)return!1;try{return await this.loadComponent(t,r),!0}catch{return!1}}async preloadComponents(t){await Promise.all(t.map(r=>this.preloadComponent(r)))}async preloadAllComponents(){const t=Array.from(this.lazyRegistry.keys()),r=t.filter(i=>i.startsWith("__module__")),o=t.filter(i=>!i.startsWith("__module__"));await Promise.all(r.map(async i=>{const a=this.lazyRegistry.get(i);if(a&&!a.loaded)try{await a.loader(),a.loaded=!0}catch(s){console.error(`[预加载] 模块 ${i} 加载失败:`,s)}})),await this.preloadComponents(o)}getComponentByShape(t){return Object.values(this.registry).find(r=>r.shape===t)}getAllComponents(){return{...this.registry}}getAllComponentIds(){const t=Object.keys(this.registry),r=Array.from(this.lazyRegistry.keys());return[...new Set([...t,...r])]}getComponentsByCategory(t){return Object.values(this.registry).filter(r=>r.metadata.category===t)}getComponentList(){return Object.values(this.registry)}hasComponent(t){return t in this.registry}unregister(t){return this.registry[t]?(delete this.registry[t],!0):(console.warn(`组件 ${t} 不存在`),!1)}getCount(){return Object.keys(this.registry).length+this.lazyRegistry.size}getLoadedCount(){return Object.keys(this.registry).length}getLazyLoadStats(){const t=this.lazyRegistry.size,r=Array.from(this.lazyRegistry.values()).filter(a=>a.loaded).length,o=t-r,i=t>0?(r/t*100).toFixed(1):"0.0";return{total:t,loaded:r,pending:o,loadRate:`${i}%`}}clear(){this.registry={}}}const pr=new LA,ec={size:{width:1920,height:1080,preset:"1920*1080"},zoom:{scale:1,min:.1,max:5},offset:{x:0,y:0},background:{color:"#1e293b",size:"origin",repeat:"repeat"},grid:{enabled:!0,size:10,color:"#475569",type:"dot"},snap:{enabled:!0,threshold:10},guides:{enabled:!1,color:"#3b82f6"},magnetism:{enabled:!0,threshold:10}},jA=[{key:"sizePreset",label:"画布尺寸",type:"select",category:"basic",path:"size.preset",defaultValue:"1920*1080",options:[{label:"1920*1080",value:"1920*1080"},{label:"1366*768",value:"1366*768"},{label:"1280*720",value:"1280*720"},{label:"800*600",value:"800*600"}],description:"预设画布尺寸"},{key:"scale",label:"缩放倍数",type:"slider",category:"transform",path:"zoom.scale",defaultValue:1,min:.05,max:10,step:.1,description:"画布缩放比例"},{key:"offsetX",label:"画布X轴偏移",type:"number",category:"transform",path:"offset.x",defaultValue:0,description:"X轴偏移量"},{key:"offsetY",label:"画布Y轴偏移",type:"number",category:"transform",path:"offset.y",defaultValue:0,description:"Y轴偏移量"},{key:"backgroundColor",label:"背景颜色",type:"color",category:"background",path:"background.color",defaultValue:"#1e293b",description:"画布背景颜色"},{key:"backgroundImage",label:"背景图片",type:"image",category:"background",path:"background.image",defaultValue:"",description:"背景图片URL"},{key:"backgroundSize",label:"背景大小",type:"select",category:"background",path:"background.size",defaultValue:"origin",options:[{label:"原始",value:"origin"},{label:"包含",value:"contain"},{label:"覆盖",value:"cover"},{label:"拉伸",value:"stretch"}],description:"背景图片尺寸模式"},{key:"backgroundRepeat",label:"图像重复",type:"select",category:"background",path:"background.repeat",defaultValue:"repeat",options:[{label:"重复",value:"repeat"},{label:"X轴重复",value:"repeat-x"},{label:"Y轴重复",value:"repeat-y"},{label:"不重复",value:"no-repeat"}],description:"背景图片重复模式"},{key:"gridEnabled",label:"网格",type:"boolean",category:"assist",path:"grid.enabled",defaultValue:!0,description:"显示网格"},{key:"gridSize",label:"网格大小",type:"number",category:"assist",path:"grid.size",defaultValue:10,min:5,max:50,description:"网格单元格大小"},{key:"snapEnabled",label:"网格对齐",type:"boolean",category:"assist",path:"snap.enabled",defaultValue:!0,description:"启用网格对齐"},{key:"guidesEnabled",label:"参考线",type:"boolean",category:"assist",path:"guides.enabled",defaultValue:!0,description:"显示参考线"},{key:"magnetismEnabled",label:"吸附",type:"boolean",category:"assist",path:"magnetism.enabled",defaultValue:!0,description:"启用吸附功能"}],bi={"1920*1080":{width:1920,height:1080},"1920*1680":{width:1920,height:1680},"1366*768":{width:1366,height:768},"1280*720":{width:1280,height:720},"800*600":{width:800,height:600}};class UA{constructor(){Pe(this,"config");this.config=n.reactive({...ec})}getConfig(){return this.config}updateConfig(t){Object.assign(this.config,t)}updateByPath(t,r){const o=t.split(".");let i=this.config;for(let a=0;a<o.length-1;a++)i=i[o[a]];if(i[o[o.length-1]]=r,t==="size.preset"&&r in bi){const{width:a,height:s}=bi[r];this.config.size.width=a,this.config.size.height=s}}getByPath(t){const r=t.split(".");let o=this.config;for(const i of r)o=o==null?void 0:o[i];return o}setSize(t,r,o){this.config.size.width=t,this.config.size.height=r,o&&(this.config.size.preset=o)}updateSize(t){this.config.size.width=t.width,this.config.size.height=t.height}setZoom(t){const{min:r=.1,max:o=5}=this.config.zoom;this.config.zoom.scale=Math.max(r,Math.min(o,t))}setOffset(t,r){this.config.offset.x=t,this.config.offset.y=r}setBackgroundColor(t){this.config.background.color=t}updateBackground(t){t.color!==void 0&&(this.config.background.color=t.color),t.image!==void 0&&(this.config.background.image=t.image),t.size!==void 0&&(this.config.background.size=t.size),t.repeat!==void 0&&(this.config.background.repeat=t.repeat)}setBackgroundImage(t){this.config.background.image=t}toggleGrid(t){this.config.grid.enabled=t??!this.config.grid.enabled}setGridSize(t){this.config.grid.size=t}toggleSnap(t){this.config.snap.enabled=t??!this.config.snap.enabled}toggleGuides(t){this.config.guides.enabled=t??!this.config.guides.enabled}toggleMagnetism(t){this.config.magnetism.enabled=t??!this.config.magnetism.enabled}reset(){Object.assign(this.config,ec)}export(){return JSON.stringify(this.config,null,2)}import(t){try{const r=JSON.parse(t);Object.assign(this.config,r)}catch(r){console.error("导入画布配置失败:",r)}}}const tt=new UA,WA={metadata:{id:"rect",name:"矩形",category:"basic",icon:"▢",description:"基础矩形图形组件",version:"1.0.0"},shape:"rect",width:120,height:60,label:"矩形",attrs:{body:{fill:"#3b82f6",stroke:"#2563eb",strokeWidth:2},label:{fill:"#fff",fontSize:14}},ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"name",label:"按钮文本",type:"text",path:"attrs.label.text",defaultValue:"矩形",description:"矩形名称"},{key:"color",label:"填充色",type:"color",path:"attrs.body.fill",defaultValue:"#3b82f6",description:"矩形填充颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#2563eb",description:"矩形边框颜色"},{key:"strokeWidth",label:"边框宽度",type:"number",path:"attrs.body.strokeWidth",defaultValue:2,min:0,max:10,description:"矩形边框宽度"},{key:"opacity",label:"透明度",type:"slider",path:"attrs.body.opacity",defaultValue:1,min:0,max:1,step:.1,description:"矩形透明度"},...Zl]},HA={metadata:{id:"circle",name:"圆形",category:"basic",icon:"○",description:"基础圆形图形组件",version:"1.0.0"},shape:"circle",width:80,height:80,label:"圆形",attrs:{body:{fill:"#10b981",stroke:"#059669",strokeWidth:2},label:{fill:"#fff",fontSize:14}},ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"text",label:"初始文本",type:"text",path:"attrs.label.text",defaultValue:"圆形",description:"圆形初始文本"},{key:"fill",label:"填充色",type:"color",path:"attrs.body.fill",defaultValue:"#10b981",description:"圆形填充颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#059669",description:"圆形边框颜色"},{key:"strokeWidth",label:"边框宽度",type:"number",path:"attrs.body.strokeWidth",defaultValue:2,min:0,max:10,description:"圆形边框宽度"},{key:"opacity",label:"透明度",type:"slider",path:"attrs.body.opacity",defaultValue:1,min:0,max:1,step:.1,description:"圆形透明度"},...Zl]},qA={metadata:{id:"text",name:"文本",category:"basic",icon:"T",description:"文本标签组件",version:"1.0.0"},shape:"rect",width:100,height:40,label:"文本",attrs:{body:{fill:"transparent",stroke:"#64748b",strokeWidth:1,strokeDasharray:"5 5"},label:{fill:"#e2e8f0",fontSize:16}},props:[{key:"label",label:"文本内容",type:"text",path:"attrs.label.text",defaultValue:"文本",description:"显示的文本内容"},{key:"fontSize",label:"字体大小",type:"number",path:"attrs.label.fontSize",defaultValue:16,min:12,max:48,description:"文本字体大小"},{key:"fontColor",label:"字体颜色",type:"color",path:"attrs.label.fill",defaultValue:"#e2e8f0",description:"文本字体颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#64748b",description:"边框颜色"},...Zl]},GA=Object.freeze(Object.defineProperty({__proto__:null,CircleComponent:HA,RectComponent:WA,TextComponent:qA},Symbol.toStringTag,{value:"Module"})),KA={class:"component-library"},YA={class:"component-grid"},XA={class:"component-content"},JA={class:"component-icon"},QA={class:"component-name"},ZA={class:"component-grid"},eP={class:"component-content"},tP={class:"component-icon"},rP={class:"component-name"},nP={class:"component-grid"},oP={class:"component-content"},iP={class:"component-icon"},aP={class:"component-name"},tc=n.defineComponent({__name:"ComponentLibrary",emits:["addComponent"],setup(e,{emit:t}){const r=t,o=n.inject("graph",n.ref(null)),i=n.inject("dnd",n.ref(null)),a=n.ref(["basic","iot","custom"]),s=n.ref(0),l=n.computed(()=>(s.value,pr.getComponentsByCategory("basic"))),c=n.computed(()=>(s.value,pr.getComponentsByCategory("iot"))),d=n.computed(()=>(s.value,pr.getComponentsByCategory("custom"))),u=async(h,g)=>{const p=o.value,m=i.value;if(!m||!p){console.warn("[组件库] DND 或 Graph 实例未初始化");return}try{const v=await pr.getComponent(g.metadata.id);if(!v){console.error(`未找到组件配置: ${g.metadata.id}`);return}const y={x:0,y:0,shape:v.shape,width:v.width,height:v.height,label:v.label,attrs:v.attrs,ports:v.ports,data:{...v.data,componentType:g.metadata.id,props:v.props}},b=p.createNode(y);m.start(b,h)}catch(v){console.error("[组件库] 拖拽初始化失败:",v)}},f=h=>{r("addComponent",h.metadata.id)};return n.onMounted(async()=>{try{await pr.preloadAllComponents(),s.value++}catch(h){console.error("[组件库] 预加载组件失败:",h)}}),(h,g)=>{const p=$l,m=bE,v=pE,y=To;return n.openBlock(),n.createElementBlock("aside",KA,[n.createVNode(y,{class:"library-content"},{default:n.withCtx(()=>[n.createVNode(v,{"expanded-names":a.value,"onUpdate:expandedNames":g[0]||(g[0]=b=>a.value=b),class:"component-collapse"},{default:n.withCtx(()=>[l.value.length>0?(n.openBlock(),n.createBlock(m,{key:0,name:"basic",title:"基础组件",class:"component-collapse-item"},{header:n.withCtx(()=>[...g[1]||(g[1]=[n.createElementVNode("span",{style:{color:"#ffffff !important","font-weight":"700","font-size":"14px"}},"基础组件",-1)])]),default:n.withCtx(()=>[n.createElementVNode("div",YA,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,b=>(n.openBlock(),n.createBlock(p,{key:b.metadata.id,class:"component-item",hoverable:!0,onClick:S=>f(b),onMousedown:S=>u(S,b)},{default:n.withCtx(()=>[n.createElementVNode("div",XA,[n.createElementVNode("span",JA,n.toDisplayString(b.metadata.icon),1),n.createElementVNode("span",QA,n.toDisplayString(b.metadata.name),1)])]),_:2},1032,["onClick","onMousedown"]))),128))])]),_:1})):n.createCommentVNode("",!0),c.value.length>0?(n.openBlock(),n.createBlock(m,{key:1,name:"iot",title:"IoT组件",class:"component-collapse-item"},{header:n.withCtx(()=>[...g[2]||(g[2]=[n.createElementVNode("span",{style:{color:"#ffffff !important","font-weight":"700","font-size":"14px"}},"IoT组件",-1)])]),default:n.withCtx(()=>[n.createElementVNode("div",ZA,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,b=>(n.openBlock(),n.createBlock(p,{key:b.metadata.id,class:"component-item",hoverable:!0,onClick:S=>f(b),onMousedown:S=>u(S,b)},{default:n.withCtx(()=>[n.createElementVNode("div",eP,[n.createElementVNode("span",tP,n.toDisplayString(b.metadata.icon),1),n.createElementVNode("span",rP,n.toDisplayString(b.metadata.name),1)])]),_:2},1032,["onClick","onMousedown"]))),128))])]),_:1})):n.createCommentVNode("",!0),d.value.length>0?(n.openBlock(),n.createBlock(m,{key:2,name:"custom",title:"自定义组件",class:"component-collapse-item"},{header:n.withCtx(()=>[...g[3]||(g[3]=[n.createElementVNode("span",{style:{color:"#ffffff !important","font-weight":"700","font-size":"14px"}},"自定义组件",-1)])]),default:n.withCtx(()=>[n.createElementVNode("div",nP,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,b=>(n.openBlock(),n.createBlock(p,{key:b.metadata.id,class:"component-item",hoverable:!0,onClick:S=>f(b),onMousedown:S=>u(S,b)},{default:n.withCtx(()=>[n.createElementVNode("div",oP,[n.createElementVNode("span",iP,n.toDisplayString(b.metadata.icon),1),n.createElementVNode("span",aP,n.toDisplayString(b.metadata.name),1)])]),_:2},1032,["onClick","onMousedown"]))),128))])]),_:1})):n.createCommentVNode("",!0)]),_:1},8,["expanded-names"])]),_:1})])}}}),sP={class:"canvas-config-panel"},lP={class:"panel-content"},cP={class:"slider-group"},dP={class:"value-display"},uP={class:"image-upload"},rc=gt(n.defineComponent({__name:"CanvasConfigPanel",setup(e){const t=n.computed(()=>tt.getConfig()),r=n.ref(),o=n.ref(t.value.size.width),i=n.ref(t.value.size.height),a=()=>{const f=t.value.size.preset;if(f==="custom")o.value=t.value.size.width,i.value=t.value.size.height;else if(f&&f in bi){const{width:h,height:g}=bi[f];tt.setSize(h,g,f)}},s=()=>{t.value.size.preset==="custom"&&tt.setSize(o.value,i.value,"custom")},l=f=>{tt.setZoom(f)},c=()=>{var f;(f=r.value)==null||f.click()},d=f=>{var p;const g=(p=f.target.files)==null?void 0:p[0];if(g){const m=new FileReader;m.onload=v=>{var b;const y=(b=v.target)==null?void 0:b.result;tt.updateByPath("background.image",y)},m.readAsDataURL(g)}},u=()=>{tt.updateByPath("background.image",""),r.value&&(r.value.value="")};return(f,h)=>{const g=rr,p=Ht,m=Jn,v=sg,y=va,b=Ct,S=Ta,_=Qr;return n.openBlock(),n.createElementBlock("div",sP,[h[15]||(h[15]=n.createElementVNode("div",{class:"panel-header"},[n.createElementVNode("h3",null,"画布配置")],-1)),n.createElementVNode("div",lP,[n.createVNode(_,{size:"small","label-placement":"left","label-width":"60"},{default:n.withCtx(()=>[n.createVNode(p,{label:"画布尺寸"},{default:n.withCtx(()=>[n.createVNode(g,{value:t.value.size.preset,"onUpdate:value":[h[0]||(h[0]=C=>t.value.size.preset=C),a],size:"small",options:[{label:"1920*1080",value:"1920*1080"},{label:"1366*768",value:"1366*768"},{label:"1280*720",value:"1280*720"},{label:"800*600",value:"800*600"},{label:"自定义",value:"custom"}]},null,8,["value"])]),_:1}),t.value.size.preset==="custom"?(n.openBlock(),n.createBlock(p,{key:0,label:"宽度"},{default:n.withCtx(()=>[n.createVNode(m,{value:o.value,"onUpdate:value":[h[1]||(h[1]=C=>o.value=C),s],min:800,max:7680,size:"small","show-button":!1},null,8,["value"])]),_:1})):n.createCommentVNode("",!0),t.value.size.preset==="custom"?(n.openBlock(),n.createBlock(p,{key:1,label:"高度"},{default:n.withCtx(()=>[n.createVNode(m,{value:i.value,"onUpdate:value":[h[2]||(h[2]=C=>i.value=C),s],min:600,max:4320,size:"small","show-button":!1},null,8,["value"])]),_:1})):n.createCommentVNode("",!0),n.createVNode(p,{label:"缩放倍数"},{default:n.withCtx(()=>[n.createElementVNode("div",cP,[n.createVNode(v,{value:t.value.zoom.scale,"onUpdate:value":[h[3]||(h[3]=C=>t.value.zoom.scale=C),l],min:.1,max:5,step:.1},null,8,["value"]),n.createElementVNode("span",dP,n.toDisplayString(t.value.zoom.scale.toFixed(1)),1)])]),_:1}),n.createVNode(p,{label:"X 偏移"},{default:n.withCtx(()=>[n.createVNode(m,{value:t.value.offset.x,"onUpdate:value":h[4]||(h[4]=C=>t.value.offset.x=C),size:"small","show-button":!1},null,8,["value"])]),_:1}),n.createVNode(p,{label:"Y 偏移"},{default:n.withCtx(()=>[n.createVNode(m,{value:t.value.offset.y,"onUpdate:value":h[5]||(h[5]=C=>t.value.offset.y=C),size:"small","show-button":!1},null,8,["value"])]),_:1}),n.createVNode(p,{label:"背景颜色"},{default:n.withCtx(()=>[n.createVNode(y,{value:t.value.background.color,"onUpdate:value":h[6]||(h[6]=C=>t.value.background.color=C)},null,8,["value"])]),_:1}),n.createVNode(p,{label:"背景图片"},{default:n.withCtx(()=>[n.createElementVNode("div",uP,[n.createElementVNode("input",{type:"file",accept:"image/*",onChange:d,ref_key:"fileInput",ref:r,style:{display:"none"}},null,544),n.createVNode(b,{onClick:c,size:"small"},{default:n.withCtx(()=>[...h[13]||(h[13]=[n.createTextVNode("选择图片",-1)])]),_:1}),t.value.background.image?(n.openBlock(),n.createBlock(b,{key:0,onClick:u,size:"small",type:"error"},{default:n.withCtx(()=>[...h[14]||(h[14]=[n.createTextVNode(" 清除 ",-1)])]),_:1})):n.createCommentVNode("",!0)])]),_:1}),n.createVNode(p,{label:"背景大小"},{default:n.withCtx(()=>[n.createVNode(g,{value:t.value.background.size,"onUpdate:value":h[7]||(h[7]=C=>t.value.background.size=C),size:"small",options:[{label:"原始大小",value:"origin"},{label:"包含",value:"contain"},{label:"覆盖",value:"cover"},{label:"拉伸",value:"stretch"}]},null,8,["value"])]),_:1}),n.createVNode(p,{label:"背景重复"},{default:n.withCtx(()=>[n.createVNode(g,{value:t.value.background.repeat,"onUpdate:value":h[8]||(h[8]=C=>t.value.background.repeat=C),size:"small",options:[{label:"重复",value:"repeat"},{label:"X轴重复",value:"repeat-x"},{label:"Y轴重复",value:"repeat-y"},{label:"不重复",value:"no-repeat"}]},null,8,["value"])]),_:1}),n.createVNode(p,{label:"吸附功能"},{default:n.withCtx(()=>[n.createVNode(S,{value:t.value.magnetism.enabled,"onUpdate:value":h[9]||(h[9]=C=>t.value.magnetism.enabled=C)},null,8,["value"])]),_:1}),n.createVNode(p,{label:"网格显示"},{default:n.withCtx(()=>[n.createVNode(S,{value:t.value.grid.enabled,"onUpdate:value":h[10]||(h[10]=C=>t.value.grid.enabled=C)},null,8,["value"])]),_:1}),t.value.grid.enabled?(n.openBlock(),n.createBlock(p,{key:2,label:"网格大小"},{default:n.withCtx(()=>[n.createVNode(m,{value:t.value.grid.size,"onUpdate:value":h[11]||(h[11]=C=>t.value.grid.size=C),min:5,max:50,size:"small","show-button":!1},null,8,["value"])]),_:1})):n.createCommentVNode("",!0),n.createVNode(p,{label:"对齐线"},{default:n.withCtx(()=>[n.createVNode(S,{value:t.value.snap.enabled,"onUpdate:value":h[12]||(h[12]=C=>t.value.snap.enabled=C)},null,8,["value"])]),_:1})]),_:1})])])}}}),[["__scopeId","data-v-f99cb19d"]]),fP={class:"basic-properties-tab"},hP={class:"property-section",style:{display:"none"}},pP={class:"property-section"},gP={key:0,class:"property-section"},nc=gt(n.defineComponent({__name:"BasicPropertiesTab",props:{selectedNode:{},nodePosition:{},nodeSize:{},nodeAttrs:{}},emits:["update-position","update-size","update-label","update-fill","update-stroke","update-stroke-width","update-opacity","update-component-name","update-dynamic-prop"],setup(e,{emit:t}){const r=e,o=t,i=n.computed(()=>{var d,u;return(u=(d=r.selectedNode)==null?void 0:d.data)!=null&&u.props?r.selectedNode.data.props:[]}),a=n.ref(0),s=d=>{if(a.value,!d.path)return d.defaultValue;const u=d.path.split(".");let f=r.selectedNode;for(const h of u)if(f&&typeof f=="object")f=f[h];else return d.defaultValue;if(f&&typeof f=="object"){if(f.target&&f.target.value!==void 0)return f.target.value;if(f.target&&f.target.checked!==void 0)return f.target.checked}return f!==void 0?f:d.defaultValue},l=d=>!d||d==="transparent"?"#000000":typeof d=="string"&&d.startsWith("#")?d:"#000000",c=(d,u)=>{o("update-dynamic-prop",d.path,u),a.value++};return(d,u)=>{const f=Ut,h=Ht,g=Qr,p=Jn,m=TT,v=IT,y=Wt,b=Np,S=va,_=Ta,C=rr;return n.openBlock(),n.createElementBlock("div",fP,[n.createElementVNode("div",hP,[u[5]||(u[5]=n.createElementVNode("h4",null,"基础信息",-1)),n.createVNode(g,{"label-width":"90",size:"small"},{default:n.withCtx(()=>[n.createVNode(h,{label:"组件名称"},{default:n.withCtx(()=>{var A;return[n.createVNode(f,{value:((A=e.selectedNode.getData())==null?void 0:A.componentName)||"","onUpdate:value":u[0]||(u[0]=k=>d.$emit("update-component-name",k)),placeholder:"请输入组件名称"},null,8,["value"])]}),_:1}),n.createVNode(h,{label:"ID"},{default:n.withCtx(()=>[n.createVNode(f,{value:e.selectedNode.id,disabled:""},null,8,["value"])]),_:1}),n.createVNode(h,{label:"类型"},{default:n.withCtx(()=>[n.createVNode(f,{value:e.selectedNode.shape,disabled:""},null,8,["value"])]),_:1})]),_:1})]),n.createElementVNode("div",pP,[u[6]||(u[6]=n.createElementVNode("h4",null,"位置和尺寸",-1)),n.createVNode(g,{"label-width":"60",size:"small"},{default:n.withCtx(()=>[n.createVNode(v,{"x-gap":12,cols:24},{default:n.withCtx(()=>[n.createVNode(m,{span:12},{default:n.withCtx(()=>[n.createVNode(h,{label:"X"},{default:n.withCtx(()=>[n.createVNode(p,{value:e.nodePosition.x,"onUpdate:value":u[1]||(u[1]=A=>d.$emit("update-position","x",A)),"show-button":!1,style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1}),n.createVNode(m,{span:12},{default:n.withCtx(()=>[n.createVNode(h,{label:"Y"},{default:n.withCtx(()=>[n.createVNode(p,{value:e.nodePosition.y,"onUpdate:value":u[2]||(u[2]=A=>d.$emit("update-position","y",A)),"show-button":!1,style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1})]),_:1}),n.createVNode(v,{"x-gap":12,cols:24},{default:n.withCtx(()=>[n.createVNode(m,{span:12},{default:n.withCtx(()=>[n.createVNode(h,{label:"宽度"},{default:n.withCtx(()=>[n.createVNode(p,{value:e.nodeSize.width,"onUpdate:value":u[3]||(u[3]=A=>d.$emit("update-size","width",A)),"show-button":!1,style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1}),n.createVNode(m,{span:12},{default:n.withCtx(()=>[n.createVNode(h,{label:"高度"},{default:n.withCtx(()=>[n.createVNode(p,{value:e.nodeSize.height,"onUpdate:value":u[4]||(u[4]=A=>d.$emit("update-size","height",A)),"show-button":!1,style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1})]),i.value.length>0?(n.openBlock(),n.createElementBlock("div",gP,[u[7]||(u[7]=n.createElementVNode("h4",null,"组件属性",-1)),n.createVNode(g,{"label-placement":"left","label-width":"100",size:"small",class:"dynamic-props-form"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,A=>(n.openBlock(),n.createBlock(h,{key:A.key,label:A.label},{label:n.withCtx(()=>[n.createElementVNode("span",null,n.toDisplayString(A.label),1),A.description?(n.openBlock(),n.createBlock(b,{key:0,placement:"top"},{trigger:n.withCtx(()=>[n.createVNode(y,{style:{"margin-left":"4px",cursor:"help"}},{default:n.withCtx(()=>[n.createVNode(n.unref(hg))]),_:1})]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(A.description),1)]),_:2},1024)):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[A.type==="text"?(n.openBlock(),n.createBlock(f,{key:0,value:s(A),"onUpdate:value":k=>c(A,k),placeholder:A.defaultValue},null,8,["value","onUpdate:value","placeholder"])):A.type==="number"?(n.openBlock(),n.createBlock(p,{key:1,value:s(A),"onUpdate:value":k=>c(A,k),min:A.min,max:A.max,step:A.step,"show-button":!1,style:{width:"100%"}},null,8,["value","onUpdate:value","min","max","step"])):A.type==="color"?(n.openBlock(),n.createBlock(S,{key:2,value:l(s(A)),"onUpdate:value":k=>c(A,k),"show-alpha":!0,modes:["hex"]},null,8,["value","onUpdate:value"])):A.type==="boolean"?(n.openBlock(),n.createBlock(_,{key:3,value:s(A),"onUpdate:value":k=>c(A,k)},null,8,["value","onUpdate:value"])):A.type==="select"?(n.openBlock(),n.createBlock(C,{key:4,value:s(A),"onUpdate:value":k=>c(A,k),options:A.options,placeholder:"请选择",style:{width:"100%"}},null,8,["value","onUpdate:value","options"])):n.createCommentVNode("",!0)]),_:2},1032,["label"]))),128))]),_:1})])):n.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-042b02b0"]]);var oc=Object.defineProperty,mP=Object.getOwnPropertyDescriptor,bP=Object.getOwnPropertyNames,yP=Object.prototype.hasOwnProperty,cr=(e,t)=>()=>(e&&(t=e(e=0)),t),Oe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Po=(e,t)=>{for(var r in t)oc(e,r,{get:t[r],enumerable:!0})},vP=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of bP(t))!yP.call(e,i)&&i!==r&&oc(e,i,{get:()=>t[i],enumerable:!(o=mP(t,i))||o.enumerable});return e},mt=e=>vP(oc({},"__esModule",{value:!0}),e),Ie=cr(()=>{}),ft={};Po(ft,{_debugEnd:()=>Fc,_debugProcess:()=>Dc,_events:()=>td,_eventsCount:()=>rd,_exiting:()=>_c,_fatalExceptions:()=>Bc,_getActiveHandles:()=>Tg,_getActiveRequests:()=>Eg,_kill:()=>Tc,_linkedBinding:()=>_g,_maxListeners:()=>ed,_preload_modules:()=>Jc,_rawDebug:()=>xc,_startProfilerIdleNotifier:()=>Vc,_stopProfilerIdleNotifier:()=>Lc,_tickCallback:()=>zc,abort:()=>Hc,addListener:()=>nd,allowedNodeEnvironmentFlags:()=>$c,arch:()=>sc,argv:()=>dc,argv0:()=>Xc,assert:()=>Ag,binding:()=>gc,browser:()=>wc,chdir:()=>yc,config:()=>kc,cpuUsage:()=>vi,cwd:()=>bc,debugPort:()=>Yc,default:()=>ud,dlopen:()=>kg,domain:()=>Sc,emit:()=>ld,emitWarning:()=>pc,env:()=>cc,execArgv:()=>uc,execPath:()=>Kc,exit:()=>Rc,features:()=>Oc,hasUncaughtExceptionCaptureCallback:()=>Pg,hrtime:()=>Aa,kill:()=>Ic,listeners:()=>Rg,memoryUsage:()=>Pc,moduleLoadList:()=>Cc,nextTick:()=>Cg,off:()=>id,on:()=>Zr,once:()=>od,openStdin:()=>Nc,pid:()=>qc,platform:()=>lc,ppid:()=>Gc,prependListener:()=>cd,prependOnceListener:()=>dd,reallyExit:()=>Ec,release:()=>vc,removeAllListeners:()=>sd,removeListener:()=>ad,resourceUsage:()=>Ac,setSourceMapsEnabled:()=>Qc,setUncaughtExceptionCaptureCallback:()=>Mc,stderr:()=>Uc,stdin:()=>Wc,stdout:()=>jc,title:()=>ac,umask:()=>mc,uptime:()=>Ig,version:()=>fc,versions:()=>hc});function ic(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function wP(){!Zn||!eo||(Zn=!1,eo.length?Mr=eo.concat(Mr):yi=-1,Mr.length&&xg())}function xg(){if(!Zn){var e=setTimeout(wP,0);Zn=!0;for(var t=Mr.length;t;){for(eo=Mr,Mr=[];++yi<t;)eo&&eo[yi].run();yi=-1,t=Mr.length}eo=null,Zn=!1,clearTimeout(e)}}function Cg(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Mr.push(new Sg(e,t)),Mr.length===1&&!Zn&&setTimeout(xg,0)}function Sg(e,t){this.fun=e,this.array=t}function Gt(){}function _g(e){ic("_linkedBinding")}function kg(e){ic("dlopen")}function Eg(){return[]}function Tg(){return[]}function Ag(e,t){if(!e)throw new Error(t||"assertion error")}function Pg(){return!1}function Ig(){return en.now()/1e3}function Aa(e){var t=Math.floor((Date.now()-en.now())*.001),r=en.now()*.001,o=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(o=o-e[0],i=i-e[1],i<0&&(o--,i+=Pa)),[o,i]}function Zr(){return ud}function Rg(e){return[]}var Mr,Zn,eo,yi,ac,sc,lc,cc,dc,uc,fc,hc,pc,gc,mc,bc,yc,vc,wc,xc,Cc,Sc,_c,kc,Ec,Tc,vi,Ac,Pc,Ic,Rc,Nc,$c,Oc,Bc,Mc,zc,Dc,Fc,Vc,Lc,jc,Uc,Wc,Hc,qc,Gc,Kc,Yc,Xc,Jc,Qc,en,Zc,Pa,ed,td,rd,nd,od,id,ad,sd,ld,cd,dd,ud,xP=cr(()=>{Ie(),Ne(),Re(),Mr=[],Zn=!1,yi=-1,Sg.prototype.run=function(){this.fun.apply(null,this.array)},ac="browser",sc="x64",lc="browser",cc={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},dc=["/usr/bin/node"],uc=[],fc="v16.8.0",hc={},pc=function(e,t){console.warn((t?t+": ":"")+e)},gc=function(e){ic("binding")},mc=function(e){return 0},bc=function(){return"/"},yc=function(e){},vc={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},wc=!0,xc=Gt,Cc=[],Sc={},_c=!1,kc={},Ec=Gt,Tc=Gt,vi=function(){return{}},Ac=vi,Pc=vi,Ic=Gt,Rc=Gt,Nc=Gt,$c={},Oc={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Bc=Gt,Mc=Gt,zc=Gt,Dc=Gt,Fc=Gt,Vc=Gt,Lc=Gt,jc=void 0,Uc=void 0,Wc=void 0,Hc=Gt,qc=2,Gc=1,Kc="/bin/usr/node",Yc=9229,Xc="node",Jc=[],Qc=Gt,en={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},en.now===void 0&&(Zc=Date.now(),en.timing&&en.timing.navigationStart&&(Zc=en.timing.navigationStart),en.now=()=>Date.now()-Zc),Pa=1e9,Aa.bigint=function(e){var t=Aa(e);return typeof BigInt>"u"?t[0]*Pa+t[1]:BigInt(t[0]*Pa)+BigInt(t[1])},ed=10,td={},rd=0,nd=Zr,od=Zr,id=Zr,ad=Zr,sd=Zr,ld=Gt,cd=Zr,dd=Zr,ud={version:fc,versions:hc,arch:sc,platform:lc,browser:wc,release:vc,_rawDebug:xc,moduleLoadList:Cc,binding:gc,_linkedBinding:_g,_events:td,_eventsCount:rd,_maxListeners:ed,on:Zr,addListener:nd,once:od,off:id,removeListener:ad,removeAllListeners:sd,emit:ld,prependListener:cd,prependOnceListener:dd,listeners:Rg,domain:Sc,_exiting:_c,config:kc,dlopen:kg,uptime:Ig,_getActiveRequests:Eg,_getActiveHandles:Tg,reallyExit:Ec,_kill:Tc,cpuUsage:vi,resourceUsage:Ac,memoryUsage:Pc,kill:Ic,exit:Rc,openStdin:Nc,allowedNodeEnvironmentFlags:$c,assert:Ag,features:Oc,_fatalExceptions:Bc,setUncaughtExceptionCaptureCallback:Mc,hasUncaughtExceptionCaptureCallback:Pg,emitWarning:pc,nextTick:Cg,_tickCallback:zc,_debugProcess:Dc,_debugEnd:Fc,_startProfilerIdleNotifier:Vc,_stopProfilerIdleNotifier:Lc,stdout:jc,stdin:Wc,stderr:Uc,abort:Hc,umask:mc,chdir:yc,cwd:bc,env:cc,title:ac,argv:dc,execArgv:uc,pid:qc,ppid:Gc,execPath:Kc,debugPort:Yc,hrtime:Aa,argv0:Xc,_preload_modules:Jc,setSourceMapsEnabled:Qc}}),Re=cr(()=>{xP()});function CP(){if(fd)return Io;fd=!0,Io.byteLength=l,Io.toByteArray=d,Io.fromByteArray=h;for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,a=o.length;i<a;++i)e[i]=o[i],t[o.charCodeAt(i)]=i;t[45]=62,t[95]=63;function s(g){var p=g.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var m=g.indexOf("=");m===-1&&(m=p);var v=m===p?0:4-m%4;return[m,v]}function l(g){var p=s(g),m=p[0],v=p[1];return(m+v)*3/4-v}function c(g,p,m){return(p+m)*3/4-m}function d(g){var p,m=s(g),v=m[0],y=m[1],b=new r(c(g,v,y)),S=0,_=y>0?v-4:v,C;for(C=0;C<_;C+=4)p=t[g.charCodeAt(C)]<<18|t[g.charCodeAt(C+1)]<<12|t[g.charCodeAt(C+2)]<<6|t[g.charCodeAt(C+3)],b[S++]=p>>16&255,b[S++]=p>>8&255,b[S++]=p&255;return y===2&&(p=t[g.charCodeAt(C)]<<2|t[g.charCodeAt(C+1)]>>4,b[S++]=p&255),y===1&&(p=t[g.charCodeAt(C)]<<10|t[g.charCodeAt(C+1)]<<4|t[g.charCodeAt(C+2)]>>2,b[S++]=p>>8&255,b[S++]=p&255),b}function u(g){return e[g>>18&63]+e[g>>12&63]+e[g>>6&63]+e[g&63]}function f(g,p,m){for(var v,y=[],b=p;b<m;b+=3)v=(g[b]<<16&16711680)+(g[b+1]<<8&65280)+(g[b+2]&255),y.push(u(v));return y.join("")}function h(g){for(var p,m=g.length,v=m%3,y=[],b=16383,S=0,_=m-v;S<_;S+=b)y.push(f(g,S,S+b>_?_:S+b));return v===1?(p=g[m-1],y.push(e[p>>2]+e[p<<4&63]+"==")):v===2&&(p=(g[m-2]<<8)+g[m-1],y.push(e[p>>10]+e[p>>4&63]+e[p<<2&63]+"=")),y.join("")}return Io}function SP(){return hd?wi:(hd=!0,wi.read=function(e,t,r,o,i){var a,s,l=i*8-o-1,c=(1<<l)-1,d=c>>1,u=-7,f=r?i-1:0,h=r?-1:1,g=e[t+f];for(f+=h,a=g&(1<<-u)-1,g>>=-u,u+=l;u>0;a=a*256+e[t+f],f+=h,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=o;u>0;s=s*256+e[t+f],f+=h,u-=8);if(a===0)a=1-d;else{if(a===c)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,o),a=a-d}return(g?-1:1)*s*Math.pow(2,a-o)},wi.write=function(e,t,r,o,i,a){var s,l,c,d=a*8-i-1,u=(1<<d)-1,f=u>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=o?0:a-1,p=o?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+f>=1?t+=h/c:t+=h*Math.pow(2,1-f),t*c>=2&&(s++,c/=2),s+f>=u?(l=0,s=u):s+f>=1?(l=(t*c-1)*Math.pow(2,i),s=s+f):(l=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+g]=l&255,g+=p,l/=256,i-=8);for(s=s<<i|l,d+=i;d>0;e[r+g]=s&255,g+=p,s/=256,d-=8);e[r+g-p]|=m*128},wi)}function _P(){if(pd)return Cn;pd=!0;let e=CP(),t=SP(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Cn.Buffer=s,Cn.SlowBuffer=y,Cn.INSPECT_MAX_BYTES=50;let o=2147483647;Cn.kMaxLength=o,s.TYPED_ARRAY_SUPPORT=i(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{let w=new Uint8Array(1),x={foo:function(){return 42}};return Object.setPrototypeOf(x,Uint8Array.prototype),Object.setPrototypeOf(w,x),w.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function a(w){if(w>o)throw new RangeError('The value "'+w+'" is invalid for option "size"');let x=new Uint8Array(w);return Object.setPrototypeOf(x,s.prototype),x}function s(w,x,E){if(typeof w=="number"){if(typeof x=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(w)}return l(w,x,E)}s.poolSize=8192;function l(w,x,E){if(typeof w=="string")return f(w,x);if(ArrayBuffer.isView(w))return g(w);if(w==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w);if(V(w,ArrayBuffer)||w&&V(w.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(V(w,SharedArrayBuffer)||w&&V(w.buffer,SharedArrayBuffer)))return p(w,x,E);if(typeof w=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let M=w.valueOf&&w.valueOf();if(M!=null&&M!==w)return s.from(M,x,E);let W=m(w);if(W)return W;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof w[Symbol.toPrimitive]=="function")return s.from(w[Symbol.toPrimitive]("string"),x,E);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w)}s.from=function(w,x,E){return l(w,x,E)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(w){if(typeof w!="number")throw new TypeError('"size" argument must be of type number');if(w<0)throw new RangeError('The value "'+w+'" is invalid for option "size"')}function d(w,x,E){return c(w),w<=0?a(w):x!==void 0?typeof E=="string"?a(w).fill(x,E):a(w).fill(x):a(w)}s.alloc=function(w,x,E){return d(w,x,E)};function u(w){return c(w),a(w<0?0:v(w)|0)}s.allocUnsafe=function(w){return u(w)},s.allocUnsafeSlow=function(w){return u(w)};function f(w,x){if((typeof x!="string"||x==="")&&(x="utf8"),!s.isEncoding(x))throw new TypeError("Unknown encoding: "+x);let E=b(w,x)|0,M=a(E),W=M.write(w,x);return W!==E&&(M=M.slice(0,W)),M}function h(w){let x=w.length<0?0:v(w.length)|0,E=a(x);for(let M=0;M<x;M+=1)E[M]=w[M]&255;return E}function g(w){if(V(w,Uint8Array)){let x=new Uint8Array(w);return p(x.buffer,x.byteOffset,x.byteLength)}return h(w)}function p(w,x,E){if(x<0||w.byteLength<x)throw new RangeError('"offset" is outside of buffer bounds');if(w.byteLength<x+(E||0))throw new RangeError('"length" is outside of buffer bounds');let M;return x===void 0&&E===void 0?M=new Uint8Array(w):E===void 0?M=new Uint8Array(w,x):M=new Uint8Array(w,x,E),Object.setPrototypeOf(M,s.prototype),M}function m(w){if(s.isBuffer(w)){let x=v(w.length)|0,E=a(x);return E.length===0||w.copy(E,0,0,x),E}if(w.length!==void 0)return typeof w.length!="number"||me(w.length)?a(0):h(w);if(w.type==="Buffer"&&Array.isArray(w.data))return h(w.data)}function v(w){if(w>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return w|0}function y(w){return+w!=w&&(w=0),s.alloc(+w)}s.isBuffer=function(w){return w!=null&&w._isBuffer===!0&&w!==s.prototype},s.compare=function(w,x){if(V(w,Uint8Array)&&(w=s.from(w,w.offset,w.byteLength)),V(x,Uint8Array)&&(x=s.from(x,x.offset,x.byteLength)),!s.isBuffer(w)||!s.isBuffer(x))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(w===x)return 0;let E=w.length,M=x.length;for(let W=0,Q=Math.min(E,M);W<Q;++W)if(w[W]!==x[W]){E=w[W],M=x[W];break}return E<M?-1:M<E?1:0},s.isEncoding=function(w){switch(String(w).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(w,x){if(!Array.isArray(w))throw new TypeError('"list" argument must be an Array of Buffers');if(w.length===0)return s.alloc(0);let E;if(x===void 0)for(x=0,E=0;E<w.length;++E)x+=w[E].length;let M=s.allocUnsafe(x),W=0;for(E=0;E<w.length;++E){let Q=w[E];if(V(Q,Uint8Array))W+Q.length>M.length?(s.isBuffer(Q)||(Q=s.from(Q)),Q.copy(M,W)):Uint8Array.prototype.set.call(M,Q,W);else if(s.isBuffer(Q))Q.copy(M,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=Q.length}return M};function b(w,x){if(s.isBuffer(w))return w.length;if(ArrayBuffer.isView(w)||V(w,ArrayBuffer))return w.byteLength;if(typeof w!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof w);let E=w.length,M=arguments.length>2&&arguments[2]===!0;if(!M&&E===0)return 0;let W=!1;for(;;)switch(x){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return fe(w).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return ye(w).length;default:if(W)return M?-1:fe(w).length;x=(""+x).toLowerCase(),W=!0}}s.byteLength=b;function S(w,x,E){let M=!1;if((x===void 0||x<0)&&(x=0),x>this.length||((E===void 0||E>this.length)&&(E=this.length),E<=0)||(E>>>=0,x>>>=0,E<=x))return"";for(w||(w="utf8");;)switch(w){case"hex":return L(this,x,E);case"utf8":case"utf-8":return O(this,x,E);case"ascii":return q(this,x,E);case"latin1":case"binary":return z(this,x,E);case"base64":return P(this,x,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,x,E);default:if(M)throw new TypeError("Unknown encoding: "+w);w=(w+"").toLowerCase(),M=!0}}s.prototype._isBuffer=!0;function _(w,x,E){let M=w[x];w[x]=w[E],w[E]=M}s.prototype.swap16=function(){let w=this.length;if(w%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let x=0;x<w;x+=2)_(this,x,x+1);return this},s.prototype.swap32=function(){let w=this.length;if(w%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let x=0;x<w;x+=4)_(this,x,x+3),_(this,x+1,x+2);return this},s.prototype.swap64=function(){let w=this.length;if(w%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let x=0;x<w;x+=8)_(this,x,x+7),_(this,x+1,x+6),_(this,x+2,x+5),_(this,x+3,x+4);return this},s.prototype.toString=function(){let w=this.length;return w===0?"":arguments.length===0?O(this,0,w):S.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(w){if(!s.isBuffer(w))throw new TypeError("Argument must be a Buffer");return this===w?!0:s.compare(this,w)===0},s.prototype.inspect=function(){let w="",x=Cn.INSPECT_MAX_BYTES;return w=this.toString("hex",0,x).replace(/(.{2})/g,"$1 ").trim(),this.length>x&&(w+=" ... "),"<Buffer "+w+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(w,x,E,M,W){if(V(w,Uint8Array)&&(w=s.from(w,w.offset,w.byteLength)),!s.isBuffer(w))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof w);if(x===void 0&&(x=0),E===void 0&&(E=w?w.length:0),M===void 0&&(M=0),W===void 0&&(W=this.length),x<0||E>w.length||M<0||W>this.length)throw new RangeError("out of range index");if(M>=W&&x>=E)return 0;if(M>=W)return-1;if(x>=E)return 1;if(x>>>=0,E>>>=0,M>>>=0,W>>>=0,this===w)return 0;let Q=W-M,we=E-x,ae=Math.min(Q,we),ge=this.slice(M,W),Be=w.slice(x,E);for(let H=0;H<ae;++H)if(ge[H]!==Be[H]){Q=ge[H],we=Be[H];break}return Q<we?-1:we<Q?1:0};function C(w,x,E,M,W){if(w.length===0)return-1;if(typeof E=="string"?(M=E,E=0):E>2147483647?E=2147483647:E<-2147483648&&(E=-2147483648),E=+E,me(E)&&(E=W?0:w.length-1),E<0&&(E=w.length+E),E>=w.length){if(W)return-1;E=w.length-1}else if(E<0)if(W)E=0;else return-1;if(typeof x=="string"&&(x=s.from(x,M)),s.isBuffer(x))return x.length===0?-1:A(w,x,E,M,W);if(typeof x=="number")return x=x&255,typeof Uint8Array.prototype.indexOf=="function"?W?Uint8Array.prototype.indexOf.call(w,x,E):Uint8Array.prototype.lastIndexOf.call(w,x,E):A(w,[x],E,M,W);throw new TypeError("val must be string, number or Buffer")}function A(w,x,E,M,W){let Q=1,we=w.length,ae=x.length;if(M!==void 0&&(M=String(M).toLowerCase(),M==="ucs2"||M==="ucs-2"||M==="utf16le"||M==="utf-16le")){if(w.length<2||x.length<2)return-1;Q=2,we/=2,ae/=2,E/=2}function ge(H,ve){return Q===1?H[ve]:H.readUInt16BE(ve*Q)}let Be;if(W){let H=-1;for(Be=E;Be<we;Be++)if(ge(w,Be)===ge(x,H===-1?0:Be-H)){if(H===-1&&(H=Be),Be-H+1===ae)return H*Q}else H!==-1&&(Be-=Be-H),H=-1}else for(E+ae>we&&(E=we-ae),Be=E;Be>=0;Be--){let H=!0;for(let ve=0;ve<ae;ve++)if(ge(w,Be+ve)!==ge(x,ve)){H=!1;break}if(H)return Be}return-1}s.prototype.includes=function(w,x,E){return this.indexOf(w,x,E)!==-1},s.prototype.indexOf=function(w,x,E){return C(this,w,x,E,!0)},s.prototype.lastIndexOf=function(w,x,E){return C(this,w,x,E,!1)};function k(w,x,E,M){E=Number(E)||0;let W=w.length-E;M?(M=Number(M),M>W&&(M=W)):M=W;let Q=x.length;M>Q/2&&(M=Q/2);let we;for(we=0;we<M;++we){let ae=parseInt(x.substr(we*2,2),16);if(me(ae))return we;w[E+we]=ae}return we}function T(w,x,E,M){return J(fe(x,w.length-E),w,E,M)}function I(w,x,E,M){return J(ie(x),w,E,M)}function R(w,x,E,M){return J(ye(x),w,E,M)}function B(w,x,E,M){return J(re(x,w.length-E),w,E,M)}s.prototype.write=function(w,x,E,M){if(x===void 0)M="utf8",E=this.length,x=0;else if(E===void 0&&typeof x=="string")M=x,E=this.length,x=0;else if(isFinite(x))x=x>>>0,isFinite(E)?(E=E>>>0,M===void 0&&(M="utf8")):(M=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let W=this.length-x;if((E===void 0||E>W)&&(E=W),w.length>0&&(E<0||x<0)||x>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");let Q=!1;for(;;)switch(M){case"hex":return k(this,w,x,E);case"utf8":case"utf-8":return T(this,w,x,E);case"ascii":case"latin1":case"binary":return I(this,w,x,E);case"base64":return R(this,w,x,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,w,x,E);default:if(Q)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),Q=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function P(w,x,E){return x===0&&E===w.length?e.fromByteArray(w):e.fromByteArray(w.slice(x,E))}function O(w,x,E){E=Math.min(w.length,E);let M=[],W=x;for(;W<E;){let Q=w[W],we=null,ae=Q>239?4:Q>223?3:Q>191?2:1;if(W+ae<=E){let ge,Be,H,ve;switch(ae){case 1:Q<128&&(we=Q);break;case 2:ge=w[W+1],(ge&192)===128&&(ve=(Q&31)<<6|ge&63,ve>127&&(we=ve));break;case 3:ge=w[W+1],Be=w[W+2],(ge&192)===128&&(Be&192)===128&&(ve=(Q&15)<<12|(ge&63)<<6|Be&63,ve>2047&&(ve<55296||ve>57343)&&(we=ve));break;case 4:ge=w[W+1],Be=w[W+2],H=w[W+3],(ge&192)===128&&(Be&192)===128&&(H&192)===128&&(ve=(Q&15)<<18|(ge&63)<<12|(Be&63)<<6|H&63,ve>65535&&ve<1114112&&(we=ve))}}we===null?(we=65533,ae=1):we>65535&&(we-=65536,M.push(we>>>10&1023|55296),we=56320|we&1023),M.push(we),W+=ae}return $(M)}let N=4096;function $(w){let x=w.length;if(x<=N)return String.fromCharCode.apply(String,w);let E="",M=0;for(;M<x;)E+=String.fromCharCode.apply(String,w.slice(M,M+=N));return E}function q(w,x,E){let M="";E=Math.min(w.length,E);for(let W=x;W<E;++W)M+=String.fromCharCode(w[W]&127);return M}function z(w,x,E){let M="";E=Math.min(w.length,E);for(let W=x;W<E;++W)M+=String.fromCharCode(w[W]);return M}function L(w,x,E){let M=w.length;(!x||x<0)&&(x=0),(!E||E<0||E>M)&&(E=M);let W="";for(let Q=x;Q<E;++Q)W+=ee[w[Q]];return W}function te(w,x,E){let M=w.slice(x,E),W="";for(let Q=0;Q<M.length-1;Q+=2)W+=String.fromCharCode(M[Q]+M[Q+1]*256);return W}s.prototype.slice=function(w,x){let E=this.length;w=~~w,x=x===void 0?E:~~x,w<0?(w+=E,w<0&&(w=0)):w>E&&(w=E),x<0?(x+=E,x<0&&(x=0)):x>E&&(x=E),x<w&&(x=w);let M=this.subarray(w,x);return Object.setPrototypeOf(M,s.prototype),M};function j(w,x,E){if(w%1!==0||w<0)throw new RangeError("offset is not uint");if(w+x>E)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(w,x,E){w=w>>>0,x=x>>>0,E||j(w,x,this.length);let M=this[w],W=1,Q=0;for(;++Q<x&&(W*=256);)M+=this[w+Q]*W;return M},s.prototype.readUintBE=s.prototype.readUIntBE=function(w,x,E){w=w>>>0,x=x>>>0,E||j(w,x,this.length);let M=this[w+--x],W=1;for(;x>0&&(W*=256);)M+=this[w+--x]*W;return M},s.prototype.readUint8=s.prototype.readUInt8=function(w,x){return w=w>>>0,x||j(w,1,this.length),this[w]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(w,x){return w=w>>>0,x||j(w,2,this.length),this[w]|this[w+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(w,x){return w=w>>>0,x||j(w,2,this.length),this[w]<<8|this[w+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(w,x){return w=w>>>0,x||j(w,4,this.length),(this[w]|this[w+1]<<8|this[w+2]<<16)+this[w+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(w,x){return w=w>>>0,x||j(w,4,this.length),this[w]*16777216+(this[w+1]<<16|this[w+2]<<8|this[w+3])},s.prototype.readBigUInt64LE=F(function(w){w=w>>>0,he(w,"offset");let x=this[w],E=this[w+7];(x===void 0||E===void 0)&&Te(w,this.length-8);let M=x+this[++w]*2**8+this[++w]*2**16+this[++w]*2**24,W=this[++w]+this[++w]*2**8+this[++w]*2**16+E*2**24;return BigInt(M)+(BigInt(W)<<BigInt(32))}),s.prototype.readBigUInt64BE=F(function(w){w=w>>>0,he(w,"offset");let x=this[w],E=this[w+7];(x===void 0||E===void 0)&&Te(w,this.length-8);let M=x*2**24+this[++w]*2**16+this[++w]*2**8+this[++w],W=this[++w]*2**24+this[++w]*2**16+this[++w]*2**8+E;return(BigInt(M)<<BigInt(32))+BigInt(W)}),s.prototype.readIntLE=function(w,x,E){w=w>>>0,x=x>>>0,E||j(w,x,this.length);let M=this[w],W=1,Q=0;for(;++Q<x&&(W*=256);)M+=this[w+Q]*W;return W*=128,M>=W&&(M-=Math.pow(2,8*x)),M},s.prototype.readIntBE=function(w,x,E){w=w>>>0,x=x>>>0,E||j(w,x,this.length);let M=x,W=1,Q=this[w+--M];for(;M>0&&(W*=256);)Q+=this[w+--M]*W;return W*=128,Q>=W&&(Q-=Math.pow(2,8*x)),Q},s.prototype.readInt8=function(w,x){return w=w>>>0,x||j(w,1,this.length),this[w]&128?(255-this[w]+1)*-1:this[w]},s.prototype.readInt16LE=function(w,x){w=w>>>0,x||j(w,2,this.length);let E=this[w]|this[w+1]<<8;return E&32768?E|4294901760:E},s.prototype.readInt16BE=function(w,x){w=w>>>0,x||j(w,2,this.length);let E=this[w+1]|this[w]<<8;return E&32768?E|4294901760:E},s.prototype.readInt32LE=function(w,x){return w=w>>>0,x||j(w,4,this.length),this[w]|this[w+1]<<8|this[w+2]<<16|this[w+3]<<24},s.prototype.readInt32BE=function(w,x){return w=w>>>0,x||j(w,4,this.length),this[w]<<24|this[w+1]<<16|this[w+2]<<8|this[w+3]},s.prototype.readBigInt64LE=F(function(w){w=w>>>0,he(w,"offset");let x=this[w],E=this[w+7];(x===void 0||E===void 0)&&Te(w,this.length-8);let M=this[w+4]+this[w+5]*2**8+this[w+6]*2**16+(E<<24);return(BigInt(M)<<BigInt(32))+BigInt(x+this[++w]*2**8+this[++w]*2**16+this[++w]*2**24)}),s.prototype.readBigInt64BE=F(function(w){w=w>>>0,he(w,"offset");let x=this[w],E=this[w+7];(x===void 0||E===void 0)&&Te(w,this.length-8);let M=(x<<24)+this[++w]*2**16+this[++w]*2**8+this[++w];return(BigInt(M)<<BigInt(32))+BigInt(this[++w]*2**24+this[++w]*2**16+this[++w]*2**8+E)}),s.prototype.readFloatLE=function(w,x){return w=w>>>0,x||j(w,4,this.length),t.read(this,w,!0,23,4)},s.prototype.readFloatBE=function(w,x){return w=w>>>0,x||j(w,4,this.length),t.read(this,w,!1,23,4)},s.prototype.readDoubleLE=function(w,x){return w=w>>>0,x||j(w,8,this.length),t.read(this,w,!0,52,8)},s.prototype.readDoubleBE=function(w,x){return w=w>>>0,x||j(w,8,this.length),t.read(this,w,!1,52,8)};function se(w,x,E,M,W,Q){if(!s.isBuffer(w))throw new TypeError('"buffer" argument must be a Buffer instance');if(x>W||x<Q)throw new RangeError('"value" argument is out of bounds');if(E+M>w.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(w,x,E,M){if(w=+w,x=x>>>0,E=E>>>0,!M){let we=Math.pow(2,8*E)-1;se(this,w,x,E,we,0)}let W=1,Q=0;for(this[x]=w&255;++Q<E&&(W*=256);)this[x+Q]=w/W&255;return x+E},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(w,x,E,M){if(w=+w,x=x>>>0,E=E>>>0,!M){let we=Math.pow(2,8*E)-1;se(this,w,x,E,we,0)}let W=E-1,Q=1;for(this[x+W]=w&255;--W>=0&&(Q*=256);)this[x+W]=w/Q&255;return x+E},s.prototype.writeUint8=s.prototype.writeUInt8=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,1,255,0),this[x]=w&255,x+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,2,65535,0),this[x]=w&255,this[x+1]=w>>>8,x+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,2,65535,0),this[x]=w>>>8,this[x+1]=w&255,x+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,4,4294967295,0),this[x+3]=w>>>24,this[x+2]=w>>>16,this[x+1]=w>>>8,this[x]=w&255,x+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,4,4294967295,0),this[x]=w>>>24,this[x+1]=w>>>16,this[x+2]=w>>>8,this[x+3]=w&255,x+4};function D(w,x,E,M,W){pe(x,M,W,w,E,7);let Q=Number(x&BigInt(4294967295));w[E++]=Q,Q=Q>>8,w[E++]=Q,Q=Q>>8,w[E++]=Q,Q=Q>>8,w[E++]=Q;let we=Number(x>>BigInt(32)&BigInt(4294967295));return w[E++]=we,we=we>>8,w[E++]=we,we=we>>8,w[E++]=we,we=we>>8,w[E++]=we,E}function U(w,x,E,M,W){pe(x,M,W,w,E,7);let Q=Number(x&BigInt(4294967295));w[E+7]=Q,Q=Q>>8,w[E+6]=Q,Q=Q>>8,w[E+5]=Q,Q=Q>>8,w[E+4]=Q;let we=Number(x>>BigInt(32)&BigInt(4294967295));return w[E+3]=we,we=we>>8,w[E+2]=we,we=we>>8,w[E+1]=we,we=we>>8,w[E]=we,E+8}s.prototype.writeBigUInt64LE=F(function(w,x=0){return D(this,w,x,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=F(function(w,x=0){return U(this,w,x,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(w,x,E,M){if(w=+w,x=x>>>0,!M){let ae=Math.pow(2,8*E-1);se(this,w,x,E,ae-1,-ae)}let W=0,Q=1,we=0;for(this[x]=w&255;++W<E&&(Q*=256);)w<0&&we===0&&this[x+W-1]!==0&&(we=1),this[x+W]=(w/Q>>0)-we&255;return x+E},s.prototype.writeIntBE=function(w,x,E,M){if(w=+w,x=x>>>0,!M){let ae=Math.pow(2,8*E-1);se(this,w,x,E,ae-1,-ae)}let W=E-1,Q=1,we=0;for(this[x+W]=w&255;--W>=0&&(Q*=256);)w<0&&we===0&&this[x+W+1]!==0&&(we=1),this[x+W]=(w/Q>>0)-we&255;return x+E},s.prototype.writeInt8=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,1,127,-128),w<0&&(w=255+w+1),this[x]=w&255,x+1},s.prototype.writeInt16LE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,2,32767,-32768),this[x]=w&255,this[x+1]=w>>>8,x+2},s.prototype.writeInt16BE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,2,32767,-32768),this[x]=w>>>8,this[x+1]=w&255,x+2},s.prototype.writeInt32LE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,4,2147483647,-2147483648),this[x]=w&255,this[x+1]=w>>>8,this[x+2]=w>>>16,this[x+3]=w>>>24,x+4},s.prototype.writeInt32BE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,4,2147483647,-2147483648),w<0&&(w=4294967295+w+1),this[x]=w>>>24,this[x+1]=w>>>16,this[x+2]=w>>>8,this[x+3]=w&255,x+4},s.prototype.writeBigInt64LE=F(function(w,x=0){return D(this,w,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=F(function(w,x=0){return U(this,w,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function xe(w,x,E,M,W,Q){if(E+M>w.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("Index out of range")}function X(w,x,E,M,W){return x=+x,E=E>>>0,W||xe(w,x,E,4),t.write(w,x,E,M,23,4),E+4}s.prototype.writeFloatLE=function(w,x,E){return X(this,w,x,!0,E)},s.prototype.writeFloatBE=function(w,x,E){return X(this,w,x,!1,E)};function Ce(w,x,E,M,W){return x=+x,E=E>>>0,W||xe(w,x,E,8),t.write(w,x,E,M,52,8),E+8}s.prototype.writeDoubleLE=function(w,x,E){return Ce(this,w,x,!0,E)},s.prototype.writeDoubleBE=function(w,x,E){return Ce(this,w,x,!1,E)},s.prototype.copy=function(w,x,E,M){if(!s.isBuffer(w))throw new TypeError("argument should be a Buffer");if(E||(E=0),!M&&M!==0&&(M=this.length),x>=w.length&&(x=w.length),x||(x=0),M>0&&M<E&&(M=E),M===E||w.length===0||this.length===0)return 0;if(x<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),w.length-x<M-E&&(M=w.length-x+E);let W=M-E;return this===w&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(x,E,M):Uint8Array.prototype.set.call(w,this.subarray(E,M),x),W},s.prototype.fill=function(w,x,E,M){if(typeof w=="string"){if(typeof x=="string"?(M=x,x=0,E=this.length):typeof E=="string"&&(M=E,E=this.length),M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!s.isEncoding(M))throw new TypeError("Unknown encoding: "+M);if(w.length===1){let Q=w.charCodeAt(0);(M==="utf8"&&Q<128||M==="latin1")&&(w=Q)}}else typeof w=="number"?w=w&255:typeof w=="boolean"&&(w=Number(w));if(x<0||this.length<x||this.length<E)throw new RangeError("Out of range index");if(E<=x)return this;x=x>>>0,E=E===void 0?this.length:E>>>0,w||(w=0);let W;if(typeof w=="number")for(W=x;W<E;++W)this[W]=w;else{let Q=s.isBuffer(w)?w:s.from(w,M),we=Q.length;if(we===0)throw new TypeError('The value "'+w+'" is invalid for argument "value"');for(W=0;W<E-x;++W)this[W+x]=Q[W%we]}return this};let ne={};function Y(w,x,E){ne[w]=class extends E{constructor(){super(),Object.defineProperty(this,"message",{value:x.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${w}]`,this.stack,delete this.name}get code(){return w}set code(M){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:M,writable:!0})}toString(){return`${this.name} [${w}]: ${this.message}`}}}Y("ERR_BUFFER_OUT_OF_BOUNDS",function(w){return w?`${w} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Y("ERR_INVALID_ARG_TYPE",function(w,x){return`The "${w}" argument must be of type number. Received type ${typeof x}`},TypeError),Y("ERR_OUT_OF_RANGE",function(w,x,E){let M=`The value of "${w}" is out of range.`,W=E;return Number.isInteger(E)&&Math.abs(E)>2**32?W=be(String(E)):typeof E=="bigint"&&(W=String(E),(E>BigInt(2)**BigInt(32)||E<-(BigInt(2)**BigInt(32)))&&(W=be(W)),W+="n"),M+=` It must be ${x}. Received ${W}`,M},RangeError);function be(w){let x="",E=w.length,M=w[0]==="-"?1:0;for(;E>=M+4;E-=3)x=`_${w.slice(E-3,E)}${x}`;return`${w.slice(0,E)}${x}`}function ce(w,x,E){he(x,"offset"),(w[x]===void 0||w[x+E]===void 0)&&Te(x,w.length-(E+1))}function pe(w,x,E,M,W,Q){if(w>E||w<x){let we=typeof x=="bigint"?"n":"",ae;throw x===0||x===BigInt(0)?ae=`>= 0${we} and < 2${we} ** ${(Q+1)*8}${we}`:ae=`>= -(2${we} ** ${(Q+1)*8-1}${we}) and < 2 ** ${(Q+1)*8-1}${we}`,new ne.ERR_OUT_OF_RANGE("value",ae,w)}ce(M,W,Q)}function he(w,x){if(typeof w!="number")throw new ne.ERR_INVALID_ARG_TYPE(x,"number",w)}function Te(w,x,E){throw Math.floor(w)!==w?(he(w,E),new ne.ERR_OUT_OF_RANGE("offset","an integer",w)):x<0?new ne.ERR_BUFFER_OUT_OF_BOUNDS:new ne.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${x}`,w)}let _e=/[^+/0-9A-Za-z-_]/g;function Z(w){if(w=w.split("=")[0],w=w.trim().replace(_e,""),w.length<2)return"";for(;w.length%4!==0;)w=w+"=";return w}function fe(w,x){x=x||1/0;let E,M=w.length,W=null,Q=[];for(let we=0;we<M;++we){if(E=w.charCodeAt(we),E>55295&&E<57344){if(!W){if(E>56319){(x-=3)>-1&&Q.push(239,191,189);continue}else if(we+1===M){(x-=3)>-1&&Q.push(239,191,189);continue}W=E;continue}if(E<56320){(x-=3)>-1&&Q.push(239,191,189),W=E;continue}E=(W-55296<<10|E-56320)+65536}else W&&(x-=3)>-1&&Q.push(239,191,189);if(W=null,E<128){if((x-=1)<0)break;Q.push(E)}else if(E<2048){if((x-=2)<0)break;Q.push(E>>6|192,E&63|128)}else if(E<65536){if((x-=3)<0)break;Q.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((x-=4)<0)break;Q.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw new Error("Invalid code point")}return Q}function ie(w){let x=[];for(let E=0;E<w.length;++E)x.push(w.charCodeAt(E)&255);return x}function re(w,x){let E,M,W,Q=[];for(let we=0;we<w.length&&!((x-=2)<0);++we)E=w.charCodeAt(we),M=E>>8,W=E%256,Q.push(W),Q.push(M);return Q}function ye(w){return e.toByteArray(Z(w))}function J(w,x,E,M){let W;for(W=0;W<M&&!(W+E>=x.length||W>=w.length);++W)x[W+E]=w[W];return W}function V(w,x){return w instanceof x||w!=null&&w.constructor!=null&&w.constructor.name!=null&&w.constructor.name===x.name}function me(w){return w!==w}let ee=function(){let w="0123456789abcdef",x=new Array(256);for(let E=0;E<16;++E){let M=E*16;for(let W=0;W<16;++W)x[M+W]=w[E]+w[W]}return x}();function F(w){return typeof BigInt>"u"?oe:w}function oe(){throw new Error("BigInt not supported")}return Cn}var Io,fd,wi,hd,Cn,pd,kP=cr(()=>{Ie(),Ne(),Re(),Io={},fd=!1,wi={},hd=!1,Cn={},pd=!1}),Ft={};Po(Ft,{Buffer:()=>Ia,INSPECT_MAX_BYTES:()=>Ng,default:()=>tn,kMaxLength:()=>$g});var tn,Ia,Ng,$g,Vt=cr(()=>{Ie(),Ne(),Re(),kP(),tn=_P(),tn.Buffer,tn.SlowBuffer,tn.INSPECT_MAX_BYTES,tn.kMaxLength,Ia=tn.Buffer,Ng=tn.INSPECT_MAX_BYTES,$g=tn.kMaxLength}),Ne=cr(()=>{Vt()}),Tt=Oe((e,t)=>{Ie(),Ne(),Re();var r=class extends Error{constructor(o){if(!Array.isArray(o))throw new TypeError(`Expected input to be an Array, got ${typeof o}`);let i="";for(let a=0;a<o.length;a++)i+=` ${o[a].stack}
|
|
2691
|
+
`)])])])]),Yl=jS,aA=Object.assign(Object.assign({},Xe.props),{value:[String,Number],defaultValue:[String,Number],trigger:{type:String,default:"click"},type:{type:String,default:"bar"},closable:Boolean,justifyContent:String,size:{type:String,default:"medium"},placement:{type:String,default:"top"},tabStyle:[String,Object],tabClass:String,addTabStyle:[String,Object],addTabClass:String,barWidth:Number,paneClass:String,paneStyle:[String,Object],paneWrapperClass:String,paneWrapperStyle:[String,Object],addable:[Boolean,Object],tabsPadding:{type:Number,default:0},animated:Boolean,onBeforeLeave:Function,onAdd:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClose:[Function,Array],labelSize:String,activeName:[String,Number],onActiveNameChange:[Function,Array]}),sA=n.defineComponent({name:"Tabs",props:aA,slots:Object,setup(e,{slots:t}){var r,o,i,a;process.env.NODE_ENV!=="production"&&n.watchEffect(()=>{e.labelSize!==void 0&&Dt("tabs","`label-size` is deprecated, please use `size` instead."),e.activeName!==void 0&&Dt("tabs","`active-name` is deprecated, please use `value` instead."),e.onActiveNameChange!==void 0&&Dt("tabs","`on-active-name-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:s,inlineThemeDisabled:l}=st(e),c=Xe("Tabs","-tabs",iA,F2,e,s),d=n.ref(null),u=n.ref(null),f=n.ref(null),h=n.ref(null),g=n.ref(null),p=n.ref(null),m=n.ref(!0),v=n.ref(!0),y=Fi(e,["labelSize","size"]),b=Fi(e,["activeName","value"]),S=n.ref((o=(r=b.value)!==null&&r!==void 0?r:e.defaultValue)!==null&&o!==void 0?o:t.default?(a=(i=pn(t.default())[0])===null||i===void 0?void 0:i.props)===null||a===void 0?void 0:a.name:null),_=Zt(b,S),C={id:0},A=n.computed(()=>{if(!(!e.justifyContent||e.type==="card"))return{display:"flex",justifyContent:e.justifyContent}});n.watch(_,()=>{C.id=0,B(),P()});function k(){var J;const{value:V}=_;return V===null?null:(J=d.value)===null||J===void 0?void 0:J.querySelector(`[data-name="${V}"]`)}function T(J){if(e.type==="card")return;const{value:V}=u;if(!V)return;const me=V.style.opacity==="0";if(J){const ee=`${s.value}-tabs-bar--disabled`,{barWidth:F,placement:oe}=e;if(J.dataset.disabled==="true"?V.classList.add(ee):V.classList.remove(ee),["top","bottom"].includes(oe)){if(R(["top","maxHeight","height"]),typeof F=="number"&&J.offsetWidth>=F){const w=Math.floor((J.offsetWidth-F)/2)+J.offsetLeft;V.style.left=`${w}px`,V.style.maxWidth=`${F}px`}else V.style.left=`${J.offsetLeft}px`,V.style.maxWidth=`${J.offsetWidth}px`;V.style.width="8192px",me&&(V.style.transition="none"),V.offsetWidth,me&&(V.style.transition="",V.style.opacity="1")}else{if(R(["left","maxWidth","width"]),typeof F=="number"&&J.offsetHeight>=F){const w=Math.floor((J.offsetHeight-F)/2)+J.offsetTop;V.style.top=`${w}px`,V.style.maxHeight=`${F}px`}else V.style.top=`${J.offsetTop}px`,V.style.maxHeight=`${J.offsetHeight}px`;V.style.height="8192px",me&&(V.style.transition="none"),V.offsetHeight,me&&(V.style.transition="",V.style.opacity="1")}}}function I(){if(e.type==="card")return;const{value:J}=u;J&&(J.style.opacity="0")}function R(J){const{value:V}=u;if(V)for(const me of J)V.style[me]=""}function B(){if(e.type==="card")return;const J=k();J?T(J):I()}function P(){var J;const V=(J=g.value)===null||J===void 0?void 0:J.$el;if(!V)return;const me=k();if(!me)return;const{scrollLeft:ee,offsetWidth:F}=V,{offsetLeft:oe,offsetWidth:w}=me;ee>oe?V.scrollTo({top:0,left:oe,behavior:"smooth"}):oe+w>ee+F&&V.scrollTo({top:0,left:oe+w-F,behavior:"smooth"})}const O=n.ref(null);let N=0,$=null;function q(J){const V=O.value;if(V){N=J.getBoundingClientRect().height;const me=`${N}px`,ee=()=>{V.style.height=me,V.style.maxHeight=me};$?(ee(),$(),$=null):$=ee}}function z(J){const V=O.value;if(V){const me=J.getBoundingClientRect().height,ee=()=>{document.body.offsetHeight,V.style.maxHeight=`${me}px`,V.style.height=`${Math.max(N,me)}px`};$?($(),$=null,ee()):$=ee}}function L(){const J=O.value;if(J){J.style.maxHeight="",J.style.height="";const{paneWrapperStyle:V}=e;if(typeof V=="string")J.style.cssText=V;else if(V){const{maxHeight:me,height:ee}=V;me!==void 0&&(J.style.maxHeight=me),ee!==void 0&&(J.style.height=ee)}}}const te={value:[]},j=n.ref("next");function se(J){const V=_.value;let me="next";for(const ee of te.value){if(ee===V)break;if(ee===J){me="prev";break}}j.value=me,D(J)}function D(J){const{onActiveNameChange:V,onUpdateValue:me,"onUpdate:value":ee}=e;V&&He(V,J),me&&He(me,J),ee&&He(ee,J),S.value=J}function U(J){const{onClose:V}=e;V&&He(V,J)}function xe(){const{value:J}=u;if(!J)return;const V="transition-disabled";J.classList.add(V),B(),J.classList.remove(V)}const X=n.ref(null);function Ce({transitionDisabled:J}){const V=d.value;if(!V)return;J&&V.classList.add("transition-disabled");const me=k();me&&X.value&&(X.value.style.width=`${me.offsetWidth}px`,X.value.style.height=`${me.offsetHeight}px`,X.value.style.transform=`translateX(${me.offsetLeft-Lt(getComputedStyle(V).paddingLeft)}px)`,J&&X.value.offsetWidth),J&&V.classList.remove("transition-disabled")}n.watch([_],()=>{e.type==="segment"&&n.nextTick(()=>{Ce({transitionDisabled:!1})})}),n.onMounted(()=>{e.type==="segment"&&Ce({transitionDisabled:!0})});let ne=0;function Y(J){var V;if(J.contentRect.width===0&&J.contentRect.height===0||ne===J.contentRect.width)return;ne=J.contentRect.width;const{type:me}=e;if((me==="line"||me==="bar")&&xe(),me!=="segment"){const{placement:ee}=e;_e((ee==="top"||ee==="bottom"?(V=g.value)===null||V===void 0?void 0:V.$el:p.value)||null)}}const be=Yl(Y,64);n.watch([()=>e.justifyContent,()=>e.size],()=>{n.nextTick(()=>{const{type:J}=e;(J==="line"||J==="bar")&&xe()})});const ce=n.ref(!1);function pe(J){var V;const{target:me,contentRect:{width:ee,height:F}}=J,oe=me.parentElement.parentElement.offsetWidth,w=me.parentElement.parentElement.offsetHeight,{placement:x}=e;if(!ce.value)x==="top"||x==="bottom"?oe<ee&&(ce.value=!0):w<F&&(ce.value=!0);else{const{value:E}=h;if(!E)return;x==="top"||x==="bottom"?oe-ee>E.$el.offsetWidth&&(ce.value=!1):w-F>E.$el.offsetHeight&&(ce.value=!1)}_e(((V=g.value)===null||V===void 0?void 0:V.$el)||null)}const he=Yl(pe,64);function Te(){const{onAdd:J}=e;J&&J(),n.nextTick(()=>{const V=k(),{value:me}=g;!V||!me||me.scrollTo({left:V.offsetLeft,top:0,behavior:"smooth"})})}function _e(J){if(!J)return;const{placement:V}=e;if(V==="top"||V==="bottom"){const{scrollLeft:me,scrollWidth:ee,offsetWidth:F}=J;m.value=me<=0,v.value=me+F>=ee}else{const{scrollTop:me,scrollHeight:ee,offsetHeight:F}=J;m.value=me<=0,v.value=me+F>=ee}}const Z=Yl(J=>{_e(J.target)},64);n.provide(Gl,{triggerRef:n.toRef(e,"trigger"),tabStyleRef:n.toRef(e,"tabStyle"),tabClassRef:n.toRef(e,"tabClass"),addTabStyleRef:n.toRef(e,"addTabStyle"),addTabClassRef:n.toRef(e,"addTabClass"),paneClassRef:n.toRef(e,"paneClass"),paneStyleRef:n.toRef(e,"paneStyle"),mergedClsPrefixRef:s,typeRef:n.toRef(e,"type"),closableRef:n.toRef(e,"closable"),valueRef:_,tabChangeIdRef:C,onBeforeLeaveRef:n.toRef(e,"onBeforeLeave"),activateTab:se,handleClose:U,handleAdd:Te}),lf(()=>{B(),P()}),n.watchEffect(()=>{const{value:J}=f;if(!J)return;const{value:V}=s,me=`${V}-tabs-nav-scroll-wrapper--shadow-start`,ee=`${V}-tabs-nav-scroll-wrapper--shadow-end`;m.value?J.classList.remove(me):J.classList.add(me),v.value?J.classList.remove(ee):J.classList.add(ee)});const fe={syncBarPosition:()=>{B()}},ie=()=>{Ce({transitionDisabled:!0})},re=n.computed(()=>{const{value:J}=y,{type:V}=e,me={card:"Card",bar:"Bar",line:"Line",segment:"Segment"}[V],ee=`${J}${me}`,{self:{barColor:F,closeIconColor:oe,closeIconColorHover:w,closeIconColorPressed:x,tabColor:E,tabBorderColor:M,paneTextColor:W,tabFontWeight:Q,tabBorderRadius:we,tabFontWeightActive:ae,colorSegment:ge,fontWeightStrong:Be,tabColorSegment:H,closeSize:ve,closeIconSize:Ae,closeColorHover:Le,closeColorPressed:We,closeBorderRadius:Ve,[Me("panePadding",J)]:Ue,[Me("tabPadding",ee)]:De,[Me("tabPaddingVertical",ee)]:Ke,[Me("tabGap",ee)]:et,[Me("tabGap",`${ee}Vertical`)]:ct,[Me("tabTextColor",V)]:bt,[Me("tabTextColorActive",V)]:Pt,[Me("tabTextColorHover",V)]:G,[Me("tabTextColorDisabled",V)]:le,[Me("tabFontSize",J)]:ze},common:{cubicBezierEaseInOut:je}}=c.value;return{"--n-bezier":je,"--n-color-segment":ge,"--n-bar-color":F,"--n-tab-font-size":ze,"--n-tab-text-color":bt,"--n-tab-text-color-active":Pt,"--n-tab-text-color-disabled":le,"--n-tab-text-color-hover":G,"--n-pane-text-color":W,"--n-tab-border-color":M,"--n-tab-border-radius":we,"--n-close-size":ve,"--n-close-icon-size":Ae,"--n-close-color-hover":Le,"--n-close-color-pressed":We,"--n-close-border-radius":Ve,"--n-close-icon-color":oe,"--n-close-icon-color-hover":w,"--n-close-icon-color-pressed":x,"--n-tab-color":E,"--n-tab-font-weight":Q,"--n-tab-font-weight-active":ae,"--n-tab-padding":De,"--n-tab-padding-vertical":Ke,"--n-tab-gap":et,"--n-tab-gap-vertical":ct,"--n-pane-padding-left":zt(Ue,"left"),"--n-pane-padding-right":zt(Ue,"right"),"--n-pane-padding-top":zt(Ue,"top"),"--n-pane-padding-bottom":zt(Ue,"bottom"),"--n-font-weight-strong":Be,"--n-tab-color-segment":H}}),ye=l?vt("tabs",n.computed(()=>`${y.value[0]}${e.type[0]}`),re,e):void 0;return Object.assign({mergedClsPrefix:s,mergedValue:_,renderedNames:new Set,segmentCapsuleElRef:X,tabsPaneWrapperRef:O,tabsElRef:d,barElRef:u,addTabInstRef:h,xScrollInstRef:g,scrollWrapperElRef:f,addTabFixed:ce,tabWrapperStyle:A,handleNavResize:be,mergedSize:y,handleScroll:Z,handleTabsResize:he,cssVars:l?void 0:re,themeClass:ye==null?void 0:ye.themeClass,animationDirection:j,renderNameListRef:te,yScrollElRef:p,handleSegmentResize:ie,onAnimationBeforeLeave:q,onAnimationEnter:z,onAnimationAfterEnter:L,onRender:ye==null?void 0:ye.onRender},fe)},render(){const{mergedClsPrefix:e,type:t,placement:r,addTabFixed:o,addable:i,mergedSize:a,renderNameListRef:s,onRender:l,paneWrapperClass:c,paneWrapperStyle:d,$slots:{default:u,prefix:f,suffix:h}}=this;l==null||l();const g=u?pn(u()).filter(C=>C.type.__TAB_PANE__===!0):[],p=u?pn(u()).filter(C=>C.type.__TAB__===!0):[],m=!p.length,v=t==="card",y=t==="segment",b=!v&&!y&&this.justifyContent;s.value=[];const S=()=>{const C=n.h("div",{style:this.tabWrapperStyle,class:`${e}-tabs-wrapper`},b?null:n.h("div",{class:`${e}-tabs-scroll-padding`,style:r==="top"||r==="bottom"?{width:`${this.tabsPadding}px`}:{height:`${this.tabsPadding}px`}}),m?g.map((A,k)=>(s.value.push(A.props.name),Xl(n.h(Kl,Object.assign({},A.props,{internalCreatedByPane:!0,internalLeftPadded:k!==0&&(!b||b==="center"||b==="start"||b==="end")}),A.children?{default:A.children.tab}:void 0)))):p.map((A,k)=>(s.value.push(A.props.name),Xl(k!==0&&!b?ug(A):A))),!o&&i&&v?dg(i,(m?g.length:p.length)!==0):null,b?null:n.h("div",{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}));return n.h("div",{ref:"tabsElRef",class:`${e}-tabs-nav-scroll-content`},v&&i?n.h(Hr,{onResize:this.handleTabsResize},{default:()=>C}):C,v?n.h("div",{class:`${e}-tabs-pad`}):null,v?null:n.h("div",{ref:"barElRef",class:`${e}-tabs-bar`}))},_=y?"top":r;return n.h("div",{class:[`${e}-tabs`,this.themeClass,`${e}-tabs--${t}-type`,`${e}-tabs--${a}-size`,b&&`${e}-tabs--flex`,`${e}-tabs--${_}`],style:this.cssVars},n.h("div",{class:[`${e}-tabs-nav--${t}-type`,`${e}-tabs-nav--${_}`,`${e}-tabs-nav`]},lt(f,C=>C&&n.h("div",{class:`${e}-tabs-nav__prefix`},C)),y?n.h(Hr,{onResize:this.handleSegmentResize},{default:()=>n.h("div",{class:`${e}-tabs-rail`,ref:"tabsElRef"},n.h("div",{class:`${e}-tabs-capsule`,ref:"segmentCapsuleElRef"},n.h("div",{class:`${e}-tabs-wrapper`},n.h("div",{class:`${e}-tabs-tab`}))),m?g.map((C,A)=>(s.value.push(C.props.name),n.h(Kl,Object.assign({},C.props,{internalCreatedByPane:!0,internalLeftPadded:A!==0}),C.children?{default:C.children.tab}:void 0))):p.map((C,A)=>(s.value.push(C.props.name),A===0?C:ug(C))))}):n.h(Hr,{onResize:this.handleNavResize},{default:()=>n.h("div",{class:`${e}-tabs-nav-scroll-wrapper`,ref:"scrollWrapperElRef"},["top","bottom"].includes(_)?n.h(mv,{ref:"xScrollInstRef",onScroll:this.handleScroll},{default:S}):n.h("div",{class:`${e}-tabs-nav-y-scroll`,onScroll:this.handleScroll,ref:"yScrollElRef"},S()))}),o&&i&&v?dg(i,!0):null,lt(h,C=>C&&n.h("div",{class:`${e}-tabs-nav__suffix`},C))),m&&(this.animated&&(_==="top"||_==="bottom")?n.h("div",{ref:"tabsPaneWrapperRef",style:d,class:[`${e}-tabs-pane-wrapper`,c]},cg(g,this.mergedValue,this.renderedNames,this.onAnimationBeforeLeave,this.onAnimationEnter,this.onAnimationAfterEnter,this.animationDirection)):cg(g,this.mergedValue,this.renderedNames)))}});function cg(e,t,r,o,i,a,s){const l=[];return e.forEach(c=>{const{name:d,displayDirective:u,"display-directive":f}=c.props,h=p=>u===p||f===p,g=t===d;if(c.key!==void 0&&(c.key=d),g||h("show")||h("show:lazy")&&r.has(d)){r.has(d)||r.add(d);const p=!h("if");l.push(p?n.withDirectives(c,[[n.vShow,g]]):c)}}),s?n.h(n.TransitionGroup,{name:`${s}-transition`,onBeforeLeave:o,onEnter:i,onAfterEnter:a},{default:()=>l}):l}function dg(e,t){return n.h(Kl,{ref:"addTabInstRef",key:"__addable",name:"__addable",internalCreatedByPane:!0,internalAddable:!0,internalLeftPadded:t,disabled:typeof e=="object"&&e.disabled})}function ug(e){const t=n.cloneVNode(e);return t.props?t.props.internalLeftPadded=!0:t.props={internalLeftPadded:!0},t}function Xl(e){return Array.isArray(e.dynamicProps)?e.dynamicProps.includes("internalLeftPadded")||e.dynamicProps.push("internalLeftPadded"):e.dynamicProps=["internalLeftPadded"],e}const lA={version:"2.0.2"},cA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},dA=n.defineComponent({name:"ArrowRedoOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",cA,r[0]||(r[0]=[n.createElementVNode("path",{d:"M448 256L272 88v96C103.57 184 64 304.77 64 424c48.61-62.24 91.6-96 208-96v96z",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1)]))}}),uA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},fA=n.defineComponent({name:"ArrowUndoOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",uA,r[0]||(r[0]=[n.createElementVNode("path",{d:"M240 424v-96c116.4 0 159.39 33.76 208 96c0-119.23-39.57-240-208-240V88L64 256z",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1)]))}}),hA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Ao=n.defineComponent({name:"CloseOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",hA,r[0]||(r[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 368L144 144"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 144L144 368"},null,-1)]))}}),pA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},gA=n.defineComponent({name:"DownloadOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",pA,r[0]||(r[0]=[n.createElementVNode("path",{d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M176 272l80 80l80-80"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 48v288"},null,-1)]))}}),mA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},fg=n.defineComponent({name:"EyeOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",mA,r[0]||(r[0]=[n.createElementVNode("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),n.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)]))}}),bA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},yA=n.defineComponent({name:"FolderOpenOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",bA,r[0]||(r[0]=[n.createElementVNode("path",{d:"M64 192v-72a40 40 0 0 1 40-40h75.89a40 40 0 0 1 22.19 6.72l27.84 18.56a40 40 0 0 0 22.19 6.72H408a40 40 0 0 1 40 40v40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),n.createElementVNode("path",{d:"M479.9 226.55L463.68 392a40 40 0 0 1-39.93 40H88.25a40 40 0 0 1-39.93-40L32.1 226.55A32 32 0 0 1 64 192h384.1a32 32 0 0 1 31.8 34.55z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)]))}}),vA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},wA=n.defineComponent({name:"GitNetworkOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",vA,r[0]||(r[0]=[n.createStaticVNode('<circle cx="128" cy="96" r="48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></circle><circle cx="256" cy="416" r="48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></circle><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M256 256v112"></path><circle cx="384" cy="96" r="48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></circle><path d="M128 144c0 74.67 68.92 112 128 112" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path><path d="M384 144c0 74.67-68.92 112-128 112" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path>',6)]))}}),xA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},hg=n.defineComponent({name:"InformationCircleOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",xA,r[0]||(r[0]=[n.createElementVNode("path",{d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),n.createElementVNode("path",{d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26z",fill:"currentColor"},null,-1)]))}}),CA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},SA=n.defineComponent({name:"SaveOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",CA,r[0]||(r[0]=[n.createElementVNode("path",{d:"M380.93 57.37A32 32 0 0 0 358.3 48H94.22A46.21 46.21 0 0 0 48 94.22v323.56A46.21 46.21 0 0 0 94.22 464h323.56A46.36 46.36 0 0 0 464 417.78V153.7a32 32 0 0 0-9.37-22.63zM256 416a64 64 0 1 1 64-64a63.92 63.92 0 0 1-64 64zm48-224H112a16 16 0 0 1-16-16v-64a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16v64a16 16 0 0 1-16 16z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)]))}}),_A={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},pg=n.defineComponent({name:"SearchOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",_A,r[0]||(r[0]=[n.createElementVNode("path",{d:"M221.09 64a157.09 157.09 0 1 0 157.09 157.09A157.1 157.1 0 0 0 221.09 64z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M338.29 338.29L448 448"},null,-1)]))}}),kA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},EA=n.defineComponent({name:"ServerOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",kA,r[0]||(r[0]=[n.createElementVNode("ellipse",{cx:"256",cy:"128",rx:"192",ry:"80",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),n.createElementVNode("path",{d:"M448 214c0 44.18-86 80-192 80S64 258.18 64 214",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),n.createElementVNode("path",{d:"M448 300c0 44.18-86 80-192 80S64 344.18 64 300",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),n.createElementVNode("path",{d:"M64 127.24v257.52C64 428.52 150 464 256 464s192-35.48 192-79.24V127.24",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1)]))}}),TA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Jl=n.defineComponent({name:"TrashOutline",render:function(t,r){return n.openBlock(),n.createElementBlock("svg",TA,r[0]||(r[0]=[n.createStaticVNode('<path d="M112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M80 112h352" fill="currentColor"></path><path d="M192 112V72h0a23.93 23.93 0 0 1 24-24h80a23.93 23.93 0 0 1 24 24h0v40" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M256 176v224"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M184 176l8 224"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M328 176l-8 224"></path>',6)]))}}),AA={class:"scada-header"},PA={class:"header-left"},IA={class:"header-center"},RA={class:"header-right"},NA=n.defineComponent({__name:"Header",props:{selectedNodesCount:{default:0}},emits:["save","import","workflow","preview","export","dataSource","undo","redo","alignLeft","alignCenter","alignRight","alignTop","alignMiddle","alignBottom","distributeHorizontal","distributeVertical"],setup(e,{emit:t}){const r=lA.version,o={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},i=n.defineComponent({render:()=>n.h("svg",o,[n.h("line",{x1:"4",y1:"2",x2:"4",y2:"22"}),n.h("rect",{x:"4",y:"6",width:"16",height:"4",rx:"1"}),n.h("rect",{x:"4",y:"14",width:"10",height:"4",rx:"1"})])}),a=n.defineComponent({render:()=>n.h("svg",o,[n.h("line",{x1:"12",y1:"2",x2:"12",y2:"22"}),n.h("rect",{x:"4",y:"6",width:"16",height:"4",rx:"1"}),n.h("rect",{x:"7",y:"14",width:"10",height:"4",rx:"1"})])}),s=n.defineComponent({render:()=>n.h("svg",o,[n.h("line",{x1:"20",y1:"2",x2:"20",y2:"22"}),n.h("rect",{x:"4",y:"6",width:"16",height:"4",rx:"1"}),n.h("rect",{x:"10",y:"14",width:"10",height:"4",rx:"1"})])}),l=n.defineComponent({render:()=>n.h("svg",o,[n.h("line",{x1:"2",y1:"4",x2:"22",y2:"4"}),n.h("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),n.h("rect",{x:"14",y:"4",width:"4",height:"10",rx:"1"})])}),c=n.defineComponent({render:()=>n.h("svg",o,[n.h("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),n.h("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),n.h("rect",{x:"14",y:"7",width:"4",height:"10",rx:"1"})])}),d=n.defineComponent({render:()=>n.h("svg",o,[n.h("line",{x1:"2",y1:"20",x2:"22",y2:"20"}),n.h("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),n.h("rect",{x:"14",y:"10",width:"4",height:"10",rx:"1"})])}),u=n.defineComponent({render:()=>n.h("svg",o,[n.h("rect",{x:"3",y:"6",width:"4",height:"12",rx:"1"}),n.h("rect",{x:"10",y:"6",width:"4",height:"12",rx:"1"}),n.h("rect",{x:"17",y:"6",width:"4",height:"12",rx:"1"})])}),f=n.defineComponent({render:()=>n.h("svg",o,[n.h("rect",{x:"6",y:"3",width:"12",height:"4",rx:"1"}),n.h("rect",{x:"6",y:"10",width:"12",height:"4",rx:"1"}),n.h("rect",{x:"6",y:"17",width:"12",height:"4",rx:"1"})])}),h=e,g=t,p=[{label:"导出 PNG 图片",key:"png"},{label:"导出 SVG 图片",key:"svg"},{label:"导出 JSON 配置",key:"json"}],m=v=>{g("export",v)};return(v,y)=>{const b=wn,S=Wt,_=Ct,C=Kk,A=m2;return n.openBlock(),n.createElementBlock("header",AA,[n.createElementVNode("div",PA,[n.renderSlot(v.$slots,"left",{},()=>[y[15]||(y[15]=n.createElementVNode("h1",{class:"logo"},"SCADA 组态引擎",-1)),n.createVNode(b,{type:"info",size:"small"},{default:n.withCtx(()=>[n.createTextVNode("v"+n.toDisplayString(n.unref(r)),1)]),_:1})],!0)]),n.createElementVNode("div",IA,[h.selectedNodesCount>=2?(n.openBlock(),n.createBlock(C,{key:0},{default:n.withCtx(()=>[n.createVNode(_,{class:"toolbar-btn",onClick:y[0]||(y[0]=k=>g("alignLeft")),title:"左对齐",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(i)},null,8,["component"])]),_:1}),n.createVNode(_,{class:"toolbar-btn",onClick:y[1]||(y[1]=k=>g("alignCenter")),title:"水平居中",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(a)},null,8,["component"])]),_:1}),n.createVNode(_,{class:"toolbar-btn",onClick:y[2]||(y[2]=k=>g("alignRight")),title:"右对齐",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(s)},null,8,["component"])]),_:1}),n.createVNode(_,{class:"toolbar-btn",onClick:y[3]||(y[3]=k=>g("alignTop")),title:"顶部对齐",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(l)},null,8,["component"])]),_:1}),n.createVNode(_,{class:"toolbar-btn",onClick:y[4]||(y[4]=k=>g("alignMiddle")),title:"垂直居中",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(c)},null,8,["component"])]),_:1}),n.createVNode(_,{class:"toolbar-btn",onClick:y[5]||(y[5]=k=>g("alignBottom")),title:"底部对齐",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(d)},null,8,["component"])]),_:1})]),_:1})):n.createCommentVNode("",!0),h.selectedNodesCount>=3?(n.openBlock(),n.createBlock(C,{key:1},{default:n.withCtx(()=>[n.createVNode(_,{class:"toolbar-btn",onClick:y[6]||(y[6]=k=>g("distributeHorizontal")),title:"横向分布",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(u)},null,8,["component"])]),_:1}),n.createVNode(_,{class:"toolbar-btn",onClick:y[7]||(y[7]=k=>g("distributeVertical")),title:"纵向分布",circle:""},{icon:n.withCtx(()=>[n.createVNode(S,{component:n.unref(f)},null,8,["component"])]),_:1})]),_:1})):n.createCommentVNode("",!0)]),n.createElementVNode("div",RA,[n.createVNode(C,null,{default:n.withCtx(()=>[n.createVNode(_,{class:"header-btn",onClick:y[8]||(y[8]=k=>g("undo")),title:"撤销 (Ctrl+Z)"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(fA))]),_:1})]),_:1}),n.createVNode(_,{class:"header-btn",onClick:y[9]||(y[9]=k=>g("redo")),title:"重做 (Ctrl+Shift+Z)"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(dA))]),_:1})]),_:1})]),_:1}),n.createVNode(_,{class:"header-btn",onClick:y[10]||(y[10]=k=>g("dataSource")),title:"数据源管理"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(EA))]),_:1})]),default:n.withCtx(()=>[y[16]||(y[16]=n.createTextVNode(" 数据源 ",-1))]),_:1}),n.createVNode(_,{class:"header-btn",onClick:y[11]||(y[11]=k=>g("workflow")),title:"流程编排"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(wA))]),_:1})]),default:n.withCtx(()=>[y[17]||(y[17]=n.createTextVNode(" 流程编排 ",-1))]),_:1}),n.createVNode(_,{class:"header-btn",onClick:y[12]||(y[12]=k=>g("import")),title:"导入"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(yA))]),_:1})]),default:n.withCtx(()=>[y[18]||(y[18]=n.createTextVNode(" 导入 ",-1))]),_:1}),n.createVNode(A,{options:p,trigger:"click",onSelect:m},{default:n.withCtx(()=>[n.createVNode(_,{class:"header-btn",title:"导出"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(gA))]),_:1})]),default:n.withCtx(()=>[y[19]||(y[19]=n.createTextVNode(" 导出 ",-1))]),_:1})]),_:1}),n.createVNode(_,{class:"header-btn",onClick:y[13]||(y[13]=k=>g("preview")),title:"预览"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(fg))]),_:1})]),default:n.withCtx(()=>[y[20]||(y[20]=n.createTextVNode(" 预览 ",-1))]),_:1}),n.createVNode(_,{class:"header-btn",onClick:y[14]||(y[14]=k=>g("save")),title:"保存",type:"primary"},{icon:n.withCtx(()=>[n.createVNode(S,null,{default:n.withCtx(()=>[n.createVNode(n.unref(SA))]),_:1})]),default:n.withCtx(()=>[y[21]||(y[21]=n.createTextVNode(" 保存 ",-1))]),_:1})])])}}}),gt=(e,t)=>{const r=e.__vccOpts||e;for(const[o,i]of t)r[o]=i;return r},Ql=gt(NA,[["__scopeId","data-v-cad16ed2"]]),wr="#31d0c6",xr="#fff",Cr=2,qt=4,$A="#999999",OA="#0f172a",BA="#1e293b",gg=[{id:"basic",name:"基础仪表盘",config:{min:0,max:100,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.3,"#67e0e3"],[.7,"#37a2da"],[1,"#fd666d"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value}"}}},{id:"temperature",name:"温度仪表盘",config:{min:-20,max:50,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.2,"#2563eb"],[.5,"#22c55e"],[.8,"#f59e0b"],[1,"#ef4444"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:10,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value}°C"}}},{id:"humidity",name:"湿度仪表盘",config:{min:0,max:100,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.3,"#fbbf24"],[.7,"#3b82f6"],[1,"#1e40af"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value}%"}}},{id:"speed",name:"速度仪表盘",config:{min:0,max:200,splitNumber:10,startAngle:225,endAngle:-45,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.4,"#10b981"],[.7,"#f59e0b"],[1,"#ef4444"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value} km/h"}}},{id:"pressure",name:"压力仪表盘",config:{min:0,max:10,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.5,"#22c55e"],[.8,"#f59e0b"],[1,"#dc2626"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value} MPa"}}},{id:"rpm",name:"转速仪表盘",config:{min:0,max:8e3,splitNumber:8,startAngle:225,endAngle:-45,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.6,"#06b6d4"],[.85,"#eab308"],[1,"#dc2626"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value} RPM"}}},{id:"battery",name:"电池仪表盘",config:{min:0,max:100,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.2,"#dc2626"],[.5,"#f59e0b"],[1,"#22c55e"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:10,fontSize:12,color:"#999"},title:{offsetCenter:[0,"80%"],fontSize:12,color:"#999"},detail:{fontSize:20,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value}%"}}},{id:"power",name:"功率仪表盘",config:{min:0,max:100,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.3,"#64748b"],[.7,"#3b82f6"],[1,"#8b5cf6"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:10,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:12,color:"#999"},detail:{fontSize:20,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value} kW"}}}];function MA(e){return gg.find(t=>t.id===e)}const mg={metadata:{id:"echarts-gauge",name:"仪表盘",category:"iot",icon:"📈",description:"ECharts 仪表盘数据展示组件,支持丰富的配置选项",version:"1.0.0"},shape:"echarts-vue",component:gt(n.defineComponent({__name:"EChartsGauge",props:{node:{}},setup(e){const t=e,r=n.ref();let o=null;const i=()=>t.node?t.node.getData?t.node.getData():t.node.data||{}:{},a=()=>{r.value&&(o&&o.dispose(),o=Lu.init(r.value),s())},s=()=>{if(!o)return;const l=i(),c=l.presetId||"basic",d=MA(c),u={tooltip:{formatter:"{a} <br/>{b} : {c}%"},series:[{name:l.name||"Pressure",type:"gauge",data:[{value:l.value??50,name:l.title||"SCORE"}]}]};d&&d.config&&Object.assign(u.series[0],d.config),o.setOption(u,!0)};return n.watch(()=>{var l;return(l=t.node)==null?void 0:l.data},(l,c)=>{s()},{deep:!0}),n.watch(()=>{var l,c;return(c=(l=t.node)==null?void 0:l.data)==null?void 0:c.presetId},(l,c)=>{l!==c&&s()}),n.watch(()=>{var l;return(l=t.node)==null?void 0:l.size},()=>{if(o&&t.node){const l=t.node.getSize?t.node.getSize():t.node.size||{width:200,height:200};o.resize({width:l.width,height:l.height})}},{deep:!0}),n.onMounted(()=>{setTimeout(()=>{a(),t.node&&typeof t.node.on=="function"&&t.node.on("change:data",({current:l})=>{s()})},100)}),n.onUnmounted(()=>{o&&(o.dispose(),o=null)}),(l,c)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"chartRef",ref:r,class:"echarts-gauge-component",style:{width:"100%",height:"100%"}},null,512))}}),[["__scopeId","data-v-3a9c4466"]]),width:200,height:200,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"echarts-gauge",presetId:"basic",value:50,title:"SCORE",name:"Pressure"},ports:{groups:{top:{position:"top",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}},right:{position:"right",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}},bottom:{position:"bottom",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}},left:{position:"left",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"presetId",label:"仪表盘类型",type:"select",path:"data.presetId",defaultValue:"basic",options:gg.map(e=>({label:e.name,value:e.id})),description:"选择预设的仪表盘类型,会自动应用对应的配置"},{key:"value",label:"当前值",type:"number",path:"data.value",defaultValue:50,description:"仪表盘当前显示值",bindable:!0},{key:"title",label:"标题",type:"text",path:"data.title",defaultValue:"SCORE",description:"仪表盘标题"},{key:"name",label:"系列名称",type:"text",path:"data.name",defaultValue:"Pressure",description:"显示在 tooltip 中的系列名称"}],points:[{id:"value",name:"当前值",description:"仪表盘当前显示的数值",dataType:"number",defaultValue:50,required:!0,range:{min:0,max:100}},{id:"min",name:"最小值",description:"仪表盘刻度最小值",dataType:"number",defaultValue:0,required:!1},{id:"max",name:"最大值",description:"仪表盘刻度最大值",dataType:"number",defaultValue:100,required:!1},{id:"title",name:"标题",description:"仪表盘显示标题",dataType:"string",defaultValue:"SCORE",required:!1}]},bg=[{id:"basic",name:"基础折线图",config:{smooth:!1,lineStyle:{width:2,color:"#5470c6"},areaStyle:null,symbol:"circle",symbolSize:6,radius:"100%"}},{id:"smooth",name:"平滑曲线",config:{smooth:!0,lineStyle:{width:2,color:"#91cc75"},areaStyle:null,symbol:"circle",symbolSize:6}},{id:"area",name:"区域折线图",config:{smooth:!1,lineStyle:{width:2,color:"#5470c6"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(84, 112, 198, 0.3)"},{offset:1,color:"rgba(84, 112, 198, 0.05)"}]}},symbol:"circle",symbolSize:6}},{id:"smooth-area",name:"平滑区域图",config:{smooth:!0,lineStyle:{width:2,color:"#91cc75"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(145, 204, 117, 0.3)"},{offset:1,color:"rgba(145, 204, 117, 0.05)"}]}},symbol:"circle",symbolSize:6}},{id:"dashed",name:"虚线折线图",config:{smooth:!1,lineStyle:{width:2,color:"#fac858",type:"dashed"},areaStyle:null,symbol:"circle",symbolSize:6}},{id:"step",name:"阶梯折线图",config:{smooth:!1,step:"middle",lineStyle:{width:2,color:"#ee6666"},areaStyle:null,symbol:"circle",symbolSize:6}}];function zA(e){return bg.find(t=>t.id===e)}const yg={metadata:{id:"echarts-line",name:"折线图",category:"iot",icon:"📉",description:"ECharts 折线图数据展示组件,支持时序数据可视化",version:"1.0.0"},shape:"echarts-line-vue",component:n.defineComponent({__name:"EChartsLine",props:{node:{}},setup(e){const t=e,r=n.ref();let o=null;const i=()=>t.node?t.node.getData?t.node.getData():t.node.data||{}:{},a=()=>{r.value&&(o=Lu.init(r.value),s())},s=()=>{if(!o)return;const l=i(),c=l.presetId||"basic",d=zA(c),u={title:{text:l.title||"数据趋势",left:"center",top:10,textStyle:{color:"#fff",fontSize:14}},tooltip:{trigger:"axis",backgroundColor:"rgba(0, 0, 0, 0.7)",borderColor:"#333",textStyle:{color:"#fff"}},grid:{left:"10%",right:"10%",top:"20%",bottom:"15%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:l.xAxisData||["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],axisLine:{lineStyle:{color:"#999"}},axisLabel:{color:"#999"}},yAxis:{type:"value",axisLine:{lineStyle:{color:"#999"}},axisLabel:{color:"#999"},splitLine:{lineStyle:{color:"rgba(255, 255, 255, 0.1)"}}},series:[{name:l.seriesName||"Data",type:"line",data:l.seriesData||[120,200,150,80,70,110,130]}]};d&&d.config&&Object.assign(u.series[0],d.config),o.setOption(u,!0)};return n.onMounted(()=>{setTimeout(()=>{a(),t.node&&typeof t.node.on=="function"&&t.node.on("change:data",({current:l})=>{s()})},100)}),n.onUnmounted(()=>{o&&(o.dispose(),o=null)}),(l,c)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"chartContainer",ref:r,style:{width:"100%",height:"100%"}},null,512))}}),width:400,height:300,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"echarts-line",presetId:"basic",title:"数据趋势",xAxisData:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],seriesData:[120,200,150,80,70,110,130],seriesName:"Data"},ports:{groups:{top:{position:"top",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}},right:{position:"right",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}},bottom:{position:"bottom",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}},left:{position:"left",attrs:{circle:{r:qt,magnet:!0,stroke:wr,strokeWidth:Cr,fill:xr}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"presetId",label:"折线图类型",type:"select",path:"data.presetId",defaultValue:"basic",options:bg.map(e=>({label:e.name,value:e.id})),description:"选择预设的折线图类型"},{key:"title",label:"图表标题",type:"text",path:"data.title",defaultValue:"数据趋势",description:"折线图标题"},{key:"seriesName",label:"系列名称",type:"text",path:"data.seriesName",defaultValue:"Data",description:"显示在 tooltip 和 legend 中的系列名称"}],points:[{id:"series_data",name:"系列数据",description:"折线图Y轴数据数组",dataType:"json",defaultValue:[120,200,150,80,70,110,130],required:!0},{id:"x_axis_data",name:"X轴数据",description:"折线图X轴标签数组",dataType:"json",defaultValue:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],required:!1},{id:"title",name:"图表标题",description:"折线图显示标题",dataType:"string",defaultValue:"数据趋势",required:!1}]},DA=Object.freeze(Object.defineProperty({__proto__:null,EChartsGaugeComponent:mg,EChartsLineComponent:yg},Symbol.toStringTag,{value:"Module"}));function vg(e){const t=yt.Markup.getForeignObjectMarkup();return e?[{tagName:e,selector:"body"},t]:[t]}yt.Graph.registerNode("vue-shape",{view:"vue-shape-view",markup:vg(),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}},propHooks(e){if(e.markup==null){const t=e.primer;if(t){e.markup=vg(t);let r={};switch(t){case"circle":r={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":r={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"};break}e.attrs=yt.ObjectExt.merge({},{body:Object.assign({refWidth:null,refHeight:null},r)},e.attrs||{})}}return e}},!0);var FA=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]]);return r};const wg={};function VA(e){const{shape:t,component:r,inherit:o}=e,i=FA(e,["shape","component","inherit"]);if(!t)throw new Error("should specify shape in config");wg[t]={component:r},yt.Graph.registerNode(t,Object.assign({inherit:o||"vue-shape"},i),!0)}n.reactive({});class Qn extends yt.NodeView{getComponentContainer(){return this.selectors&&this.selectors.foContent}confirmUpdate(t){const r=super.confirmUpdate(t);return this.handleAction(r,Qn.action,()=>{this.renderVueComponent()})}targetId(){return`${this.graph.view.cid}:${this.cell.id}`}renderVueComponent(){this.unmountVueComponent();const t=this.getComponentContainer(),r=this.cell,o=this.graph;if(t){const{component:i}=wg[r.shape];i&&(this.vm=n.createApp({render(){return n.h(i,{node:r,graph:o})},provide(){return{getNode:()=>r,getGraph:()=>o}}}),this.vm.mount(t))}}unmountVueComponent(){const t=this.getComponentContainer();return this.vm&&(this.vm.unmount(),this.vm=null),t&&(t.innerHTML=""),t}onMouseDown(t,r,o){const i=t.target;if(i.tagName.toLowerCase()==="input"){const s=i.getAttribute("type");if(s==null||["text","password","number","email","search","tel","url"].includes(s))return}super.onMouseDown(t,r,o)}unmount(){return this.unmountVueComponent(),super.unmount(),this}}Qn.action="vue",Qn.config({bootstrap:[Qn.action],actions:{component:Qn.action}}),yt.NodeView.registry.register("vue-shape-view",Qn,!0);const Zl=[{key:"animationEnabled",label:"启用动画",type:"boolean",path:"data.animation.enabled",defaultValue:!1,description:"是否启用动画效果",bindable:!0},{key:"animationType",label:"动画类型",type:"select",path:"data.animation.type",defaultValue:"none",options:[{label:"无动画",value:"none"},{label:"闪烁",value:"blink"},{label:"缩放",value:"scale"},{label:"旋转",value:"rotate"},{label:"浮动",value:"float"},{label:"脉冲",value:"pulse"},{label:"流动",value:"speed-flow"},{label:"颜色变化",value:"color"}],description:"组件动画效果类型",bindable:!1},{key:"animationDuration",label:"动画时长(ms)",type:"number",path:"data.animation.duration",defaultValue:1e3,min:100,max:5e3,step:100,description:"动画完成一次所需时间",bindable:!1},{key:"animationLoop",label:"循环播放",type:"boolean",path:"data.animation.loop",defaultValue:!0,description:"是否循环播放动画",bindable:!1}];class LA{constructor(){Pe(this,"registry",{});Pe(this,"lazyRegistry",new Map);Pe(this,"loadingPromises",new Map);this.registerDefaultComponents(),this.registerLazyComponents()}registerDefaultComponents(){this.register(mg),this.register(yg)}registerLazyComponents(){Object.entries(Object.assign({})).forEach(([r,o])=>{const i=`__module__${r}`;this.lazyRegistry.set(i,{loader:async()=>{const a=await o();return Object.values(a).forEach(s=>{if(s&&typeof s=="object"&&s.metadata){const l=s,c=l.metadata.id;this.registry[c]||(this.registry[c]=l,this.registerVueShape(l))}}),{default:{}}},loading:!1,loaded:!1})})}registerVueShape(t){if(t.component)try{VA({shape:t.shape,width:t.width,height:t.height,component:t.component,ports:t.ports})}catch{}}register(t){const{id:r}=t.metadata;this.registry[r]&&console.warn(`组件 ${r} 已存在,将被覆盖`),this.registry[r]=t,this.registerVueShape(t)}registerLazy(t,r){this.lazyRegistry.has(t)&&console.warn(`懒加载组件 ${t} 已存在,将被覆盖`),this.lazyRegistry.set(t,{loader:r,loading:!1,loaded:!1})}registerBatch(t){t.forEach(r=>this.register(r))}async getComponent(t){if(this.registry[t])return this.registry[t];const r=this.lazyRegistry.get(t);if(r)return this.loadComponent(t,r)}getComponentSync(t){return this.registry[t]}async loadComponent(t,r){if(r.loaded&&r.config)return r.config;if(r.loading){const i=this.loadingPromises.get(t);if(i)return i}r.loading=!0;const o=(async()=>{try{if(!r.loader)throw new Error(`组件 ${t} 没有 loader`);const a=(await r.loader()).default;return r.config=a,r.loaded=!0,r.loading=!1,this.registry[t]=a,this.registerVueShape(a),this.loadingPromises.delete(t),a}catch(i){throw r.loading=!1,this.loadingPromises.delete(t),console.error(`[懒加载] 组件 ${t} 加载失败:`,i),i}})();return this.loadingPromises.set(t,o),o}async preloadComponent(t){const r=this.lazyRegistry.get(t);if(!r||r.loaded)return!1;try{return await this.loadComponent(t,r),!0}catch{return!1}}async preloadComponents(t){await Promise.all(t.map(r=>this.preloadComponent(r)))}async preloadAllComponents(){const t=Array.from(this.lazyRegistry.keys()),r=t.filter(i=>i.startsWith("__module__")),o=t.filter(i=>!i.startsWith("__module__"));await Promise.all(r.map(async i=>{const a=this.lazyRegistry.get(i);if(a&&!a.loaded)try{await a.loader(),a.loaded=!0}catch(s){console.error(`[预加载] 模块 ${i} 加载失败:`,s)}})),await this.preloadComponents(o)}getComponentByShape(t){return Object.values(this.registry).find(r=>r.shape===t)}getAllComponents(){return{...this.registry}}getAllComponentIds(){const t=Object.keys(this.registry),r=Array.from(this.lazyRegistry.keys());return[...new Set([...t,...r])]}getComponentsByCategory(t){return Object.values(this.registry).filter(r=>r.metadata.category===t)}getComponentList(){return Object.values(this.registry)}hasComponent(t){return t in this.registry}unregister(t){return this.registry[t]?(delete this.registry[t],!0):(console.warn(`组件 ${t} 不存在`),!1)}getCount(){return Object.keys(this.registry).length+this.lazyRegistry.size}getLoadedCount(){return Object.keys(this.registry).length}getLazyLoadStats(){const t=this.lazyRegistry.size,r=Array.from(this.lazyRegistry.values()).filter(a=>a.loaded).length,o=t-r,i=t>0?(r/t*100).toFixed(1):"0.0";return{total:t,loaded:r,pending:o,loadRate:`${i}%`}}clear(){this.registry={}}}const pr=new LA,ec={size:{width:1920,height:1080,preset:"1920*1080"},zoom:{scale:1,min:.1,max:5},offset:{x:0,y:0},background:{color:"#1e293b",size:"origin",repeat:"repeat"},grid:{enabled:!0,size:10,color:"#475569",type:"dot"},snap:{enabled:!0,threshold:10},guides:{enabled:!1,color:"#3b82f6"},magnetism:{enabled:!0,threshold:10}},jA=[{key:"sizePreset",label:"画布尺寸",type:"select",category:"basic",path:"size.preset",defaultValue:"1920*1080",options:[{label:"1920*1080",value:"1920*1080"},{label:"1366*768",value:"1366*768"},{label:"1280*720",value:"1280*720"},{label:"800*600",value:"800*600"}],description:"预设画布尺寸"},{key:"scale",label:"缩放倍数",type:"slider",category:"transform",path:"zoom.scale",defaultValue:1,min:.05,max:10,step:.1,description:"画布缩放比例"},{key:"offsetX",label:"画布X轴偏移",type:"number",category:"transform",path:"offset.x",defaultValue:0,description:"X轴偏移量"},{key:"offsetY",label:"画布Y轴偏移",type:"number",category:"transform",path:"offset.y",defaultValue:0,description:"Y轴偏移量"},{key:"backgroundColor",label:"背景颜色",type:"color",category:"background",path:"background.color",defaultValue:"#1e293b",description:"画布背景颜色"},{key:"backgroundImage",label:"背景图片",type:"image",category:"background",path:"background.image",defaultValue:"",description:"背景图片URL"},{key:"backgroundSize",label:"背景大小",type:"select",category:"background",path:"background.size",defaultValue:"origin",options:[{label:"原始",value:"origin"},{label:"包含",value:"contain"},{label:"覆盖",value:"cover"},{label:"拉伸",value:"stretch"}],description:"背景图片尺寸模式"},{key:"backgroundRepeat",label:"图像重复",type:"select",category:"background",path:"background.repeat",defaultValue:"repeat",options:[{label:"重复",value:"repeat"},{label:"X轴重复",value:"repeat-x"},{label:"Y轴重复",value:"repeat-y"},{label:"不重复",value:"no-repeat"}],description:"背景图片重复模式"},{key:"gridEnabled",label:"网格",type:"boolean",category:"assist",path:"grid.enabled",defaultValue:!0,description:"显示网格"},{key:"gridSize",label:"网格大小",type:"number",category:"assist",path:"grid.size",defaultValue:10,min:5,max:50,description:"网格单元格大小"},{key:"snapEnabled",label:"网格对齐",type:"boolean",category:"assist",path:"snap.enabled",defaultValue:!0,description:"启用网格对齐"},{key:"guidesEnabled",label:"参考线",type:"boolean",category:"assist",path:"guides.enabled",defaultValue:!0,description:"显示参考线"},{key:"magnetismEnabled",label:"吸附",type:"boolean",category:"assist",path:"magnetism.enabled",defaultValue:!0,description:"启用吸附功能"}],bi={"1920*1080":{width:1920,height:1080},"1920*1680":{width:1920,height:1680},"1366*768":{width:1366,height:768},"1280*720":{width:1280,height:720},"800*600":{width:800,height:600}};class UA{constructor(){Pe(this,"config");this.config=n.reactive({...ec})}getConfig(){return this.config}updateConfig(t){Object.assign(this.config,t)}updateByPath(t,r){const o=t.split(".");let i=this.config;for(let a=0;a<o.length-1;a++)i=i[o[a]];if(i[o[o.length-1]]=r,t==="size.preset"&&r in bi){const{width:a,height:s}=bi[r];this.config.size.width=a,this.config.size.height=s}}getByPath(t){const r=t.split(".");let o=this.config;for(const i of r)o=o==null?void 0:o[i];return o}setSize(t,r,o){this.config.size.width=t,this.config.size.height=r,o&&(this.config.size.preset=o)}updateSize(t){this.config.size.width=t.width,this.config.size.height=t.height}setZoom(t){const{min:r=.1,max:o=5}=this.config.zoom;this.config.zoom.scale=Math.max(r,Math.min(o,t))}setOffset(t,r){this.config.offset.x=t,this.config.offset.y=r}setBackgroundColor(t){this.config.background.color=t}updateBackground(t){t.color!==void 0&&(this.config.background.color=t.color),t.image!==void 0&&(this.config.background.image=t.image),t.size!==void 0&&(this.config.background.size=t.size),t.repeat!==void 0&&(this.config.background.repeat=t.repeat)}setBackgroundImage(t){this.config.background.image=t}toggleGrid(t){this.config.grid.enabled=t??!this.config.grid.enabled}setGridSize(t){this.config.grid.size=t}toggleSnap(t){this.config.snap.enabled=t??!this.config.snap.enabled}toggleGuides(t){this.config.guides.enabled=t??!this.config.guides.enabled}toggleMagnetism(t){this.config.magnetism.enabled=t??!this.config.magnetism.enabled}reset(){Object.assign(this.config,ec)}export(){return JSON.stringify(this.config,null,2)}import(t){try{const r=JSON.parse(t);Object.assign(this.config,r)}catch(r){console.error("导入画布配置失败:",r)}}}const tt=new UA,WA={metadata:{id:"rect",name:"矩形",category:"basic",icon:"▢",description:"基础矩形图形组件",version:"1.0.0"},shape:"rect",width:120,height:60,label:"矩形",attrs:{body:{fill:"#3b82f6",stroke:"#2563eb",strokeWidth:2},label:{fill:"#fff",fontSize:14}},ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"name",label:"按钮文本",type:"text",path:"attrs.label.text",defaultValue:"矩形",description:"矩形名称"},{key:"color",label:"填充色",type:"color",path:"attrs.body.fill",defaultValue:"#3b82f6",description:"矩形填充颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#2563eb",description:"矩形边框颜色"},{key:"strokeWidth",label:"边框宽度",type:"number",path:"attrs.body.strokeWidth",defaultValue:2,min:0,max:10,description:"矩形边框宽度"},{key:"opacity",label:"透明度",type:"slider",path:"attrs.body.opacity",defaultValue:1,min:0,max:1,step:.1,description:"矩形透明度"},...Zl]},HA={metadata:{id:"circle",name:"圆形",category:"basic",icon:"○",description:"基础圆形图形组件",version:"1.0.0"},shape:"circle",width:80,height:80,label:"圆形",attrs:{body:{fill:"#10b981",stroke:"#059669",strokeWidth:2},label:{fill:"#fff",fontSize:14}},ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"text",label:"初始文本",type:"text",path:"attrs.label.text",defaultValue:"圆形",description:"圆形初始文本"},{key:"fill",label:"填充色",type:"color",path:"attrs.body.fill",defaultValue:"#10b981",description:"圆形填充颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#059669",description:"圆形边框颜色"},{key:"strokeWidth",label:"边框宽度",type:"number",path:"attrs.body.strokeWidth",defaultValue:2,min:0,max:10,description:"圆形边框宽度"},{key:"opacity",label:"透明度",type:"slider",path:"attrs.body.opacity",defaultValue:1,min:0,max:1,step:.1,description:"圆形透明度"},...Zl]},qA={metadata:{id:"text",name:"文本",category:"basic",icon:"T",description:"文本标签组件",version:"1.0.0"},shape:"rect",width:100,height:40,label:"文本",attrs:{body:{fill:"transparent",stroke:"#64748b",strokeWidth:1,strokeDasharray:"5 5"},label:{fill:"#e2e8f0",fontSize:16}},props:[{key:"label",label:"文本内容",type:"text",path:"attrs.label.text",defaultValue:"文本",description:"显示的文本内容"},{key:"fontSize",label:"字体大小",type:"number",path:"attrs.label.fontSize",defaultValue:16,min:12,max:48,description:"文本字体大小"},{key:"fontColor",label:"字体颜色",type:"color",path:"attrs.label.fill",defaultValue:"#e2e8f0",description:"文本字体颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#64748b",description:"边框颜色"},...Zl]},GA=Object.freeze(Object.defineProperty({__proto__:null,CircleComponent:HA,RectComponent:WA,TextComponent:qA},Symbol.toStringTag,{value:"Module"})),KA={class:"component-library"},YA={class:"component-grid"},XA={class:"component-content"},JA={class:"component-icon"},QA={class:"component-name"},ZA={class:"component-grid"},eP={class:"component-content"},tP={class:"component-icon"},rP={class:"component-name"},nP={class:"component-grid"},oP={class:"component-content"},iP={class:"component-icon"},aP={class:"component-name"},tc=n.defineComponent({__name:"ComponentLibrary",emits:["addComponent"],setup(e,{emit:t}){const r=t,o=n.inject("graph",n.ref(null)),i=n.inject("dnd",n.ref(null)),a=n.ref(["basic","iot","custom"]),s=n.ref(0),l=n.computed(()=>(s.value,pr.getComponentsByCategory("basic"))),c=n.computed(()=>(s.value,pr.getComponentsByCategory("iot"))),d=n.computed(()=>(s.value,pr.getComponentsByCategory("custom"))),u=async(h,g)=>{const p=o.value,m=i.value;if(!m||!p){console.warn("[组件库] DND 或 Graph 实例未初始化");return}try{const v=await pr.getComponent(g.metadata.id);if(!v){console.error(`未找到组件配置: ${g.metadata.id}`);return}const y={x:0,y:0,shape:v.shape,width:v.width,height:v.height,label:v.label,attrs:v.attrs,ports:v.ports,data:{...v.data,componentType:g.metadata.id,props:v.props}},b=p.createNode(y);m.start(b,h)}catch(v){console.error("[组件库] 拖拽初始化失败:",v)}},f=h=>{r("addComponent",h.metadata.id)};return n.onMounted(async()=>{try{await pr.preloadAllComponents(),s.value++}catch(h){console.error("[组件库] 预加载组件失败:",h)}}),(h,g)=>{const p=$l,m=bE,v=pE,y=To;return n.openBlock(),n.createElementBlock("aside",KA,[n.createVNode(y,{class:"library-content"},{default:n.withCtx(()=>[n.createVNode(v,{"expanded-names":a.value,"onUpdate:expandedNames":g[0]||(g[0]=b=>a.value=b),class:"component-collapse"},{default:n.withCtx(()=>[l.value.length>0?(n.openBlock(),n.createBlock(m,{key:0,name:"basic",title:"基础组件",class:"component-collapse-item"},{header:n.withCtx(()=>[...g[1]||(g[1]=[n.createElementVNode("span",{style:{color:"#ffffff !important","font-weight":"700","font-size":"14px"}},"基础组件",-1)])]),default:n.withCtx(()=>[n.createElementVNode("div",YA,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,b=>(n.openBlock(),n.createBlock(p,{key:b.metadata.id,class:"component-item",hoverable:!0,onClick:S=>f(b),onMousedown:S=>u(S,b)},{default:n.withCtx(()=>[n.createElementVNode("div",XA,[n.createElementVNode("span",JA,n.toDisplayString(b.metadata.icon),1),n.createElementVNode("span",QA,n.toDisplayString(b.metadata.name),1)])]),_:2},1032,["onClick","onMousedown"]))),128))])]),_:1})):n.createCommentVNode("",!0),c.value.length>0?(n.openBlock(),n.createBlock(m,{key:1,name:"iot",title:"IoT组件",class:"component-collapse-item"},{header:n.withCtx(()=>[...g[2]||(g[2]=[n.createElementVNode("span",{style:{color:"#ffffff !important","font-weight":"700","font-size":"14px"}},"IoT组件",-1)])]),default:n.withCtx(()=>[n.createElementVNode("div",ZA,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,b=>(n.openBlock(),n.createBlock(p,{key:b.metadata.id,class:"component-item",hoverable:!0,onClick:S=>f(b),onMousedown:S=>u(S,b)},{default:n.withCtx(()=>[n.createElementVNode("div",eP,[n.createElementVNode("span",tP,n.toDisplayString(b.metadata.icon),1),n.createElementVNode("span",rP,n.toDisplayString(b.metadata.name),1)])]),_:2},1032,["onClick","onMousedown"]))),128))])]),_:1})):n.createCommentVNode("",!0),d.value.length>0?(n.openBlock(),n.createBlock(m,{key:2,name:"custom",title:"自定义组件",class:"component-collapse-item"},{header:n.withCtx(()=>[...g[3]||(g[3]=[n.createElementVNode("span",{style:{color:"#ffffff !important","font-weight":"700","font-size":"14px"}},"自定义组件",-1)])]),default:n.withCtx(()=>[n.createElementVNode("div",nP,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,b=>(n.openBlock(),n.createBlock(p,{key:b.metadata.id,class:"component-item",hoverable:!0,onClick:S=>f(b),onMousedown:S=>u(S,b)},{default:n.withCtx(()=>[n.createElementVNode("div",oP,[n.createElementVNode("span",iP,n.toDisplayString(b.metadata.icon),1),n.createElementVNode("span",aP,n.toDisplayString(b.metadata.name),1)])]),_:2},1032,["onClick","onMousedown"]))),128))])]),_:1})):n.createCommentVNode("",!0)]),_:1},8,["expanded-names"])]),_:1})])}}}),sP={class:"canvas-config-panel"},lP={class:"panel-content"},cP={class:"slider-group"},dP={class:"value-display"},uP={class:"image-upload"},rc=gt(n.defineComponent({__name:"CanvasConfigPanel",setup(e){const t=n.computed(()=>tt.getConfig()),r=n.ref(),o=n.ref(t.value.size.width),i=n.ref(t.value.size.height),a=()=>{const f=t.value.size.preset;if(f==="custom")o.value=t.value.size.width,i.value=t.value.size.height;else if(f&&f in bi){const{width:h,height:g}=bi[f];tt.setSize(h,g,f)}},s=()=>{t.value.size.preset==="custom"&&tt.setSize(o.value,i.value,"custom")},l=f=>{tt.setZoom(f)},c=()=>{var f;(f=r.value)==null||f.click()},d=f=>{var p;const g=(p=f.target.files)==null?void 0:p[0];if(g){const m=new FileReader;m.onload=v=>{var b;const y=(b=v.target)==null?void 0:b.result;tt.updateByPath("background.image",y)},m.readAsDataURL(g)}},u=()=>{tt.updateByPath("background.image",""),r.value&&(r.value.value="")};return(f,h)=>{const g=rr,p=Ht,m=Jn,v=sg,y=va,b=Ct,S=Ta,_=Qr;return n.openBlock(),n.createElementBlock("div",sP,[h[15]||(h[15]=n.createElementVNode("div",{class:"panel-header"},[n.createElementVNode("h3",null,"画布配置")],-1)),n.createElementVNode("div",lP,[n.createVNode(_,{size:"small","label-placement":"left","label-width":"60"},{default:n.withCtx(()=>[n.createVNode(p,{label:"画布尺寸"},{default:n.withCtx(()=>[n.createVNode(g,{value:t.value.size.preset,"onUpdate:value":[h[0]||(h[0]=C=>t.value.size.preset=C),a],size:"small",options:[{label:"1920*1080",value:"1920*1080"},{label:"1366*768",value:"1366*768"},{label:"1280*720",value:"1280*720"},{label:"800*600",value:"800*600"},{label:"自定义",value:"custom"}]},null,8,["value"])]),_:1}),t.value.size.preset==="custom"?(n.openBlock(),n.createBlock(p,{key:0,label:"宽度"},{default:n.withCtx(()=>[n.createVNode(m,{value:o.value,"onUpdate:value":[h[1]||(h[1]=C=>o.value=C),s],min:800,max:7680,size:"small","show-button":!1},null,8,["value"])]),_:1})):n.createCommentVNode("",!0),t.value.size.preset==="custom"?(n.openBlock(),n.createBlock(p,{key:1,label:"高度"},{default:n.withCtx(()=>[n.createVNode(m,{value:i.value,"onUpdate:value":[h[2]||(h[2]=C=>i.value=C),s],min:600,max:4320,size:"small","show-button":!1},null,8,["value"])]),_:1})):n.createCommentVNode("",!0),n.createVNode(p,{label:"缩放倍数"},{default:n.withCtx(()=>[n.createElementVNode("div",cP,[n.createVNode(v,{value:t.value.zoom.scale,"onUpdate:value":[h[3]||(h[3]=C=>t.value.zoom.scale=C),l],min:.1,max:5,step:.1},null,8,["value"]),n.createElementVNode("span",dP,n.toDisplayString(t.value.zoom.scale.toFixed(1)),1)])]),_:1}),n.createVNode(p,{label:"X 偏移"},{default:n.withCtx(()=>[n.createVNode(m,{value:t.value.offset.x,"onUpdate:value":h[4]||(h[4]=C=>t.value.offset.x=C),size:"small","show-button":!1},null,8,["value"])]),_:1}),n.createVNode(p,{label:"Y 偏移"},{default:n.withCtx(()=>[n.createVNode(m,{value:t.value.offset.y,"onUpdate:value":h[5]||(h[5]=C=>t.value.offset.y=C),size:"small","show-button":!1},null,8,["value"])]),_:1}),n.createVNode(p,{label:"背景颜色"},{default:n.withCtx(()=>[n.createVNode(y,{value:t.value.background.color,"onUpdate:value":h[6]||(h[6]=C=>t.value.background.color=C)},null,8,["value"])]),_:1}),n.createVNode(p,{label:"背景图片"},{default:n.withCtx(()=>[n.createElementVNode("div",uP,[n.createElementVNode("input",{type:"file",accept:"image/*",onChange:d,ref_key:"fileInput",ref:r,style:{display:"none"}},null,544),n.createVNode(b,{onClick:c,size:"small"},{default:n.withCtx(()=>[...h[13]||(h[13]=[n.createTextVNode("选择图片",-1)])]),_:1}),t.value.background.image?(n.openBlock(),n.createBlock(b,{key:0,onClick:u,size:"small",type:"error"},{default:n.withCtx(()=>[...h[14]||(h[14]=[n.createTextVNode(" 清除 ",-1)])]),_:1})):n.createCommentVNode("",!0)])]),_:1}),n.createVNode(p,{label:"背景大小"},{default:n.withCtx(()=>[n.createVNode(g,{value:t.value.background.size,"onUpdate:value":h[7]||(h[7]=C=>t.value.background.size=C),size:"small",options:[{label:"原始大小",value:"origin"},{label:"包含",value:"contain"},{label:"覆盖",value:"cover"},{label:"拉伸",value:"stretch"}]},null,8,["value"])]),_:1}),n.createVNode(p,{label:"背景重复"},{default:n.withCtx(()=>[n.createVNode(g,{value:t.value.background.repeat,"onUpdate:value":h[8]||(h[8]=C=>t.value.background.repeat=C),size:"small",options:[{label:"重复",value:"repeat"},{label:"X轴重复",value:"repeat-x"},{label:"Y轴重复",value:"repeat-y"},{label:"不重复",value:"no-repeat"}]},null,8,["value"])]),_:1}),n.createVNode(p,{label:"吸附功能"},{default:n.withCtx(()=>[n.createVNode(S,{value:t.value.magnetism.enabled,"onUpdate:value":h[9]||(h[9]=C=>t.value.magnetism.enabled=C)},null,8,["value"])]),_:1}),n.createVNode(p,{label:"网格显示"},{default:n.withCtx(()=>[n.createVNode(S,{value:t.value.grid.enabled,"onUpdate:value":h[10]||(h[10]=C=>t.value.grid.enabled=C)},null,8,["value"])]),_:1}),t.value.grid.enabled?(n.openBlock(),n.createBlock(p,{key:2,label:"网格大小"},{default:n.withCtx(()=>[n.createVNode(m,{value:t.value.grid.size,"onUpdate:value":h[11]||(h[11]=C=>t.value.grid.size=C),min:5,max:50,size:"small","show-button":!1},null,8,["value"])]),_:1})):n.createCommentVNode("",!0),n.createVNode(p,{label:"对齐线"},{default:n.withCtx(()=>[n.createVNode(S,{value:t.value.snap.enabled,"onUpdate:value":h[12]||(h[12]=C=>t.value.snap.enabled=C)},null,8,["value"])]),_:1})]),_:1})])])}}}),[["__scopeId","data-v-f99cb19d"]]),fP={class:"basic-properties-tab"},hP={class:"property-section",style:{display:"none"}},pP={class:"property-section"},gP={key:0,class:"property-section"},nc=gt(n.defineComponent({__name:"BasicPropertiesTab",props:{selectedNode:{},nodePosition:{},nodeSize:{},nodeAttrs:{}},emits:["update-position","update-size","update-label","update-fill","update-stroke","update-stroke-width","update-opacity","update-component-name","update-dynamic-prop"],setup(e,{emit:t}){const r=e,o=t,i=n.computed(()=>{var d,u;return(u=(d=r.selectedNode)==null?void 0:d.data)!=null&&u.props?r.selectedNode.data.props:[]}),a=n.ref(0),s=d=>{if(a.value,!d.path)return d.defaultValue;const u=d.path.split(".");let f=r.selectedNode;for(const h of u)if(f&&typeof f=="object")f=f[h];else return d.defaultValue;if(f&&typeof f=="object"){if(f.target&&f.target.value!==void 0)return f.target.value;if(f.target&&f.target.checked!==void 0)return f.target.checked}return f!==void 0?f:d.defaultValue},l=d=>!d||d==="transparent"?"#000000":typeof d=="string"&&d.startsWith("#")?d:"#000000",c=(d,u)=>{o("update-dynamic-prop",d.path,u),a.value++};return(d,u)=>{const f=Ut,h=Ht,g=Qr,p=Jn,m=TT,v=IT,y=Wt,b=Np,S=va,_=Ta,C=rr;return n.openBlock(),n.createElementBlock("div",fP,[n.createElementVNode("div",hP,[u[5]||(u[5]=n.createElementVNode("h4",null,"基础信息",-1)),n.createVNode(g,{"label-width":"90",size:"small"},{default:n.withCtx(()=>[n.createVNode(h,{label:"组件名称"},{default:n.withCtx(()=>{var A;return[n.createVNode(f,{value:((A=e.selectedNode.getData())==null?void 0:A.componentName)||"","onUpdate:value":u[0]||(u[0]=k=>d.$emit("update-component-name",k)),placeholder:"请输入组件名称"},null,8,["value"])]}),_:1}),n.createVNode(h,{label:"ID"},{default:n.withCtx(()=>[n.createVNode(f,{value:e.selectedNode.id,disabled:""},null,8,["value"])]),_:1}),n.createVNode(h,{label:"类型"},{default:n.withCtx(()=>[n.createVNode(f,{value:e.selectedNode.shape,disabled:""},null,8,["value"])]),_:1})]),_:1})]),n.createElementVNode("div",pP,[u[6]||(u[6]=n.createElementVNode("h4",null,"位置和尺寸",-1)),n.createVNode(g,{"label-width":"60",size:"small"},{default:n.withCtx(()=>[n.createVNode(v,{"x-gap":12,cols:24},{default:n.withCtx(()=>[n.createVNode(m,{span:12},{default:n.withCtx(()=>[n.createVNode(h,{label:"X"},{default:n.withCtx(()=>[n.createVNode(p,{value:e.nodePosition.x,"onUpdate:value":u[1]||(u[1]=A=>d.$emit("update-position","x",A)),"show-button":!1,style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1}),n.createVNode(m,{span:12},{default:n.withCtx(()=>[n.createVNode(h,{label:"Y"},{default:n.withCtx(()=>[n.createVNode(p,{value:e.nodePosition.y,"onUpdate:value":u[2]||(u[2]=A=>d.$emit("update-position","y",A)),"show-button":!1,style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1})]),_:1}),n.createVNode(v,{"x-gap":12,cols:24},{default:n.withCtx(()=>[n.createVNode(m,{span:12},{default:n.withCtx(()=>[n.createVNode(h,{label:"宽度"},{default:n.withCtx(()=>[n.createVNode(p,{value:e.nodeSize.width,"onUpdate:value":u[3]||(u[3]=A=>d.$emit("update-size","width",A)),"show-button":!1,style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1}),n.createVNode(m,{span:12},{default:n.withCtx(()=>[n.createVNode(h,{label:"高度"},{default:n.withCtx(()=>[n.createVNode(p,{value:e.nodeSize.height,"onUpdate:value":u[4]||(u[4]=A=>d.$emit("update-size","height",A)),"show-button":!1,style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1})]),i.value.length>0?(n.openBlock(),n.createElementBlock("div",gP,[u[7]||(u[7]=n.createElementVNode("h4",null,"组件属性",-1)),n.createVNode(g,{"label-placement":"left","label-width":"100",size:"small",class:"dynamic-props-form"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,A=>(n.openBlock(),n.createBlock(h,{key:A.key,label:A.label},{label:n.withCtx(()=>[n.createElementVNode("span",null,n.toDisplayString(A.label),1),A.description?(n.openBlock(),n.createBlock(b,{key:0,placement:"top"},{trigger:n.withCtx(()=>[n.createVNode(y,{style:{"margin-left":"4px",cursor:"help"}},{default:n.withCtx(()=>[n.createVNode(n.unref(hg))]),_:1})]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(A.description),1)]),_:2},1024)):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[A.type==="text"?(n.openBlock(),n.createBlock(f,{key:0,value:s(A),"onUpdate:value":k=>c(A,k),placeholder:A.defaultValue},null,8,["value","onUpdate:value","placeholder"])):A.type==="number"?(n.openBlock(),n.createBlock(p,{key:1,value:s(A),"onUpdate:value":k=>c(A,k),min:A.min,max:A.max,step:A.step,"show-button":!1,style:{width:"100%"}},null,8,["value","onUpdate:value","min","max","step"])):A.type==="color"?(n.openBlock(),n.createBlock(S,{key:2,value:l(s(A)),"onUpdate:value":k=>c(A,k),"show-alpha":!0,modes:["hex"]},null,8,["value","onUpdate:value"])):A.type==="boolean"?(n.openBlock(),n.createBlock(_,{key:3,value:s(A),"onUpdate:value":k=>c(A,k)},null,8,["value","onUpdate:value"])):A.type==="select"?(n.openBlock(),n.createBlock(C,{key:4,value:s(A),"onUpdate:value":k=>c(A,k),options:A.options,placeholder:"请选择",style:{width:"100%"}},null,8,["value","onUpdate:value","options"])):n.createCommentVNode("",!0)]),_:2},1032,["label"]))),128))]),_:1})])):n.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-042b02b0"]]);var oc=Object.defineProperty,mP=Object.getOwnPropertyDescriptor,bP=Object.getOwnPropertyNames,yP=Object.prototype.hasOwnProperty,cr=(e,t)=>()=>(e&&(t=e(e=0)),t),Oe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Po=(e,t)=>{for(var r in t)oc(e,r,{get:t[r],enumerable:!0})},vP=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of bP(t))!yP.call(e,i)&&i!==r&&oc(e,i,{get:()=>t[i],enumerable:!(o=mP(t,i))||o.enumerable});return e},mt=e=>vP(oc({},"__esModule",{value:!0}),e),Ie=cr(()=>{}),ft={};Po(ft,{_debugEnd:()=>Fc,_debugProcess:()=>Dc,_events:()=>td,_eventsCount:()=>rd,_exiting:()=>_c,_fatalExceptions:()=>Bc,_getActiveHandles:()=>Tg,_getActiveRequests:()=>Eg,_kill:()=>Tc,_linkedBinding:()=>_g,_maxListeners:()=>ed,_preload_modules:()=>Jc,_rawDebug:()=>xc,_startProfilerIdleNotifier:()=>Vc,_stopProfilerIdleNotifier:()=>Lc,_tickCallback:()=>zc,abort:()=>Hc,addListener:()=>nd,allowedNodeEnvironmentFlags:()=>$c,arch:()=>sc,argv:()=>dc,argv0:()=>Xc,assert:()=>Ag,binding:()=>gc,browser:()=>wc,chdir:()=>yc,config:()=>kc,cpuUsage:()=>vi,cwd:()=>bc,debugPort:()=>Yc,default:()=>ud,dlopen:()=>kg,domain:()=>Sc,emit:()=>ld,emitWarning:()=>pc,env:()=>cc,execArgv:()=>uc,execPath:()=>Kc,exit:()=>Rc,features:()=>Oc,hasUncaughtExceptionCaptureCallback:()=>Pg,hrtime:()=>Aa,kill:()=>Ic,listeners:()=>Rg,memoryUsage:()=>Pc,moduleLoadList:()=>Cc,nextTick:()=>Cg,off:()=>id,on:()=>Zr,once:()=>od,openStdin:()=>Nc,pid:()=>qc,platform:()=>lc,ppid:()=>Gc,prependListener:()=>cd,prependOnceListener:()=>dd,reallyExit:()=>Ec,release:()=>vc,removeAllListeners:()=>sd,removeListener:()=>ad,resourceUsage:()=>Ac,setSourceMapsEnabled:()=>Qc,setUncaughtExceptionCaptureCallback:()=>Mc,stderr:()=>Uc,stdin:()=>Wc,stdout:()=>jc,title:()=>ac,umask:()=>mc,uptime:()=>Ig,version:()=>fc,versions:()=>hc});function ic(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function wP(){!Zn||!eo||(Zn=!1,eo.length?Mr=eo.concat(Mr):yi=-1,Mr.length&&xg())}function xg(){if(!Zn){var e=setTimeout(wP,0);Zn=!0;for(var t=Mr.length;t;){for(eo=Mr,Mr=[];++yi<t;)eo&&eo[yi].run();yi=-1,t=Mr.length}eo=null,Zn=!1,clearTimeout(e)}}function Cg(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Mr.push(new Sg(e,t)),Mr.length===1&&!Zn&&setTimeout(xg,0)}function Sg(e,t){this.fun=e,this.array=t}function Gt(){}function _g(e){ic("_linkedBinding")}function kg(e){ic("dlopen")}function Eg(){return[]}function Tg(){return[]}function Ag(e,t){if(!e)throw new Error(t||"assertion error")}function Pg(){return!1}function Ig(){return en.now()/1e3}function Aa(e){var t=Math.floor((Date.now()-en.now())*.001),r=en.now()*.001,o=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(o=o-e[0],i=i-e[1],i<0&&(o--,i+=Pa)),[o,i]}function Zr(){return ud}function Rg(e){return[]}var Mr,Zn,eo,yi,ac,sc,lc,cc,dc,uc,fc,hc,pc,gc,mc,bc,yc,vc,wc,xc,Cc,Sc,_c,kc,Ec,Tc,vi,Ac,Pc,Ic,Rc,Nc,$c,Oc,Bc,Mc,zc,Dc,Fc,Vc,Lc,jc,Uc,Wc,Hc,qc,Gc,Kc,Yc,Xc,Jc,Qc,en,Zc,Pa,ed,td,rd,nd,od,id,ad,sd,ld,cd,dd,ud,xP=cr(()=>{Ie(),Ne(),Re(),Mr=[],Zn=!1,yi=-1,Sg.prototype.run=function(){this.fun.apply(null,this.array)},ac="browser",sc="x64",lc="browser",cc={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},dc=["/usr/bin/node"],uc=[],fc="v16.8.0",hc={},pc=function(e,t){console.warn((t?t+": ":"")+e)},gc=function(e){ic("binding")},mc=function(e){return 0},bc=function(){return"/"},yc=function(e){},vc={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},wc=!0,xc=Gt,Cc=[],Sc={},_c=!1,kc={},Ec=Gt,Tc=Gt,vi=function(){return{}},Ac=vi,Pc=vi,Ic=Gt,Rc=Gt,Nc=Gt,$c={},Oc={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Bc=Gt,Mc=Gt,zc=Gt,Dc=Gt,Fc=Gt,Vc=Gt,Lc=Gt,jc=void 0,Uc=void 0,Wc=void 0,Hc=Gt,qc=2,Gc=1,Kc="/bin/usr/node",Yc=9229,Xc="node",Jc=[],Qc=Gt,en={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},en.now===void 0&&(Zc=Date.now(),en.timing&&en.timing.navigationStart&&(Zc=en.timing.navigationStart),en.now=()=>Date.now()-Zc),Pa=1e9,Aa.bigint=function(e){var t=Aa(e);return typeof BigInt>"u"?t[0]*Pa+t[1]:BigInt(t[0]*Pa)+BigInt(t[1])},ed=10,td={},rd=0,nd=Zr,od=Zr,id=Zr,ad=Zr,sd=Zr,ld=Gt,cd=Zr,dd=Zr,ud={version:fc,versions:hc,arch:sc,platform:lc,browser:wc,release:vc,_rawDebug:xc,moduleLoadList:Cc,binding:gc,_linkedBinding:_g,_events:td,_eventsCount:rd,_maxListeners:ed,on:Zr,addListener:nd,once:od,off:id,removeListener:ad,removeAllListeners:sd,emit:ld,prependListener:cd,prependOnceListener:dd,listeners:Rg,domain:Sc,_exiting:_c,config:kc,dlopen:kg,uptime:Ig,_getActiveRequests:Eg,_getActiveHandles:Tg,reallyExit:Ec,_kill:Tc,cpuUsage:vi,resourceUsage:Ac,memoryUsage:Pc,kill:Ic,exit:Rc,openStdin:Nc,allowedNodeEnvironmentFlags:$c,assert:Ag,features:Oc,_fatalExceptions:Bc,setUncaughtExceptionCaptureCallback:Mc,hasUncaughtExceptionCaptureCallback:Pg,emitWarning:pc,nextTick:Cg,_tickCallback:zc,_debugProcess:Dc,_debugEnd:Fc,_startProfilerIdleNotifier:Vc,_stopProfilerIdleNotifier:Lc,stdout:jc,stdin:Wc,stderr:Uc,abort:Hc,umask:mc,chdir:yc,cwd:bc,env:cc,title:ac,argv:dc,execArgv:uc,pid:qc,ppid:Gc,execPath:Kc,debugPort:Yc,hrtime:Aa,argv0:Xc,_preload_modules:Jc,setSourceMapsEnabled:Qc}}),Re=cr(()=>{xP()});function CP(){if(fd)return Io;fd=!0,Io.byteLength=l,Io.toByteArray=d,Io.fromByteArray=h;for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,a=o.length;i<a;++i)e[i]=o[i],t[o.charCodeAt(i)]=i;t[45]=62,t[95]=63;function s(g){var p=g.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var m=g.indexOf("=");m===-1&&(m=p);var v=m===p?0:4-m%4;return[m,v]}function l(g){var p=s(g),m=p[0],v=p[1];return(m+v)*3/4-v}function c(g,p,m){return(p+m)*3/4-m}function d(g){var p,m=s(g),v=m[0],y=m[1],b=new r(c(g,v,y)),S=0,_=y>0?v-4:v,C;for(C=0;C<_;C+=4)p=t[g.charCodeAt(C)]<<18|t[g.charCodeAt(C+1)]<<12|t[g.charCodeAt(C+2)]<<6|t[g.charCodeAt(C+3)],b[S++]=p>>16&255,b[S++]=p>>8&255,b[S++]=p&255;return y===2&&(p=t[g.charCodeAt(C)]<<2|t[g.charCodeAt(C+1)]>>4,b[S++]=p&255),y===1&&(p=t[g.charCodeAt(C)]<<10|t[g.charCodeAt(C+1)]<<4|t[g.charCodeAt(C+2)]>>2,b[S++]=p>>8&255,b[S++]=p&255),b}function u(g){return e[g>>18&63]+e[g>>12&63]+e[g>>6&63]+e[g&63]}function f(g,p,m){for(var v,y=[],b=p;b<m;b+=3)v=(g[b]<<16&16711680)+(g[b+1]<<8&65280)+(g[b+2]&255),y.push(u(v));return y.join("")}function h(g){for(var p,m=g.length,v=m%3,y=[],b=16383,S=0,_=m-v;S<_;S+=b)y.push(f(g,S,S+b>_?_:S+b));return v===1?(p=g[m-1],y.push(e[p>>2]+e[p<<4&63]+"==")):v===2&&(p=(g[m-2]<<8)+g[m-1],y.push(e[p>>10]+e[p>>4&63]+e[p<<2&63]+"=")),y.join("")}return Io}function SP(){return hd?wi:(hd=!0,wi.read=function(e,t,r,o,i){var a,s,l=i*8-o-1,c=(1<<l)-1,d=c>>1,u=-7,f=r?i-1:0,h=r?-1:1,g=e[t+f];for(f+=h,a=g&(1<<-u)-1,g>>=-u,u+=l;u>0;a=a*256+e[t+f],f+=h,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=o;u>0;s=s*256+e[t+f],f+=h,u-=8);if(a===0)a=1-d;else{if(a===c)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,o),a=a-d}return(g?-1:1)*s*Math.pow(2,a-o)},wi.write=function(e,t,r,o,i,a){var s,l,c,d=a*8-i-1,u=(1<<d)-1,f=u>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=o?0:a-1,p=o?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+f>=1?t+=h/c:t+=h*Math.pow(2,1-f),t*c>=2&&(s++,c/=2),s+f>=u?(l=0,s=u):s+f>=1?(l=(t*c-1)*Math.pow(2,i),s=s+f):(l=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+g]=l&255,g+=p,l/=256,i-=8);for(s=s<<i|l,d+=i;d>0;e[r+g]=s&255,g+=p,s/=256,d-=8);e[r+g-p]|=m*128},wi)}function _P(){if(pd)return Cn;pd=!0;let e=CP(),t=SP(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Cn.Buffer=s,Cn.SlowBuffer=y,Cn.INSPECT_MAX_BYTES=50;let o=2147483647;Cn.kMaxLength=o,s.TYPED_ARRAY_SUPPORT=i(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{let w=new Uint8Array(1),x={foo:function(){return 42}};return Object.setPrototypeOf(x,Uint8Array.prototype),Object.setPrototypeOf(w,x),w.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function a(w){if(w>o)throw new RangeError('The value "'+w+'" is invalid for option "size"');let x=new Uint8Array(w);return Object.setPrototypeOf(x,s.prototype),x}function s(w,x,E){if(typeof w=="number"){if(typeof x=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(w)}return l(w,x,E)}s.poolSize=8192;function l(w,x,E){if(typeof w=="string")return f(w,x);if(ArrayBuffer.isView(w))return g(w);if(w==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w);if(V(w,ArrayBuffer)||w&&V(w.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(V(w,SharedArrayBuffer)||w&&V(w.buffer,SharedArrayBuffer)))return p(w,x,E);if(typeof w=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let M=w.valueOf&&w.valueOf();if(M!=null&&M!==w)return s.from(M,x,E);let W=m(w);if(W)return W;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof w[Symbol.toPrimitive]=="function")return s.from(w[Symbol.toPrimitive]("string"),x,E);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w)}s.from=function(w,x,E){return l(w,x,E)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(w){if(typeof w!="number")throw new TypeError('"size" argument must be of type number');if(w<0)throw new RangeError('The value "'+w+'" is invalid for option "size"')}function d(w,x,E){return c(w),w<=0?a(w):x!==void 0?typeof E=="string"?a(w).fill(x,E):a(w).fill(x):a(w)}s.alloc=function(w,x,E){return d(w,x,E)};function u(w){return c(w),a(w<0?0:v(w)|0)}s.allocUnsafe=function(w){return u(w)},s.allocUnsafeSlow=function(w){return u(w)};function f(w,x){if((typeof x!="string"||x==="")&&(x="utf8"),!s.isEncoding(x))throw new TypeError("Unknown encoding: "+x);let E=b(w,x)|0,M=a(E),W=M.write(w,x);return W!==E&&(M=M.slice(0,W)),M}function h(w){let x=w.length<0?0:v(w.length)|0,E=a(x);for(let M=0;M<x;M+=1)E[M]=w[M]&255;return E}function g(w){if(V(w,Uint8Array)){let x=new Uint8Array(w);return p(x.buffer,x.byteOffset,x.byteLength)}return h(w)}function p(w,x,E){if(x<0||w.byteLength<x)throw new RangeError('"offset" is outside of buffer bounds');if(w.byteLength<x+(E||0))throw new RangeError('"length" is outside of buffer bounds');let M;return x===void 0&&E===void 0?M=new Uint8Array(w):E===void 0?M=new Uint8Array(w,x):M=new Uint8Array(w,x,E),Object.setPrototypeOf(M,s.prototype),M}function m(w){if(s.isBuffer(w)){let x=v(w.length)|0,E=a(x);return E.length===0||w.copy(E,0,0,x),E}if(w.length!==void 0)return typeof w.length!="number"||me(w.length)?a(0):h(w);if(w.type==="Buffer"&&Array.isArray(w.data))return h(w.data)}function v(w){if(w>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return w|0}function y(w){return+w!=w&&(w=0),s.alloc(+w)}s.isBuffer=function(w){return w!=null&&w._isBuffer===!0&&w!==s.prototype},s.compare=function(w,x){if(V(w,Uint8Array)&&(w=s.from(w,w.offset,w.byteLength)),V(x,Uint8Array)&&(x=s.from(x,x.offset,x.byteLength)),!s.isBuffer(w)||!s.isBuffer(x))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(w===x)return 0;let E=w.length,M=x.length;for(let W=0,Q=Math.min(E,M);W<Q;++W)if(w[W]!==x[W]){E=w[W],M=x[W];break}return E<M?-1:M<E?1:0},s.isEncoding=function(w){switch(String(w).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(w,x){if(!Array.isArray(w))throw new TypeError('"list" argument must be an Array of Buffers');if(w.length===0)return s.alloc(0);let E;if(x===void 0)for(x=0,E=0;E<w.length;++E)x+=w[E].length;let M=s.allocUnsafe(x),W=0;for(E=0;E<w.length;++E){let Q=w[E];if(V(Q,Uint8Array))W+Q.length>M.length?(s.isBuffer(Q)||(Q=s.from(Q)),Q.copy(M,W)):Uint8Array.prototype.set.call(M,Q,W);else if(s.isBuffer(Q))Q.copy(M,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=Q.length}return M};function b(w,x){if(s.isBuffer(w))return w.length;if(ArrayBuffer.isView(w)||V(w,ArrayBuffer))return w.byteLength;if(typeof w!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof w);let E=w.length,M=arguments.length>2&&arguments[2]===!0;if(!M&&E===0)return 0;let W=!1;for(;;)switch(x){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return fe(w).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return ye(w).length;default:if(W)return M?-1:fe(w).length;x=(""+x).toLowerCase(),W=!0}}s.byteLength=b;function S(w,x,E){let M=!1;if((x===void 0||x<0)&&(x=0),x>this.length||((E===void 0||E>this.length)&&(E=this.length),E<=0)||(E>>>=0,x>>>=0,E<=x))return"";for(w||(w="utf8");;)switch(w){case"hex":return L(this,x,E);case"utf8":case"utf-8":return O(this,x,E);case"ascii":return q(this,x,E);case"latin1":case"binary":return z(this,x,E);case"base64":return P(this,x,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,x,E);default:if(M)throw new TypeError("Unknown encoding: "+w);w=(w+"").toLowerCase(),M=!0}}s.prototype._isBuffer=!0;function _(w,x,E){let M=w[x];w[x]=w[E],w[E]=M}s.prototype.swap16=function(){let w=this.length;if(w%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let x=0;x<w;x+=2)_(this,x,x+1);return this},s.prototype.swap32=function(){let w=this.length;if(w%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let x=0;x<w;x+=4)_(this,x,x+3),_(this,x+1,x+2);return this},s.prototype.swap64=function(){let w=this.length;if(w%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let x=0;x<w;x+=8)_(this,x,x+7),_(this,x+1,x+6),_(this,x+2,x+5),_(this,x+3,x+4);return this},s.prototype.toString=function(){let w=this.length;return w===0?"":arguments.length===0?O(this,0,w):S.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(w){if(!s.isBuffer(w))throw new TypeError("Argument must be a Buffer");return this===w?!0:s.compare(this,w)===0},s.prototype.inspect=function(){let w="",x=Cn.INSPECT_MAX_BYTES;return w=this.toString("hex",0,x).replace(/(.{2})/g,"$1 ").trim(),this.length>x&&(w+=" ... "),"<Buffer "+w+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(w,x,E,M,W){if(V(w,Uint8Array)&&(w=s.from(w,w.offset,w.byteLength)),!s.isBuffer(w))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof w);if(x===void 0&&(x=0),E===void 0&&(E=w?w.length:0),M===void 0&&(M=0),W===void 0&&(W=this.length),x<0||E>w.length||M<0||W>this.length)throw new RangeError("out of range index");if(M>=W&&x>=E)return 0;if(M>=W)return-1;if(x>=E)return 1;if(x>>>=0,E>>>=0,M>>>=0,W>>>=0,this===w)return 0;let Q=W-M,we=E-x,ae=Math.min(Q,we),ge=this.slice(M,W),Be=w.slice(x,E);for(let H=0;H<ae;++H)if(ge[H]!==Be[H]){Q=ge[H],we=Be[H];break}return Q<we?-1:we<Q?1:0};function C(w,x,E,M,W){if(w.length===0)return-1;if(typeof E=="string"?(M=E,E=0):E>2147483647?E=2147483647:E<-2147483648&&(E=-2147483648),E=+E,me(E)&&(E=W?0:w.length-1),E<0&&(E=w.length+E),E>=w.length){if(W)return-1;E=w.length-1}else if(E<0)if(W)E=0;else return-1;if(typeof x=="string"&&(x=s.from(x,M)),s.isBuffer(x))return x.length===0?-1:A(w,x,E,M,W);if(typeof x=="number")return x=x&255,typeof Uint8Array.prototype.indexOf=="function"?W?Uint8Array.prototype.indexOf.call(w,x,E):Uint8Array.prototype.lastIndexOf.call(w,x,E):A(w,[x],E,M,W);throw new TypeError("val must be string, number or Buffer")}function A(w,x,E,M,W){let Q=1,we=w.length,ae=x.length;if(M!==void 0&&(M=String(M).toLowerCase(),M==="ucs2"||M==="ucs-2"||M==="utf16le"||M==="utf-16le")){if(w.length<2||x.length<2)return-1;Q=2,we/=2,ae/=2,E/=2}function ge(H,ve){return Q===1?H[ve]:H.readUInt16BE(ve*Q)}let Be;if(W){let H=-1;for(Be=E;Be<we;Be++)if(ge(w,Be)===ge(x,H===-1?0:Be-H)){if(H===-1&&(H=Be),Be-H+1===ae)return H*Q}else H!==-1&&(Be-=Be-H),H=-1}else for(E+ae>we&&(E=we-ae),Be=E;Be>=0;Be--){let H=!0;for(let ve=0;ve<ae;ve++)if(ge(w,Be+ve)!==ge(x,ve)){H=!1;break}if(H)return Be}return-1}s.prototype.includes=function(w,x,E){return this.indexOf(w,x,E)!==-1},s.prototype.indexOf=function(w,x,E){return C(this,w,x,E,!0)},s.prototype.lastIndexOf=function(w,x,E){return C(this,w,x,E,!1)};function k(w,x,E,M){E=Number(E)||0;let W=w.length-E;M?(M=Number(M),M>W&&(M=W)):M=W;let Q=x.length;M>Q/2&&(M=Q/2);let we;for(we=0;we<M;++we){let ae=parseInt(x.substr(we*2,2),16);if(me(ae))return we;w[E+we]=ae}return we}function T(w,x,E,M){return J(fe(x,w.length-E),w,E,M)}function I(w,x,E,M){return J(ie(x),w,E,M)}function R(w,x,E,M){return J(ye(x),w,E,M)}function B(w,x,E,M){return J(re(x,w.length-E),w,E,M)}s.prototype.write=function(w,x,E,M){if(x===void 0)M="utf8",E=this.length,x=0;else if(E===void 0&&typeof x=="string")M=x,E=this.length,x=0;else if(isFinite(x))x=x>>>0,isFinite(E)?(E=E>>>0,M===void 0&&(M="utf8")):(M=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let W=this.length-x;if((E===void 0||E>W)&&(E=W),w.length>0&&(E<0||x<0)||x>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");let Q=!1;for(;;)switch(M){case"hex":return k(this,w,x,E);case"utf8":case"utf-8":return T(this,w,x,E);case"ascii":case"latin1":case"binary":return I(this,w,x,E);case"base64":return R(this,w,x,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,w,x,E);default:if(Q)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),Q=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function P(w,x,E){return x===0&&E===w.length?e.fromByteArray(w):e.fromByteArray(w.slice(x,E))}function O(w,x,E){E=Math.min(w.length,E);let M=[],W=x;for(;W<E;){let Q=w[W],we=null,ae=Q>239?4:Q>223?3:Q>191?2:1;if(W+ae<=E){let ge,Be,H,ve;switch(ae){case 1:Q<128&&(we=Q);break;case 2:ge=w[W+1],(ge&192)===128&&(ve=(Q&31)<<6|ge&63,ve>127&&(we=ve));break;case 3:ge=w[W+1],Be=w[W+2],(ge&192)===128&&(Be&192)===128&&(ve=(Q&15)<<12|(ge&63)<<6|Be&63,ve>2047&&(ve<55296||ve>57343)&&(we=ve));break;case 4:ge=w[W+1],Be=w[W+2],H=w[W+3],(ge&192)===128&&(Be&192)===128&&(H&192)===128&&(ve=(Q&15)<<18|(ge&63)<<12|(Be&63)<<6|H&63,ve>65535&&ve<1114112&&(we=ve))}}we===null?(we=65533,ae=1):we>65535&&(we-=65536,M.push(we>>>10&1023|55296),we=56320|we&1023),M.push(we),W+=ae}return $(M)}let N=4096;function $(w){let x=w.length;if(x<=N)return String.fromCharCode.apply(String,w);let E="",M=0;for(;M<x;)E+=String.fromCharCode.apply(String,w.slice(M,M+=N));return E}function q(w,x,E){let M="";E=Math.min(w.length,E);for(let W=x;W<E;++W)M+=String.fromCharCode(w[W]&127);return M}function z(w,x,E){let M="";E=Math.min(w.length,E);for(let W=x;W<E;++W)M+=String.fromCharCode(w[W]);return M}function L(w,x,E){let M=w.length;(!x||x<0)&&(x=0),(!E||E<0||E>M)&&(E=M);let W="";for(let Q=x;Q<E;++Q)W+=ee[w[Q]];return W}function te(w,x,E){let M=w.slice(x,E),W="";for(let Q=0;Q<M.length-1;Q+=2)W+=String.fromCharCode(M[Q]+M[Q+1]*256);return W}s.prototype.slice=function(w,x){let E=this.length;w=~~w,x=x===void 0?E:~~x,w<0?(w+=E,w<0&&(w=0)):w>E&&(w=E),x<0?(x+=E,x<0&&(x=0)):x>E&&(x=E),x<w&&(x=w);let M=this.subarray(w,x);return Object.setPrototypeOf(M,s.prototype),M};function j(w,x,E){if(w%1!==0||w<0)throw new RangeError("offset is not uint");if(w+x>E)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(w,x,E){w=w>>>0,x=x>>>0,E||j(w,x,this.length);let M=this[w],W=1,Q=0;for(;++Q<x&&(W*=256);)M+=this[w+Q]*W;return M},s.prototype.readUintBE=s.prototype.readUIntBE=function(w,x,E){w=w>>>0,x=x>>>0,E||j(w,x,this.length);let M=this[w+--x],W=1;for(;x>0&&(W*=256);)M+=this[w+--x]*W;return M},s.prototype.readUint8=s.prototype.readUInt8=function(w,x){return w=w>>>0,x||j(w,1,this.length),this[w]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(w,x){return w=w>>>0,x||j(w,2,this.length),this[w]|this[w+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(w,x){return w=w>>>0,x||j(w,2,this.length),this[w]<<8|this[w+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(w,x){return w=w>>>0,x||j(w,4,this.length),(this[w]|this[w+1]<<8|this[w+2]<<16)+this[w+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(w,x){return w=w>>>0,x||j(w,4,this.length),this[w]*16777216+(this[w+1]<<16|this[w+2]<<8|this[w+3])},s.prototype.readBigUInt64LE=F(function(w){w=w>>>0,he(w,"offset");let x=this[w],E=this[w+7];(x===void 0||E===void 0)&&Te(w,this.length-8);let M=x+this[++w]*2**8+this[++w]*2**16+this[++w]*2**24,W=this[++w]+this[++w]*2**8+this[++w]*2**16+E*2**24;return BigInt(M)+(BigInt(W)<<BigInt(32))}),s.prototype.readBigUInt64BE=F(function(w){w=w>>>0,he(w,"offset");let x=this[w],E=this[w+7];(x===void 0||E===void 0)&&Te(w,this.length-8);let M=x*2**24+this[++w]*2**16+this[++w]*2**8+this[++w],W=this[++w]*2**24+this[++w]*2**16+this[++w]*2**8+E;return(BigInt(M)<<BigInt(32))+BigInt(W)}),s.prototype.readIntLE=function(w,x,E){w=w>>>0,x=x>>>0,E||j(w,x,this.length);let M=this[w],W=1,Q=0;for(;++Q<x&&(W*=256);)M+=this[w+Q]*W;return W*=128,M>=W&&(M-=Math.pow(2,8*x)),M},s.prototype.readIntBE=function(w,x,E){w=w>>>0,x=x>>>0,E||j(w,x,this.length);let M=x,W=1,Q=this[w+--M];for(;M>0&&(W*=256);)Q+=this[w+--M]*W;return W*=128,Q>=W&&(Q-=Math.pow(2,8*x)),Q},s.prototype.readInt8=function(w,x){return w=w>>>0,x||j(w,1,this.length),this[w]&128?(255-this[w]+1)*-1:this[w]},s.prototype.readInt16LE=function(w,x){w=w>>>0,x||j(w,2,this.length);let E=this[w]|this[w+1]<<8;return E&32768?E|4294901760:E},s.prototype.readInt16BE=function(w,x){w=w>>>0,x||j(w,2,this.length);let E=this[w+1]|this[w]<<8;return E&32768?E|4294901760:E},s.prototype.readInt32LE=function(w,x){return w=w>>>0,x||j(w,4,this.length),this[w]|this[w+1]<<8|this[w+2]<<16|this[w+3]<<24},s.prototype.readInt32BE=function(w,x){return w=w>>>0,x||j(w,4,this.length),this[w]<<24|this[w+1]<<16|this[w+2]<<8|this[w+3]},s.prototype.readBigInt64LE=F(function(w){w=w>>>0,he(w,"offset");let x=this[w],E=this[w+7];(x===void 0||E===void 0)&&Te(w,this.length-8);let M=this[w+4]+this[w+5]*2**8+this[w+6]*2**16+(E<<24);return(BigInt(M)<<BigInt(32))+BigInt(x+this[++w]*2**8+this[++w]*2**16+this[++w]*2**24)}),s.prototype.readBigInt64BE=F(function(w){w=w>>>0,he(w,"offset");let x=this[w],E=this[w+7];(x===void 0||E===void 0)&&Te(w,this.length-8);let M=(x<<24)+this[++w]*2**16+this[++w]*2**8+this[++w];return(BigInt(M)<<BigInt(32))+BigInt(this[++w]*2**24+this[++w]*2**16+this[++w]*2**8+E)}),s.prototype.readFloatLE=function(w,x){return w=w>>>0,x||j(w,4,this.length),t.read(this,w,!0,23,4)},s.prototype.readFloatBE=function(w,x){return w=w>>>0,x||j(w,4,this.length),t.read(this,w,!1,23,4)},s.prototype.readDoubleLE=function(w,x){return w=w>>>0,x||j(w,8,this.length),t.read(this,w,!0,52,8)},s.prototype.readDoubleBE=function(w,x){return w=w>>>0,x||j(w,8,this.length),t.read(this,w,!1,52,8)};function se(w,x,E,M,W,Q){if(!s.isBuffer(w))throw new TypeError('"buffer" argument must be a Buffer instance');if(x>W||x<Q)throw new RangeError('"value" argument is out of bounds');if(E+M>w.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(w,x,E,M){if(w=+w,x=x>>>0,E=E>>>0,!M){let we=Math.pow(2,8*E)-1;se(this,w,x,E,we,0)}let W=1,Q=0;for(this[x]=w&255;++Q<E&&(W*=256);)this[x+Q]=w/W&255;return x+E},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(w,x,E,M){if(w=+w,x=x>>>0,E=E>>>0,!M){let we=Math.pow(2,8*E)-1;se(this,w,x,E,we,0)}let W=E-1,Q=1;for(this[x+W]=w&255;--W>=0&&(Q*=256);)this[x+W]=w/Q&255;return x+E},s.prototype.writeUint8=s.prototype.writeUInt8=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,1,255,0),this[x]=w&255,x+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,2,65535,0),this[x]=w&255,this[x+1]=w>>>8,x+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,2,65535,0),this[x]=w>>>8,this[x+1]=w&255,x+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,4,4294967295,0),this[x+3]=w>>>24,this[x+2]=w>>>16,this[x+1]=w>>>8,this[x]=w&255,x+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,4,4294967295,0),this[x]=w>>>24,this[x+1]=w>>>16,this[x+2]=w>>>8,this[x+3]=w&255,x+4};function D(w,x,E,M,W){pe(x,M,W,w,E,7);let Q=Number(x&BigInt(4294967295));w[E++]=Q,Q=Q>>8,w[E++]=Q,Q=Q>>8,w[E++]=Q,Q=Q>>8,w[E++]=Q;let we=Number(x>>BigInt(32)&BigInt(4294967295));return w[E++]=we,we=we>>8,w[E++]=we,we=we>>8,w[E++]=we,we=we>>8,w[E++]=we,E}function U(w,x,E,M,W){pe(x,M,W,w,E,7);let Q=Number(x&BigInt(4294967295));w[E+7]=Q,Q=Q>>8,w[E+6]=Q,Q=Q>>8,w[E+5]=Q,Q=Q>>8,w[E+4]=Q;let we=Number(x>>BigInt(32)&BigInt(4294967295));return w[E+3]=we,we=we>>8,w[E+2]=we,we=we>>8,w[E+1]=we,we=we>>8,w[E]=we,E+8}s.prototype.writeBigUInt64LE=F(function(w,x=0){return D(this,w,x,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=F(function(w,x=0){return U(this,w,x,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(w,x,E,M){if(w=+w,x=x>>>0,!M){let ae=Math.pow(2,8*E-1);se(this,w,x,E,ae-1,-ae)}let W=0,Q=1,we=0;for(this[x]=w&255;++W<E&&(Q*=256);)w<0&&we===0&&this[x+W-1]!==0&&(we=1),this[x+W]=(w/Q>>0)-we&255;return x+E},s.prototype.writeIntBE=function(w,x,E,M){if(w=+w,x=x>>>0,!M){let ae=Math.pow(2,8*E-1);se(this,w,x,E,ae-1,-ae)}let W=E-1,Q=1,we=0;for(this[x+W]=w&255;--W>=0&&(Q*=256);)w<0&&we===0&&this[x+W+1]!==0&&(we=1),this[x+W]=(w/Q>>0)-we&255;return x+E},s.prototype.writeInt8=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,1,127,-128),w<0&&(w=255+w+1),this[x]=w&255,x+1},s.prototype.writeInt16LE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,2,32767,-32768),this[x]=w&255,this[x+1]=w>>>8,x+2},s.prototype.writeInt16BE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,2,32767,-32768),this[x]=w>>>8,this[x+1]=w&255,x+2},s.prototype.writeInt32LE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,4,2147483647,-2147483648),this[x]=w&255,this[x+1]=w>>>8,this[x+2]=w>>>16,this[x+3]=w>>>24,x+4},s.prototype.writeInt32BE=function(w,x,E){return w=+w,x=x>>>0,E||se(this,w,x,4,2147483647,-2147483648),w<0&&(w=4294967295+w+1),this[x]=w>>>24,this[x+1]=w>>>16,this[x+2]=w>>>8,this[x+3]=w&255,x+4},s.prototype.writeBigInt64LE=F(function(w,x=0){return D(this,w,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=F(function(w,x=0){return U(this,w,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function xe(w,x,E,M,W,Q){if(E+M>w.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("Index out of range")}function X(w,x,E,M,W){return x=+x,E=E>>>0,W||xe(w,x,E,4),t.write(w,x,E,M,23,4),E+4}s.prototype.writeFloatLE=function(w,x,E){return X(this,w,x,!0,E)},s.prototype.writeFloatBE=function(w,x,E){return X(this,w,x,!1,E)};function Ce(w,x,E,M,W){return x=+x,E=E>>>0,W||xe(w,x,E,8),t.write(w,x,E,M,52,8),E+8}s.prototype.writeDoubleLE=function(w,x,E){return Ce(this,w,x,!0,E)},s.prototype.writeDoubleBE=function(w,x,E){return Ce(this,w,x,!1,E)},s.prototype.copy=function(w,x,E,M){if(!s.isBuffer(w))throw new TypeError("argument should be a Buffer");if(E||(E=0),!M&&M!==0&&(M=this.length),x>=w.length&&(x=w.length),x||(x=0),M>0&&M<E&&(M=E),M===E||w.length===0||this.length===0)return 0;if(x<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),w.length-x<M-E&&(M=w.length-x+E);let W=M-E;return this===w&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(x,E,M):Uint8Array.prototype.set.call(w,this.subarray(E,M),x),W},s.prototype.fill=function(w,x,E,M){if(typeof w=="string"){if(typeof x=="string"?(M=x,x=0,E=this.length):typeof E=="string"&&(M=E,E=this.length),M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!s.isEncoding(M))throw new TypeError("Unknown encoding: "+M);if(w.length===1){let Q=w.charCodeAt(0);(M==="utf8"&&Q<128||M==="latin1")&&(w=Q)}}else typeof w=="number"?w=w&255:typeof w=="boolean"&&(w=Number(w));if(x<0||this.length<x||this.length<E)throw new RangeError("Out of range index");if(E<=x)return this;x=x>>>0,E=E===void 0?this.length:E>>>0,w||(w=0);let W;if(typeof w=="number")for(W=x;W<E;++W)this[W]=w;else{let Q=s.isBuffer(w)?w:s.from(w,M),we=Q.length;if(we===0)throw new TypeError('The value "'+w+'" is invalid for argument "value"');for(W=0;W<E-x;++W)this[W+x]=Q[W%we]}return this};let ne={};function Y(w,x,E){ne[w]=class extends E{constructor(){super(),Object.defineProperty(this,"message",{value:x.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${w}]`,this.stack,delete this.name}get code(){return w}set code(M){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:M,writable:!0})}toString(){return`${this.name} [${w}]: ${this.message}`}}}Y("ERR_BUFFER_OUT_OF_BOUNDS",function(w){return w?`${w} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Y("ERR_INVALID_ARG_TYPE",function(w,x){return`The "${w}" argument must be of type number. Received type ${typeof x}`},TypeError),Y("ERR_OUT_OF_RANGE",function(w,x,E){let M=`The value of "${w}" is out of range.`,W=E;return Number.isInteger(E)&&Math.abs(E)>2**32?W=be(String(E)):typeof E=="bigint"&&(W=String(E),(E>BigInt(2)**BigInt(32)||E<-(BigInt(2)**BigInt(32)))&&(W=be(W)),W+="n"),M+=` It must be ${x}. Received ${W}`,M},RangeError);function be(w){let x="",E=w.length,M=w[0]==="-"?1:0;for(;E>=M+4;E-=3)x=`_${w.slice(E-3,E)}${x}`;return`${w.slice(0,E)}${x}`}function ce(w,x,E){he(x,"offset"),(w[x]===void 0||w[x+E]===void 0)&&Te(x,w.length-(E+1))}function pe(w,x,E,M,W,Q){if(w>E||w<x){let we=typeof x=="bigint"?"n":"",ae;throw x===0||x===BigInt(0)?ae=`>= 0${we} and < 2${we} ** ${(Q+1)*8}${we}`:ae=`>= -(2${we} ** ${(Q+1)*8-1}${we}) and < 2 ** ${(Q+1)*8-1}${we}`,new ne.ERR_OUT_OF_RANGE("value",ae,w)}ce(M,W,Q)}function he(w,x){if(typeof w!="number")throw new ne.ERR_INVALID_ARG_TYPE(x,"number",w)}function Te(w,x,E){throw Math.floor(w)!==w?(he(w,E),new ne.ERR_OUT_OF_RANGE("offset","an integer",w)):x<0?new ne.ERR_BUFFER_OUT_OF_BOUNDS:new ne.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${x}`,w)}let _e=/[^+/0-9A-Za-z-_]/g;function Z(w){if(w=w.split("=")[0],w=w.trim().replace(_e,""),w.length<2)return"";for(;w.length%4!==0;)w=w+"=";return w}function fe(w,x){x=x||1/0;let E,M=w.length,W=null,Q=[];for(let we=0;we<M;++we){if(E=w.charCodeAt(we),E>55295&&E<57344){if(!W){if(E>56319){(x-=3)>-1&&Q.push(239,191,189);continue}else if(we+1===M){(x-=3)>-1&&Q.push(239,191,189);continue}W=E;continue}if(E<56320){(x-=3)>-1&&Q.push(239,191,189),W=E;continue}E=(W-55296<<10|E-56320)+65536}else W&&(x-=3)>-1&&Q.push(239,191,189);if(W=null,E<128){if((x-=1)<0)break;Q.push(E)}else if(E<2048){if((x-=2)<0)break;Q.push(E>>6|192,E&63|128)}else if(E<65536){if((x-=3)<0)break;Q.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((x-=4)<0)break;Q.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw new Error("Invalid code point")}return Q}function ie(w){let x=[];for(let E=0;E<w.length;++E)x.push(w.charCodeAt(E)&255);return x}function re(w,x){let E,M,W,Q=[];for(let we=0;we<w.length&&!((x-=2)<0);++we)E=w.charCodeAt(we),M=E>>8,W=E%256,Q.push(W),Q.push(M);return Q}function ye(w){return e.toByteArray(Z(w))}function J(w,x,E,M){let W;for(W=0;W<M&&!(W+E>=x.length||W>=w.length);++W)x[W+E]=w[W];return W}function V(w,x){return w instanceof x||w!=null&&w.constructor!=null&&w.constructor.name!=null&&w.constructor.name===x.name}function me(w){return w!==w}let ee=function(){let w="0123456789abcdef",x=new Array(256);for(let E=0;E<16;++E){let M=E*16;for(let W=0;W<16;++W)x[M+W]=w[E]+w[W]}return x}();function F(w){return typeof BigInt>"u"?oe:w}function oe(){throw new Error("BigInt not supported")}return Cn}var Io,fd,wi,hd,Cn,pd,kP=cr(()=>{Ie(),Ne(),Re(),Io={},fd=!1,wi={},hd=!1,Cn={},pd=!1}),Ft={};Po(Ft,{Buffer:()=>Ia,INSPECT_MAX_BYTES:()=>Ng,default:()=>tn,kMaxLength:()=>$g});var tn,Ia,Ng,$g,Vt=cr(()=>{Ie(),Ne(),Re(),kP(),tn=_P(),tn.Buffer,tn.SlowBuffer,tn.INSPECT_MAX_BYTES,tn.kMaxLength,Ia=tn.Buffer,Ng=tn.INSPECT_MAX_BYTES,$g=tn.kMaxLength}),Ne=cr(()=>{Vt()}),Tt=Oe((e,t)=>{Ie(),Ne(),Re();var r=class extends Error{constructor(o){if(!Array.isArray(o))throw new TypeError(`Expected input to be an Array, got ${typeof o}`);let i="";for(let a=0;a<o.length;a++)i+=` ${o[a].stack}
|
|
2692
2692
|
`;super(i),this.name="AggregateError",this.errors=o}};t.exports={AggregateError:r,ArrayIsArray(o){return Array.isArray(o)},ArrayPrototypeIncludes(o,i){return o.includes(i)},ArrayPrototypeIndexOf(o,i){return o.indexOf(i)},ArrayPrototypeJoin(o,i){return o.join(i)},ArrayPrototypeMap(o,i){return o.map(i)},ArrayPrototypePop(o,i){return o.pop(i)},ArrayPrototypePush(o,i){return o.push(i)},ArrayPrototypeSlice(o,i,a){return o.slice(i,a)},Error,FunctionPrototypeCall(o,i,...a){return o.call(i,...a)},FunctionPrototypeSymbolHasInstance(o,i){return Function.prototype[Symbol.hasInstance].call(o,i)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(o,i){return Object.defineProperties(o,i)},ObjectDefineProperty(o,i,a){return Object.defineProperty(o,i,a)},ObjectGetOwnPropertyDescriptor(o,i){return Object.getOwnPropertyDescriptor(o,i)},ObjectKeys(o){return Object.keys(o)},ObjectSetPrototypeOf(o,i){return Object.setPrototypeOf(o,i)},Promise,PromisePrototypeCatch(o,i){return o.catch(i)},PromisePrototypeThen(o,i,a){return o.then(i,a)},PromiseReject(o){return Promise.reject(o)},PromiseResolve(o){return Promise.resolve(o)},ReflectApply:Reflect.apply,RegExpPrototypeTest(o,i){return o.test(i)},SafeSet:Set,String,StringPrototypeSlice(o,i,a){return o.slice(i,a)},StringPrototypeToLowerCase(o){return o.toLowerCase()},StringPrototypeToUpperCase(o){return o.toUpperCase()},StringPrototypeTrim(o){return o.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(o,i,a){return o.set(i,a)},Boolean,Uint8Array}}),Og=Oe((e,t)=>{Ie(),Ne(),Re(),t.exports={format(r,...o){return r.replace(/%([sdifj])/g,function(...[i,a]){let s=o.shift();return a==="f"?s.toFixed(6):a==="j"?JSON.stringify(s):a==="s"&&typeof s=="object"?`${s.constructor!==Object?s.constructor.name:""} {}`.trim():s.toString()})},inspect(r){switch(typeof r){case"string":if(r.includes("'"))if(r.includes('"')){if(!r.includes("`")&&!r.includes("${"))return`\`${r}\``}else return`"${r}"`;return`'${r}'`;case"number":return isNaN(r)?"NaN":Object.is(r,-0)?String(r):r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}}}}),nr=Oe((e,t)=>{Ie(),Ne(),Re();var{format:r,inspect:o}=Og(),{AggregateError:i}=Tt(),a=globalThis.AggregateError||i,s=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,d="__node_internal_",u={};function f(b,S){if(!b)throw new u.ERR_INTERNAL_ASSERTION(S)}function h(b){let S="",_=b.length,C=b[0]==="-"?1:0;for(;_>=C+4;_-=3)S=`_${b.slice(_-3,_)}${S}`;return`${b.slice(0,_)}${S}`}function g(b,S,_){if(typeof S=="function")return f(S.length<=_.length,`Code: ${b}; The provided arguments length (${_.length}) does not match the required ones (${S.length}).`),S(..._);let C=(S.match(/%[dfijoOs]/g)||[]).length;return f(C===_.length,`Code: ${b}; The provided arguments length (${_.length}) does not match the required ones (${C}).`),_.length===0?S:r(S,..._)}function p(b,S,_){_||(_=Error);class C extends _{constructor(...k){super(g(b,S,k))}toString(){return`${this.name} [${b}]: ${this.message}`}}Object.defineProperties(C.prototype,{name:{value:_.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${b}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),C.prototype.code=b,C.prototype[s]=!0,u[b]=C}function m(b){let S=d+b.name;return Object.defineProperty(b,"name",{value:S}),b}function v(b,S){if(b&&S&&b!==S){if(Array.isArray(S.errors))return S.errors.push(b),S;let _=new a([S,b],S.message);return _.code=S.code,_}return b||S}var y=class extends Error{constructor(b="The operation was aborted",S=void 0){if(S!==void 0&&typeof S!="object")throw new u.ERR_INVALID_ARG_TYPE("options","Object",S);super(b,S),this.code="ABORT_ERR",this.name="AbortError"}};p("ERR_ASSERTION","%s",Error),p("ERR_INVALID_ARG_TYPE",(b,S,_)=>{f(typeof b=="string","'name' must be a string"),Array.isArray(S)||(S=[S]);let C="The ";b.endsWith(" argument")?C+=`${b} `:C+=`"${b}" ${b.includes(".")?"property":"argument"} `,C+="must be ";let A=[],k=[],T=[];for(let R of S)f(typeof R=="string","All expected entries have to be of type string"),l.includes(R)?A.push(R.toLowerCase()):c.test(R)?k.push(R):(f(R!=="object",'The value "object" should be written as "Object"'),T.push(R));if(k.length>0){let R=A.indexOf("object");R!==-1&&(A.splice(A,R,1),k.push("Object"))}if(A.length>0){switch(A.length){case 1:C+=`of type ${A[0]}`;break;case 2:C+=`one of type ${A[0]} or ${A[1]}`;break;default:{let R=A.pop();C+=`one of type ${A.join(", ")}, or ${R}`}}(k.length>0||T.length>0)&&(C+=" or ")}if(k.length>0){switch(k.length){case 1:C+=`an instance of ${k[0]}`;break;case 2:C+=`an instance of ${k[0]} or ${k[1]}`;break;default:{let R=k.pop();C+=`an instance of ${k.join(", ")}, or ${R}`}}T.length>0&&(C+=" or ")}switch(T.length){case 0:break;case 1:T[0].toLowerCase()!==T[0]&&(C+="an "),C+=`${T[0]}`;break;case 2:C+=`one of ${T[0]} or ${T[1]}`;break;default:{let R=T.pop();C+=`one of ${T.join(", ")}, or ${R}`}}if(_==null)C+=`. Received ${_}`;else if(typeof _=="function"&&_.name)C+=`. Received function ${_.name}`;else if(typeof _=="object"){var I;if((I=_.constructor)!==null&&I!==void 0&&I.name)C+=`. Received an instance of ${_.constructor.name}`;else{let R=o(_,{depth:-1});C+=`. Received ${R}`}}else{let R=o(_,{colors:!1});R.length>25&&(R=`${R.slice(0,25)}...`),C+=`. Received type ${typeof _} (${R})`}return C},TypeError),p("ERR_INVALID_ARG_VALUE",(b,S,_="is invalid")=>{let C=o(S);return C.length>128&&(C=C.slice(0,128)+"..."),`The ${b.includes(".")?"property":"argument"} '${b}' ${_}. Received ${C}`},TypeError),p("ERR_INVALID_RETURN_VALUE",(b,S,_)=>{var C;let A=_!=null&&(C=_.constructor)!==null&&C!==void 0&&C.name?`instance of ${_.constructor.name}`:`type ${typeof _}`;return`Expected ${b} to be returned from the "${S}" function but got ${A}.`},TypeError),p("ERR_MISSING_ARGS",(...b)=>{f(b.length>0,"At least one arg needs to be specified");let S,_=b.length;switch(b=(Array.isArray(b)?b:[b]).map(C=>`"${C}"`).join(" or "),_){case 1:S+=`The ${b[0]} argument`;break;case 2:S+=`The ${b[0]} and ${b[1]} arguments`;break;default:{let C=b.pop();S+=`The ${b.join(", ")}, and ${C} arguments`}break}return`${S} must be specified`},TypeError),p("ERR_OUT_OF_RANGE",(b,S,_)=>{f(S,'Missing "range" argument');let C;if(Number.isInteger(_)&&Math.abs(_)>2**32)C=h(String(_));else if(typeof _=="bigint"){C=String(_);let A=BigInt(2)**BigInt(32);(_>A||_<-A)&&(C=h(C)),C+="n"}else C=o(_);return`The value of "${b}" is out of range. It must be ${S}. Received ${C}`},RangeError),p("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),p("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),p("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),p("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),p("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),p("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),p("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),p("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),p("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),p("ERR_STREAM_WRITE_AFTER_END","write after end",Error),p("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:y,aggregateTwoErrors:m(v),hideStackFrames:m,codes:u}}),xi=Oe((e,t)=>{Ie(),Ne(),Re();var{AbortController:r,AbortSignal:o}=typeof self<"u"?self:typeof window<"u"?window:void 0;t.exports=r,t.exports.AbortSignal=o,t.exports.default=r}),Sn={};Po(Sn,{EventEmitter:()=>Bg,default:()=>Ro,defaultMaxListeners:()=>Mg,init:()=>zg,listenerCount:()=>Dg,on:()=>Fg,once:()=>Vg});function EP(){if(gd)return Ci;gd=!0;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(_,C,A){return Function.prototype.apply.call(_,C,A)},r;e&&typeof e.ownKeys=="function"?r=e.ownKeys:Object.getOwnPropertySymbols?r=function(_){return Object.getOwnPropertyNames(_).concat(Object.getOwnPropertySymbols(_))}:r=function(_){return Object.getOwnPropertyNames(_)};function o(_){console&&console.warn&&console.warn(_)}var i=Number.isNaN||function(_){return _!==_};function a(){a.init.call(this)}Ci=a,Ci.once=y,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function l(_){if(typeof _!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof _)}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(_){if(typeof _!="number"||_<0||i(_))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+_+".");s=_}}),a.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(_){if(typeof _!="number"||_<0||i(_))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+_+".");return this._maxListeners=_,this};function c(_){return _._maxListeners===void 0?a.defaultMaxListeners:_._maxListeners}a.prototype.getMaxListeners=function(){return c(this)},a.prototype.emit=function(_){for(var C=[],A=1;A<arguments.length;A++)C.push(arguments[A]);var k=_==="error",T=this._events;if(T!==void 0)k=k&&T.error===void 0;else if(!k)return!1;if(k){var I;if(C.length>0&&(I=C[0]),I instanceof Error)throw I;var R=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw R.context=I,R}var B=T[_];if(B===void 0)return!1;if(typeof B=="function")t(B,this,C);else for(var P=B.length,O=p(B,P),A=0;A<P;++A)t(O[A],this,C);return!0};function d(_,C,A,k){var T,I,R;if(l(A),I=_._events,I===void 0?(I=_._events=Object.create(null),_._eventsCount=0):(I.newListener!==void 0&&(_.emit("newListener",C,A.listener?A.listener:A),I=_._events),R=I[C]),R===void 0)R=I[C]=A,++_._eventsCount;else if(typeof R=="function"?R=I[C]=k?[A,R]:[R,A]:k?R.unshift(A):R.push(A),T=c(_),T>0&&R.length>T&&!R.warned){R.warned=!0;var B=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");B.name="MaxListenersExceededWarning",B.emitter=_,B.type=C,B.count=R.length,o(B)}return _}a.prototype.addListener=function(_,C){return d(this,_,C,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(_,C){return d(this,_,C,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(_,C,A){var k={fired:!1,wrapFn:void 0,target:_,type:C,listener:A},T=u.bind(k);return T.listener=A,k.wrapFn=T,T}a.prototype.once=function(_,C){return l(C),this.on(_,f(this,_,C)),this},a.prototype.prependOnceListener=function(_,C){return l(C),this.prependListener(_,f(this,_,C)),this},a.prototype.removeListener=function(_,C){var A,k,T,I,R;if(l(C),k=this._events,k===void 0)return this;if(A=k[_],A===void 0)return this;if(A===C||A.listener===C)--this._eventsCount===0?this._events=Object.create(null):(delete k[_],k.removeListener&&this.emit("removeListener",_,A.listener||C));else if(typeof A!="function"){for(T=-1,I=A.length-1;I>=0;I--)if(A[I]===C||A[I].listener===C){R=A[I].listener,T=I;break}if(T<0)return this;T===0?A.shift():m(A,T),A.length===1&&(k[_]=A[0]),k.removeListener!==void 0&&this.emit("removeListener",_,R||C)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(_){var C,A,k;if(A=this._events,A===void 0)return this;if(A.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):A[_]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete A[_]),this;if(arguments.length===0){var T=Object.keys(A),I;for(k=0;k<T.length;++k)I=T[k],I!=="removeListener"&&this.removeAllListeners(I);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(C=A[_],typeof C=="function")this.removeListener(_,C);else if(C!==void 0)for(k=C.length-1;k>=0;k--)this.removeListener(_,C[k]);return this};function h(_,C,A){var k=_._events;if(k===void 0)return[];var T=k[C];return T===void 0?[]:typeof T=="function"?A?[T.listener||T]:[T]:A?v(T):p(T,T.length)}a.prototype.listeners=function(_){return h(this,_,!0)},a.prototype.rawListeners=function(_){return h(this,_,!1)},a.listenerCount=function(_,C){return typeof _.listenerCount=="function"?_.listenerCount(C):g.call(_,C)},a.prototype.listenerCount=g;function g(_){var C=this._events;if(C!==void 0){var A=C[_];if(typeof A=="function")return 1;if(A!==void 0)return A.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function p(_,C){for(var A=new Array(C),k=0;k<C;++k)A[k]=_[k];return A}function m(_,C){for(;C+1<_.length;C++)_[C]=_[C+1];_.pop()}function v(_){for(var C=new Array(_.length),A=0;A<C.length;++A)C[A]=_[A].listener||_[A];return C}function y(_,C){return new Promise(function(A,k){function T(R){_.removeListener(C,I),k(R)}function I(){typeof _.removeListener=="function"&&_.removeListener("error",T),A([].slice.call(arguments))}S(_,C,I,{once:!0}),C!=="error"&&b(_,T,{once:!0})})}function b(_,C,A){typeof _.on=="function"&&S(_,"error",C,A)}function S(_,C,A,k){if(typeof _.on=="function")k.once?_.once(C,A):_.on(C,A);else if(typeof _.addEventListener=="function")_.addEventListener(C,function T(I){k.once&&_.removeEventListener(C,T),A(I)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof _)}return Ci}var Ci,gd,Ro,Bg,Mg,zg,Dg,Fg,Vg,to=cr(()=>{Ie(),Ne(),Re(),Ci={},gd=!1,Ro=EP(),Ro.once,Ro.once=function(e,t){return new Promise((r,o)=>{function i(...s){a!==void 0&&e.removeListener("error",a),r(s)}let a;t!=="error"&&(a=s=>{e.removeListener(name,i),o(s)},e.once("error",a)),e.once(t,i)})},Ro.on=function(e,t){let r=[],o=[],i=null,a=!1,s={async next(){let d=r.shift();if(d)return createIterResult(d,!1);if(i){let u=Promise.reject(i);return i=null,u}return a?createIterResult(void 0,!0):new Promise((u,f)=>o.push({resolve:u,reject:f}))},async return(){e.removeListener(t,l),e.removeListener("error",c),a=!0;for(let d of o)d.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(d){i=d,e.removeListener(t,l),e.removeListener("error",c)},[Symbol.asyncIterator](){return this}};return e.on(t,l),e.on("error",c),s;function l(...d){let u=o.shift();u?u.resolve(createIterResult(d,!1)):r.push(d)}function c(d){a=!0;let u=o.shift();u?u.reject(d):i=d,s.return()}},{EventEmitter:Bg,defaultMaxListeners:Mg,init:zg,listenerCount:Dg,on:Fg,once:Vg}=Ro}),dr=Oe((e,t)=>{Ie(),Ne(),Re();var r=(Vt(),mt(Ft)),{format:o,inspect:i}=Og(),{codes:{ERR_INVALID_ARG_TYPE:a}}=nr(),{kResistStopPropagation:s,AggregateError:l,SymbolDispose:c}=Tt(),d=globalThis.AbortSignal||xi().AbortSignal,u=globalThis.AbortController||xi().AbortController,f=Object.getPrototypeOf(async function(){}).constructor,h=globalThis.Blob||r.Blob,g=typeof h<"u"?function(v){return v instanceof h}:function(v){return!1},p=(v,y)=>{if(v!==void 0&&(v===null||typeof v!="object"||!("aborted"in v)))throw new a(y,"AbortSignal",v)},m=(v,y)=>{if(typeof v!="function")throw new a(y,"Function",v)};t.exports={AggregateError:l,kEmptyObject:Object.freeze({}),once(v){let y=!1;return function(...b){y||(y=!0,v.apply(this,b))}},createDeferredPromise:function(){let v,y;return{promise:new Promise((b,S)=>{v=b,y=S}),resolve:v,reject:y}},promisify(v){return new Promise((y,b)=>{v((S,..._)=>S?b(S):y(..._))})},debuglog(){return function(){}},format:o,inspect:i,types:{isAsyncFunction(v){return v instanceof f},isArrayBufferView(v){return ArrayBuffer.isView(v)}},isBlob:g,deprecate(v,y){return v},addAbortListener:(to(),mt(Sn)).addAbortListener||function(v,y){if(v===void 0)throw new a("signal","AbortSignal",v);p(v,"signal"),m(y,"listener");let b;return v.aborted?queueMicrotask(()=>y()):(v.addEventListener("abort",y,{__proto__:null,once:!0,[s]:!0}),b=()=>{v.removeEventListener("abort",y)}),{__proto__:null,[c](){var S;(S=b)===null||S===void 0||S()}}},AbortSignalAny:d.any||function(v){if(v.length===1)return v[0];let y=new u,b=()=>y.abort();return v.forEach(S=>{p(S,"signals"),S.addEventListener("abort",b,{once:!0})}),y.signal.addEventListener("abort",()=>{v.forEach(S=>S.removeEventListener("abort",b))},{once:!0}),y.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),Si=Oe((e,t)=>{Ie(),Ne(),Re();var{ArrayIsArray:r,ArrayPrototypeIncludes:o,ArrayPrototypeJoin:i,ArrayPrototypeMap:a,NumberIsInteger:s,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:d,NumberParseInt:u,ObjectPrototypeHasOwnProperty:f,RegExpPrototypeExec:h,String:g,StringPrototypeToUpperCase:p,StringPrototypeTrim:m}=Tt(),{hideStackFrames:v,codes:{ERR_SOCKET_BAD_PORT:y,ERR_INVALID_ARG_TYPE:b,ERR_INVALID_ARG_VALUE:S,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:C}}=nr(),{normalizeEncoding:A}=dr(),{isAsyncFunction:k,isArrayBufferView:T}=dr().types,I={};function R(V){return V===(V|0)}function B(V){return V===V>>>0}var P=/^[0-7]+$/,O="must be a 32-bit unsigned integer or an octal string";function N(V,me,ee){if(typeof V>"u"&&(V=ee),typeof V=="string"){if(h(P,V)===null)throw new S(me,V,O);V=u(V,8)}return z(V,me),V}var $=v((V,me,ee=d,F=c)=>{if(typeof V!="number")throw new b(me,"number",V);if(!s(V))throw new _(me,"an integer",V);if(V<ee||V>F)throw new _(me,`>= ${ee} && <= ${F}`,V)}),q=v((V,me,ee=-2147483648,F=2147483647)=>{if(typeof V!="number")throw new b(me,"number",V);if(!s(V))throw new _(me,"an integer",V);if(V<ee||V>F)throw new _(me,`>= ${ee} && <= ${F}`,V)}),z=v((V,me,ee=!1)=>{if(typeof V!="number")throw new b(me,"number",V);if(!s(V))throw new _(me,"an integer",V);let F=ee?1:0,oe=4294967295;if(V<F||V>oe)throw new _(me,`>= ${F} && <= ${oe}`,V)});function L(V,me){if(typeof V!="string")throw new b(me,"string",V)}function te(V,me,ee=void 0,F){if(typeof V!="number")throw new b(me,"number",V);if(ee!=null&&V<ee||F!=null&&V>F||(ee!=null||F!=null)&&l(V))throw new _(me,`${ee!=null?`>= ${ee}`:""}${ee!=null&&F!=null?" && ":""}${F!=null?`<= ${F}`:""}`,V)}var j=v((V,me,ee)=>{if(!o(ee,V)){let F="must be one of: "+i(a(ee,oe=>typeof oe=="string"?`'${oe}'`:g(oe)),", ");throw new S(me,V,F)}});function se(V,me){if(typeof V!="boolean")throw new b(me,"boolean",V)}function D(V,me,ee){return V==null||!f(V,me)?ee:V[me]}var U=v((V,me,ee=null)=>{let F=D(ee,"allowArray",!1),oe=D(ee,"allowFunction",!1);if(!D(ee,"nullable",!1)&&V===null||!F&&r(V)||typeof V!="object"&&(!oe||typeof V!="function"))throw new b(me,"Object",V)}),xe=v((V,me)=>{if(V!=null&&typeof V!="object"&&typeof V!="function")throw new b(me,"a dictionary",V)}),X=v((V,me,ee=0)=>{if(!r(V))throw new b(me,"Array",V);if(V.length<ee){let F=`must be longer than ${ee}`;throw new S(me,V,F)}});function Ce(V,me){X(V,me);for(let ee=0;ee<V.length;ee++)L(V[ee],`${me}[${ee}]`)}function ne(V,me){X(V,me);for(let ee=0;ee<V.length;ee++)se(V[ee],`${me}[${ee}]`)}function Y(V,me){X(V,me);for(let ee=0;ee<V.length;ee++){let F=V[ee],oe=`${me}[${ee}]`;if(F==null)throw new b(oe,"AbortSignal",F);Te(F,oe)}}function be(V,me="signal"){if(L(V,me),I[V]===void 0)throw I[p(V)]!==void 0?new C(V+" (signals must use all capital letters)"):new C(V)}var ce=v((V,me="buffer")=>{if(!T(V))throw new b(me,["Buffer","TypedArray","DataView"],V)});function pe(V,me){let ee=A(me),F=V.length;if(ee==="hex"&&F%2!==0)throw new S("encoding",me,`is invalid for data of length ${F}`)}function he(V,me="Port",ee=!0){if(typeof V!="number"&&typeof V!="string"||typeof V=="string"&&m(V).length===0||+V!==+V>>>0||V>65535||V===0&&!ee)throw new y(me,V,ee);return V|0}var Te=v((V,me)=>{if(V!==void 0&&(V===null||typeof V!="object"||!("aborted"in V)))throw new b(me,"AbortSignal",V)}),_e=v((V,me)=>{if(typeof V!="function")throw new b(me,"Function",V)}),Z=v((V,me)=>{if(typeof V!="function"||k(V))throw new b(me,"Function",V)}),fe=v((V,me)=>{if(V!==void 0)throw new b(me,"undefined",V)});function ie(V,me,ee){if(!o(ee,V))throw new b(me,`('${i(ee,"|")}')`,V)}var re=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ye(V,me){if(typeof V>"u"||!h(re,V))throw new S(me,V,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function J(V){if(typeof V=="string")return ye(V,"hints"),V;if(r(V)){let me=V.length,ee="";if(me===0)return ee;for(let F=0;F<me;F++){let oe=V[F];ye(oe,"hints"),ee+=oe,F!==me-1&&(ee+=", ")}return ee}throw new S("hints",V,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:R,isUint32:B,parseFileMode:N,validateArray:X,validateStringArray:Ce,validateBooleanArray:ne,validateAbortSignalArray:Y,validateBoolean:se,validateBuffer:ce,validateDictionary:xe,validateEncoding:pe,validateFunction:_e,validateInt32:q,validateInteger:$,validateNumber:te,validateObject:U,validateOneOf:j,validatePlainFunction:Z,validatePort:he,validateSignalName:be,validateString:L,validateUint32:z,validateUndefined:fe,validateUnion:ie,validateAbortSignal:Te,validateLinkHeaderValue:J}}),ro=Oe((e,t)=>{Ie(),Ne(),Re();var r=t.exports={},o,i;function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?o=setTimeout:o=a}catch{o=a}try{typeof clearTimeout=="function"?i=clearTimeout:i=s}catch{i=s}})();function l(y){if(o===setTimeout)return setTimeout(y,0);if((o===a||!o)&&setTimeout)return o=setTimeout,setTimeout(y,0);try{return o(y,0)}catch{try{return o.call(null,y,0)}catch{return o.call(this,y,0)}}}function c(y){if(i===clearTimeout)return clearTimeout(y);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(y);try{return i(y)}catch{try{return i.call(null,y)}catch{return i.call(this,y)}}}var d=[],u=!1,f,h=-1;function g(){!u||!f||(u=!1,f.length?d=f.concat(d):h=-1,d.length&&p())}function p(){if(!u){var y=l(g);u=!0;for(var b=d.length;b;){for(f=d,d=[];++h<b;)f&&f[h].run();h=-1,b=d.length}f=null,u=!1,c(y)}}r.nextTick=function(y){var b=new Array(arguments.length-1);if(arguments.length>1)for(var S=1;S<arguments.length;S++)b[S-1]=arguments[S];d.push(new m(y,b)),d.length===1&&!u&&l(p)};function m(y,b){this.fun=y,this.array=b}m.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function v(){}r.on=v,r.addListener=v,r.once=v,r.off=v,r.removeListener=v,r.removeAllListeners=v,r.emit=v,r.prependListener=v,r.prependOnceListener=v,r.listeners=function(y){return[]},r.binding=function(y){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(y){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}}),rn=Oe((e,t)=>{Ie(),Ne(),Re();var{SymbolAsyncIterator:r,SymbolIterator:o,SymbolFor:i}=Tt(),a=i("nodejs.stream.destroyed"),s=i("nodejs.stream.errored"),l=i("nodejs.stream.readable"),c=i("nodejs.stream.writable"),d=i("nodejs.stream.disturbed"),u=i("nodejs.webstream.isClosedPromise"),f=i("nodejs.webstream.controllerErrorFunction");function h(D,U=!1){var xe;return!!(D&&typeof D.pipe=="function"&&typeof D.on=="function"&&(!U||typeof D.pause=="function"&&typeof D.resume=="function")&&(!D._writableState||((xe=D._readableState)===null||xe===void 0?void 0:xe.readable)!==!1)&&(!D._writableState||D._readableState))}function g(D){var U;return!!(D&&typeof D.write=="function"&&typeof D.on=="function"&&(!D._readableState||((U=D._writableState)===null||U===void 0?void 0:U.writable)!==!1))}function p(D){return!!(D&&typeof D.pipe=="function"&&D._readableState&&typeof D.on=="function"&&typeof D.write=="function")}function m(D){return D&&(D._readableState||D._writableState||typeof D.write=="function"&&typeof D.on=="function"||typeof D.pipe=="function"&&typeof D.on=="function")}function v(D){return!!(D&&!m(D)&&typeof D.pipeThrough=="function"&&typeof D.getReader=="function"&&typeof D.cancel=="function")}function y(D){return!!(D&&!m(D)&&typeof D.getWriter=="function"&&typeof D.abort=="function")}function b(D){return!!(D&&!m(D)&&typeof D.readable=="object"&&typeof D.writable=="object")}function S(D){return v(D)||y(D)||b(D)}function _(D,U){return D==null?!1:U===!0?typeof D[r]=="function":U===!1?typeof D[o]=="function":typeof D[r]=="function"||typeof D[o]=="function"}function C(D){if(!m(D))return null;let U=D._writableState,xe=D._readableState,X=U||xe;return!!(D.destroyed||D[a]||X!=null&&X.destroyed)}function A(D){if(!g(D))return null;if(D.writableEnded===!0)return!0;let U=D._writableState;return U!=null&&U.errored?!1:typeof(U==null?void 0:U.ended)!="boolean"?null:U.ended}function k(D,U){if(!g(D))return null;if(D.writableFinished===!0)return!0;let xe=D._writableState;return xe!=null&&xe.errored?!1:typeof(xe==null?void 0:xe.finished)!="boolean"?null:!!(xe.finished||U===!1&&xe.ended===!0&&xe.length===0)}function T(D){if(!h(D))return null;if(D.readableEnded===!0)return!0;let U=D._readableState;return!U||U.errored?!1:typeof(U==null?void 0:U.ended)!="boolean"?null:U.ended}function I(D,U){if(!h(D))return null;let xe=D._readableState;return xe!=null&&xe.errored?!1:typeof(xe==null?void 0:xe.endEmitted)!="boolean"?null:!!(xe.endEmitted||U===!1&&xe.ended===!0&&xe.length===0)}function R(D){return D&&D[l]!=null?D[l]:typeof(D==null?void 0:D.readable)!="boolean"?null:C(D)?!1:h(D)&&D.readable&&!I(D)}function B(D){return D&&D[c]!=null?D[c]:typeof(D==null?void 0:D.writable)!="boolean"?null:C(D)?!1:g(D)&&D.writable&&!A(D)}function P(D,U){return m(D)?C(D)?!0:!((U==null?void 0:U.readable)!==!1&&R(D)||(U==null?void 0:U.writable)!==!1&&B(D)):null}function O(D){var U,xe;return m(D)?D.writableErrored?D.writableErrored:(U=(xe=D._writableState)===null||xe===void 0?void 0:xe.errored)!==null&&U!==void 0?U:null:null}function N(D){var U,xe;return m(D)?D.readableErrored?D.readableErrored:(U=(xe=D._readableState)===null||xe===void 0?void 0:xe.errored)!==null&&U!==void 0?U:null:null}function $(D){if(!m(D))return null;if(typeof D.closed=="boolean")return D.closed;let U=D._writableState,xe=D._readableState;return typeof(U==null?void 0:U.closed)=="boolean"||typeof(xe==null?void 0:xe.closed)=="boolean"?(U==null?void 0:U.closed)||(xe==null?void 0:xe.closed):typeof D._closed=="boolean"&&q(D)?D._closed:null}function q(D){return typeof D._closed=="boolean"&&typeof D._defaultKeepAlive=="boolean"&&typeof D._removedConnection=="boolean"&&typeof D._removedContLen=="boolean"}function z(D){return typeof D._sent100=="boolean"&&q(D)}function L(D){var U;return typeof D._consuming=="boolean"&&typeof D._dumped=="boolean"&&((U=D.req)===null||U===void 0?void 0:U.upgradeOrConnect)===void 0}function te(D){if(!m(D))return null;let U=D._writableState,xe=D._readableState,X=U||xe;return!X&&z(D)||!!(X&&X.autoDestroy&&X.emitClose&&X.closed===!1)}function j(D){var U;return!!(D&&((U=D[d])!==null&&U!==void 0?U:D.readableDidRead||D.readableAborted))}function se(D){var U,xe,X,Ce,ne,Y,be,ce,pe,he;return!!(D&&((U=(xe=(X=(Ce=(ne=(Y=D[s])!==null&&Y!==void 0?Y:D.readableErrored)!==null&&ne!==void 0?ne:D.writableErrored)!==null&&Ce!==void 0?Ce:(be=D._readableState)===null||be===void 0?void 0:be.errorEmitted)!==null&&X!==void 0?X:(ce=D._writableState)===null||ce===void 0?void 0:ce.errorEmitted)!==null&&xe!==void 0?xe:(pe=D._readableState)===null||pe===void 0?void 0:pe.errored)!==null&&U!==void 0?U:!((he=D._writableState)===null||he===void 0)&&he.errored))}t.exports={isDestroyed:C,kIsDestroyed:a,isDisturbed:j,kIsDisturbed:d,isErrored:se,kIsErrored:s,isReadable:R,kIsReadable:l,kIsClosedPromise:u,kControllerErrorFunction:f,kIsWritable:c,isClosed:$,isDuplexNodeStream:p,isFinished:P,isIterable:_,isReadableNodeStream:h,isReadableStream:v,isReadableEnded:T,isReadableFinished:I,isReadableErrored:N,isNodeStream:m,isWebStream:S,isWritable:B,isWritableNodeStream:g,isWritableStream:y,isWritableEnded:A,isWritableFinished:k,isWritableErrored:O,isServerRequest:L,isServerResponse:z,willEmitClose:te,isTransformStream:b}}),_n=Oe((e,t)=>{Ie(),Ne(),Re();var r=ro(),{AbortError:o,codes:i}=nr(),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:s}=i,{kEmptyObject:l,once:c}=dr(),{validateAbortSignal:d,validateFunction:u,validateObject:f,validateBoolean:h}=Si(),{Promise:g,PromisePrototypeThen:p,SymbolDispose:m}=Tt(),{isClosed:v,isReadable:y,isReadableNodeStream:b,isReadableStream:S,isReadableFinished:_,isReadableErrored:C,isWritable:A,isWritableNodeStream:k,isWritableStream:T,isWritableFinished:I,isWritableErrored:R,isNodeStream:B,willEmitClose:P,kIsClosedPromise:O}=rn(),N;function $(j){return j.setHeader&&typeof j.abort=="function"}var q=()=>{};function z(j,se,D){var U,xe;if(arguments.length===2?(D=se,se=l):se==null?se=l:f(se,"options"),u(D,"callback"),d(se.signal,"options.signal"),D=c(D),S(j)||T(j))return L(j,se,D);if(!B(j))throw new a("stream",["ReadableStream","WritableStream","Stream"],j);let X=(U=se.readable)!==null&&U!==void 0?U:b(j),Ce=(xe=se.writable)!==null&&xe!==void 0?xe:k(j),ne=j._writableState,Y=j._readableState,be=()=>{j.writable||he()},ce=P(j)&&b(j)===X&&k(j)===Ce,pe=I(j,!1),he=()=>{pe=!0,j.destroyed&&(ce=!1),!(ce&&(!j.readable||X))&&(!X||Te)&&D.call(j)},Te=_(j,!1),_e=()=>{Te=!0,j.destroyed&&(ce=!1),!(ce&&(!j.writable||Ce))&&(!Ce||pe)&&D.call(j)},Z=V=>{D.call(j,V)},fe=v(j),ie=()=>{fe=!0;let V=R(j)||C(j);if(V&&typeof V!="boolean")return D.call(j,V);if(X&&!Te&&b(j,!0)&&!_(j,!1))return D.call(j,new s);if(Ce&&!pe&&!I(j,!1))return D.call(j,new s);D.call(j)},re=()=>{fe=!0;let V=R(j)||C(j);if(V&&typeof V!="boolean")return D.call(j,V);D.call(j)},ye=()=>{j.req.on("finish",he)};$(j)?(j.on("complete",he),ce||j.on("abort",ie),j.req?ye():j.on("request",ye)):Ce&&!ne&&(j.on("end",be),j.on("close",be)),!ce&&typeof j.aborted=="boolean"&&j.on("aborted",ie),j.on("end",_e),j.on("finish",he),se.error!==!1&&j.on("error",Z),j.on("close",ie),fe?r.nextTick(ie):ne!=null&&ne.errorEmitted||Y!=null&&Y.errorEmitted?ce||r.nextTick(re):(!X&&(!ce||y(j))&&(pe||A(j)===!1)||!Ce&&(!ce||A(j))&&(Te||y(j)===!1)||Y&&j.req&&j.aborted)&&r.nextTick(re);let J=()=>{D=q,j.removeListener("aborted",ie),j.removeListener("complete",he),j.removeListener("abort",ie),j.removeListener("request",ye),j.req&&j.req.removeListener("finish",he),j.removeListener("end",be),j.removeListener("close",be),j.removeListener("finish",he),j.removeListener("end",_e),j.removeListener("error",Z),j.removeListener("close",ie)};if(se.signal&&!fe){let V=()=>{let me=D;J(),me.call(j,new o(void 0,{cause:se.signal.reason}))};if(se.signal.aborted)r.nextTick(V);else{N=N||dr().addAbortListener;let me=N(se.signal,V),ee=D;D=c((...F)=>{me[m](),ee.apply(j,F)})}}return J}function L(j,se,D){let U=!1,xe=q;if(se.signal)if(xe=()=>{U=!0,D.call(j,new o(void 0,{cause:se.signal.reason}))},se.signal.aborted)r.nextTick(xe);else{N=N||dr().addAbortListener;let Ce=N(se.signal,xe),ne=D;D=c((...Y)=>{Ce[m](),ne.apply(j,Y)})}let X=(...Ce)=>{U||r.nextTick(()=>D.apply(j,Ce))};return p(j[O].promise,X,X),q}function te(j,se){var D;let U=!1;return se===null&&(se=l),(D=se)!==null&&D!==void 0&&D.cleanup&&(h(se.cleanup,"cleanup"),U=se.cleanup),new g((xe,X)=>{let Ce=z(j,se,ne=>{U&&Ce(),ne?X(ne):xe()})})}t.exports=z,t.exports.finished=te}),No=Oe((e,t)=>{Ie(),Ne(),Re();var r=ro(),{aggregateTwoErrors:o,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:a}=nr(),{Symbol:s}=Tt(),{kIsDestroyed:l,isDestroyed:c,isFinished:d,isServerRequest:u}=rn(),f=s("kDestroy"),h=s("kConstruct");function g(P,O,N){P&&(P.stack,O&&!O.errored&&(O.errored=P),N&&!N.errored&&(N.errored=P))}function p(P,O){let N=this._readableState,$=this._writableState,q=$||N;return $!=null&&$.destroyed||N!=null&&N.destroyed?(typeof O=="function"&&O(),this):(g(P,$,N),$&&($.destroyed=!0),N&&(N.destroyed=!0),q.constructed?m(this,P,O):this.once(f,function(z){m(this,o(z,P),O)}),this)}function m(P,O,N){let $=!1;function q(z){if($)return;$=!0;let L=P._readableState,te=P._writableState;g(z,te,L),te&&(te.closed=!0),L&&(L.closed=!0),typeof N=="function"&&N(z),z?r.nextTick(v,P,z):r.nextTick(y,P)}try{P._destroy(O||null,q)}catch(z){q(z)}}function v(P,O){b(P,O),y(P)}function y(P){let O=P._readableState,N=P._writableState;N&&(N.closeEmitted=!0),O&&(O.closeEmitted=!0),(N!=null&&N.emitClose||O!=null&&O.emitClose)&&P.emit("close")}function b(P,O){let N=P._readableState,$=P._writableState;$!=null&&$.errorEmitted||N!=null&&N.errorEmitted||($&&($.errorEmitted=!0),N&&(N.errorEmitted=!0),P.emit("error",O))}function S(){let P=this._readableState,O=this._writableState;P&&(P.constructed=!0,P.closed=!1,P.closeEmitted=!1,P.destroyed=!1,P.errored=null,P.errorEmitted=!1,P.reading=!1,P.ended=P.readable===!1,P.endEmitted=P.readable===!1),O&&(O.constructed=!0,O.destroyed=!1,O.closed=!1,O.closeEmitted=!1,O.errored=null,O.errorEmitted=!1,O.finalCalled=!1,O.prefinished=!1,O.ended=O.writable===!1,O.ending=O.writable===!1,O.finished=O.writable===!1)}function _(P,O,N){let $=P._readableState,q=P._writableState;if(q!=null&&q.destroyed||$!=null&&$.destroyed)return this;$!=null&&$.autoDestroy||q!=null&&q.autoDestroy?P.destroy(O):O&&(O.stack,q&&!q.errored&&(q.errored=O),$&&!$.errored&&($.errored=O),N?r.nextTick(b,P,O):b(P,O))}function C(P,O){if(typeof P._construct!="function")return;let N=P._readableState,$=P._writableState;N&&(N.constructed=!1),$&&($.constructed=!1),P.once(h,O),!(P.listenerCount(h)>1)&&r.nextTick(A,P)}function A(P){let O=!1;function N($){if(O){_(P,$??new i);return}O=!0;let q=P._readableState,z=P._writableState,L=z||q;q&&(q.constructed=!0),z&&(z.constructed=!0),L.destroyed?P.emit(f,$):$?_(P,$,!0):r.nextTick(k,P)}try{P._construct($=>{r.nextTick(N,$)})}catch($){r.nextTick(N,$)}}function k(P){P.emit(h)}function T(P){return(P==null?void 0:P.setHeader)&&typeof P.abort=="function"}function I(P){P.emit("close")}function R(P,O){P.emit("error",O),r.nextTick(I,P)}function B(P,O){!P||c(P)||(!O&&!d(P)&&(O=new a),u(P)?(P.socket=null,P.destroy(O)):T(P)?P.abort():T(P.req)?P.req.abort():typeof P.destroy=="function"?P.destroy(O):typeof P.close=="function"?P.close():O?r.nextTick(R,P,O):r.nextTick(I,P),P.destroyed||(P[l]=!0))}t.exports={construct:C,destroyer:B,destroy:p,undestroy:S,errorOrDestroy:_}}),md=Oe((e,t)=>{Ie(),Ne(),Re();var{ArrayIsArray:r,ObjectSetPrototypeOf:o}=Tt(),{EventEmitter:i}=(to(),mt(Sn));function a(l){i.call(this,l)}o(a.prototype,i.prototype),o(a,i),a.prototype.pipe=function(l,c){let d=this;function u(y){l.writable&&l.write(y)===!1&&d.pause&&d.pause()}d.on("data",u);function f(){d.readable&&d.resume&&d.resume()}l.on("drain",f),!l._isStdio&&(!c||c.end!==!1)&&(d.on("end",g),d.on("close",p));let h=!1;function g(){h||(h=!0,l.end())}function p(){h||(h=!0,typeof l.destroy=="function"&&l.destroy())}function m(y){v(),i.listenerCount(this,"error")===0&&this.emit("error",y)}s(d,"error",m),s(l,"error",m);function v(){d.removeListener("data",u),l.removeListener("drain",f),d.removeListener("end",g),d.removeListener("close",p),d.removeListener("error",m),l.removeListener("error",m),d.removeListener("end",v),d.removeListener("close",v),l.removeListener("close",v)}return d.on("end",v),d.on("close",v),l.on("close",v),l.emit("pipe",d),l};function s(l,c,d){if(typeof l.prependListener=="function")return l.prependListener(c,d);!l._events||!l._events[c]?l.on(c,d):r(l._events[c])?l._events[c].unshift(d):l._events[c]=[d,l._events[c]]}t.exports={Stream:a,prependListener:s}}),Ra=Oe((e,t)=>{Ie(),Ne(),Re();var{SymbolDispose:r}=Tt(),{AbortError:o,codes:i}=nr(),{isNodeStream:a,isWebStream:s,kControllerErrorFunction:l}=rn(),c=_n(),{ERR_INVALID_ARG_TYPE:d}=i,u,f=(h,g)=>{if(typeof h!="object"||!("aborted"in h))throw new d(g,"AbortSignal",h)};t.exports.addAbortSignal=function(h,g){if(f(h,"signal"),!a(g)&&!s(g))throw new d("stream",["ReadableStream","WritableStream","Stream"],g);return t.exports.addAbortSignalNoValidate(h,g)},t.exports.addAbortSignalNoValidate=function(h,g){if(typeof h!="object"||!("aborted"in h))return g;let p=a(g)?()=>{g.destroy(new o(void 0,{cause:h.reason}))}:()=>{g[l](new o(void 0,{cause:h.reason}))};if(h.aborted)p();else{u=u||dr().addAbortListener;let m=u(h,p);c(g,m[r])}return g}}),TP=Oe((e,t)=>{Ie(),Ne(),Re();var{StringPrototypeSlice:r,SymbolIterator:o,TypedArrayPrototypeSet:i,Uint8Array:a}=Tt(),{Buffer:s}=(Vt(),mt(Ft)),{inspect:l}=dr();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(c){let d={data:c,next:null};this.length>0?this.tail.next=d:this.head=d,this.tail=d,++this.length}unshift(c){let d={data:c,next:this.head};this.length===0&&(this.tail=d),this.head=d,++this.length}shift(){if(this.length===0)return;let c=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,c}clear(){this.head=this.tail=null,this.length=0}join(c){if(this.length===0)return"";let d=this.head,u=""+d.data;for(;(d=d.next)!==null;)u+=c+d.data;return u}concat(c){if(this.length===0)return s.alloc(0);let d=s.allocUnsafe(c>>>0),u=this.head,f=0;for(;u;)i(d,u.data,f),f+=u.data.length,u=u.next;return d}consume(c,d){let u=this.head.data;if(c<u.length){let f=u.slice(0,c);return this.head.data=u.slice(c),f}return c===u.length?this.shift():d?this._getString(c):this._getBuffer(c)}first(){return this.head.data}*[o](){for(let c=this.head;c;c=c.next)yield c.data}_getString(c){let d="",u=this.head,f=0;do{let h=u.data;if(c>h.length)d+=h,c-=h.length;else{c===h.length?(d+=h,++f,u.next?this.head=u.next:this.head=this.tail=null):(d+=r(h,0,c),this.head=u,u.data=r(h,c));break}++f}while((u=u.next)!==null);return this.length-=f,d}_getBuffer(c){let d=s.allocUnsafe(c),u=c,f=this.head,h=0;do{let g=f.data;if(c>g.length)i(d,g,u-c),c-=g.length;else{c===g.length?(i(d,g,u-c),++h,f.next?this.head=f.next:this.head=this.tail=null):(i(d,new a(g.buffer,g.byteOffset,c),u-c),this.head=f,f.data=g.slice(c));break}++h}while((f=f.next)!==null);return this.length-=h,d}[Symbol.for("nodejs.util.inspect.custom")](c,d){return l(this,{...d,depth:0,customInspect:!1})}}}),Na=Oe((e,t)=>{Ie(),Ne(),Re();var{MathFloor:r,NumberIsInteger:o}=Tt(),{validateInteger:i}=Si(),{ERR_INVALID_ARG_VALUE:a}=nr().codes,s=16*1024,l=16;function c(h,g,p){return h.highWaterMark!=null?h.highWaterMark:g?h[p]:null}function d(h){return h?l:s}function u(h,g){i(g,"value",0),h?l=g:s=g}function f(h,g,p,m){let v=c(g,m,p);if(v!=null){if(!o(v)||v<0){let y=m?`options.${p}`:"options.highWaterMark";throw new a(y,v)}return r(v)}return d(h.objectMode)}t.exports={getHighWaterMark:f,getDefaultHighWaterMark:d,setDefaultHighWaterMark:u}}),AP=Oe((e,t)=>{Ie(),Ne(),Re();var r=(Vt(),mt(Ft)),o=r.Buffer;function i(s,l){for(var c in s)l[c]=s[c]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=a);function a(s,l,c){return o(s,l,c)}a.prototype=Object.create(o.prototype),i(o,a),a.from=function(s,l,c){if(typeof s=="number")throw new TypeError("Argument must not be a number");return o(s,l,c)},a.alloc=function(s,l,c){if(typeof s!="number")throw new TypeError("Argument must be a number");var d=o(s);return l!==void 0?typeof c=="string"?d.fill(l,c):d.fill(l):d.fill(0),d},a.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return o(s)},a.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}}),PP=Oe(e=>{Ie(),Ne(),Re();var t=AP().Buffer,r=t.isEncoding||function(b){switch(b=""+b,b&&b.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(b){if(!b)return"utf8";for(var S;;)switch(b){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return b;default:if(S)return;b=(""+b).toLowerCase(),S=!0}}function i(b){var S=o(b);if(typeof S!="string"&&(t.isEncoding===r||!r(b)))throw new Error("Unknown encoding: "+b);return S||b}e.StringDecoder=a;function a(b){this.encoding=i(b);var S;switch(this.encoding){case"utf16le":this.text=h,this.end=g,S=4;break;case"utf8":this.fillLast=d,S=4;break;case"base64":this.text=p,this.end=m,S=3;break;default:this.write=v,this.end=y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(S)}a.prototype.write=function(b){if(b.length===0)return"";var S,_;if(this.lastNeed){if(S=this.fillLast(b),S===void 0)return"";_=this.lastNeed,this.lastNeed=0}else _=0;return _<b.length?S?S+this.text(b,_):this.text(b,_):S||""},a.prototype.end=f,a.prototype.text=u,a.prototype.fillLast=function(b){if(this.lastNeed<=b.length)return b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,b.length),this.lastNeed-=b.length};function s(b){return b<=127?0:b>>5===6?2:b>>4===14?3:b>>3===30?4:b>>6===2?-1:-2}function l(b,S,_){var C=S.length-1;if(C<_)return 0;var A=s(S[C]);return A>=0?(A>0&&(b.lastNeed=A-1),A):--C<_||A===-2?0:(A=s(S[C]),A>=0?(A>0&&(b.lastNeed=A-2),A):--C<_||A===-2?0:(A=s(S[C]),A>=0?(A>0&&(A===2?A=0:b.lastNeed=A-3),A):0))}function c(b,S,_){if((S[0]&192)!==128)return b.lastNeed=0,"�";if(b.lastNeed>1&&S.length>1){if((S[1]&192)!==128)return b.lastNeed=1,"�";if(b.lastNeed>2&&S.length>2&&(S[2]&192)!==128)return b.lastNeed=2,"�"}}function d(b){var S=this.lastTotal-this.lastNeed,_=c(this,b);if(_!==void 0)return _;if(this.lastNeed<=b.length)return b.copy(this.lastChar,S,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,S,0,b.length),this.lastNeed-=b.length}function u(b,S){var _=l(this,b,S);if(!this.lastNeed)return b.toString("utf8",S);this.lastTotal=_;var C=b.length-(_-this.lastNeed);return b.copy(this.lastChar,0,C),b.toString("utf8",S,C)}function f(b){var S=b&&b.length?this.write(b):"";return this.lastNeed?S+"�":S}function h(b,S){if((b.length-S)%2===0){var _=b.toString("utf16le",S);if(_){var C=_.charCodeAt(_.length-1);if(C>=55296&&C<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1],_.slice(0,-1)}return _}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",S,b.length-1)}function g(b){var S=b&&b.length?this.write(b):"";if(this.lastNeed){var _=this.lastTotal-this.lastNeed;return S+this.lastChar.toString("utf16le",0,_)}return S}function p(b,S){var _=(b.length-S)%3;return _===0?b.toString("base64",S):(this.lastNeed=3-_,this.lastTotal=3,_===1?this.lastChar[0]=b[b.length-1]:(this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1]),b.toString("base64",S,b.length-_))}function m(b){var S=b&&b.length?this.write(b):"";return this.lastNeed?S+this.lastChar.toString("base64",0,3-this.lastNeed):S}function v(b){return b.toString(this.encoding)}function y(b){return b&&b.length?this.write(b):""}}),Lg=Oe((e,t)=>{Ie(),Ne(),Re();var r=ro(),{PromisePrototypeThen:o,SymbolAsyncIterator:i,SymbolIterator:a}=Tt(),{Buffer:s}=(Vt(),mt(Ft)),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:c}=nr().codes;function d(u,f,h){let g;if(typeof f=="string"||f instanceof s)return new u({objectMode:!0,...h,read(){this.push(f),this.push(null)}});let p;if(f&&f[i])p=!0,g=f[i]();else if(f&&f[a])p=!1,g=f[a]();else throw new l("iterable",["Iterable"],f);let m=new u({objectMode:!0,highWaterMark:1,...h}),v=!1;m._read=function(){v||(v=!0,b())},m._destroy=function(S,_){o(y(S),()=>r.nextTick(_,S),C=>r.nextTick(_,C||S))};async function y(S){let _=S!=null,C=typeof g.throw=="function";if(_&&C){let{value:A,done:k}=await g.throw(S);if(await A,k)return}if(typeof g.return=="function"){let{value:A}=await g.return();await A}}async function b(){for(;;){try{let{value:S,done:_}=p?await g.next():g.next();if(_)m.push(null);else{let C=S&&typeof S.then=="function"?await S:S;if(C===null)throw v=!1,new c;if(m.push(C))continue;v=!1}}catch(S){m.destroy(S)}break}}return m}t.exports=d}),$a=Oe((e,t)=>{Ie(),Ne(),Re();var r=ro(),{ArrayPrototypeIndexOf:o,NumberIsInteger:i,NumberIsNaN:a,NumberParseInt:s,ObjectDefineProperties:l,ObjectKeys:c,ObjectSetPrototypeOf:d,Promise:u,SafeSet:f,SymbolAsyncDispose:h,SymbolAsyncIterator:g,Symbol:p}=Tt();t.exports=F,F.ReadableState=ee;var{EventEmitter:m}=(to(),mt(Sn)),{Stream:v,prependListener:y}=md(),{Buffer:b}=(Vt(),mt(Ft)),{addAbortSignal:S}=Ra(),_=_n(),C=dr().debuglog("stream",G=>{C=G}),A=TP(),k=No(),{getHighWaterMark:T,getDefaultHighWaterMark:I}=Na(),{aggregateTwoErrors:R,codes:{ERR_INVALID_ARG_TYPE:B,ERR_METHOD_NOT_IMPLEMENTED:P,ERR_OUT_OF_RANGE:O,ERR_STREAM_PUSH_AFTER_EOF:N,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:$},AbortError:q}=nr(),{validateObject:z}=Si(),L=p("kPaused"),{StringDecoder:te}=PP(),j=Lg();d(F.prototype,v.prototype),d(F,v);var se=()=>{},{errorOrDestroy:D}=k,U=1,xe=2,X=4,Ce=8,ne=16,Y=32,be=64,ce=128,pe=256,he=512,Te=1024,_e=2048,Z=4096,fe=8192,ie=16384,re=32768,ye=65536,J=1<<17,V=1<<18;function me(G){return{enumerable:!1,get(){return(this.state&G)!==0},set(le){le?this.state|=G:this.state&=~G}}}l(ee.prototype,{objectMode:me(U),ended:me(xe),endEmitted:me(X),reading:me(Ce),constructed:me(ne),sync:me(Y),needReadable:me(be),emittedReadable:me(ce),readableListening:me(pe),resumeScheduled:me(he),errorEmitted:me(Te),emitClose:me(_e),autoDestroy:me(Z),destroyed:me(fe),closed:me(ie),closeEmitted:me(re),multiAwaitDrain:me(ye),readingMore:me(J),dataEmitted:me(V)});function ee(G,le,ze){typeof ze!="boolean"&&(ze=le instanceof nn()),this.state=_e|Z|ne|Y,G&&G.objectMode&&(this.state|=U),ze&&G&&G.readableObjectMode&&(this.state|=U),this.highWaterMark=G?T(this,G,"readableHighWaterMark",ze):I(!1),this.buffer=new A,this.length=0,this.pipes=[],this.flowing=null,this[L]=null,G&&G.emitClose===!1&&(this.state&=~_e),G&&G.autoDestroy===!1&&(this.state&=~Z),this.errored=null,this.defaultEncoding=G&&G.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,G&&G.encoding&&(this.decoder=new te(G.encoding),this.encoding=G.encoding)}function F(G){if(!(this instanceof F))return new F(G);let le=this instanceof nn();this._readableState=new ee(G,this,le),G&&(typeof G.read=="function"&&(this._read=G.read),typeof G.destroy=="function"&&(this._destroy=G.destroy),typeof G.construct=="function"&&(this._construct=G.construct),G.signal&&!le&&S(G.signal,this)),v.call(this,G),k.construct(this,()=>{this._readableState.needReadable&&ae(this,this._readableState)})}F.prototype.destroy=k.destroy,F.prototype._undestroy=k.undestroy,F.prototype._destroy=function(G,le){le(G)},F.prototype[m.captureRejectionSymbol]=function(G){this.destroy(G)},F.prototype[h]=function(){let G;return this.destroyed||(G=this.readableEnded?null:new q,this.destroy(G)),new u((le,ze)=>_(this,je=>je&&je!==G?ze(je):le(null)))},F.prototype.push=function(G,le){return oe(this,G,le,!1)},F.prototype.unshift=function(G,le){return oe(this,G,le,!0)};function oe(G,le,ze,je){C("readableAddChunk",le);let qe=G._readableState,ke;if(!(qe.state&U)&&(typeof le=="string"?(ze=ze||qe.defaultEncoding,qe.encoding!==ze&&(je&&qe.encoding?le=b.from(le,ze).toString(qe.encoding):(le=b.from(le,ze),ze=""))):le instanceof b?ze="":v._isUint8Array(le)?(le=v._uint8ArrayToBuffer(le),ze=""):le!=null&&(ke=new B("chunk",["string","Buffer","Uint8Array"],le))),ke)D(G,ke);else if(le===null)qe.state&=~Ce,W(G,qe);else if(qe.state&U||le&&le.length>0)if(je)if(qe.state&X)D(G,new $);else{if(qe.destroyed||qe.errored)return!1;w(G,qe,le,!0)}else if(qe.ended)D(G,new N);else{if(qe.destroyed||qe.errored)return!1;qe.state&=~Ce,qe.decoder&&!ze?(le=qe.decoder.write(le),qe.objectMode||le.length!==0?w(G,qe,le,!1):ae(G,qe)):w(G,qe,le,!1)}else je||(qe.state&=~Ce,ae(G,qe));return!qe.ended&&(qe.length<qe.highWaterMark||qe.length===0)}function w(G,le,ze,je){le.flowing&&le.length===0&&!le.sync&&G.listenerCount("data")>0?(le.state&ye?le.awaitDrainWriters.clear():le.awaitDrainWriters=null,le.dataEmitted=!0,G.emit("data",ze)):(le.length+=le.objectMode?1:ze.length,je?le.buffer.unshift(ze):le.buffer.push(ze),le.state&be&&Q(G)),ae(G,le)}F.prototype.isPaused=function(){let G=this._readableState;return G[L]===!0||G.flowing===!1},F.prototype.setEncoding=function(G){let le=new te(G);this._readableState.decoder=le,this._readableState.encoding=this._readableState.decoder.encoding;let ze=this._readableState.buffer,je="";for(let qe of ze)je+=le.write(qe);return ze.clear(),je!==""&&ze.push(je),this._readableState.length=je.length,this};var x=1073741824;function E(G){if(G>x)throw new O("size","<= 1GiB",G);return G--,G|=G>>>1,G|=G>>>2,G|=G>>>4,G|=G>>>8,G|=G>>>16,G++,G}function M(G,le){return G<=0||le.length===0&&le.ended?0:le.state&U?1:a(G)?le.flowing&&le.length?le.buffer.first().length:le.length:G<=le.length?G:le.ended?le.length:0}F.prototype.read=function(G){C("read",G),G===void 0?G=NaN:i(G)||(G=s(G,10));let le=this._readableState,ze=G;if(G>le.highWaterMark&&(le.highWaterMark=E(G)),G!==0&&(le.state&=~ce),G===0&&le.needReadable&&((le.highWaterMark!==0?le.length>=le.highWaterMark:le.length>0)||le.ended))return C("read: emitReadable",le.length,le.ended),le.length===0&&le.ended?Ke(this):Q(this),null;if(G=M(G,le),G===0&&le.ended)return le.length===0&&Ke(this),null;let je=(le.state&be)!==0;if(C("need readable",je),(le.length===0||le.length-G<le.highWaterMark)&&(je=!0,C("length less than watermark",je)),le.ended||le.reading||le.destroyed||le.errored||!le.constructed)je=!1,C("reading, ended or constructing",je);else if(je){C("do read"),le.state|=Ce|Y,le.length===0&&(le.state|=be);try{this._read(le.highWaterMark)}catch(ke){D(this,ke)}le.state&=~Y,le.reading||(G=M(ze,le))}let qe;return G>0?qe=De(G,le):qe=null,qe===null?(le.needReadable=le.length<=le.highWaterMark,G=0):(le.length-=G,le.multiAwaitDrain?le.awaitDrainWriters.clear():le.awaitDrainWriters=null),le.length===0&&(le.ended||(le.needReadable=!0),ze!==G&&le.ended&&Ke(this)),qe!==null&&!le.errorEmitted&&!le.closeEmitted&&(le.dataEmitted=!0,this.emit("data",qe)),qe};function W(G,le){if(C("onEofChunk"),!le.ended){if(le.decoder){let ze=le.decoder.end();ze&&ze.length&&(le.buffer.push(ze),le.length+=le.objectMode?1:ze.length)}le.ended=!0,le.sync?Q(G):(le.needReadable=!1,le.emittedReadable=!0,we(G))}}function Q(G){let le=G._readableState;C("emitReadable",le.needReadable,le.emittedReadable),le.needReadable=!1,le.emittedReadable||(C("emitReadable",le.flowing),le.emittedReadable=!0,r.nextTick(we,G))}function we(G){let le=G._readableState;C("emitReadable_",le.destroyed,le.length,le.ended),!le.destroyed&&!le.errored&&(le.length||le.ended)&&(G.emit("readable"),le.emittedReadable=!1),le.needReadable=!le.flowing&&!le.ended&&le.length<=le.highWaterMark,We(G)}function ae(G,le){!le.readingMore&&le.constructed&&(le.readingMore=!0,r.nextTick(ge,G,le))}function ge(G,le){for(;!le.reading&&!le.ended&&(le.length<le.highWaterMark||le.flowing&&le.length===0);){let ze=le.length;if(C("maybeReadMore read 0"),G.read(0),ze===le.length)break}le.readingMore=!1}F.prototype._read=function(G){throw new P("_read()")},F.prototype.pipe=function(G,le){let ze=this,je=this._readableState;je.pipes.length===1&&(je.multiAwaitDrain||(je.multiAwaitDrain=!0,je.awaitDrainWriters=new f(je.awaitDrainWriters?[je.awaitDrainWriters]:[]))),je.pipes.push(G),C("pipe count=%d opts=%j",je.pipes.length,le);let qe=(!le||le.end!==!1)&&G!==r.stdout&&G!==r.stderr?$e:ir;je.endEmitted?r.nextTick(qe):ze.once("end",qe),G.on("unpipe",ke);function ke(Qt,gr){C("onunpipe"),Qt===ze&&gr&&gr.hasUnpiped===!1&&(gr.hasUnpiped=!0,ht())}function $e(){C("onend"),G.end()}let Ge,ot=!1;function ht(){C("cleanup"),G.removeListener("close",It),G.removeListener("finish",Jt),Ge&&G.removeListener("drain",Ge),G.removeListener("error",Mt),G.removeListener("unpipe",ke),ze.removeListener("end",$e),ze.removeListener("end",ir),ze.removeListener("data",Xt),ot=!0,Ge&&je.awaitDrainWriters&&(!G._writableState||G._writableState.needDrain)&&Ge()}function rt(){ot||(je.pipes.length===1&&je.pipes[0]===G?(C("false write response, pause",0),je.awaitDrainWriters=G,je.multiAwaitDrain=!1):je.pipes.length>1&&je.pipes.includes(G)&&(C("false write response, pause",je.awaitDrainWriters.size),je.awaitDrainWriters.add(G)),ze.pause()),Ge||(Ge=Be(ze,G),G.on("drain",Ge))}ze.on("data",Xt);function Xt(Qt){C("ondata");let gr=G.write(Qt);C("dest.write",gr),gr===!1&&rt()}function Mt(Qt){if(C("onerror",Qt),ir(),G.removeListener("error",Mt),G.listenerCount("error")===0){let gr=G._writableState||G._readableState;gr&&!gr.errorEmitted?D(G,Qt):G.emit("error",Qt)}}y(G,"error",Mt);function It(){G.removeListener("finish",Jt),ir()}G.once("close",It);function Jt(){C("onfinish"),G.removeListener("close",It),ir()}G.once("finish",Jt);function ir(){C("unpipe"),ze.unpipe(G)}return G.emit("pipe",ze),G.writableNeedDrain===!0?rt():je.flowing||(C("pipe resume"),ze.resume()),G};function Be(G,le){return function(){let ze=G._readableState;ze.awaitDrainWriters===le?(C("pipeOnDrain",1),ze.awaitDrainWriters=null):ze.multiAwaitDrain&&(C("pipeOnDrain",ze.awaitDrainWriters.size),ze.awaitDrainWriters.delete(le)),(!ze.awaitDrainWriters||ze.awaitDrainWriters.size===0)&&G.listenerCount("data")&&G.resume()}}F.prototype.unpipe=function(G){let le=this._readableState,ze={hasUnpiped:!1};if(le.pipes.length===0)return this;if(!G){let qe=le.pipes;le.pipes=[],this.pause();for(let ke=0;ke<qe.length;ke++)qe[ke].emit("unpipe",this,{hasUnpiped:!1});return this}let je=o(le.pipes,G);return je===-1?this:(le.pipes.splice(je,1),le.pipes.length===0&&this.pause(),G.emit("unpipe",this,ze),this)},F.prototype.on=function(G,le){let ze=v.prototype.on.call(this,G,le),je=this._readableState;return G==="data"?(je.readableListening=this.listenerCount("readable")>0,je.flowing!==!1&&this.resume()):G==="readable"&&!je.endEmitted&&!je.readableListening&&(je.readableListening=je.needReadable=!0,je.flowing=!1,je.emittedReadable=!1,C("on readable",je.length,je.reading),je.length?Q(this):je.reading||r.nextTick(ve,this)),ze},F.prototype.addListener=F.prototype.on,F.prototype.removeListener=function(G,le){let ze=v.prototype.removeListener.call(this,G,le);return G==="readable"&&r.nextTick(H,this),ze},F.prototype.off=F.prototype.removeListener,F.prototype.removeAllListeners=function(G){let le=v.prototype.removeAllListeners.apply(this,arguments);return(G==="readable"||G===void 0)&&r.nextTick(H,this),le};function H(G){let le=G._readableState;le.readableListening=G.listenerCount("readable")>0,le.resumeScheduled&&le[L]===!1?le.flowing=!0:G.listenerCount("data")>0?G.resume():le.readableListening||(le.flowing=null)}function ve(G){C("readable nexttick read 0"),G.read(0)}F.prototype.resume=function(){let G=this._readableState;return G.flowing||(C("resume"),G.flowing=!G.readableListening,Ae(this,G)),G[L]=!1,this};function Ae(G,le){le.resumeScheduled||(le.resumeScheduled=!0,r.nextTick(Le,G,le))}function Le(G,le){C("resume",le.reading),le.reading||G.read(0),le.resumeScheduled=!1,G.emit("resume"),We(G),le.flowing&&!le.reading&&G.read(0)}F.prototype.pause=function(){return C("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(C("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[L]=!0,this};function We(G){let le=G._readableState;for(C("flow",le.flowing);le.flowing&&G.read()!==null;);}F.prototype.wrap=function(G){let le=!1;G.on("data",je=>{!this.push(je)&&G.pause&&(le=!0,G.pause())}),G.on("end",()=>{this.push(null)}),G.on("error",je=>{D(this,je)}),G.on("close",()=>{this.destroy()}),G.on("destroy",()=>{this.destroy()}),this._read=()=>{le&&G.resume&&(le=!1,G.resume())};let ze=c(G);for(let je=1;je<ze.length;je++){let qe=ze[je];this[qe]===void 0&&typeof G[qe]=="function"&&(this[qe]=G[qe].bind(G))}return this},F.prototype[g]=function(){return Ve(this)},F.prototype.iterator=function(G){return G!==void 0&&z(G,"options"),Ve(this,G)};function Ve(G,le){typeof G.read!="function"&&(G=F.wrap(G,{objectMode:!0}));let ze=Ue(G,le);return ze.stream=G,ze}async function*Ue(G,le){let ze=se;function je($e){this===G?(ze(),ze=se):ze=$e}G.on("readable",je);let qe,ke=_(G,{writable:!1},$e=>{qe=$e?R(qe,$e):null,ze(),ze=se});try{for(;;){let $e=G.destroyed?null:G.read();if($e!==null)yield $e;else{if(qe)throw qe;if(qe===null)return;await new u(je)}}}catch($e){throw qe=R(qe,$e),qe}finally{(qe||(le==null?void 0:le.destroyOnReturn)!==!1)&&(qe===void 0||G._readableState.autoDestroy)?k.destroyer(G,null):(G.off("readable",je),ke())}}l(F.prototype,{readable:{__proto__:null,get(){let G=this._readableState;return!!G&&G.readable!==!1&&!G.destroyed&&!G.errorEmitted&&!G.endEmitted},set(G){this._readableState&&(this._readableState.readable=!!G)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(G){this._readableState&&(this._readableState.flowing=G)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(G){this._readableState&&(this._readableState.destroyed=G)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),l(ee.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[L]!==!1},set(G){this[L]=!!G}}}),F._fromList=De;function De(G,le){if(le.length===0)return null;let ze;return le.objectMode?ze=le.buffer.shift():!G||G>=le.length?(le.decoder?ze=le.buffer.join(""):le.buffer.length===1?ze=le.buffer.first():ze=le.buffer.concat(le.length),le.buffer.clear()):ze=le.buffer.consume(G,le.decoder),ze}function Ke(G){let le=G._readableState;C("endReadable",le.endEmitted),le.endEmitted||(le.ended=!0,r.nextTick(et,le,G))}function et(G,le){if(C("endReadableNT",G.endEmitted,G.length),!G.errored&&!G.closeEmitted&&!G.endEmitted&&G.length===0){if(G.endEmitted=!0,le.emit("end"),le.writable&&le.allowHalfOpen===!1)r.nextTick(ct,le);else if(G.autoDestroy){let ze=le._writableState;(!ze||ze.autoDestroy&&(ze.finished||ze.writable===!1))&&le.destroy()}}}function ct(G){G.writable&&!G.writableEnded&&!G.destroyed&&G.end()}F.from=function(G,le){return j(F,G,le)};var bt;function Pt(){return bt===void 0&&(bt={}),bt}F.fromWeb=function(G,le){return Pt().newStreamReadableFromReadableStream(G,le)},F.toWeb=function(G,le){return Pt().newReadableStreamFromStreamReadable(G,le)},F.wrap=function(G,le){var ze,je;return new F({objectMode:(ze=(je=G.readableObjectMode)!==null&&je!==void 0?je:G.objectMode)!==null&&ze!==void 0?ze:!0,...le,destroy(qe,ke){k.destroyer(G,qe),ke(qe)}}).wrap(G)}}),bd=Oe((e,t)=>{Ie(),Ne(),Re();var r=ro(),{ArrayPrototypeSlice:o,Error:i,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:s,ObjectDefineProperties:l,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:d,Symbol:u,SymbolHasInstance:f}=Tt();t.exports=z,z.WritableState=$;var{EventEmitter:h}=(to(),mt(Sn)),g=md().Stream,{Buffer:p}=(Vt(),mt(Ft)),m=No(),{addAbortSignal:v}=Ra(),{getHighWaterMark:y,getDefaultHighWaterMark:b}=Na(),{ERR_INVALID_ARG_TYPE:S,ERR_METHOD_NOT_IMPLEMENTED:_,ERR_MULTIPLE_CALLBACK:C,ERR_STREAM_CANNOT_PIPE:A,ERR_STREAM_DESTROYED:k,ERR_STREAM_ALREADY_FINISHED:T,ERR_STREAM_NULL_VALUES:I,ERR_STREAM_WRITE_AFTER_END:R,ERR_UNKNOWN_ENCODING:B}=nr().codes,{errorOrDestroy:P}=m;c(z.prototype,g.prototype),c(z,g);function O(){}var N=u("kOnFinished");function $(Z,fe,ie){typeof ie!="boolean"&&(ie=fe instanceof nn()),this.objectMode=!!(Z&&Z.objectMode),ie&&(this.objectMode=this.objectMode||!!(Z&&Z.writableObjectMode)),this.highWaterMark=Z?y(this,Z,"writableHighWaterMark",ie):b(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let re=!!(Z&&Z.decodeStrings===!1);this.decodeStrings=!re,this.defaultEncoding=Z&&Z.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=D.bind(void 0,fe),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,q(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!Z||Z.emitClose!==!1,this.autoDestroy=!Z||Z.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[N]=[]}function q(Z){Z.buffered=[],Z.bufferedIndex=0,Z.allBuffers=!0,Z.allNoop=!0}$.prototype.getBuffer=function(){return o(this.buffered,this.bufferedIndex)},s($.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function z(Z){let fe=this instanceof nn();if(!fe&&!a(z,this))return new z(Z);this._writableState=new $(Z,this,fe),Z&&(typeof Z.write=="function"&&(this._write=Z.write),typeof Z.writev=="function"&&(this._writev=Z.writev),typeof Z.destroy=="function"&&(this._destroy=Z.destroy),typeof Z.final=="function"&&(this._final=Z.final),typeof Z.construct=="function"&&(this._construct=Z.construct),Z.signal&&v(Z.signal,this)),g.call(this,Z),m.construct(this,()=>{let ie=this._writableState;ie.writing||Ce(this,ie),ce(this,ie)})}s(z,f,{__proto__:null,value:function(Z){return a(this,Z)?!0:this!==z?!1:Z&&Z._writableState instanceof $}}),z.prototype.pipe=function(){P(this,new A)};function L(Z,fe,ie,re){let ye=Z._writableState;if(typeof ie=="function")re=ie,ie=ye.defaultEncoding;else{if(!ie)ie=ye.defaultEncoding;else if(ie!=="buffer"&&!p.isEncoding(ie))throw new B(ie);typeof re!="function"&&(re=O)}if(fe===null)throw new I;if(!ye.objectMode)if(typeof fe=="string")ye.decodeStrings!==!1&&(fe=p.from(fe,ie),ie="buffer");else if(fe instanceof p)ie="buffer";else if(g._isUint8Array(fe))fe=g._uint8ArrayToBuffer(fe),ie="buffer";else throw new S("chunk",["string","Buffer","Uint8Array"],fe);let J;return ye.ending?J=new R:ye.destroyed&&(J=new k("write")),J?(r.nextTick(re,J),P(Z,J,!0),J):(ye.pendingcb++,te(Z,ye,fe,ie,re))}z.prototype.write=function(Z,fe,ie){return L(this,Z,fe,ie)===!0},z.prototype.cork=function(){this._writableState.corked++},z.prototype.uncork=function(){let Z=this._writableState;Z.corked&&(Z.corked--,Z.writing||Ce(this,Z))},z.prototype.setDefaultEncoding=function(Z){if(typeof Z=="string"&&(Z=d(Z)),!p.isEncoding(Z))throw new B(Z);return this._writableState.defaultEncoding=Z,this};function te(Z,fe,ie,re,ye){let J=fe.objectMode?1:ie.length;fe.length+=J;let V=fe.length<fe.highWaterMark;return V||(fe.needDrain=!0),fe.writing||fe.corked||fe.errored||!fe.constructed?(fe.buffered.push({chunk:ie,encoding:re,callback:ye}),fe.allBuffers&&re!=="buffer"&&(fe.allBuffers=!1),fe.allNoop&&ye!==O&&(fe.allNoop=!1)):(fe.writelen=J,fe.writecb=ye,fe.writing=!0,fe.sync=!0,Z._write(ie,re,fe.onwrite),fe.sync=!1),V&&!fe.errored&&!fe.destroyed}function j(Z,fe,ie,re,ye,J,V){fe.writelen=re,fe.writecb=V,fe.writing=!0,fe.sync=!0,fe.destroyed?fe.onwrite(new k("write")):ie?Z._writev(ye,fe.onwrite):Z._write(ye,J,fe.onwrite),fe.sync=!1}function se(Z,fe,ie,re){--fe.pendingcb,re(ie),X(fe),P(Z,ie)}function D(Z,fe){let ie=Z._writableState,re=ie.sync,ye=ie.writecb;if(typeof ye!="function"){P(Z,new C);return}ie.writing=!1,ie.writecb=null,ie.length-=ie.writelen,ie.writelen=0,fe?(fe.stack,ie.errored||(ie.errored=fe),Z._readableState&&!Z._readableState.errored&&(Z._readableState.errored=fe),re?r.nextTick(se,Z,ie,fe,ye):se(Z,ie,fe,ye)):(ie.buffered.length>ie.bufferedIndex&&Ce(Z,ie),re?ie.afterWriteTickInfo!==null&&ie.afterWriteTickInfo.cb===ye?ie.afterWriteTickInfo.count++:(ie.afterWriteTickInfo={count:1,cb:ye,stream:Z,state:ie},r.nextTick(U,ie.afterWriteTickInfo)):xe(Z,ie,1,ye))}function U({stream:Z,state:fe,count:ie,cb:re}){return fe.afterWriteTickInfo=null,xe(Z,fe,ie,re)}function xe(Z,fe,ie,re){for(!fe.ending&&!Z.destroyed&&fe.length===0&&fe.needDrain&&(fe.needDrain=!1,Z.emit("drain"));ie-- >0;)fe.pendingcb--,re();fe.destroyed&&X(fe),ce(Z,fe)}function X(Z){if(Z.writing)return;for(let ye=Z.bufferedIndex;ye<Z.buffered.length;++ye){var fe;let{chunk:J,callback:V}=Z.buffered[ye],me=Z.objectMode?1:J.length;Z.length-=me,V((fe=Z.errored)!==null&&fe!==void 0?fe:new k("write"))}let ie=Z[N].splice(0);for(let ye=0;ye<ie.length;ye++){var re;ie[ye]((re=Z.errored)!==null&&re!==void 0?re:new k("end"))}q(Z)}function Ce(Z,fe){if(fe.corked||fe.bufferProcessing||fe.destroyed||!fe.constructed)return;let{buffered:ie,bufferedIndex:re,objectMode:ye}=fe,J=ie.length-re;if(!J)return;let V=re;if(fe.bufferProcessing=!0,J>1&&Z._writev){fe.pendingcb-=J-1;let me=fe.allNoop?O:F=>{for(let oe=V;oe<ie.length;++oe)ie[oe].callback(F)},ee=fe.allNoop&&V===0?ie:o(ie,V);ee.allBuffers=fe.allBuffers,j(Z,fe,!0,fe.length,ee,"",me),q(fe)}else{do{let{chunk:me,encoding:ee,callback:F}=ie[V];ie[V++]=null;let oe=ye?1:me.length;j(Z,fe,!1,oe,me,ee,F)}while(V<ie.length&&!fe.writing);V===ie.length?q(fe):V>256?(ie.splice(0,V),fe.bufferedIndex=0):fe.bufferedIndex=V}fe.bufferProcessing=!1}z.prototype._write=function(Z,fe,ie){if(this._writev)this._writev([{chunk:Z,encoding:fe}],ie);else throw new _("_write()")},z.prototype._writev=null,z.prototype.end=function(Z,fe,ie){let re=this._writableState;typeof Z=="function"?(ie=Z,Z=null,fe=null):typeof fe=="function"&&(ie=fe,fe=null);let ye;if(Z!=null){let J=L(this,Z,fe);J instanceof i&&(ye=J)}return re.corked&&(re.corked=1,this.uncork()),ye||(!re.errored&&!re.ending?(re.ending=!0,ce(this,re,!0),re.ended=!0):re.finished?ye=new T("end"):re.destroyed&&(ye=new k("end"))),typeof ie=="function"&&(ye||re.finished?r.nextTick(ie,ye):re[N].push(ie)),this};function ne(Z){return Z.ending&&!Z.destroyed&&Z.constructed&&Z.length===0&&!Z.errored&&Z.buffered.length===0&&!Z.finished&&!Z.writing&&!Z.errorEmitted&&!Z.closeEmitted}function Y(Z,fe){let ie=!1;function re(ye){if(ie){P(Z,ye??C());return}if(ie=!0,fe.pendingcb--,ye){let J=fe[N].splice(0);for(let V=0;V<J.length;V++)J[V](ye);P(Z,ye,fe.sync)}else ne(fe)&&(fe.prefinished=!0,Z.emit("prefinish"),fe.pendingcb++,r.nextTick(pe,Z,fe))}fe.sync=!0,fe.pendingcb++;try{Z._final(re)}catch(ye){re(ye)}fe.sync=!1}function be(Z,fe){!fe.prefinished&&!fe.finalCalled&&(typeof Z._final=="function"&&!fe.destroyed?(fe.finalCalled=!0,Y(Z,fe)):(fe.prefinished=!0,Z.emit("prefinish")))}function ce(Z,fe,ie){ne(fe)&&(be(Z,fe),fe.pendingcb===0&&(ie?(fe.pendingcb++,r.nextTick((re,ye)=>{ne(ye)?pe(re,ye):ye.pendingcb--},Z,fe)):ne(fe)&&(fe.pendingcb++,pe(Z,fe))))}function pe(Z,fe){fe.pendingcb--,fe.finished=!0;let ie=fe[N].splice(0);for(let re=0;re<ie.length;re++)ie[re]();if(Z.emit("finish"),fe.autoDestroy){let re=Z._readableState;(!re||re.autoDestroy&&(re.endEmitted||re.readable===!1))&&Z.destroy()}}l(z.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(Z){this._writableState&&(this._writableState.destroyed=Z)}},writable:{__proto__:null,get(){let Z=this._writableState;return!!Z&&Z.writable!==!1&&!Z.destroyed&&!Z.errored&&!Z.ending&&!Z.ended},set(Z){this._writableState&&(this._writableState.writable=!!Z)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let Z=this._writableState;return Z?!Z.destroyed&&!Z.ending&&Z.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var he=m.destroy;z.prototype.destroy=function(Z,fe){let ie=this._writableState;return!ie.destroyed&&(ie.bufferedIndex<ie.buffered.length||ie[N].length)&&r.nextTick(X,ie),he.call(this,Z,fe),this},z.prototype._undestroy=m.undestroy,z.prototype._destroy=function(Z,fe){fe(Z)},z.prototype[h.captureRejectionSymbol]=function(Z){this.destroy(Z)};var Te;function _e(){return Te===void 0&&(Te={}),Te}z.fromWeb=function(Z,fe){return _e().newStreamWritableFromWritableStream(Z,fe)},z.toWeb=function(Z){return _e().newWritableStreamFromStreamWritable(Z)}}),IP=Oe((e,t)=>{Ie(),Ne(),Re();var r=ro(),o=(Vt(),mt(Ft)),{isReadable:i,isWritable:a,isIterable:s,isNodeStream:l,isReadableNodeStream:c,isWritableNodeStream:d,isDuplexNodeStream:u,isReadableStream:f,isWritableStream:h}=rn(),g=_n(),{AbortError:p,codes:{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_RETURN_VALUE:v}}=nr(),{destroyer:y}=No(),b=nn(),S=$a(),_=bd(),{createDeferredPromise:C}=dr(),A=Lg(),k=globalThis.Blob||o.Blob,T=typeof k<"u"?function(N){return N instanceof k}:function(N){return!1},I=globalThis.AbortController||xi().AbortController,{FunctionPrototypeCall:R}=Tt(),B=class extends b{constructor(N){super(N),(N==null?void 0:N.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(N==null?void 0:N.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};t.exports=function N($,q){if(u($))return $;if(c($))return O({readable:$});if(d($))return O({writable:$});if(l($))return O({writable:!1,readable:!1});if(f($))return O({readable:S.fromWeb($)});if(h($))return O({writable:_.fromWeb($)});if(typeof $=="function"){let{value:L,write:te,final:j,destroy:se}=P($);if(s(L))return A(B,L,{objectMode:!0,write:te,final:j,destroy:se});let D=L==null?void 0:L.then;if(typeof D=="function"){let U,xe=R(D,L,X=>{if(X!=null)throw new v("nully","body",X)},X=>{y(U,X)});return U=new B({objectMode:!0,readable:!1,write:te,final(X){j(async()=>{try{await xe,r.nextTick(X,null)}catch(Ce){r.nextTick(X,Ce)}})},destroy:se})}throw new v("Iterable, AsyncIterable or AsyncFunction",q,L)}if(T($))return N($.arrayBuffer());if(s($))return A(B,$,{objectMode:!0,writable:!1});if(f($==null?void 0:$.readable)&&h($==null?void 0:$.writable))return B.fromWeb($);if(typeof($==null?void 0:$.writable)=="object"||typeof($==null?void 0:$.readable)=="object"){let L=$!=null&&$.readable?c($==null?void 0:$.readable)?$==null?void 0:$.readable:N($.readable):void 0,te=$!=null&&$.writable?d($==null?void 0:$.writable)?$==null?void 0:$.writable:N($.writable):void 0;return O({readable:L,writable:te})}let z=$==null?void 0:$.then;if(typeof z=="function"){let L;return R(z,$,te=>{te!=null&&L.push(te),L.push(null)},te=>{y(L,te)}),L=new B({objectMode:!0,writable:!1,read(){}})}throw new m(q,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],$)};function P(N){let{promise:$,resolve:q}=C(),z=new I,L=z.signal;return{value:N(async function*(){for(;;){let te=$;$=null;let{chunk:j,done:se,cb:D}=await te;if(r.nextTick(D),se)return;if(L.aborted)throw new p(void 0,{cause:L.reason});({promise:$,resolve:q}=C()),yield j}}(),{signal:L}),write(te,j,se){let D=q;q=null,D({chunk:te,done:!1,cb:se})},final(te){let j=q;q=null,j({done:!0,cb:te})},destroy(te,j){z.abort(),j(te)}}}function O(N){let $=N.readable&&typeof N.readable.read!="function"?S.wrap(N.readable):N.readable,q=N.writable,z=!!i($),L=!!a(q),te,j,se,D,U;function xe(X){let Ce=D;D=null,Ce?Ce(X):X&&U.destroy(X)}return U=new B({readableObjectMode:!!($!=null&&$.readableObjectMode),writableObjectMode:!!(q!=null&&q.writableObjectMode),readable:z,writable:L}),L&&(g(q,X=>{L=!1,X&&y($,X),xe(X)}),U._write=function(X,Ce,ne){q.write(X,Ce)?ne():te=ne},U._final=function(X){q.end(),j=X},q.on("drain",function(){if(te){let X=te;te=null,X()}}),q.on("finish",function(){if(j){let X=j;j=null,X()}})),z&&(g($,X=>{z=!1,X&&y($,X),xe(X)}),$.on("readable",function(){if(se){let X=se;se=null,X()}}),$.on("end",function(){U.push(null)}),U._read=function(){for(;;){let X=$.read();if(X===null){se=U._read;return}if(!U.push(X))return}}),U._destroy=function(X,Ce){!X&&D!==null&&(X=new p),se=null,te=null,j=null,D===null?Ce(X):(D=Ce,y(q,X),y($,X))},U}}),nn=Oe((e,t)=>{Ie(),Ne(),Re();var{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:o,ObjectKeys:i,ObjectSetPrototypeOf:a}=Tt();t.exports=c;var s=$a(),l=bd();a(c.prototype,s.prototype),a(c,s);{let h=i(l.prototype);for(let g=0;g<h.length;g++){let p=h[g];c.prototype[p]||(c.prototype[p]=l.prototype[p])}}function c(h){if(!(this instanceof c))return new c(h);s.call(this,h),l.call(this,h),h?(this.allowHalfOpen=h.allowHalfOpen!==!1,h.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),h.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}r(c.prototype,{writable:{__proto__:null,...o(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...o(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...o(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...o(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...o(l.prototype,"writableLength")},writableFinished:{__proto__:null,...o(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...o(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...o(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...o(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(h){this._readableState&&this._writableState&&(this._readableState.destroyed=h,this._writableState.destroyed=h)}}});var d;function u(){return d===void 0&&(d={}),d}c.fromWeb=function(h,g){return u().newStreamDuplexFromReadableWritablePair(h,g)},c.toWeb=function(h){return u().newReadableWritablePairFromDuplex(h)};var f;c.from=function(h){return f||(f=IP()),f(h,"body")}}),jg=Oe((e,t)=>{Ie(),Ne(),Re();var{ObjectSetPrototypeOf:r,Symbol:o}=Tt();t.exports=c;var{ERR_METHOD_NOT_IMPLEMENTED:i}=nr().codes,a=nn(),{getHighWaterMark:s}=Na();r(c.prototype,a.prototype),r(c,a);var l=o("kCallback");function c(f){if(!(this instanceof c))return new c(f);let h=f?s(this,f,"readableHighWaterMark",!0):null;h===0&&(f={...f,highWaterMark:null,readableHighWaterMark:h,writableHighWaterMark:f.writableHighWaterMark||0}),a.call(this,f),this._readableState.sync=!1,this[l]=null,f&&(typeof f.transform=="function"&&(this._transform=f.transform),typeof f.flush=="function"&&(this._flush=f.flush)),this.on("prefinish",u)}function d(f){typeof this._flush=="function"&&!this.destroyed?this._flush((h,g)=>{if(h){f?f(h):this.destroy(h);return}g!=null&&this.push(g),this.push(null),f&&f()}):(this.push(null),f&&f())}function u(){this._final!==d&&d.call(this)}c.prototype._final=d,c.prototype._transform=function(f,h,g){throw new i("_transform()")},c.prototype._write=function(f,h,g){let p=this._readableState,m=this._writableState,v=p.length;this._transform(f,h,(y,b)=>{if(y){g(y);return}b!=null&&this.push(b),m.ended||v===p.length||p.length<p.highWaterMark?g():this[l]=g})},c.prototype._read=function(){if(this[l]){let f=this[l];this[l]=null,f()}}}),Ug=Oe((e,t)=>{Ie(),Ne(),Re();var{ObjectSetPrototypeOf:r}=Tt();t.exports=i;var o=jg();r(i.prototype,o.prototype),r(i,o);function i(a){if(!(this instanceof i))return new i(a);o.call(this,a)}i.prototype._transform=function(a,s,l){l(null,a)}}),yd=Oe((e,t)=>{Ie(),Ne(),Re();var r=ro(),{ArrayIsArray:o,Promise:i,SymbolAsyncIterator:a,SymbolDispose:s}=Tt(),l=_n(),{once:c}=dr(),d=No(),u=nn(),{aggregateTwoErrors:f,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:p,ERR_STREAM_DESTROYED:m,ERR_STREAM_PREMATURE_CLOSE:v},AbortError:y}=nr(),{validateFunction:b,validateAbortSignal:S}=Si(),{isIterable:_,isReadable:C,isReadableNodeStream:A,isNodeStream:k,isTransformStream:T,isWebStream:I,isReadableStream:R,isReadableFinished:B}=rn(),P=globalThis.AbortController||xi().AbortController,O,N,$;function q(X,Ce,ne){let Y=!1;X.on("close",()=>{Y=!0});let be=l(X,{readable:Ce,writable:ne},ce=>{Y=!ce});return{destroy:ce=>{Y||(Y=!0,d.destroyer(X,ce||new m("pipe")))},cleanup:be}}function z(X){return b(X[X.length-1],"streams[stream.length - 1]"),X.pop()}function L(X){if(_(X))return X;if(A(X))return te(X);throw new h("val",["Readable","Iterable","AsyncIterable"],X)}async function*te(X){N||(N=$a()),yield*N.prototype[a].call(X)}async function j(X,Ce,ne,{end:Y}){let be,ce=null,pe=_e=>{if(_e&&(be=_e),ce){let Z=ce;ce=null,Z()}},he=()=>new i((_e,Z)=>{be?Z(be):ce=()=>{be?Z(be):_e()}});Ce.on("drain",pe);let Te=l(Ce,{readable:!1},pe);try{Ce.writableNeedDrain&&await he();for await(let _e of X)Ce.write(_e)||await he();Y&&(Ce.end(),await he()),ne()}catch(_e){ne(be!==_e?f(be,_e):_e)}finally{Te(),Ce.off("drain",pe)}}async function se(X,Ce,ne,{end:Y}){T(Ce)&&(Ce=Ce.writable);let be=Ce.getWriter();try{for await(let ce of X)await be.ready,be.write(ce).catch(()=>{});await be.ready,Y&&await be.close(),ne()}catch(ce){try{await be.abort(ce),ne(ce)}catch(pe){ne(pe)}}}function D(...X){return U(X,c(z(X)))}function U(X,Ce,ne){if(X.length===1&&o(X[0])&&(X=X[0]),X.length<2)throw new p("streams");let Y=new P,be=Y.signal,ce=ne==null?void 0:ne.signal,pe=[];S(ce,"options.signal");function he(){ye(new y)}$=$||dr().addAbortListener;let Te;ce&&(Te=$(ce,he));let _e,Z,fe=[],ie=0;function re(ee){ye(ee,--ie===0)}function ye(ee,F){var oe;if(ee&&(!_e||_e.code==="ERR_STREAM_PREMATURE_CLOSE")&&(_e=ee),!(!_e&&!F)){for(;fe.length;)fe.shift()(_e);(oe=Te)===null||oe===void 0||oe[s](),Y.abort(),F&&(_e||pe.forEach(w=>w()),r.nextTick(Ce,_e,Z))}}let J;for(let ee=0;ee<X.length;ee++){let F=X[ee],oe=ee<X.length-1,w=ee>0,x=oe||(ne==null?void 0:ne.end)!==!1,E=ee===X.length-1;if(k(F)){let M=function(W){W&&W.name!=="AbortError"&&W.code!=="ERR_STREAM_PREMATURE_CLOSE"&&re(W)};if(x){let{destroy:W,cleanup:Q}=q(F,oe,w);fe.push(W),C(F)&&E&&pe.push(Q)}F.on("error",M),C(F)&&E&&pe.push(()=>{F.removeListener("error",M)})}if(ee===0)if(typeof F=="function"){if(J=F({signal:be}),!_(J))throw new g("Iterable, AsyncIterable or Stream","source",J)}else _(F)||A(F)||T(F)?J=F:J=u.from(F);else if(typeof F=="function"){if(T(J)){var V;J=L((V=J)===null||V===void 0?void 0:V.readable)}else J=L(J);if(J=F(J,{signal:be}),oe){if(!_(J,!0))throw new g("AsyncIterable",`transform[${ee-1}]`,J)}else{var me;O||(O=Ug());let M=new O({objectMode:!0}),W=(me=J)===null||me===void 0?void 0:me.then;if(typeof W=="function")ie++,W.call(J,ae=>{Z=ae,ae!=null&&M.write(ae),x&&M.end(),r.nextTick(re)},ae=>{M.destroy(ae),r.nextTick(re,ae)});else if(_(J,!0))ie++,j(J,M,re,{end:x});else if(R(J)||T(J)){let ae=J.readable||J;ie++,j(ae,M,re,{end:x})}else throw new g("AsyncIterable or Promise","destination",J);J=M;let{destroy:Q,cleanup:we}=q(J,!1,!0);fe.push(Q),E&&pe.push(we)}}else if(k(F)){if(A(J)){ie+=2;let M=xe(J,F,re,{end:x});C(F)&&E&&pe.push(M)}else if(T(J)||R(J)){let M=J.readable||J;ie++,j(M,F,re,{end:x})}else if(_(J))ie++,j(J,F,re,{end:x});else throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],J);J=F}else if(I(F)){if(A(J))ie++,se(L(J),F,re,{end:x});else if(R(J)||_(J))ie++,se(J,F,re,{end:x});else if(T(J))ie++,se(J.readable,F,re,{end:x});else throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],J);J=F}else J=u.from(F)}return(be!=null&&be.aborted||ce!=null&&ce.aborted)&&r.nextTick(he),J}function xe(X,Ce,ne,{end:Y}){let be=!1;if(Ce.on("close",()=>{be||ne(new v)}),X.pipe(Ce,{end:!1}),Y){let ce=function(){be=!0,Ce.end()};B(X)?r.nextTick(ce):X.once("end",ce)}else ne();return l(X,{readable:!0,writable:!1},ce=>{let pe=X._readableState;ce&&ce.code==="ERR_STREAM_PREMATURE_CLOSE"&&pe&&pe.ended&&!pe.errored&&!pe.errorEmitted?X.once("end",ne).once("error",ne):ne(ce)}),l(Ce,{readable:!1,writable:!0},ne)}t.exports={pipelineImpl:U,pipeline:D}}),Wg=Oe((e,t)=>{Ie(),Ne(),Re();var{pipeline:r}=yd(),o=nn(),{destroyer:i}=No(),{isNodeStream:a,isReadable:s,isWritable:l,isWebStream:c,isTransformStream:d,isWritableStream:u,isReadableStream:f}=rn(),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:g,ERR_MISSING_ARGS:p}}=nr(),m=_n();t.exports=function(...v){if(v.length===0)throw new p("streams");if(v.length===1)return o.from(v[0]);let y=[...v];if(typeof v[0]=="function"&&(v[0]=o.from(v[0])),typeof v[v.length-1]=="function"){let P=v.length-1;v[P]=o.from(v[P])}for(let P=0;P<v.length;++P)if(!(!a(v[P])&&!c(v[P]))){if(P<v.length-1&&!(s(v[P])||f(v[P])||d(v[P])))throw new g(`streams[${P}]`,y[P],"must be readable");if(P>0&&!(l(v[P])||u(v[P])||d(v[P])))throw new g(`streams[${P}]`,y[P],"must be writable")}let b,S,_,C,A;function k(P){let O=C;C=null,O?O(P):P?A.destroy(P):!B&&!R&&A.destroy()}let T=v[0],I=r(v,k),R=!!(l(T)||u(T)||d(T)),B=!!(s(I)||f(I)||d(I));if(A=new o({writableObjectMode:!!(T!=null&&T.writableObjectMode),readableObjectMode:!!(I!=null&&I.readableObjectMode),writable:R,readable:B}),R){if(a(T))A._write=function(O,N,$){T.write(O,N)?$():b=$},A._final=function(O){T.end(),S=O},T.on("drain",function(){if(b){let O=b;b=null,O()}});else if(c(T)){let O=(d(T)?T.writable:T).getWriter();A._write=async function(N,$,q){try{await O.ready,O.write(N).catch(()=>{}),q()}catch(z){q(z)}},A._final=async function(N){try{await O.ready,O.close().catch(()=>{}),S=N}catch($){N($)}}}let P=d(I)?I.readable:I;m(P,()=>{if(S){let O=S;S=null,O()}})}if(B){if(a(I))I.on("readable",function(){if(_){let P=_;_=null,P()}}),I.on("end",function(){A.push(null)}),A._read=function(){for(;;){let P=I.read();if(P===null){_=A._read;return}if(!A.push(P))return}};else if(c(I)){let P=(d(I)?I.readable:I).getReader();A._read=async function(){for(;;)try{let{value:O,done:N}=await P.read();if(!A.push(O))return;if(N){A.push(null);return}}catch{return}}}}return A._destroy=function(P,O){!P&&C!==null&&(P=new h),_=null,b=null,S=null,C===null?O(P):(C=O,a(I)&&i(I,P))},A}}),RP=Oe((e,t)=>{Ie(),Ne(),Re();var r=globalThis.AbortController||xi().AbortController,{codes:{ERR_INVALID_ARG_VALUE:o,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:s},AbortError:l}=nr(),{validateAbortSignal:c,validateInteger:d,validateObject:u}=Si(),f=Tt().Symbol("kWeak"),h=Tt().Symbol("kResistStopPropagation"),{finished:g}=_n(),p=Wg(),{addAbortSignalNoValidate:m}=Ra(),{isWritable:v,isNodeStream:y}=rn(),{deprecate:b}=dr(),{ArrayPrototypePush:S,Boolean:_,MathFloor:C,Number:A,NumberIsNaN:k,Promise:T,PromiseReject:I,PromiseResolve:R,PromisePrototypeThen:B,Symbol:P}=Tt(),O=P("kEmpty"),N=P("kEof");function $(ce,pe){if(pe!=null&&u(pe,"options"),(pe==null?void 0:pe.signal)!=null&&c(pe.signal,"options.signal"),y(ce)&&!v(ce))throw new o("stream",ce,"must be writable");let he=p(this,ce);return pe!=null&&pe.signal&&m(pe.signal,he),he}function q(ce,pe){if(typeof ce!="function")throw new i("fn",["Function","AsyncFunction"],ce);pe!=null&&u(pe,"options"),(pe==null?void 0:pe.signal)!=null&&c(pe.signal,"options.signal");let he=1;(pe==null?void 0:pe.concurrency)!=null&&(he=C(pe.concurrency));let Te=he-1;return(pe==null?void 0:pe.highWaterMark)!=null&&(Te=C(pe.highWaterMark)),d(he,"options.concurrency",1),d(Te,"options.highWaterMark",0),Te+=he,(async function*(){let _e=dr().AbortSignalAny([pe==null?void 0:pe.signal].filter(_)),Z=this,fe=[],ie={signal:_e},re,ye,J=!1,V=0;function me(){J=!0,ee()}function ee(){V-=1,F()}function F(){ye&&!J&&V<he&&fe.length<Te&&(ye(),ye=null)}async function oe(){try{for await(let w of Z){if(J)return;if(_e.aborted)throw new l;try{if(w=ce(w,ie),w===O)continue;w=R(w)}catch(x){w=I(x)}V+=1,B(w,ee,me),fe.push(w),re&&(re(),re=null),!J&&(fe.length>=Te||V>=he)&&await new T(x=>{ye=x})}fe.push(N)}catch(w){let x=I(w);B(x,ee,me),fe.push(x)}finally{J=!0,re&&(re(),re=null)}}oe();try{for(;;){for(;fe.length>0;){let w=await fe[0];if(w===N)return;if(_e.aborted)throw new l;w!==O&&(yield w),fe.shift(),F()}await new T(w=>{re=w})}}finally{J=!0,ye&&(ye(),ye=null)}}).call(this)}function z(ce=void 0){return ce!=null&&u(ce,"options"),(ce==null?void 0:ce.signal)!=null&&c(ce.signal,"options.signal"),(async function*(){let pe=0;for await(let Te of this){var he;if(ce!=null&&(he=ce.signal)!==null&&he!==void 0&&he.aborted)throw new l({cause:ce.signal.reason});yield[pe++,Te]}}).call(this)}async function L(ce,pe=void 0){for await(let he of D.call(this,ce,pe))return!0;return!1}async function te(ce,pe=void 0){if(typeof ce!="function")throw new i("fn",["Function","AsyncFunction"],ce);return!await L.call(this,async(...he)=>!await ce(...he),pe)}async function j(ce,pe){for await(let he of D.call(this,ce,pe))return he}async function se(ce,pe){if(typeof ce!="function")throw new i("fn",["Function","AsyncFunction"],ce);async function he(Te,_e){return await ce(Te,_e),O}for await(let Te of q.call(this,he,pe));}function D(ce,pe){if(typeof ce!="function")throw new i("fn",["Function","AsyncFunction"],ce);async function he(Te,_e){return await ce(Te,_e)?Te:O}return q.call(this,he,pe)}var U=class extends a{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function xe(ce,pe,he){var Te;if(typeof ce!="function")throw new i("reducer",["Function","AsyncFunction"],ce);he!=null&&u(he,"options"),(he==null?void 0:he.signal)!=null&&c(he.signal,"options.signal");let _e=arguments.length>1;if(he!=null&&(Te=he.signal)!==null&&Te!==void 0&&Te.aborted){let ye=new l(void 0,{cause:he.signal.reason});throw this.once("error",()=>{}),await g(this.destroy(ye)),ye}let Z=new r,fe=Z.signal;if(he!=null&&he.signal){let ye={once:!0,[f]:this,[h]:!0};he.signal.addEventListener("abort",()=>Z.abort(),ye)}let ie=!1;try{for await(let ye of this){var re;if(ie=!0,he!=null&&(re=he.signal)!==null&&re!==void 0&&re.aborted)throw new l;_e?pe=await ce(pe,ye,{signal:fe}):(pe=ye,_e=!0)}if(!ie&&!_e)throw new U}finally{Z.abort()}return pe}async function X(ce){ce!=null&&u(ce,"options"),(ce==null?void 0:ce.signal)!=null&&c(ce.signal,"options.signal");let pe=[];for await(let Te of this){var he;if(ce!=null&&(he=ce.signal)!==null&&he!==void 0&&he.aborted)throw new l(void 0,{cause:ce.signal.reason});S(pe,Te)}return pe}function Ce(ce,pe){let he=q.call(this,ce,pe);return(async function*(){for await(let Te of he)yield*Te}).call(this)}function ne(ce){if(ce=A(ce),k(ce))return 0;if(ce<0)throw new s("number",">= 0",ce);return ce}function Y(ce,pe=void 0){return pe!=null&&u(pe,"options"),(pe==null?void 0:pe.signal)!=null&&c(pe.signal,"options.signal"),ce=ne(ce),(async function*(){var he;if(pe!=null&&(he=pe.signal)!==null&&he!==void 0&&he.aborted)throw new l;for await(let _e of this){var Te;if(pe!=null&&(Te=pe.signal)!==null&&Te!==void 0&&Te.aborted)throw new l;ce--<=0&&(yield _e)}}).call(this)}function be(ce,pe=void 0){return pe!=null&&u(pe,"options"),(pe==null?void 0:pe.signal)!=null&&c(pe.signal,"options.signal"),ce=ne(ce),(async function*(){var he;if(pe!=null&&(he=pe.signal)!==null&&he!==void 0&&he.aborted)throw new l;for await(let _e of this){var Te;if(pe!=null&&(Te=pe.signal)!==null&&Te!==void 0&&Te.aborted)throw new l;if(ce-- >0&&(yield _e),ce<=0)return}}).call(this)}t.exports.streamReturningOperators={asIndexedPairs:b(z,"readable.asIndexedPairs will be removed in a future version."),drop:Y,filter:D,flatMap:Ce,map:q,take:be,compose:$},t.exports.promiseReturningOperators={every:te,forEach:se,reduce:xe,toArray:X,some:L,find:j}}),Hg=Oe((e,t)=>{Ie(),Ne(),Re();var{ArrayPrototypePop:r,Promise:o}=Tt(),{isIterable:i,isNodeStream:a,isWebStream:s}=rn(),{pipelineImpl:l}=yd(),{finished:c}=_n();qg();function d(...u){return new o((f,h)=>{let g,p,m=u[u.length-1];if(m&&typeof m=="object"&&!a(m)&&!i(m)&&!s(m)){let v=r(u);g=v.signal,p=v.end}l(u,(v,y)=>{v?h(v):f(y)},{signal:g,end:p})})}t.exports={finished:c,pipeline:d}}),qg=Oe((e,t)=>{Ie(),Ne(),Re();var{Buffer:r}=(Vt(),mt(Ft)),{ObjectDefineProperty:o,ObjectKeys:i,ReflectApply:a}=Tt(),{promisify:{custom:s}}=dr(),{streamReturningOperators:l,promiseReturningOperators:c}=RP(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:d}}=nr(),u=Wg(),{setDefaultHighWaterMark:f,getDefaultHighWaterMark:h}=Na(),{pipeline:g}=yd(),{destroyer:p}=No(),m=_n(),v=Hg(),y=rn(),b=t.exports=md().Stream;b.isDestroyed=y.isDestroyed,b.isDisturbed=y.isDisturbed,b.isErrored=y.isErrored,b.isReadable=y.isReadable,b.isWritable=y.isWritable,b.Readable=$a();for(let _ of i(l)){let C=function(...k){if(new.target)throw d();return b.Readable.from(a(A,this,k))},A=l[_];o(C,"name",{__proto__:null,value:A.name}),o(C,"length",{__proto__:null,value:A.length}),o(b.Readable.prototype,_,{__proto__:null,value:C,enumerable:!1,configurable:!0,writable:!0})}for(let _ of i(c)){let C=function(...k){if(new.target)throw d();return a(A,this,k)},A=c[_];o(C,"name",{__proto__:null,value:A.name}),o(C,"length",{__proto__:null,value:A.length}),o(b.Readable.prototype,_,{__proto__:null,value:C,enumerable:!1,configurable:!0,writable:!0})}b.Writable=bd(),b.Duplex=nn(),b.Transform=jg(),b.PassThrough=Ug(),b.pipeline=g;var{addAbortSignal:S}=Ra();b.addAbortSignal=S,b.finished=m,b.destroy=p,b.compose=u,b.setDefaultHighWaterMark=f,b.getDefaultHighWaterMark=h,o(b,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return v}}),o(g,s,{__proto__:null,enumerable:!0,get(){return v.pipeline}}),o(m,s,{__proto__:null,enumerable:!0,get(){return v.finished}}),b.Stream=b,b._isUint8Array=function(_){return _ instanceof Uint8Array},b._uint8ArrayToBuffer=function(_){return r.from(_.buffer,_.byteOffset,_.byteLength)}}),no=Oe((e,t)=>{Ie(),Ne(),Re();var r=qg(),o=Hg(),i=r.Readable.destroy;t.exports=r.Readable,t.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,t.exports._isUint8Array=r._isUint8Array,t.exports.isDisturbed=r.isDisturbed,t.exports.isErrored=r.isErrored,t.exports.isReadable=r.isReadable,t.exports.Readable=r.Readable,t.exports.Writable=r.Writable,t.exports.Duplex=r.Duplex,t.exports.Transform=r.Transform,t.exports.PassThrough=r.PassThrough,t.exports.addAbortSignal=r.addAbortSignal,t.exports.finished=r.finished,t.exports.destroy=r.destroy,t.exports.destroy=i,t.exports.pipeline=r.pipeline,t.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get(){return o}}),t.exports.Stream=r.Stream,t.exports.default=t.exports}),NP=Oe((e,t)=>{Ie(),Ne(),Re(),typeof Object.create=="function"?t.exports=function(r,o){o&&(r.super_=o,r.prototype=Object.create(o.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,o){if(o){r.super_=o;var i=function(){};i.prototype=o.prototype,r.prototype=new i,r.prototype.constructor=r}}}),$P=Oe((e,t)=>{Ie(),Ne(),Re();var{Buffer:r}=(Vt(),mt(Ft)),o=Symbol.for("BufferList");function i(a){if(!(this instanceof i))return new i(a);i._init.call(this,a)}i._init=function(a){Object.defineProperty(this,o,{value:!0}),this._bufs=[],this.length=0,a&&this.append(a)},i.prototype._new=function(a){return new i(a)},i.prototype._offset=function(a){if(a===0)return[0,0];let s=0;for(let l=0;l<this._bufs.length;l++){let c=s+this._bufs[l].length;if(a<c||l===this._bufs.length-1)return[l,a-s];s=c}},i.prototype._reverseOffset=function(a){let s=a[0],l=a[1];for(let c=0;c<s;c++)l+=this._bufs[c].length;return l},i.prototype.getBuffers=function(){return this._bufs},i.prototype.get=function(a){if(a>this.length||a<0)return;let s=this._offset(a);return this._bufs[s[0]][s[1]]},i.prototype.slice=function(a,s){return typeof a=="number"&&a<0&&(a+=this.length),typeof s=="number"&&s<0&&(s+=this.length),this.copy(null,0,a,s)},i.prototype.copy=function(a,s,l,c){if((typeof l!="number"||l<0)&&(l=0),(typeof c!="number"||c>this.length)&&(c=this.length),l>=this.length||c<=0)return a||r.alloc(0);let d=!!a,u=this._offset(l),f=c-l,h=f,g=d&&s||0,p=u[1];if(l===0&&c===this.length){if(!d)return this._bufs.length===1?this._bufs[0]:r.concat(this._bufs,this.length);for(let m=0;m<this._bufs.length;m++)this._bufs[m].copy(a,g),g+=this._bufs[m].length;return a}if(h<=this._bufs[u[0]].length-p)return d?this._bufs[u[0]].copy(a,s,p,p+h):this._bufs[u[0]].slice(p,p+h);d||(a=r.allocUnsafe(f));for(let m=u[0];m<this._bufs.length;m++){let v=this._bufs[m].length-p;if(h>v)this._bufs[m].copy(a,g,p),g+=v;else{this._bufs[m].copy(a,g,p,p+h),g+=v;break}h-=v,p&&(p=0)}return a.length>g?a.slice(0,g):a},i.prototype.shallowSlice=function(a,s){if(a=a||0,s=typeof s!="number"?this.length:s,a<0&&(a+=this.length),s<0&&(s+=this.length),a===s)return this._new();let l=this._offset(a),c=this._offset(s),d=this._bufs.slice(l[0],c[0]+1);return c[1]===0?d.pop():d[d.length-1]=d[d.length-1].slice(0,c[1]),l[1]!==0&&(d[0]=d[0].slice(l[1])),this._new(d)},i.prototype.toString=function(a,s,l){return this.slice(s,l).toString(a)},i.prototype.consume=function(a){if(a=Math.trunc(a),Number.isNaN(a)||a<=0)return this;for(;this._bufs.length;)if(a>=this._bufs[0].length)a-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(a),this.length-=a;break}return this},i.prototype.duplicate=function(){let a=this._new();for(let s=0;s<this._bufs.length;s++)a.append(this._bufs[s]);return a},i.prototype.append=function(a){return this._attach(a,i.prototype._appendBuffer)},i.prototype.prepend=function(a){return this._attach(a,i.prototype._prependBuffer,!0)},i.prototype._attach=function(a,s,l){if(a==null)return this;if(a.buffer)s.call(this,r.from(a.buffer,a.byteOffset,a.byteLength));else if(Array.isArray(a)){let[c,d]=l?[a.length-1,-1]:[0,1];for(let u=c;u>=0&&u<a.length;u+=d)this._attach(a[u],s,l)}else if(this._isBufferList(a)){let[c,d]=l?[a._bufs.length-1,-1]:[0,1];for(let u=c;u>=0&&u<a._bufs.length;u+=d)this._attach(a._bufs[u],s,l)}else typeof a=="number"&&(a=a.toString()),s.call(this,r.from(a));return this},i.prototype._appendBuffer=function(a){this._bufs.push(a),this.length+=a.length},i.prototype._prependBuffer=function(a){this._bufs.unshift(a),this.length+=a.length},i.prototype.indexOf=function(a,s,l){if(l===void 0&&typeof s=="string"&&(l=s,s=void 0),typeof a=="function"||Array.isArray(a))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof a=="number"?a=r.from([a]):typeof a=="string"?a=r.from(a,l):this._isBufferList(a)?a=a.slice():Array.isArray(a.buffer)?a=r.from(a.buffer,a.byteOffset,a.byteLength):r.isBuffer(a)||(a=r.from(a)),s=Number(s||0),isNaN(s)&&(s=0),s<0&&(s=this.length+s),s<0&&(s=0),a.length===0)return s>this.length?this.length:s;let c=this._offset(s),d=c[0],u=c[1];for(;d<this._bufs.length;d++){let f=this._bufs[d];for(;u<f.length;)if(f.length-u>=a.length){let h=f.indexOf(a,u);if(h!==-1)return this._reverseOffset([d,h]);u=f.length-a.length+1}else{let h=this._reverseOffset([d,u]);if(this._match(h,a))return h;u++}u=0}return-1},i.prototype._match=function(a,s){if(this.length-a<s.length)return!1;for(let l=0;l<s.length;l++)if(this.get(a+l)!==s[l])return!1;return!0},function(){let a={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let s in a)(function(l){a[l]===null?i.prototype[l]=function(c,d){return this.slice(c,c+d)[l](0,d)}:i.prototype[l]=function(c=0){return this.slice(c,c+a[l])[l](0)}})(s)}(),i.prototype._isBufferList=function(a){return a instanceof i||i.isBufferList(a)},i.isBufferList=function(a){return a!=null&&a[o]},t.exports=i}),OP=Oe((e,t)=>{Ie(),Ne(),Re();var r=no().Duplex,o=NP(),i=$P();function a(s){if(!(this instanceof a))return new a(s);if(typeof s=="function"){this._callback=s;let l=(function(c){this._callback&&(this._callback(c),this._callback=null)}).bind(this);this.on("pipe",function(c){c.on("error",l)}),this.on("unpipe",function(c){c.removeListener("error",l)}),s=null}i._init.call(this,s),r.call(this)}o(a,r),Object.assign(a.prototype,i.prototype),a.prototype._new=function(s){return new a(s)},a.prototype._write=function(s,l,c){this._appendBuffer(s),typeof c=="function"&&c()},a.prototype._read=function(s){if(!this.length)return this.push(null);s=Math.min(s,this.length),this.push(this.slice(0,s)),this.consume(s)},a.prototype.end=function(s){r.prototype.end.call(this,s),this._callback&&(this._callback(null,this.slice()),this._callback=null)},a.prototype._destroy=function(s,l){this._bufs.length=0,this.length=0,l(s)},a.prototype._isBufferList=function(s){return s instanceof a||s instanceof i||a.isBufferList(s)},a.isBufferList=i.isBufferList,t.exports=a,t.exports.BufferListStream=a,t.exports.BufferList=i}),BP=Oe((e,t)=>{Ie(),Ne(),Re();var r=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};t.exports=r}),Gg=Oe((e,t)=>{Ie(),Ne(),Re();var r=t.exports,{Buffer:o}=(Vt(),mt(Ft));r.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},r.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},r.requiredHeaderFlagsErrors={};for(let a in r.requiredHeaderFlags){let s=r.requiredHeaderFlags[a];r.requiredHeaderFlagsErrors[a]="Invalid header flag bits, must be 0x"+s.toString(16)+" for "+r.types[a]+" packet"}r.codes={};for(let a in r.types){let s=r.types[a];r.codes[s]=a}r.CMD_SHIFT=4,r.CMD_MASK=240,r.DUP_MASK=8,r.QOS_MASK=3,r.QOS_SHIFT=1,r.RETAIN_MASK=1,r.VARBYTEINT_MASK=127,r.VARBYTEINT_FIN_MASK=128,r.VARBYTEINT_MAX=268435455,r.SESSIONPRESENT_MASK=1,r.SESSIONPRESENT_HEADER=o.from([r.SESSIONPRESENT_MASK]),r.CONNACK_HEADER=o.from([r.codes.connack<<r.CMD_SHIFT]),r.USERNAME_MASK=128,r.PASSWORD_MASK=64,r.WILL_RETAIN_MASK=32,r.WILL_QOS_MASK=24,r.WILL_QOS_SHIFT=3,r.WILL_FLAG_MASK=4,r.CLEAN_SESSION_MASK=2,r.CONNECT_HEADER=o.from([r.codes.connect<<r.CMD_SHIFT]),r.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},r.propertiesCodes={};for(let a in r.properties){let s=r.properties[a];r.propertiesCodes[s]=a}r.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function i(a){return[0,1,2].map(s=>[0,1].map(l=>[0,1].map(c=>{let d=o.alloc(1);return d.writeUInt8(r.codes[a]<<r.CMD_SHIFT|(l?r.DUP_MASK:0)|s<<r.QOS_SHIFT|c,0,!0),d})))}r.PUBLISH_HEADER=i("publish"),r.SUBSCRIBE_HEADER=i("subscribe"),r.SUBSCRIBE_OPTIONS_QOS_MASK=3,r.SUBSCRIBE_OPTIONS_NL_MASK=1,r.SUBSCRIBE_OPTIONS_NL_SHIFT=2,r.SUBSCRIBE_OPTIONS_RAP_MASK=1,r.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,r.SUBSCRIBE_OPTIONS_RH_MASK=3,r.SUBSCRIBE_OPTIONS_RH_SHIFT=4,r.SUBSCRIBE_OPTIONS_RH=[0,16,32],r.SUBSCRIBE_OPTIONS_NL=4,r.SUBSCRIBE_OPTIONS_RAP=8,r.SUBSCRIBE_OPTIONS_QOS=[0,1,2],r.UNSUBSCRIBE_HEADER=i("unsubscribe"),r.ACKS={unsuback:i("unsuback"),puback:i("puback"),pubcomp:i("pubcomp"),pubrel:i("pubrel"),pubrec:i("pubrec")},r.SUBACK_HEADER=o.from([r.codes.suback<<r.CMD_SHIFT]),r.VERSION3=o.from([3]),r.VERSION4=o.from([4]),r.VERSION5=o.from([5]),r.VERSION131=o.from([131]),r.VERSION132=o.from([132]),r.QOS=[0,1,2].map(a=>o.from([a])),r.EMPTY={pingreq:o.from([r.codes.pingreq<<4,0]),pingresp:o.from([r.codes.pingresp<<4,0]),disconnect:o.from([r.codes.disconnect<<4,0])},r.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},r.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},r.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},r.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),MP=Oe((e,t)=>{Ie(),Ne(),Re();var r=1e3,o=r*60,i=o*60,a=i*24,s=a*7,l=a*365.25;t.exports=function(h,g){g=g||{};var p=typeof h;if(p==="string"&&h.length>0)return c(h);if(p==="number"&&isFinite(h))return g.long?u(h):d(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))};function c(h){if(h=String(h),!(h.length>100)){var g=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(g){var p=parseFloat(g[1]),m=(g[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return p*l;case"weeks":case"week":case"w":return p*s;case"days":case"day":case"d":return p*a;case"hours":case"hour":case"hrs":case"hr":case"h":return p*i;case"minutes":case"minute":case"mins":case"min":case"m":return p*o;case"seconds":case"second":case"secs":case"sec":case"s":return p*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return p;default:return}}}}function d(h){var g=Math.abs(h);return g>=a?Math.round(h/a)+"d":g>=i?Math.round(h/i)+"h":g>=o?Math.round(h/o)+"m":g>=r?Math.round(h/r)+"s":h+"ms"}function u(h){var g=Math.abs(h);return g>=a?f(h,g,a,"day"):g>=i?f(h,g,i,"hour"):g>=o?f(h,g,o,"minute"):g>=r?f(h,g,r,"second"):h+" ms"}function f(h,g,p,m){var v=g>=p*1.5;return Math.round(h/p)+" "+m+(v?"s":"")}}),zP=Oe((e,t)=>{Ie(),Ne(),Re();function r(o){a.debug=a,a.default=a,a.coerce=f,a.disable=d,a.enable=l,a.enabled=u,a.humanize=MP(),a.destroy=h,Object.keys(o).forEach(g=>{a[g]=o[g]}),a.names=[],a.skips=[],a.formatters={};function i(g){let p=0;for(let m=0;m<g.length;m++)p=(p<<5)-p+g.charCodeAt(m),p|=0;return a.colors[Math.abs(p)%a.colors.length]}a.selectColor=i;function a(g){let p,m=null,v,y;function b(...S){if(!b.enabled)return;let _=b,C=Number(new Date),A=C-(p||C);_.diff=A,_.prev=p,_.curr=C,p=C,S[0]=a.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let k=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(T,I)=>{if(T==="%%")return"%";k++;let R=a.formatters[I];if(typeof R=="function"){let B=S[k];T=R.call(_,B),S.splice(k,1),k--}return T}),a.formatArgs.call(_,S),(_.log||a.log).apply(_,S)}return b.namespace=g,b.useColors=a.useColors(),b.color=a.selectColor(g),b.extend=s,b.destroy=a.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(v!==a.namespaces&&(v=a.namespaces,y=a.enabled(g)),y),set:S=>{m=S}}),typeof a.init=="function"&&a.init(b),b}function s(g,p){let m=a(this.namespace+(typeof p>"u"?":":p)+g);return m.log=this.log,m}function l(g){a.save(g),a.namespaces=g,a.names=[],a.skips=[];let p=(typeof g=="string"?g:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of p)m[0]==="-"?a.skips.push(m.slice(1)):a.names.push(m)}function c(g,p){let m=0,v=0,y=-1,b=0;for(;m<g.length;)if(v<p.length&&(p[v]===g[m]||p[v]==="*"))p[v]==="*"?(y=v,b=m,v++):(m++,v++);else if(y!==-1)v=y+1,b++,m=b;else return!1;for(;v<p.length&&p[v]==="*";)v++;return v===p.length}function d(){let g=[...a.names,...a.skips.map(p=>"-"+p)].join(",");return a.enable(""),g}function u(g){for(let p of a.skips)if(c(g,p))return!1;for(let p of a.names)if(c(g,p))return!0;return!1}function f(g){return g instanceof Error?g.stack||g.message:g}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a.enable(a.load()),a}t.exports=r}),on=Oe((e,t)=>{Ie(),Ne(),Re(),e.formatArgs=o,e.save=i,e.load=a,e.useColors=r,e.storage=s(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let c;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(c=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(c[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let d="color: "+this.color;c.splice(1,0,d,"color: inherit");let u=0,f=0;c[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(u++,h==="%c"&&(f=u))}),c.splice(f,0,d)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function a(){let c;try{c=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!c&&typeof ft<"u"&&"env"in ft&&(c=ft.env.DEBUG),c}function s(){try{return localStorage}catch{}}t.exports=zP()(e);var{formatters:l}=t.exports;l.j=function(c){try{return JSON.stringify(c)}catch(d){return"[UnexpectedJSONParseError]: "+d.message}}}),DP=Oe((e,t)=>{Ie(),Ne(),Re();var r=OP(),{EventEmitter:o}=(to(),mt(Sn)),i=BP(),a=Gg(),s=on()("mqtt-packet:parser"),l=class Mu extends o{constructor(){super(),this.parser=this.constructor.parser}static parser(d){return this instanceof Mu?(this.settings=d||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new Mu().parser(d)}_resetState(){s("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new i,this.error=null,this._list=r(),this._stateCounter=0}parse(d){for(this.error&&this._resetState(),this._list.append(d),s("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,s("parse: state complete. _stateCounter is now: %d",this._stateCounter),s("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return s("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let d=this._list.readUInt8(0),u=d>>a.CMD_SHIFT;this.packet.cmd=a.types[u];let f=d&15,h=a.requiredHeaderFlags[u];return h!=null&&f!==h?this._emitError(new Error(a.requiredHeaderFlagsErrors[u])):(this.packet.retain=(d&a.RETAIN_MASK)!==0,this.packet.qos=d>>a.QOS_SHIFT&a.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(d&a.DUP_MASK)!==0,s("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let d=this._parseVarByteNum(!0);return d&&(this.packet.length=d.value,this._list.consume(d.bytes)),s("_parseLength %d",d.value),!!d}_parsePayload(){s("_parsePayload: payload %O",this._list);let d=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}d=!0}return s("_parsePayload complete result: %s",d),d}_parseConnect(){s("_parseConnect");let d,u,f,h,g={},p=this.packet,m=this._parseString();if(m===null)return this._emitError(new Error("Cannot parse protocolId"));if(m!=="MQTT"&&m!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(p.protocolId=m,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(p.protocolVersion=this._list.readUInt8(this._pos),p.protocolVersion>=128&&(p.bridgeMode=!0,p.protocolVersion=p.protocolVersion-128),p.protocolVersion!==3&&p.protocolVersion!==4&&p.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));g.username=this._list.readUInt8(this._pos)&a.USERNAME_MASK,g.password=this._list.readUInt8(this._pos)&a.PASSWORD_MASK,g.will=this._list.readUInt8(this._pos)&a.WILL_FLAG_MASK;let v=!!(this._list.readUInt8(this._pos)&a.WILL_RETAIN_MASK),y=(this._list.readUInt8(this._pos)&a.WILL_QOS_MASK)>>a.WILL_QOS_SHIFT;if(g.will)p.will={},p.will.retain=v,p.will.qos=y;else{if(v)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(y)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(p.clean=(this._list.readUInt8(this._pos)&a.CLEAN_SESSION_MASK)!==0,this._pos++,p.keepalive=this._parseNum(),p.keepalive===-1)return this._emitError(new Error("Packet too short"));if(p.protocolVersion===5){let S=this._parseProperties();Object.getOwnPropertyNames(S).length&&(p.properties=S)}let b=this._parseString();if(b===null)return this._emitError(new Error("Packet too short"));if(p.clientId=b,s("_parseConnect: packet.clientId: %s",p.clientId),g.will){if(p.protocolVersion===5){let S=this._parseProperties();Object.getOwnPropertyNames(S).length&&(p.will.properties=S)}if(d=this._parseString(),d===null)return this._emitError(new Error("Cannot parse will topic"));if(p.will.topic=d,s("_parseConnect: packet.will.topic: %s",p.will.topic),u=this._parseBuffer(),u===null)return this._emitError(new Error("Cannot parse will payload"));p.will.payload=u,s("_parseConnect: packet.will.paylaod: %s",p.will.payload)}if(g.username){if(h=this._parseString(),h===null)return this._emitError(new Error("Cannot parse username"));p.username=h,s("_parseConnect: packet.username: %s",p.username)}if(g.password){if(f=this._parseBuffer(),f===null)return this._emitError(new Error("Cannot parse password"));p.password=f}return this.settings=p,s("_parseConnect: complete"),p}_parseConnack(){s("_parseConnack");let d=this.packet;if(this._list.length<1)return null;let u=this._list.readUInt8(this._pos++);if(u>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(d.sessionPresent=!!(u&a.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?d.reasonCode=this._list.readUInt8(this._pos++):d.reasonCode=0;else{if(this._list.length<2)return null;d.returnCode=this._list.readUInt8(this._pos++)}if(d.returnCode===-1||d.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(d.properties=f)}s("_parseConnack: complete")}_parsePublish(){s("_parsePublish");let d=this.packet;if(d.topic=this._parseString(),d.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(d.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(d.properties=u)}d.payload=this._list.slice(this._pos,d.length),s("_parsePublish: payload from buffer list: %o",d.payload)}}_parseSubscribe(){s("_parseSubscribe");let d=this.packet,u,f,h,g,p,m,v;if(d.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let y=this._parseProperties();Object.getOwnPropertyNames(y).length&&(d.properties=y)}if(d.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<d.length;){if(u=this._parseString(),u===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=d.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(f=this._parseByte(),this.settings.protocolVersion===5){if(f&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(f&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(h=f&a.SUBSCRIBE_OPTIONS_QOS_MASK,h>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(m=(f>>a.SUBSCRIBE_OPTIONS_NL_SHIFT&a.SUBSCRIBE_OPTIONS_NL_MASK)!==0,p=(f>>a.SUBSCRIBE_OPTIONS_RAP_SHIFT&a.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,g=f>>a.SUBSCRIBE_OPTIONS_RH_SHIFT&a.SUBSCRIBE_OPTIONS_RH_MASK,g>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));v={topic:u,qos:h},this.settings.protocolVersion===5?(v.nl=m,v.rap=p,v.rh=g):this.settings.bridgeMode&&(v.rh=0,v.rap=!0,v.nl=!0),s("_parseSubscribe: push subscription `%s` to subscription",v),d.subscriptions.push(v)}}}_parseSuback(){s("_parseSuback");let d=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(d.properties=u)}if(d.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let u=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!a.MQTT5_SUBACK_CODES[u])return this._emitError(new Error("Invalid suback code"))}else if(u>2&&u!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(u)}}}_parseUnsubscribe(){s("_parseUnsubscribe");let d=this.packet;if(d.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(d.properties=u)}if(d.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<d.length;){let u=this._parseString();if(u===null)return this._emitError(new Error("Cannot parse topic"));s("_parseUnsubscribe: push topic `%s` to unsubscriptions",u),d.unsubscriptions.push(u)}}}_parseUnsuback(){s("_parseUnsuback");let d=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&d.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(d.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let u=this._parseProperties();for(Object.getOwnPropertyNames(u).length&&(d.properties=u),d.granted=[];this._pos<this.packet.length;){let f=this._list.readUInt8(this._pos++);if(!a.MQTT5_UNSUBACK_CODES[f])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(f)}}}_parseConfirmation(){s("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let d=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(d.length>2){switch(d.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!a.MQTT5_PUBACK_PUBREC_CODES[d.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!a.MQTT5_PUBREL_PUBCOMP_CODES[d.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}s("_parseConfirmation: packet.reasonCode `%d`",d.reasonCode)}else d.reasonCode=0;if(d.length>3){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(d.properties=u)}}return!0}_parseDisconnect(){let d=this.packet;if(s("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(d.reasonCode=this._parseByte(),a.MQTT5_DISCONNECT_CODES[d.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):d.reasonCode=0;let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(d.properties=u)}return s("_parseDisconnect result: true"),!0}_parseAuth(){s("_parseAuth");let d=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(d.reasonCode=this._parseByte(),!a.MQTT5_AUTH_CODES[d.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let u=this._parseProperties();return Object.getOwnPropertyNames(u).length&&(d.properties=u),s("_parseAuth: result: true"),!0}_parseMessageId(){let d=this.packet;return d.messageId=this._parseNum(),d.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(s("_parseMessageId: packet.messageId %d",d.messageId),!0)}_parseString(d){let u=this._parseNum(),f=u+this._pos;if(u===-1||f>this._list.length||f>this.packet.length)return null;let h=this._list.toString("utf8",this._pos,f);return this._pos+=u,s("_parseString: result: %s",h),h}_parseStringPair(){return s("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let d=this._parseNum(),u=d+this._pos;if(d===-1||u>this._list.length||u>this.packet.length)return null;let f=this._list.slice(this._pos,u);return this._pos+=d,s("_parseBuffer: result: %o",f),f}_parseNum(){if(this._list.length-this._pos<2)return-1;let d=this._list.readUInt16BE(this._pos);return this._pos+=2,s("_parseNum: result: %s",d),d}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let d=this._list.readUInt32BE(this._pos);return this._pos+=4,s("_parse4ByteNum: result: %s",d),d}_parseVarByteNum(d){s("_parseVarByteNum");let u=4,f=0,h=1,g=0,p=!1,m,v=this._pos?this._pos:0;for(;f<u&&v+f<this._list.length;){if(m=this._list.readUInt8(v+f++),g+=h*(m&a.VARBYTEINT_MASK),h*=128,(m&a.VARBYTEINT_FIN_MASK)===0){p=!0;break}if(this._list.length<=f)break}return!p&&f===u&&this._list.length>=f&&this._emitError(new Error("Invalid variable byte integer")),v&&(this._pos+=f),p?d?p={bytes:f,value:g}:p=g:p=!1,s("_parseVarByteNum: result: %o",p),p}_parseByte(){let d;return this._pos<this._list.length&&(d=this._list.readUInt8(this._pos),this._pos++),s("_parseByte: result: %o",d),d}_parseByType(d){switch(s("_parseByType: type: %s",d),d){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){s("_parseProperties");let d=this._parseVarByteNum(),u=this._pos+d,f={};for(;this._pos<u;){let h=this._parseByte();if(!h)return this._emitError(new Error("Cannot parse property code type")),!1;let g=a.propertiesCodes[h];if(!g)return this._emitError(new Error("Unknown property")),!1;if(g==="userProperties"){f[g]||(f[g]=Object.create(null));let p=this._parseByType(a.propertiesTypes[g]);if(f[g][p.name])if(Array.isArray(f[g][p.name]))f[g][p.name].push(p.value);else{let m=f[g][p.name];f[g][p.name]=[m],f[g][p.name].push(p.value)}else f[g][p.name]=p.value;continue}f[g]?Array.isArray(f[g])?f[g].push(this._parseByType(a.propertiesTypes[g])):(f[g]=[f[g]],f[g].push(this._parseByType(a.propertiesTypes[g]))):f[g]=this._parseByType(a.propertiesTypes[g])}return f}_newPacket(){return s("_newPacket"),this.packet&&(this._list.consume(this.packet.length),s("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),s("_newPacket: new packet"),this.packet=new i,this._pos=0,!0}_emitError(d){s("_emitError",d),this.error=d,this.emit("error",d)}};t.exports=l}),FP=Oe((e,t)=>{Ie(),Ne(),Re();var{Buffer:r}=(Vt(),mt(Ft)),o=65536,i={},a=r.isBuffer(r.from([1,2]).subarray(0,1));function s(u){let f=r.allocUnsafe(2);return f.writeUInt8(u>>8,0),f.writeUInt8(u&255,1),f}function l(){for(let u=0;u<o;u++)i[u]=s(u)}function c(u){let f=0,h=0,g=r.allocUnsafe(4);do f=u%128|0,u=u/128|0,u>0&&(f=f|128),g.writeUInt8(f,h++);while(u>0&&h<4);return u>0&&(h=0),a?g.subarray(0,h):g.slice(0,h)}function d(u){let f=r.allocUnsafe(4);return f.writeUInt32BE(u,0),f}t.exports={cache:i,generateCache:l,generateNumber:s,genBufVariableByteInt:c,generate4ByteBuffer:d}}),VP=Oe((e,t)=>{Ie(),Ne(),Re(),typeof ft>"u"||!ft.version||ft.version.indexOf("v0.")===0||ft.version.indexOf("v1.")===0&&ft.version.indexOf("v1.8.")!==0?t.exports={nextTick:r}:t.exports=ft;function r(o,i,a,s){if(typeof o!="function")throw new TypeError('"callback" argument must be a function');var l=arguments.length,c,d;switch(l){case 0:case 1:return ft.nextTick(o);case 2:return ft.nextTick(function(){o.call(null,i)});case 3:return ft.nextTick(function(){o.call(null,i,a)});case 4:return ft.nextTick(function(){o.call(null,i,a,s)});default:for(c=new Array(l-1),d=0;d<c.length;)c[d++]=arguments[d];return ft.nextTick(function(){o.apply(null,c)})}}}),Kg=Oe((e,t)=>{Ie(),Ne(),Re();var r=Gg(),{Buffer:o}=(Vt(),mt(Ft)),i=o.allocUnsafe(0),a=o.from([0]),s=FP(),l=VP().nextTick,c=on()("mqtt-packet:writeToStream"),d=s.cache,u=s.generateNumber,f=s.generateCache,h=s.genBufVariableByteInt,g=s.generate4ByteBuffer,p=z,m=!0;function v(ne,Y,be){switch(c("generate called"),Y.cork&&(Y.cork(),l(y,Y)),m&&(m=!1,f()),c("generate: packet.cmd: %s",ne.cmd),ne.cmd){case"connect":return b(ne,Y);case"connack":return S(ne,Y,be);case"publish":return _(ne,Y,be);case"puback":case"pubrec":case"pubrel":case"pubcomp":return C(ne,Y,be);case"subscribe":return A(ne,Y,be);case"suback":return k(ne,Y,be);case"unsubscribe":return T(ne,Y,be);case"unsuback":return I(ne,Y,be);case"pingreq":case"pingresp":return R(ne,Y);case"disconnect":return B(ne,Y,be);case"auth":return P(ne,Y,be);default:return Y.destroy(new Error("Unknown command")),!1}}Object.defineProperty(v,"cacheNumbers",{get(){return p===z},set(ne){ne?((!d||Object.keys(d).length===0)&&(m=!0),p=z):(m=!1,p=L)}});function y(ne){ne.uncork()}function b(ne,Y,be){let ce=ne||{},pe=ce.protocolId||"MQTT",he=ce.protocolVersion||4,Te=ce.will,_e=ce.clean,Z=ce.keepalive||0,fe=ce.clientId||"",ie=ce.username,re=ce.password,ye=ce.properties;_e===void 0&&(_e=!0);let J=0;if(typeof pe!="string"&&!o.isBuffer(pe))return Y.destroy(new Error("Invalid protocolId")),!1;if(J+=pe.length+2,he!==3&&he!==4&&he!==5)return Y.destroy(new Error("Invalid protocol version")),!1;if(J+=1,(typeof fe=="string"||o.isBuffer(fe))&&(fe||he>=4)&&(fe||_e))J+=o.byteLength(fe)+2;else{if(he<4)return Y.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(_e*1===0)return Y.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof Z!="number"||Z<0||Z>65535||Z%1!==0)return Y.destroy(new Error("Invalid keepalive")),!1;J+=2,J+=1;let V,me;if(he===5){if(V=se(Y,ye),!V)return!1;J+=V.length}if(Te){if(typeof Te!="object")return Y.destroy(new Error("Invalid will")),!1;if(!Te.topic||typeof Te.topic!="string")return Y.destroy(new Error("Invalid will topic")),!1;if(J+=o.byteLength(Te.topic)+2,J+=2,Te.payload)if(Te.payload.length>=0)typeof Te.payload=="string"?J+=o.byteLength(Te.payload):J+=Te.payload.length;else return Y.destroy(new Error("Invalid will payload")),!1;if(me={},he===5){if(me=se(Y,Te.properties),!me)return!1;J+=me.length}}let ee=!1;if(ie!=null)if(Ce(ie))ee=!0,J+=o.byteLength(ie)+2;else return Y.destroy(new Error("Invalid username")),!1;if(re!=null){if(!ee)return Y.destroy(new Error("Username is required to use password")),!1;if(Ce(re))J+=X(re)+2;else return Y.destroy(new Error("Invalid password")),!1}Y.write(r.CONNECT_HEADER),N(Y,J),j(Y,pe),ce.bridgeMode&&(he+=128),Y.write(he===131?r.VERSION131:he===132?r.VERSION132:he===4?r.VERSION4:he===5?r.VERSION5:r.VERSION3);let F=0;return F|=ie!=null?r.USERNAME_MASK:0,F|=re!=null?r.PASSWORD_MASK:0,F|=Te&&Te.retain?r.WILL_RETAIN_MASK:0,F|=Te&&Te.qos?Te.qos<<r.WILL_QOS_SHIFT:0,F|=Te?r.WILL_FLAG_MASK:0,F|=_e?r.CLEAN_SESSION_MASK:0,Y.write(o.from([F])),p(Y,Z),he===5&&V.write(),j(Y,fe),Te&&(he===5&&me.write(),$(Y,Te.topic),j(Y,Te.payload)),ie!=null&&j(Y,ie),re!=null&&j(Y,re),!0}function S(ne,Y,be){let ce=be?be.protocolVersion:4,pe=ne||{},he=ce===5?pe.reasonCode:pe.returnCode,Te=pe.properties,_e=2;if(typeof he!="number")return Y.destroy(new Error("Invalid return code")),!1;let Z=null;if(ce===5){if(Z=se(Y,Te),!Z)return!1;_e+=Z.length}return Y.write(r.CONNACK_HEADER),N(Y,_e),Y.write(pe.sessionPresent?r.SESSIONPRESENT_HEADER:a),Y.write(o.from([he])),Z==null||Z.write(),!0}function _(ne,Y,be){c("publish: packet: %o",ne);let ce=be?be.protocolVersion:4,pe=ne||{},he=pe.qos||0,Te=pe.retain?r.RETAIN_MASK:0,_e=pe.topic,Z=pe.payload||i,fe=pe.messageId,ie=pe.properties,re=0;if(typeof _e=="string")re+=o.byteLength(_e)+2;else if(o.isBuffer(_e))re+=_e.length+2;else return Y.destroy(new Error("Invalid topic")),!1;if(o.isBuffer(Z)?re+=Z.length:re+=o.byteLength(Z),he&&typeof fe!="number")return Y.destroy(new Error("Invalid messageId")),!1;he&&(re+=2);let ye=null;if(ce===5){if(ye=se(Y,ie),!ye)return!1;re+=ye.length}return Y.write(r.PUBLISH_HEADER[he][pe.dup?1:0][Te?1:0]),N(Y,re),p(Y,X(_e)),Y.write(_e),he>0&&p(Y,fe),ye==null||ye.write(),c("publish: payload: %o",Z),Y.write(Z)}function C(ne,Y,be){let ce=be?be.protocolVersion:4,pe=ne||{},he=pe.cmd||"puback",Te=pe.messageId,_e=pe.dup&&he==="pubrel"?r.DUP_MASK:0,Z=0,fe=pe.reasonCode,ie=pe.properties,re=ce===5?3:2;if(he==="pubrel"&&(Z=1),typeof Te!="number")return Y.destroy(new Error("Invalid messageId")),!1;let ye=null;if(ce===5&&typeof ie=="object"){if(ye=D(Y,ie,be,re),!ye)return!1;re+=ye.length}return Y.write(r.ACKS[he][Z][_e][0]),re===3&&(re+=fe!==0?1:-1),N(Y,re),p(Y,Te),ce===5&&re!==2&&Y.write(o.from([fe])),ye!==null?ye.write():re===4&&Y.write(o.from([0])),!0}function A(ne,Y,be){c("subscribe: packet: ");let ce=be?be.protocolVersion:4,pe=ne||{},he=pe.dup?r.DUP_MASK:0,Te=pe.messageId,_e=pe.subscriptions,Z=pe.properties,fe=0;if(typeof Te!="number")return Y.destroy(new Error("Invalid messageId")),!1;fe+=2;let ie=null;if(ce===5){if(ie=se(Y,Z),!ie)return!1;fe+=ie.length}if(typeof _e=="object"&&_e.length)for(let ye=0;ye<_e.length;ye+=1){let J=_e[ye].topic,V=_e[ye].qos;if(typeof J!="string")return Y.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof V!="number")return Y.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(ce===5){if(typeof(_e[ye].nl||!1)!="boolean")return Y.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(_e[ye].rap||!1)!="boolean")return Y.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let me=_e[ye].rh||0;if(typeof me!="number"||me>2)return Y.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}fe+=o.byteLength(J)+2+1}else return Y.destroy(new Error("Invalid subscriptions")),!1;c("subscribe: writing to stream: %o",r.SUBSCRIBE_HEADER),Y.write(r.SUBSCRIBE_HEADER[1][he?1:0][0]),N(Y,fe),p(Y,Te),ie!==null&&ie.write();let re=!0;for(let ye of _e){let J=ye.topic,V=ye.qos,me=+ye.nl,ee=+ye.rap,F=ye.rh,oe;$(Y,J),oe=r.SUBSCRIBE_OPTIONS_QOS[V],ce===5&&(oe|=me?r.SUBSCRIBE_OPTIONS_NL:0,oe|=ee?r.SUBSCRIBE_OPTIONS_RAP:0,oe|=F?r.SUBSCRIBE_OPTIONS_RH[F]:0),re=Y.write(o.from([oe]))}return re}function k(ne,Y,be){let ce=be?be.protocolVersion:4,pe=ne||{},he=pe.messageId,Te=pe.granted,_e=pe.properties,Z=0;if(typeof he!="number")return Y.destroy(new Error("Invalid messageId")),!1;if(Z+=2,typeof Te=="object"&&Te.length)for(let ie=0;ie<Te.length;ie+=1){if(typeof Te[ie]!="number")return Y.destroy(new Error("Invalid qos vector")),!1;Z+=1}else return Y.destroy(new Error("Invalid qos vector")),!1;let fe=null;if(ce===5){if(fe=D(Y,_e,be,Z),!fe)return!1;Z+=fe.length}return Y.write(r.SUBACK_HEADER),N(Y,Z),p(Y,he),fe!==null&&fe.write(),Y.write(o.from(Te))}function T(ne,Y,be){let ce=be?be.protocolVersion:4,pe=ne||{},he=pe.messageId,Te=pe.dup?r.DUP_MASK:0,_e=pe.unsubscriptions,Z=pe.properties,fe=0;if(typeof he!="number")return Y.destroy(new Error("Invalid messageId")),!1;if(fe+=2,typeof _e=="object"&&_e.length)for(let ye=0;ye<_e.length;ye+=1){if(typeof _e[ye]!="string")return Y.destroy(new Error("Invalid unsubscriptions")),!1;fe+=o.byteLength(_e[ye])+2}else return Y.destroy(new Error("Invalid unsubscriptions")),!1;let ie=null;if(ce===5){if(ie=se(Y,Z),!ie)return!1;fe+=ie.length}Y.write(r.UNSUBSCRIBE_HEADER[1][Te?1:0][0]),N(Y,fe),p(Y,he),ie!==null&&ie.write();let re=!0;for(let ye=0;ye<_e.length;ye++)re=$(Y,_e[ye]);return re}function I(ne,Y,be){let ce=be?be.protocolVersion:4,pe=ne||{},he=pe.messageId,Te=pe.dup?r.DUP_MASK:0,_e=pe.granted,Z=pe.properties,fe=pe.cmd,ie=0,re=2;if(typeof he!="number")return Y.destroy(new Error("Invalid messageId")),!1;if(ce===5)if(typeof _e=="object"&&_e.length)for(let J=0;J<_e.length;J+=1){if(typeof _e[J]!="number")return Y.destroy(new Error("Invalid qos vector")),!1;re+=1}else return Y.destroy(new Error("Invalid qos vector")),!1;let ye=null;if(ce===5){if(ye=D(Y,Z,be,re),!ye)return!1;re+=ye.length}return Y.write(r.ACKS[fe][ie][Te][0]),N(Y,re),p(Y,he),ye!==null&&ye.write(),ce===5&&Y.write(o.from(_e)),!0}function R(ne,Y,be){return Y.write(r.EMPTY[ne.cmd])}function B(ne,Y,be){let ce=be?be.protocolVersion:4,pe=ne||{},he=pe.reasonCode,Te=pe.properties,_e=ce===5?1:0,Z=null;if(ce===5){if(Z=D(Y,Te,be,_e),!Z)return!1;_e+=Z.length}return Y.write(o.from([r.codes.disconnect<<4])),N(Y,_e),ce===5&&Y.write(o.from([he])),Z!==null&&Z.write(),!0}function P(ne,Y,be){let ce=be?be.protocolVersion:4,pe=ne||{},he=pe.reasonCode,Te=pe.properties,_e=ce===5?1:0;ce!==5&&Y.destroy(new Error("Invalid mqtt version for auth packet"));let Z=D(Y,Te,be,_e);return Z?(_e+=Z.length,Y.write(o.from([r.codes.auth<<4])),N(Y,_e),Y.write(o.from([he])),Z!==null&&Z.write(),!0):!1}var O={};function N(ne,Y){if(Y>r.VARBYTEINT_MAX)return ne.destroy(new Error(`Invalid variable byte integer: ${Y}`)),!1;let be=O[Y];return be||(be=h(Y),Y<16384&&(O[Y]=be)),c("writeVarByteInt: writing to stream: %o",be),ne.write(be)}function $(ne,Y){let be=o.byteLength(Y);return p(ne,be),c("writeString: %s",Y),ne.write(Y,"utf8")}function q(ne,Y,be){$(ne,Y),$(ne,be)}function z(ne,Y){return c("writeNumberCached: number: %d",Y),c("writeNumberCached: %o",d[Y]),ne.write(d[Y])}function L(ne,Y){let be=u(Y);return c("writeNumberGenerated: %o",be),ne.write(be)}function te(ne,Y){let be=g(Y);return c("write4ByteNumber: %o",be),ne.write(be)}function j(ne,Y){typeof Y=="string"?$(ne,Y):Y?(p(ne,Y.length),ne.write(Y)):p(ne,0)}function se(ne,Y){if(typeof Y!="object"||Y.length!=null)return{length:1,write(){xe(ne,{},0)}};let be=0;function ce(pe,he){let Te=r.propertiesTypes[pe],_e=0;switch(Te){case"byte":{if(typeof he!="boolean")return ne.destroy(new Error(`Invalid ${pe}: ${he}`)),!1;_e+=2;break}case"int8":{if(typeof he!="number"||he<0||he>255)return ne.destroy(new Error(`Invalid ${pe}: ${he}`)),!1;_e+=2;break}case"binary":{if(he&&he===null)return ne.destroy(new Error(`Invalid ${pe}: ${he}`)),!1;_e+=1+o.byteLength(he)+2;break}case"int16":{if(typeof he!="number"||he<0||he>65535)return ne.destroy(new Error(`Invalid ${pe}: ${he}`)),!1;_e+=3;break}case"int32":{if(typeof he!="number"||he<0||he>4294967295)return ne.destroy(new Error(`Invalid ${pe}: ${he}`)),!1;_e+=5;break}case"var":{if(typeof he!="number"||he<0||he>268435455)return ne.destroy(new Error(`Invalid ${pe}: ${he}`)),!1;_e+=1+o.byteLength(h(he));break}case"string":{if(typeof he!="string")return ne.destroy(new Error(`Invalid ${pe}: ${he}`)),!1;_e+=3+o.byteLength(he.toString());break}case"pair":{if(typeof he!="object")return ne.destroy(new Error(`Invalid ${pe}: ${he}`)),!1;_e+=Object.getOwnPropertyNames(he).reduce((Z,fe)=>{let ie=he[fe];return Array.isArray(ie)?Z+=ie.reduce((re,ye)=>(re+=3+o.byteLength(fe.toString())+2+o.byteLength(ye.toString()),re),0):Z+=3+o.byteLength(fe.toString())+2+o.byteLength(he[fe].toString()),Z},0);break}default:return ne.destroy(new Error(`Invalid property ${pe}: ${he}`)),!1}return _e}if(Y)for(let pe in Y){let he=0,Te=0,_e=Y[pe];if(_e!==void 0){if(Array.isArray(_e))for(let Z=0;Z<_e.length;Z++){if(Te=ce(pe,_e[Z]),!Te)return!1;he+=Te}else{if(Te=ce(pe,_e),!Te)return!1;he=Te}if(!he)return!1;be+=he}}return{length:o.byteLength(h(be))+be,write(){xe(ne,Y,be)}}}function D(ne,Y,be,ce){let pe=["reasonString","userProperties"],he=be&&be.properties&&be.properties.maximumPacketSize?be.properties.maximumPacketSize:0,Te=se(ne,Y);if(he)for(;ce+Te.length>he;){let _e=pe.shift();if(_e&&Y[_e])delete Y[_e],Te=se(ne,Y);else return!1}return Te}function U(ne,Y,be){switch(r.propertiesTypes[Y]){case"byte":{ne.write(o.from([r.properties[Y]])),ne.write(o.from([+be]));break}case"int8":{ne.write(o.from([r.properties[Y]])),ne.write(o.from([be]));break}case"binary":{ne.write(o.from([r.properties[Y]])),j(ne,be);break}case"int16":{ne.write(o.from([r.properties[Y]])),p(ne,be);break}case"int32":{ne.write(o.from([r.properties[Y]])),te(ne,be);break}case"var":{ne.write(o.from([r.properties[Y]])),N(ne,be);break}case"string":{ne.write(o.from([r.properties[Y]])),$(ne,be);break}case"pair":{Object.getOwnPropertyNames(be).forEach(ce=>{let pe=be[ce];Array.isArray(pe)?pe.forEach(he=>{ne.write(o.from([r.properties[Y]])),q(ne,ce.toString(),he.toString())}):(ne.write(o.from([r.properties[Y]])),q(ne,ce.toString(),pe.toString()))});break}default:return ne.destroy(new Error(`Invalid property ${Y} value: ${be}`)),!1}}function xe(ne,Y,be){N(ne,be);for(let ce in Y)if(Object.prototype.hasOwnProperty.call(Y,ce)&&Y[ce]!=null){let pe=Y[ce];if(Array.isArray(pe))for(let he=0;he<pe.length;he++)U(ne,ce,pe[he]);else U(ne,ce,pe)}}function X(ne){return ne?ne instanceof o?ne.length:o.byteLength(ne):0}function Ce(ne){return typeof ne=="string"||ne instanceof o}t.exports=v}),LP=Oe((e,t)=>{Ie(),Ne(),Re();var r=Kg(),{EventEmitter:o}=(to(),mt(Sn)),{Buffer:i}=(Vt(),mt(Ft));function a(l,c){let d=new s;return r(l,d,c),d.concat()}var s=class extends o{constructor(){super(),this._array=new Array(20),this._i=0}write(l){return this._array[this._i++]=l,!0}concat(){let l=0,c=new Array(this._array.length),d=this._array,u=0,f;for(f=0;f<d.length&&d[f]!==void 0;f++)typeof d[f]!="string"?c[f]=d[f].length:c[f]=i.byteLength(d[f]),l+=c[f];let h=i.allocUnsafe(l);for(f=0;f<d.length&&d[f]!==void 0;f++)typeof d[f]!="string"?(d[f].copy(h,u),u+=c[f]):(h.write(d[f],u),u+=c[f]);return h}destroy(l){l&&this.emit("error",l)}};t.exports=a}),jP=Oe(e=>{Ie(),Ne(),Re(),e.parser=DP().parser,e.generate=LP(),e.writeToStream=Kg()}),UP=Oe((e,t)=>{Ie(),Ne(),Re(),t.exports=o;function r(a){return a instanceof Ia?Ia.from(a):new a.constructor(a.buffer.slice(),a.byteOffset,a.length)}function o(a){if(a=a||{},a.circles)return i(a);let s=new Map;if(s.set(Date,f=>new Date(f)),s.set(Map,(f,h)=>new Map(c(Array.from(f),h))),s.set(Set,(f,h)=>new Set(c(Array.from(f),h))),a.constructorHandlers)for(let f of a.constructorHandlers)s.set(f[0],f[1]);let l=null;return a.proto?u:d;function c(f,h){let g=Object.keys(f),p=new Array(g.length);for(let m=0;m<g.length;m++){let v=g[m],y=f[v];typeof y!="object"||y===null?p[v]=y:y.constructor!==Object&&(l=s.get(y.constructor))?p[v]=l(y,h):ArrayBuffer.isView(y)?p[v]=r(y):p[v]=h(y)}return p}function d(f){if(typeof f!="object"||f===null)return f;if(Array.isArray(f))return c(f,d);if(f.constructor!==Object&&(l=s.get(f.constructor)))return l(f,d);let h={};for(let g in f){if(Object.hasOwnProperty.call(f,g)===!1)continue;let p=f[g];typeof p!="object"||p===null?h[g]=p:p.constructor!==Object&&(l=s.get(p.constructor))?h[g]=l(p,d):ArrayBuffer.isView(p)?h[g]=r(p):h[g]=d(p)}return h}function u(f){if(typeof f!="object"||f===null)return f;if(Array.isArray(f))return c(f,u);if(f.constructor!==Object&&(l=s.get(f.constructor)))return l(f,u);let h={};for(let g in f){let p=f[g];typeof p!="object"||p===null?h[g]=p:p.constructor!==Object&&(l=s.get(p.constructor))?h[g]=l(p,u):ArrayBuffer.isView(p)?h[g]=r(p):h[g]=u(p)}return h}}function i(a){let s=[],l=[],c=new Map;if(c.set(Date,g=>new Date(g)),c.set(Map,(g,p)=>new Map(u(Array.from(g),p))),c.set(Set,(g,p)=>new Set(u(Array.from(g),p))),a.constructorHandlers)for(let g of a.constructorHandlers)c.set(g[0],g[1]);let d=null;return a.proto?h:f;function u(g,p){let m=Object.keys(g),v=new Array(m.length);for(let y=0;y<m.length;y++){let b=m[y],S=g[b];if(typeof S!="object"||S===null)v[b]=S;else if(S.constructor!==Object&&(d=c.get(S.constructor)))v[b]=d(S,p);else if(ArrayBuffer.isView(S))v[b]=r(S);else{let _=s.indexOf(S);_!==-1?v[b]=l[_]:v[b]=p(S)}}return v}function f(g){if(typeof g!="object"||g===null)return g;if(Array.isArray(g))return u(g,f);if(g.constructor!==Object&&(d=c.get(g.constructor)))return d(g,f);let p={};s.push(g),l.push(p);for(let m in g){if(Object.hasOwnProperty.call(g,m)===!1)continue;let v=g[m];if(typeof v!="object"||v===null)p[m]=v;else if(v.constructor!==Object&&(d=c.get(v.constructor)))p[m]=d(v,f);else if(ArrayBuffer.isView(v))p[m]=r(v);else{let y=s.indexOf(v);y!==-1?p[m]=l[y]:p[m]=f(v)}}return s.pop(),l.pop(),p}function h(g){if(typeof g!="object"||g===null)return g;if(Array.isArray(g))return u(g,h);if(g.constructor!==Object&&(d=c.get(g.constructor)))return d(g,h);let p={};s.push(g),l.push(p);for(let m in g){let v=g[m];if(typeof v!="object"||v===null)p[m]=v;else if(v.constructor!==Object&&(d=c.get(v.constructor)))p[m]=d(v,h);else if(ArrayBuffer.isView(v))p[m]=r(v);else{let y=s.indexOf(v);y!==-1?p[m]=l[y]:p[m]=h(v)}}return s.pop(),l.pop(),p}}}),WP=Oe((e,t)=>{Ie(),Ne(),Re(),t.exports=UP()()}),Yg=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"__esModule",{value:!0}),e.validateTopic=t,e.validateTopics=r;function t(o){let i=o.split("/");for(let a=0;a<i.length;a++)if(i[a]!=="+"){if(i[a]==="#")return a===i.length-1;if(i[a].indexOf("+")!==-1||i[a].indexOf("#")!==-1)return!1}return!0}function r(o){if(o.length===0)return"empty_topic_list";for(let i=0;i<o.length;i++)if(!t(o[i]))return o[i];return null}}),Xg=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"__esModule",{value:!0});var t=no(),r={objectMode:!0},o={clean:!0},i=class{constructor(a){Pe(this,"options");Pe(this,"_inflights");this.options=a||{},this.options={...o,...a},this._inflights=new Map}put(a,s){return this._inflights.set(a.messageId,a),s&&s(),this}createStream(){let a=new t.Readable(r),s=[],l=!1,c=0;return this._inflights.forEach((d,u)=>{s.push(d)}),a._read=()=>{!l&&c<s.length?a.push(s[c++]):a.push(null)},a.destroy=d=>{if(!l)return l=!0,setTimeout(()=>{a.emit("close")},0),a},a}del(a,s){let l=this._inflights.get(a.messageId);return l?(this._inflights.delete(a.messageId),s(null,l)):s&&s(new Error("missing packet")),this}get(a,s){let l=this._inflights.get(a.messageId);return l?s(null,l):s&&s(new Error("missing packet")),this}close(a){this.options.clean&&(this._inflights=null),a&&a()}};e.default=i}),HP=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"__esModule",{value:!0});var t=[0,16,128,131,135,144,145,151,153],r=(o,i,a)=>{o.log("handlePublish: packet %o",i),a=typeof a<"u"?a:o.noop;let s=i.topic.toString(),l=i.payload,{qos:c}=i,{messageId:d}=i,{options:u}=o;if(o.options.protocolVersion===5){let f;if(i.properties&&(f=i.properties.topicAlias),typeof f<"u")if(s.length===0)if(f>0&&f<=65535){let h=o.topicAliasRecv.getTopicByAlias(f);if(h)s=h,o.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",s,f);else{o.log("handlePublish :: unregistered topic alias. alias: %d",f),o.emit("error",new Error("Received unregistered Topic Alias"));return}}else{o.log("handlePublish :: topic alias out of range. alias: %d",f),o.emit("error",new Error("Received Topic Alias is out of range"));return}else if(o.topicAliasRecv.put(s,f))o.log("handlePublish :: registered topic: %s - alias: %d",s,f);else{o.log("handlePublish :: topic alias out of range. alias: %d",f),o.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(o.log("handlePublish: qos %d",c),c){case 2:{u.customHandleAcks(s,l,i,(f,h)=>{if(typeof f=="number"&&(h=f,f=null),f)return o.emit("error",f);if(t.indexOf(h)===-1)return o.emit("error",new Error("Wrong reason code for pubrec"));h?o._sendPacket({cmd:"pubrec",messageId:d,reasonCode:h},a):o.incomingStore.put(i,()=>{o._sendPacket({cmd:"pubrec",messageId:d},a)})});break}case 1:{u.customHandleAcks(s,l,i,(f,h)=>{if(typeof f=="number"&&(h=f,f=null),f)return o.emit("error",f);if(t.indexOf(h)===-1)return o.emit("error",new Error("Wrong reason code for puback"));h||o.emit("message",s,l,i),o.handleMessage(i,g=>{if(g)return a&&a(g);o._sendPacket({cmd:"puback",messageId:d,reasonCode:h},a)})});break}case 0:o.emit("message",s,l,i),o.handleMessage(i,a);break;default:o.log("handlePublish: unknown QoS. Doing nothing.");break}};e.default=r}),qP=Oe((e,t)=>{t.exports={version:"5.15.0"}}),$o=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"__esModule",{value:!0}),e.MQTTJS_VERSION=e.nextTick=e.ErrorWithSubackPacket=e.ErrorWithReasonCode=void 0,e.applyMixin=o;var t=class Ey extends Error{constructor(s,l){super(s);Pe(this,"code");this.code=l,Object.setPrototypeOf(this,Ey.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};e.ErrorWithReasonCode=t;var r=class Ty extends Error{constructor(s,l){super(s);Pe(this,"packet");this.packet=l,Object.setPrototypeOf(this,Ty.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};e.ErrorWithSubackPacket=r;function o(i,a,s=!1){let l=[a];for(;;){let c=l[0],d=Object.getPrototypeOf(c);if(d!=null&&d.prototype)l.unshift(d);else break}for(let c of l)for(let d of Object.getOwnPropertyNames(c.prototype))(s||d!=="constructor")&&Object.defineProperty(i.prototype,d,Object.getOwnPropertyDescriptor(c.prototype,d)??Object.create(null))}e.nextTick=typeof(ft==null?void 0:ft.nextTick)=="function"?ft.nextTick:i=>{setTimeout(i,0)},e.MQTTJS_VERSION=qP().version}),Oa=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=void 0;var t=$o();e.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};var r=(o,i)=>{let{messageId:a}=i,s=i.cmd,l=null,c=o.outgoing[a]?o.outgoing[a].cb:null,d=null;if(!c){o.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(o.log("_handleAck :: packet type",s),s){case"pubcomp":case"puback":{let u=i.reasonCode;u&&u>0&&u!==16?(d=new t.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[u]}`,u),o._removeOutgoingAndStoreMessage(a,()=>{c(d,i)})):o._removeOutgoingAndStoreMessage(a,c);break}case"pubrec":{l={cmd:"pubrel",qos:2,messageId:a};let u=i.reasonCode;u&&u>0&&u!==16?(d=new t.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[u]}`,u),o._removeOutgoingAndStoreMessage(a,()=>{c(d,i)})):o._sendPacket(l);break}case"suback":{delete o.outgoing[a],o.messageIdProvider.deallocate(a);let u=i.granted;for(let f=0;f<u.length;f++){let h=u[f];if(h&128){d=new Error(`Subscribe error: ${e.ReasonCodes[h]}`),d.code=h;let g=o.messageIdToTopic[a];g&&g.forEach(p=>{delete o._resubscribeTopics[p]})}}delete o.messageIdToTopic[a],o._invokeStoreProcessingQueue(),c(d,i);break}case"unsuback":{delete o.outgoing[a],o.messageIdProvider.deallocate(a),o._invokeStoreProcessingQueue(),c(null,i);break}default:o.emit("error",new Error("unrecognized packet type"))}o.disconnecting&&Object.keys(o.outgoing).length===0&&o.emit("outgoingEmpty")};e.default=r}),GP=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"__esModule",{value:!0});var t=$o(),r=Oa(),o=(i,a)=>{let{options:s}=i,l=s.protocolVersion,c=l===5?a.reasonCode:a.returnCode;if(l!==5){let d=new t.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${l}`,c);i.emit("error",d);return}i.handleAuth(a,(d,u)=>{if(d){i.emit("error",d);return}if(c===24)i.reconnecting=!1,i._sendPacket(u);else{let f=new t.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[c]}`,c);i.emit("error",f)}})};e.default=o}),KP=Oe(e=>{var g,p,m,v,y,b,S,_,C,A,k,T,I,R,B,P,O,N,$,q,z,L,te,j,se,D,U,xe,X,zu,ne,Y,be,ce,Ay,he,Te,_e,Nn,$n,Du,us,fs,St,Fu,Ii,On,Vu,oe;Ie(),Ne(),Re(),Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,r=new Set,o=typeof ft=="object"&&ft?ft:{},i=(w,x,E,M)=>{typeof o.emitWarning=="function"?o.emitWarning(w,x,E,M):console.error(`[${E}] ${x}: ${w}`)},a=globalThis.AbortController,s=globalThis.AbortSignal;if(typeof a>"u"){s=class{constructor(){Pe(this,"onabort");Pe(this,"_onabort",[]);Pe(this,"reason");Pe(this,"aborted",!1)}addEventListener(E,M){this._onabort.push(M)}},a=class{constructor(){Pe(this,"signal",new s);x()}abort(E){var M,W;if(!this.signal.aborted){this.signal.reason=E,this.signal.aborted=!0;for(let Q of this.signal._onabort)Q(E);(W=(M=this.signal).onabort)==null||W.call(M,E)}}};let w=((g=o.env)==null?void 0:g.LRU_CACHE_IGNORE_AC_WARNING)!=="1",x=()=>{w&&(w=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",x))}}var l=w=>!r.has(w),c=w=>w&&w===Math.floor(w)&&w>0&&isFinite(w),d=w=>c(w)?w<=Math.pow(2,8)?Uint8Array:w<=Math.pow(2,16)?Uint16Array:w<=Math.pow(2,32)?Uint32Array:w<=Number.MAX_SAFE_INTEGER?u:null:null,u=class extends Array{constructor(w){super(w),this.fill(0)}},f=(p=class{constructor(x,E){Pe(this,"heap");Pe(this,"length");if(!ue(p,m))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new E(x),this.length=0}static create(x){let E=d(x);if(!E)return[];Qe(p,m,!0);let M=new p(x,E);return Qe(p,m,!1),M}push(x){this.heap[this.length++]=x}pop(){return this.heap[--this.length]}},m=new WeakMap,dt(p,m,!1),p),h=(oe=class{constructor(x){dt(this,X);dt(this,b);dt(this,S);dt(this,_);dt(this,C);dt(this,A);dt(this,k);Pe(this,"ttl");Pe(this,"ttlResolution");Pe(this,"ttlAutopurge");Pe(this,"updateAgeOnGet");Pe(this,"updateAgeOnHas");Pe(this,"allowStale");Pe(this,"noDisposeOnSet");Pe(this,"noUpdateTTL");Pe(this,"maxEntrySize");Pe(this,"sizeCalculation");Pe(this,"noDeleteOnFetchRejection");Pe(this,"noDeleteOnStaleGet");Pe(this,"allowStaleOnFetchAbort");Pe(this,"allowStaleOnFetchRejection");Pe(this,"ignoreFetchAbort");dt(this,T);dt(this,I);dt(this,R);dt(this,B);dt(this,P);dt(this,O);dt(this,N);dt(this,$);dt(this,q);dt(this,z);dt(this,L);dt(this,te);dt(this,j);dt(this,se);dt(this,D);dt(this,U);dt(this,xe);dt(this,ne,()=>{});dt(this,Y,()=>{});dt(this,be,()=>{});dt(this,ce,()=>!1);dt(this,he,x=>{});dt(this,Te,(x,E,M)=>{});dt(this,_e,(x,E,M,W)=>{if(M||W)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Pe(this,v,"LRUCache");let{max:E=0,ttl:M,ttlResolution:W=1,ttlAutopurge:Q,updateAgeOnGet:we,updateAgeOnHas:ae,allowStale:ge,dispose:Be,disposeAfter:H,noDisposeOnSet:ve,noUpdateTTL:Ae,maxSize:Le=0,maxEntrySize:We=0,sizeCalculation:Ve,fetchMethod:Ue,memoMethod:De,noDeleteOnFetchRejection:Ke,noDeleteOnStaleGet:et,allowStaleOnFetchRejection:ct,allowStaleOnFetchAbort:bt,ignoreFetchAbort:Pt}=x;if(E!==0&&!c(E))throw new TypeError("max option must be a nonnegative integer");let G=E?d(E):Array;if(!G)throw new Error("invalid max value: "+E);if(Qe(this,b,E),Qe(this,S,Le),this.maxEntrySize=We||ue(this,S),this.sizeCalculation=Ve,this.sizeCalculation){if(!ue(this,S)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(De!==void 0&&typeof De!="function")throw new TypeError("memoMethod must be a function if defined");if(Qe(this,k,De),Ue!==void 0&&typeof Ue!="function")throw new TypeError("fetchMethod must be a function if specified");if(Qe(this,A,Ue),Qe(this,U,!!Ue),Qe(this,R,new Map),Qe(this,B,new Array(E).fill(void 0)),Qe(this,P,new Array(E).fill(void 0)),Qe(this,O,new G(E)),Qe(this,N,new G(E)),Qe(this,$,0),Qe(this,q,0),Qe(this,z,f.create(E)),Qe(this,T,0),Qe(this,I,0),typeof Be=="function"&&Qe(this,_,Be),typeof H=="function"?(Qe(this,C,H),Qe(this,L,[])):(Qe(this,C,void 0),Qe(this,L,void 0)),Qe(this,D,!!ue(this,_)),Qe(this,xe,!!ue(this,C)),this.noDisposeOnSet=!!ve,this.noUpdateTTL=!!Ae,this.noDeleteOnFetchRejection=!!Ke,this.allowStaleOnFetchRejection=!!ct,this.allowStaleOnFetchAbort=!!bt,this.ignoreFetchAbort=!!Pt,this.maxEntrySize!==0){if(ue(this,S)!==0&&!c(ue(this,S)))throw new TypeError("maxSize must be a positive integer if specified");if(!c(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Ye(this,X,Ay).call(this)}if(this.allowStale=!!ge,this.noDeleteOnStaleGet=!!et,this.updateAgeOnGet=!!we,this.updateAgeOnHas=!!ae,this.ttlResolution=c(W)||W===0?W:1,this.ttlAutopurge=!!Q,this.ttl=M||0,this.ttl){if(!c(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Ye(this,X,zu).call(this)}if(ue(this,b)===0&&this.ttl===0&&ue(this,S)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!ue(this,b)&&!ue(this,S)){let le="LRU_CACHE_UNBOUNDED";l(le)&&(r.add(le),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",le,oe))}}static unsafeExposeInternals(x){return{starts:ue(x,j),ttls:ue(x,se),sizes:ue(x,te),keyMap:ue(x,R),keyList:ue(x,B),valList:ue(x,P),next:ue(x,O),prev:ue(x,N),get head(){return ue(x,$)},get tail(){return ue(x,q)},free:ue(x,z),isBackgroundFetch:E=>{var M;return Ye(M=x,X,St).call(M,E)},backgroundFetch:(E,M,W,Q)=>{var we;return Ye(we=x,X,fs).call(we,E,M,W,Q)},moveToTail:E=>{var M;return Ye(M=x,X,Ii).call(M,E)},indexes:E=>{var M;return Ye(M=x,X,Nn).call(M,E)},rindexes:E=>{var M;return Ye(M=x,X,$n).call(M,E)},isStale:E=>{var M;return ue(M=x,ce).call(M,E)}}}get max(){return ue(this,b)}get maxSize(){return ue(this,S)}get calculatedSize(){return ue(this,I)}get size(){return ue(this,T)}get fetchMethod(){return ue(this,A)}get memoMethod(){return ue(this,k)}get dispose(){return ue(this,_)}get disposeAfter(){return ue(this,C)}getRemainingTTL(x){return ue(this,R).has(x)?1/0:0}*entries(){for(let x of Ye(this,X,Nn).call(this))ue(this,P)[x]!==void 0&&ue(this,B)[x]!==void 0&&!Ye(this,X,St).call(this,ue(this,P)[x])&&(yield[ue(this,B)[x],ue(this,P)[x]])}*rentries(){for(let x of Ye(this,X,$n).call(this))ue(this,P)[x]!==void 0&&ue(this,B)[x]!==void 0&&!Ye(this,X,St).call(this,ue(this,P)[x])&&(yield[ue(this,B)[x],ue(this,P)[x]])}*keys(){for(let x of Ye(this,X,Nn).call(this)){let E=ue(this,B)[x];E!==void 0&&!Ye(this,X,St).call(this,ue(this,P)[x])&&(yield E)}}*rkeys(){for(let x of Ye(this,X,$n).call(this)){let E=ue(this,B)[x];E!==void 0&&!Ye(this,X,St).call(this,ue(this,P)[x])&&(yield E)}}*values(){for(let x of Ye(this,X,Nn).call(this))ue(this,P)[x]!==void 0&&!Ye(this,X,St).call(this,ue(this,P)[x])&&(yield ue(this,P)[x])}*rvalues(){for(let x of Ye(this,X,$n).call(this))ue(this,P)[x]!==void 0&&!Ye(this,X,St).call(this,ue(this,P)[x])&&(yield ue(this,P)[x])}[(y=Symbol.iterator,v=Symbol.toStringTag,y)](){return this.entries()}find(x,E={}){for(let M of Ye(this,X,Nn).call(this)){let W=ue(this,P)[M],Q=Ye(this,X,St).call(this,W)?W.__staleWhileFetching:W;if(Q!==void 0&&x(Q,ue(this,B)[M],this))return this.get(ue(this,B)[M],E)}}forEach(x,E=this){for(let M of Ye(this,X,Nn).call(this)){let W=ue(this,P)[M],Q=Ye(this,X,St).call(this,W)?W.__staleWhileFetching:W;Q!==void 0&&x.call(E,Q,ue(this,B)[M],this)}}rforEach(x,E=this){for(let M of Ye(this,X,$n).call(this)){let W=ue(this,P)[M],Q=Ye(this,X,St).call(this,W)?W.__staleWhileFetching:W;Q!==void 0&&x.call(E,Q,ue(this,B)[M],this)}}purgeStale(){let x=!1;for(let E of Ye(this,X,$n).call(this,{allowStale:!0}))ue(this,ce).call(this,E)&&(Ye(this,X,On).call(this,ue(this,B)[E],"expire"),x=!0);return x}info(x){let E=ue(this,R).get(x);if(E===void 0)return;let M=ue(this,P)[E],W=Ye(this,X,St).call(this,M)?M.__staleWhileFetching:M;if(W===void 0)return;let Q={value:W};if(ue(this,se)&&ue(this,j)){let we=ue(this,se)[E],ae=ue(this,j)[E];if(we&&ae){let ge=we-(t.now()-ae);Q.ttl=ge,Q.start=Date.now()}}return ue(this,te)&&(Q.size=ue(this,te)[E]),Q}dump(){let x=[];for(let E of Ye(this,X,Nn).call(this,{allowStale:!0})){let M=ue(this,B)[E],W=ue(this,P)[E],Q=Ye(this,X,St).call(this,W)?W.__staleWhileFetching:W;if(Q===void 0||M===void 0)continue;let we={value:Q};if(ue(this,se)&&ue(this,j)){we.ttl=ue(this,se)[E];let ae=t.now()-ue(this,j)[E];we.start=Math.floor(Date.now()-ae)}ue(this,te)&&(we.size=ue(this,te)[E]),x.unshift([M,we])}return x}load(x){this.clear();for(let[E,M]of x){if(M.start){let W=Date.now()-M.start;M.start=t.now()-W}this.set(E,M.value,M)}}set(x,E,M={}){var Ae,Le,We,Ve,Ue;if(E===void 0)return this.delete(x),this;let{ttl:W=this.ttl,start:Q,noDisposeOnSet:we=this.noDisposeOnSet,sizeCalculation:ae=this.sizeCalculation,status:ge}=M,{noUpdateTTL:Be=this.noUpdateTTL}=M,H=ue(this,_e).call(this,x,E,M.size||0,ae);if(this.maxEntrySize&&H>this.maxEntrySize)return ge&&(ge.set="miss",ge.maxEntrySizeExceeded=!0),Ye(this,X,On).call(this,x,"set"),this;let ve=ue(this,T)===0?void 0:ue(this,R).get(x);if(ve===void 0)ve=ue(this,T)===0?ue(this,q):ue(this,z).length!==0?ue(this,z).pop():ue(this,T)===ue(this,b)?Ye(this,X,us).call(this,!1):ue(this,T),ue(this,B)[ve]=x,ue(this,P)[ve]=E,ue(this,R).set(x,ve),ue(this,O)[ue(this,q)]=ve,ue(this,N)[ve]=ue(this,q),Qe(this,q,ve),ds(this,T)._++,ue(this,Te).call(this,ve,H,ge),ge&&(ge.set="add"),Be=!1;else{Ye(this,X,Ii).call(this,ve);let De=ue(this,P)[ve];if(E!==De){if(ue(this,U)&&Ye(this,X,St).call(this,De)){De.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Ke}=De;Ke!==void 0&&!we&&(ue(this,D)&&((Ae=ue(this,_))==null||Ae.call(this,Ke,x,"set")),ue(this,xe)&&((Le=ue(this,L))==null||Le.push([Ke,x,"set"])))}else we||(ue(this,D)&&((We=ue(this,_))==null||We.call(this,De,x,"set")),ue(this,xe)&&((Ve=ue(this,L))==null||Ve.push([De,x,"set"])));if(ue(this,he).call(this,ve),ue(this,Te).call(this,ve,H,ge),ue(this,P)[ve]=E,ge){ge.set="replace";let Ke=De&&Ye(this,X,St).call(this,De)?De.__staleWhileFetching:De;Ke!==void 0&&(ge.oldValue=Ke)}}else ge&&(ge.set="update")}if(W!==0&&!ue(this,se)&&Ye(this,X,zu).call(this),ue(this,se)&&(Be||ue(this,be).call(this,ve,W,Q),ge&&ue(this,Y).call(this,ge,ve)),!we&&ue(this,xe)&&ue(this,L)){let De=ue(this,L),Ke;for(;Ke=De==null?void 0:De.shift();)(Ue=ue(this,C))==null||Ue.call(this,...Ke)}return this}pop(){var x;try{for(;ue(this,T);){let E=ue(this,P)[ue(this,$)];if(Ye(this,X,us).call(this,!0),Ye(this,X,St).call(this,E)){if(E.__staleWhileFetching)return E.__staleWhileFetching}else if(E!==void 0)return E}}finally{if(ue(this,xe)&&ue(this,L)){let E=ue(this,L),M;for(;M=E==null?void 0:E.shift();)(x=ue(this,C))==null||x.call(this,...M)}}}has(x,E={}){let{updateAgeOnHas:M=this.updateAgeOnHas,status:W}=E,Q=ue(this,R).get(x);if(Q!==void 0){let we=ue(this,P)[Q];if(Ye(this,X,St).call(this,we)&&we.__staleWhileFetching===void 0)return!1;if(ue(this,ce).call(this,Q))W&&(W.has="stale",ue(this,Y).call(this,W,Q));else return M&&ue(this,ne).call(this,Q),W&&(W.has="hit",ue(this,Y).call(this,W,Q)),!0}else W&&(W.has="miss");return!1}peek(x,E={}){let{allowStale:M=this.allowStale}=E,W=ue(this,R).get(x);if(W===void 0||!M&&ue(this,ce).call(this,W))return;let Q=ue(this,P)[W];return Ye(this,X,St).call(this,Q)?Q.__staleWhileFetching:Q}async fetch(x,E={}){let{allowStale:M=this.allowStale,updateAgeOnGet:W=this.updateAgeOnGet,noDeleteOnStaleGet:Q=this.noDeleteOnStaleGet,ttl:we=this.ttl,noDisposeOnSet:ae=this.noDisposeOnSet,size:ge=0,sizeCalculation:Be=this.sizeCalculation,noUpdateTTL:H=this.noUpdateTTL,noDeleteOnFetchRejection:ve=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Ae=this.allowStaleOnFetchRejection,ignoreFetchAbort:Le=this.ignoreFetchAbort,allowStaleOnFetchAbort:We=this.allowStaleOnFetchAbort,context:Ve,forceRefresh:Ue=!1,status:De,signal:Ke}=E;if(!ue(this,U))return De&&(De.fetch="get"),this.get(x,{allowStale:M,updateAgeOnGet:W,noDeleteOnStaleGet:Q,status:De});let et={allowStale:M,updateAgeOnGet:W,noDeleteOnStaleGet:Q,ttl:we,noDisposeOnSet:ae,size:ge,sizeCalculation:Be,noUpdateTTL:H,noDeleteOnFetchRejection:ve,allowStaleOnFetchRejection:Ae,allowStaleOnFetchAbort:We,ignoreFetchAbort:Le,status:De,signal:Ke},ct=ue(this,R).get(x);if(ct===void 0){De&&(De.fetch="miss");let bt=Ye(this,X,fs).call(this,x,ct,et,Ve);return bt.__returned=bt}else{let bt=ue(this,P)[ct];if(Ye(this,X,St).call(this,bt)){let ze=M&&bt.__staleWhileFetching!==void 0;return De&&(De.fetch="inflight",ze&&(De.returnedStale=!0)),ze?bt.__staleWhileFetching:bt.__returned=bt}let Pt=ue(this,ce).call(this,ct);if(!Ue&&!Pt)return De&&(De.fetch="hit"),Ye(this,X,Ii).call(this,ct),W&&ue(this,ne).call(this,ct),De&&ue(this,Y).call(this,De,ct),bt;let G=Ye(this,X,fs).call(this,x,ct,et,Ve),le=G.__staleWhileFetching!==void 0&&M;return De&&(De.fetch=Pt?"stale":"refresh",le&&Pt&&(De.returnedStale=!0)),le?G.__staleWhileFetching:G.__returned=G}}async forceFetch(x,E={}){let M=await this.fetch(x,E);if(M===void 0)throw new Error("fetch() returned undefined");return M}memo(x,E={}){let M=ue(this,k);if(!M)throw new Error("no memoMethod provided to constructor");let{context:W,forceRefresh:Q,...we}=E,ae=this.get(x,we);if(!Q&&ae!==void 0)return ae;let ge=M(x,ae,{options:we,context:W});return this.set(x,ge,we),ge}get(x,E={}){let{allowStale:M=this.allowStale,updateAgeOnGet:W=this.updateAgeOnGet,noDeleteOnStaleGet:Q=this.noDeleteOnStaleGet,status:we}=E,ae=ue(this,R).get(x);if(ae!==void 0){let ge=ue(this,P)[ae],Be=Ye(this,X,St).call(this,ge);return we&&ue(this,Y).call(this,we,ae),ue(this,ce).call(this,ae)?(we&&(we.get="stale"),Be?(we&&M&&ge.__staleWhileFetching!==void 0&&(we.returnedStale=!0),M?ge.__staleWhileFetching:void 0):(Q||Ye(this,X,On).call(this,x,"expire"),we&&M&&(we.returnedStale=!0),M?ge:void 0)):(we&&(we.get="hit"),Be?ge.__staleWhileFetching:(Ye(this,X,Ii).call(this,ae),W&&ue(this,ne).call(this,ae),ge))}else we&&(we.get="miss")}delete(x){return Ye(this,X,On).call(this,x,"delete")}clear(){return Ye(this,X,Vu).call(this,"delete")}},b=new WeakMap,S=new WeakMap,_=new WeakMap,C=new WeakMap,A=new WeakMap,k=new WeakMap,T=new WeakMap,I=new WeakMap,R=new WeakMap,B=new WeakMap,P=new WeakMap,O=new WeakMap,N=new WeakMap,$=new WeakMap,q=new WeakMap,z=new WeakMap,L=new WeakMap,te=new WeakMap,j=new WeakMap,se=new WeakMap,D=new WeakMap,U=new WeakMap,xe=new WeakMap,X=new WeakSet,zu=function(){let x=new u(ue(this,b)),E=new u(ue(this,b));Qe(this,se,x),Qe(this,j,E),Qe(this,be,(Q,we,ae=t.now())=>{if(E[Q]=we!==0?ae:0,x[Q]=we,we!==0&&this.ttlAutopurge){let ge=setTimeout(()=>{ue(this,ce).call(this,Q)&&Ye(this,X,On).call(this,ue(this,B)[Q],"expire")},we+1);ge.unref&&ge.unref()}}),Qe(this,ne,Q=>{E[Q]=x[Q]!==0?t.now():0}),Qe(this,Y,(Q,we)=>{if(x[we]){let ae=x[we],ge=E[we];if(!ae||!ge)return;Q.ttl=ae,Q.start=ge,Q.now=M||W();let Be=Q.now-ge;Q.remainingTTL=ae-Be}});let M=0,W=()=>{let Q=t.now();if(this.ttlResolution>0){M=Q;let we=setTimeout(()=>M=0,this.ttlResolution);we.unref&&we.unref()}return Q};this.getRemainingTTL=Q=>{let we=ue(this,R).get(Q);if(we===void 0)return 0;let ae=x[we],ge=E[we];if(!ae||!ge)return 1/0;let Be=(M||W())-ge;return ae-Be},Qe(this,ce,Q=>{let we=E[Q],ae=x[Q];return!!ae&&!!we&&(M||W())-we>ae})},ne=new WeakMap,Y=new WeakMap,be=new WeakMap,ce=new WeakMap,Ay=function(){let x=new u(ue(this,b));Qe(this,I,0),Qe(this,te,x),Qe(this,he,E=>{Qe(this,I,ue(this,I)-x[E]),x[E]=0}),Qe(this,_e,(E,M,W,Q)=>{if(Ye(this,X,St).call(this,M))return 0;if(!c(W))if(Q){if(typeof Q!="function")throw new TypeError("sizeCalculation must be a function");if(W=Q(M,E),!c(W))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return W}),Qe(this,Te,(E,M,W)=>{if(x[E]=M,ue(this,S)){let Q=ue(this,S)-x[E];for(;ue(this,I)>Q;)Ye(this,X,us).call(this,!0)}Qe(this,I,ue(this,I)+x[E]),W&&(W.entrySize=M,W.totalCalculatedSize=ue(this,I))})},he=new WeakMap,Te=new WeakMap,_e=new WeakMap,Nn=function*({allowStale:x=this.allowStale}={}){if(ue(this,T))for(let E=ue(this,q);!(!Ye(this,X,Du).call(this,E)||((x||!ue(this,ce).call(this,E))&&(yield E),E===ue(this,$)));)E=ue(this,N)[E]},$n=function*({allowStale:x=this.allowStale}={}){if(ue(this,T))for(let E=ue(this,$);!(!Ye(this,X,Du).call(this,E)||((x||!ue(this,ce).call(this,E))&&(yield E),E===ue(this,q)));)E=ue(this,O)[E]},Du=function(x){return x!==void 0&&ue(this,R).get(ue(this,B)[x])===x},us=function(x){var Q,we;let E=ue(this,$),M=ue(this,B)[E],W=ue(this,P)[E];return ue(this,U)&&Ye(this,X,St).call(this,W)?W.__abortController.abort(new Error("evicted")):(ue(this,D)||ue(this,xe))&&(ue(this,D)&&((Q=ue(this,_))==null||Q.call(this,W,M,"evict")),ue(this,xe)&&((we=ue(this,L))==null||we.push([W,M,"evict"]))),ue(this,he).call(this,E),x&&(ue(this,B)[E]=void 0,ue(this,P)[E]=void 0,ue(this,z).push(E)),ue(this,T)===1?(Qe(this,$,Qe(this,q,0)),ue(this,z).length=0):Qe(this,$,ue(this,O)[E]),ue(this,R).delete(M),ds(this,T)._--,E},fs=function(x,E,M,W){let Q=E===void 0?void 0:ue(this,P)[E];if(Ye(this,X,St).call(this,Q))return Q;let we=new a,{signal:ae}=M;ae==null||ae.addEventListener("abort",()=>we.abort(ae.reason),{signal:we.signal});let ge={signal:we.signal,options:M,context:W},Be=(Ve,Ue=!1)=>{let{aborted:De}=we.signal,Ke=M.ignoreFetchAbort&&Ve!==void 0;if(M.status&&(De&&!Ue?(M.status.fetchAborted=!0,M.status.fetchError=we.signal.reason,Ke&&(M.status.fetchAbortIgnored=!0)):M.status.fetchResolved=!0),De&&!Ke&&!Ue)return ve(we.signal.reason);let et=Le;return ue(this,P)[E]===Le&&(Ve===void 0?et.__staleWhileFetching?ue(this,P)[E]=et.__staleWhileFetching:Ye(this,X,On).call(this,x,"fetch"):(M.status&&(M.status.fetchUpdated=!0),this.set(x,Ve,ge.options))),Ve},H=Ve=>(M.status&&(M.status.fetchRejected=!0,M.status.fetchError=Ve),ve(Ve)),ve=Ve=>{let{aborted:Ue}=we.signal,De=Ue&&M.allowStaleOnFetchAbort,Ke=De||M.allowStaleOnFetchRejection,et=Ke||M.noDeleteOnFetchRejection,ct=Le;if(ue(this,P)[E]===Le&&(!et||ct.__staleWhileFetching===void 0?Ye(this,X,On).call(this,x,"fetch"):De||(ue(this,P)[E]=ct.__staleWhileFetching)),Ke)return M.status&&ct.__staleWhileFetching!==void 0&&(M.status.returnedStale=!0),ct.__staleWhileFetching;if(ct.__returned===ct)throw Ve},Ae=(Ve,Ue)=>{var Ke;let De=(Ke=ue(this,A))==null?void 0:Ke.call(this,x,Q,ge);De&&De instanceof Promise&&De.then(et=>Ve(et===void 0?void 0:et),Ue),we.signal.addEventListener("abort",()=>{(!M.ignoreFetchAbort||M.allowStaleOnFetchAbort)&&(Ve(void 0),M.allowStaleOnFetchAbort&&(Ve=et=>Be(et,!0)))})};M.status&&(M.status.fetchDispatched=!0);let Le=new Promise(Ae).then(Be,H),We=Object.assign(Le,{__abortController:we,__staleWhileFetching:Q,__returned:void 0});return E===void 0?(this.set(x,We,{...ge.options,status:void 0}),E=ue(this,R).get(x)):ue(this,P)[E]=We,We},St=function(x){if(!ue(this,U))return!1;let E=x;return!!E&&E instanceof Promise&&E.hasOwnProperty("__staleWhileFetching")&&E.__abortController instanceof a},Fu=function(x,E){ue(this,N)[E]=x,ue(this,O)[x]=E},Ii=function(x){x!==ue(this,q)&&(x===ue(this,$)?Qe(this,$,ue(this,O)[x]):Ye(this,X,Fu).call(this,ue(this,N)[x],ue(this,O)[x]),Ye(this,X,Fu).call(this,ue(this,q),x),Qe(this,q,x))},On=function(x,E){var W,Q,we,ae;let M=!1;if(ue(this,T)!==0){let ge=ue(this,R).get(x);if(ge!==void 0)if(M=!0,ue(this,T)===1)Ye(this,X,Vu).call(this,E);else{ue(this,he).call(this,ge);let Be=ue(this,P)[ge];if(Ye(this,X,St).call(this,Be)?Be.__abortController.abort(new Error("deleted")):(ue(this,D)||ue(this,xe))&&(ue(this,D)&&((W=ue(this,_))==null||W.call(this,Be,x,E)),ue(this,xe)&&((Q=ue(this,L))==null||Q.push([Be,x,E]))),ue(this,R).delete(x),ue(this,B)[ge]=void 0,ue(this,P)[ge]=void 0,ge===ue(this,q))Qe(this,q,ue(this,N)[ge]);else if(ge===ue(this,$))Qe(this,$,ue(this,O)[ge]);else{let H=ue(this,N)[ge];ue(this,O)[H]=ue(this,O)[ge];let ve=ue(this,O)[ge];ue(this,N)[ve]=ue(this,N)[ge]}ds(this,T)._--,ue(this,z).push(ge)}}if(ue(this,xe)&&((we=ue(this,L))!=null&&we.length)){let ge=ue(this,L),Be;for(;Be=ge==null?void 0:ge.shift();)(ae=ue(this,C))==null||ae.call(this,...Be)}return M},Vu=function(x){var E,M,W;for(let Q of Ye(this,X,$n).call(this,{allowStale:!0})){let we=ue(this,P)[Q];if(Ye(this,X,St).call(this,we))we.__abortController.abort(new Error("deleted"));else{let ae=ue(this,B)[Q];ue(this,D)&&((E=ue(this,_))==null||E.call(this,we,ae,x)),ue(this,xe)&&((M=ue(this,L))==null||M.push([we,ae,x]))}}if(ue(this,R).clear(),ue(this,P).fill(void 0),ue(this,B).fill(void 0),ue(this,se)&&ue(this,j)&&(ue(this,se).fill(0),ue(this,j).fill(0)),ue(this,te)&&ue(this,te).fill(0),Qe(this,$,0),Qe(this,q,0),ue(this,z).length=0,Qe(this,I,0),Qe(this,T,0),ue(this,xe)&&ue(this,L)){let Q=ue(this,L),we;for(;we=Q==null?void 0:Q.shift();)(W=ue(this,C))==null||W.call(this,...we)}},oe);e.LRUCache=h}),an=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.ContainerIterator=e.Container=e.Base=void 0;var t=class{constructor(i=0){this.iteratorType=i}equals(i){return this.o===i.o}};e.ContainerIterator=t;var r=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};e.Base=r;var o=class extends r{};e.Container=o}),YP=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=an(),r=class extends t.Base{constructor(i=[]){super(),this.S=[];let a=this;i.forEach(function(s){a.push(s)})}clear(){this.i=0,this.S=[]}push(i){return this.S.push(i),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},o=r;e.default=o}),XP=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=an(),r=class extends t.Base{constructor(i=[]){super(),this.j=0,this.q=[];let a=this;i.forEach(function(s){a.push(s)})}clear(){this.q=[],this.i=this.j=0}push(i){let a=this.q.length;if(this.j/a>.5&&this.j+this.i>=a&&a>4096){let s=this.i;for(let l=0;l<s;++l)this.q[l]=this.q[this.j+l];this.j=0,this.q[this.i]=i}else this.q[this.j+this.i]=i;return++this.i}pop(){if(this.i===0)return;let i=this.q[this.j++];return this.i-=1,i}front(){if(this.i!==0)return this.q[this.j]}},o=r;e.default=o}),JP=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=an(),r=class extends t.Base{constructor(i=[],a=function(l,c){return l>c?-1:l<c?1:0},s=!0){if(super(),this.v=a,Array.isArray(i))this.C=s?[...i]:i;else{this.C=[];let c=this;i.forEach(function(d){c.C.push(d)})}this.i=this.C.length;let l=this.i>>1;for(let c=this.i-1>>1;c>=0;--c)this.k(c,l)}m(i){let a=this.C[i];for(;i>0;){let s=i-1>>1,l=this.C[s];if(this.v(l,a)<=0)break;this.C[i]=l,i=s}this.C[i]=a}k(i,a){let s=this.C[i];for(;i<a;){let l=i<<1|1,c=l+1,d=this.C[l];if(c<this.i&&this.v(d,this.C[c])>0&&(l=c,d=this.C[c]),this.v(d,s)>=0)break;this.C[i]=d,i=l}this.C[i]=s}clear(){this.i=0,this.C.length=0}push(i){this.C.push(i),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let i=this.C[0],a=this.C.pop();return this.i-=1,this.i&&(this.C[0]=a,this.k(0,this.i>>1)),i}top(){return this.C[0]}find(i){return this.C.indexOf(i)>=0}remove(i){let a=this.C.indexOf(i);return a<0?!1:(a===0?this.pop():a===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(a,1,this.C.pop()),this.i-=1,this.m(a),this.k(a,this.i>>1)),!0)}updateItem(i){let a=this.C.indexOf(i);return a<0?!1:(this.m(a),this.k(a,this.i>>1),!0)}toArray(){return[...this.C]}},o=r;e.default=o}),vd=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=an(),r=class extends t.Container{},o=r;e.default=o}),sn=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.throwIteratorAccessError=t;function t(){throw new RangeError("Iterator access denied!")}}),Jg=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.RandomIterator=void 0;var t=an(),r=sn(),o=class extends t.ContainerIterator{constructor(i,a){super(a),this.o=i,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,r.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,r.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,r.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,r.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(i){this.container.setElementByPos(this.o,i)}};e.RandomIterator=o}),QP=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=o(vd()),r=Jg();function o(l){return l&&l.t?l:{default:l}}var i=class Py extends r.RandomIterator{constructor(c,d,u){super(c,u),this.container=d}copy(){return new Py(this.o,this.container,this.iteratorType)}},a=class extends t.default{constructor(l=[],c=!0){if(super(),Array.isArray(l))this.J=c?[...l]:l,this.i=l.length;else{this.J=[];let d=this;l.forEach(function(u){d.pushBack(u)})}}clear(){this.i=0,this.J.length=0}begin(){return new i(0,this)}end(){return new i(this.i,this)}rBegin(){return new i(this.i-1,this,1)}rEnd(){return new i(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(l){if(l<0||l>this.i-1)throw new RangeError;return this.J[l]}eraseElementByPos(l){if(l<0||l>this.i-1)throw new RangeError;return this.J.splice(l,1),this.i-=1,this.i}eraseElementByValue(l){let c=0;for(let d=0;d<this.i;++d)this.J[d]!==l&&(this.J[c++]=this.J[d]);return this.i=this.J.length=c,this.i}eraseElementByIterator(l){let c=l.o;return l=l.next(),this.eraseElementByPos(c),l}pushBack(l){return this.J.push(l),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(l,c){if(l<0||l>this.i-1)throw new RangeError;this.J[l]=c}insert(l,c,d=1){if(l<0||l>this.i)throw new RangeError;return this.J.splice(l,0,...new Array(d).fill(c)),this.i+=d,this.i}find(l){for(let c=0;c<this.i;++c)if(this.J[c]===l)return new i(c,this);return this.end()}reverse(){this.J.reverse()}unique(){let l=1;for(let c=1;c<this.i;++c)this.J[c]!==this.J[c-1]&&(this.J[l++]=this.J[c]);return this.i=this.J.length=l,this.i}sort(l){this.J.sort(l)}forEach(l){for(let c=0;c<this.i;++c)l(this.J[c],c,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}},s=a;e.default=s}),ZP=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=i(vd()),r=an(),o=sn();function i(c){return c&&c.t?c:{default:c}}var a=class Iy extends r.ContainerIterator{constructor(d,u,f,h){super(h),this.o=d,this.h=u,this.container=f,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,o.throwIteratorAccessError)(),this.o.l}set pointer(d){this.o===this.h&&(0,o.throwIteratorAccessError)(),this.o.l=d}copy(){return new Iy(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.default{constructor(c=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let d=this;c.forEach(function(u){d.pushBack(u)})}V(c){let{L:d,B:u}=c;d.B=u,u.L=d,c===this.p&&(this.p=u),c===this._&&(this._=d),this.i-=1}G(c,d){let u=d.B,f={l:c,L:d,B:u};d.B=f,u.L=f,d===this.h&&(this.p=f),u===this.h&&(this._=f),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new a(this.p,this.h,this)}end(){return new a(this.h,this.h,this)}rBegin(){return new a(this._,this.h,this,1)}rEnd(){return new a(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(c){if(c<0||c>this.i-1)throw new RangeError;let d=this.p;for(;c--;)d=d.B;return d.l}eraseElementByPos(c){if(c<0||c>this.i-1)throw new RangeError;let d=this.p;for(;c--;)d=d.B;return this.V(d),this.i}eraseElementByValue(c){let d=this.p;for(;d!==this.h;)d.l===c&&this.V(d),d=d.B;return this.i}eraseElementByIterator(c){let d=c.o;return d===this.h&&(0,o.throwIteratorAccessError)(),c=c.next(),this.V(d),c}pushBack(c){return this.G(c,this._),this.i}popBack(){if(this.i===0)return;let c=this._.l;return this.V(this._),c}pushFront(c){return this.G(c,this.h),this.i}popFront(){if(this.i===0)return;let c=this.p.l;return this.V(this.p),c}setElementByPos(c,d){if(c<0||c>this.i-1)throw new RangeError;let u=this.p;for(;c--;)u=u.B;u.l=d}insert(c,d,u=1){if(c<0||c>this.i)throw new RangeError;if(u<=0)return this.i;if(c===0)for(;u--;)this.pushFront(d);else if(c===this.i)for(;u--;)this.pushBack(d);else{let f=this.p;for(let g=1;g<c;++g)f=f.B;let h=f.B;for(this.i+=u;u--;)f.B={l:d,L:f},f.B.L=f,f=f.B;f.B=h,h.L=f}return this.i}find(c){let d=this.p;for(;d!==this.h;){if(d.l===c)return new a(d,this.h,this);d=d.B}return this.end()}reverse(){if(this.i<=1)return;let c=this.p,d=this._,u=0;for(;u<<1<this.i;){let f=c.l;c.l=d.l,d.l=f,c=c.B,d=d.L,u+=1}}unique(){if(this.i<=1)return this.i;let c=this.p;for(;c!==this.h;){let d=c;for(;d.B!==this.h&&d.l===d.B.l;)d=d.B,this.i-=1;c.B=d.B,c.B.L=c,c=c.B}return this.i}sort(c){if(this.i<=1)return;let d=[];this.forEach(function(f){d.push(f)}),d.sort(c);let u=this.p;d.forEach(function(f){u.l=f,u=u.B})}merge(c){let d=this;if(this.i===0)c.forEach(function(u){d.pushBack(u)});else{let u=this.p;c.forEach(function(f){for(;u!==d.h&&u.l<=f;)u=u.B;d.G(f,u.L)})}return this.i}forEach(c){let d=this.p,u=0;for(;d!==this.h;)c(d.l,u++,this),d=d.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let c=this.p;for(;c!==this.h;)yield c.l,c=c.B}).bind(this)()}},l=s;e.default=l}),eI=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=o(vd()),r=Jg();function o(l){return l&&l.t?l:{default:l}}var i=class Ry extends r.RandomIterator{constructor(c,d,u){super(c,u),this.container=d}copy(){return new Ry(this.o,this.container,this.iteratorType)}},a=class extends t.default{constructor(l=[],c=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let d=(()=>{if(typeof l.length=="number")return l.length;if(typeof l.size=="number")return l.size;if(typeof l.size=="function")return l.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=c,this.P=Math.max(Math.ceil(d/this.F),1);for(let h=0;h<this.P;++h)this.A.push(new Array(this.F));let u=Math.ceil(d/this.F);this.j=this.R=(this.P>>1)-(u>>1),this.D=this.N=this.F-d%this.F>>1;let f=this;l.forEach(function(h){f.pushBack(h)})}T(){let l=[],c=Math.max(this.P>>1,1);for(let d=0;d<c;++d)l[d]=new Array(this.F);for(let d=this.j;d<this.P;++d)l[l.length]=this.A[d];for(let d=0;d<this.R;++d)l[l.length]=this.A[d];l[l.length]=[...this.A[this.R]],this.j=c,this.R=l.length-1;for(let d=0;d<c;++d)l[l.length]=new Array(this.F);this.A=l,this.P=l.length}O(l){let c=this.D+l+1,d=c%this.F,u=d-1,f=this.j+(c-d)/this.F;return d===0&&(f-=1),f%=this.P,u<0&&(u+=this.F),{curNodeBucketIndex:f,curNodePointerIndex:u}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new i(0,this)}end(){return new i(this.i,this)}rBegin(){return new i(this.i-1,this,1)}rEnd(){return new i(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(l){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=l,this.i}popBack(){if(this.i===0)return;let l=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,l}pushFront(l){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=l,this.i}popFront(){if(this.i===0)return;let l=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,l}getElementByPos(l){if(l<0||l>this.i-1)throw new RangeError;let{curNodeBucketIndex:c,curNodePointerIndex:d}=this.O(l);return this.A[c][d]}setElementByPos(l,c){if(l<0||l>this.i-1)throw new RangeError;let{curNodeBucketIndex:d,curNodePointerIndex:u}=this.O(l);this.A[d][u]=c}insert(l,c,d=1){if(l<0||l>this.i)throw new RangeError;if(l===0)for(;d--;)this.pushFront(c);else if(l===this.i)for(;d--;)this.pushBack(c);else{let u=[];for(let f=l;f<this.i;++f)u.push(this.getElementByPos(f));this.cut(l-1);for(let f=0;f<d;++f)this.pushBack(c);for(let f=0;f<u.length;++f)this.pushBack(u[f])}return this.i}cut(l){if(l<0)return this.clear(),0;let{curNodeBucketIndex:c,curNodePointerIndex:d}=this.O(l);return this.R=c,this.N=d,this.i=l+1,this.i}eraseElementByPos(l){if(l<0||l>this.i-1)throw new RangeError;if(l===0)this.popFront();else if(l===this.i-1)this.popBack();else{let c=[];for(let u=l+1;u<this.i;++u)c.push(this.getElementByPos(u));this.cut(l),this.popBack();let d=this;c.forEach(function(u){d.pushBack(u)})}return this.i}eraseElementByValue(l){if(this.i===0)return 0;let c=[];for(let u=0;u<this.i;++u){let f=this.getElementByPos(u);f!==l&&c.push(f)}let d=c.length;for(let u=0;u<d;++u)this.setElementByPos(u,c[u]);return this.cut(d-1)}eraseElementByIterator(l){let c=l.o;return this.eraseElementByPos(c),l=l.next(),l}find(l){for(let c=0;c<this.i;++c)if(this.getElementByPos(c)===l)return new i(c,this);return this.end()}reverse(){let l=0,c=this.i-1;for(;l<c;){let d=this.getElementByPos(l);this.setElementByPos(l,this.getElementByPos(c)),this.setElementByPos(c,d),l+=1,c-=1}}unique(){if(this.i<=1)return this.i;let l=1,c=this.getElementByPos(0);for(let d=1;d<this.i;++d){let u=this.getElementByPos(d);u!==c&&(c=u,this.setElementByPos(l++,u))}for(;this.i>l;)this.popBack();return this.i}sort(l){let c=[];for(let d=0;d<this.i;++d)c.push(this.getElementByPos(d));c.sort(l);for(let d=0;d<this.i;++d)this.setElementByPos(d,c[d])}shrinkToFit(){if(this.i===0)return;let l=[];this.forEach(function(c){l.push(c)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let c=0;c<this.P;++c)this.A.push(new Array(this.F));for(let c=0;c<l.length;++c)this.pushBack(l[c])}forEach(l){for(let c=0;c<this.i;++c)l(this.getElementByPos(c),c,this)}[Symbol.iterator](){return(function*(){for(let l=0;l<this.i;++l)yield this.getElementByPos(l)}).bind(this)()}},s=a;e.default=s}),tI=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.TreeNodeEnableIndex=e.TreeNode=void 0;var t=class{constructor(o,i){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=o,this.l=i}L(){let o=this;if(o.ee===1&&o.tt.tt===o)o=o.W;else if(o.U)for(o=o.U;o.W;)o=o.W;else{let i=o.tt;for(;i.U===o;)o=i,i=o.tt;o=i}return o}B(){let o=this;if(o.W){for(o=o.W;o.U;)o=o.U;return o}else{let i=o.tt;for(;i.W===o;)o=i,i=o.tt;return o.W!==i?i:o}}te(){let o=this.tt,i=this.W,a=i.U;return o.tt===this?o.tt=i:o.U===this?o.U=i:o.W=i,i.tt=o,i.U=this,this.tt=i,this.W=a,a&&(a.tt=this),i}se(){let o=this.tt,i=this.U,a=i.W;return o.tt===this?o.tt=i:o.U===this?o.U=i:o.W=i,i.tt=o,i.W=this,this.tt=i,this.U=a,a&&(a.tt=this),i}};e.TreeNode=t;var r=class extends t{constructor(){super(...arguments),this.rt=1}te(){let o=super.te();return this.ie(),o.ie(),o}se(){let o=super.se();return this.ie(),o.ie(),o}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};e.TreeNodeEnableIndex=r}),Qg=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=tI(),r=an(),o=sn(),i=class extends r.Container{constructor(s=function(c,d){return c<d?-1:c>d?1:0},l=!1){super(),this.Y=void 0,this.v=s,l?(this.re=t.TreeNodeEnableIndex,this.M=function(c,d,u){let f=this.ne(c,d,u);if(f){let h=f.tt;for(;h!==this.h;)h.rt+=1,h=h.tt;let g=this.he(f);if(g){let{parentNode:p,grandParent:m,curNode:v}=g;p.ie(),m.ie(),v.ie()}}return this.i},this.V=function(c){let d=this.fe(c);for(;d!==this.h;)d.rt-=1,d=d.tt}):(this.re=t.TreeNode,this.M=function(c,d,u){let f=this.ne(c,d,u);return f&&this.he(f),this.i},this.V=this.fe),this.h=new this.re}X(s,l){let c=this.h;for(;s;){let d=this.v(s.u,l);if(d<0)s=s.W;else if(d>0)c=s,s=s.U;else return s}return c}Z(s,l){let c=this.h;for(;s;)this.v(s.u,l)<=0?s=s.W:(c=s,s=s.U);return c}$(s,l){let c=this.h;for(;s;){let d=this.v(s.u,l);if(d<0)c=s,s=s.W;else if(d>0)s=s.U;else return s}return c}rr(s,l){let c=this.h;for(;s;)this.v(s.u,l)<0?(c=s,s=s.W):s=s.U;return c}ue(s){for(;;){let l=s.tt;if(l===this.h)return;if(s.ee===1){s.ee=0;return}if(s===l.U){let c=l.W;if(c.ee===1)c.ee=0,l.ee=1,l===this.Y?this.Y=l.te():l.te();else if(c.W&&c.W.ee===1){c.ee=l.ee,l.ee=0,c.W.ee=0,l===this.Y?this.Y=l.te():l.te();return}else c.U&&c.U.ee===1?(c.ee=1,c.U.ee=0,c.se()):(c.ee=1,s=l)}else{let c=l.U;if(c.ee===1)c.ee=0,l.ee=1,l===this.Y?this.Y=l.se():l.se();else if(c.U&&c.U.ee===1){c.ee=l.ee,l.ee=0,c.U.ee=0,l===this.Y?this.Y=l.se():l.se();return}else c.W&&c.W.ee===1?(c.ee=1,c.W.ee=0,c.te()):(c.ee=1,s=l)}}}fe(s){if(this.i===1)return this.clear(),this.h;let l=s;for(;l.U||l.W;){if(l.W)for(l=l.W;l.U;)l=l.U;else l=l.U;[s.u,l.u]=[l.u,s.u],[s.l,l.l]=[l.l,s.l],s=l}this.h.U===l?this.h.U=l.tt:this.h.W===l&&(this.h.W=l.tt),this.ue(l);let c=l.tt;return l===c.U?c.U=void 0:c.W=void 0,this.i-=1,this.Y.ee=0,c}oe(s,l){return s===void 0?!1:this.oe(s.U,l)||l(s)?!0:this.oe(s.W,l)}he(s){for(;;){let l=s.tt;if(l.ee===0)return;let c=l.tt;if(l===c.U){let d=c.W;if(d&&d.ee===1){if(d.ee=l.ee=0,c===this.Y)return;c.ee=1,s=c;continue}else if(s===l.W){if(s.ee=0,s.U&&(s.U.tt=l),s.W&&(s.W.tt=c),l.W=s.U,c.U=s.W,s.U=l,s.W=c,c===this.Y)this.Y=s,this.h.tt=s;else{let u=c.tt;u.U===c?u.U=s:u.W=s}return s.tt=c.tt,l.tt=s,c.tt=s,c.ee=1,{parentNode:l,grandParent:c,curNode:s}}else l.ee=0,c===this.Y?this.Y=c.se():c.se(),c.ee=1}else{let d=c.U;if(d&&d.ee===1){if(d.ee=l.ee=0,c===this.Y)return;c.ee=1,s=c;continue}else if(s===l.U){if(s.ee=0,s.U&&(s.U.tt=c),s.W&&(s.W.tt=l),c.W=s.U,l.U=s.W,s.U=c,s.W=l,c===this.Y)this.Y=s,this.h.tt=s;else{let u=c.tt;u.U===c?u.U=s:u.W=s}return s.tt=c.tt,l.tt=s,c.tt=s,c.ee=1,{parentNode:l,grandParent:c,curNode:s}}else l.ee=0,c===this.Y?this.Y=c.te():c.te(),c.ee=1}return}}ne(s,l,c){if(this.Y===void 0){this.i+=1,this.Y=new this.re(s,l),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let d,u=this.h.U,f=this.v(u.u,s);if(f===0){u.l=l;return}else if(f>0)u.U=new this.re(s,l),u.U.tt=u,d=u.U,this.h.U=d;else{let h=this.h.W,g=this.v(h.u,s);if(g===0){h.l=l;return}else if(g<0)h.W=new this.re(s,l),h.W.tt=h,d=h.W,this.h.W=d;else{if(c!==void 0){let p=c.o;if(p!==this.h){let m=this.v(p.u,s);if(m===0){p.l=l;return}else if(m>0){let v=p.L(),y=this.v(v.u,s);if(y===0){v.l=l;return}else y<0&&(d=new this.re(s,l),v.W===void 0?(v.W=d,d.tt=v):(p.U=d,d.tt=p))}}}if(d===void 0)for(d=this.Y;;){let p=this.v(d.u,s);if(p>0){if(d.U===void 0){d.U=new this.re(s,l),d.U.tt=d,d=d.U;break}d=d.U}else if(p<0){if(d.W===void 0){d.W=new this.re(s,l),d.W.tt=d,d=d.W;break}d=d.W}else{d.l=l;return}}}}return this.i+=1,d}I(s,l){for(;s;){let c=this.v(s.u,l);if(c<0)s=s.W;else if(c>0)s=s.U;else return s}return s||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(s,l){let c=s.o;if(c===this.h&&(0,o.throwIteratorAccessError)(),this.i===1)return c.u=l,!0;if(c===this.h.U)return this.v(c.B().u,l)>0?(c.u=l,!0):!1;if(c===this.h.W)return this.v(c.L().u,l)<0?(c.u=l,!0):!1;let d=c.L().u;if(this.v(d,l)>=0)return!1;let u=c.B().u;return this.v(u,l)<=0?!1:(c.u=l,!0)}eraseElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;let l=0,c=this;return this.oe(this.Y,function(d){return s===l?(c.V(d),!0):(l+=1,!1)}),this.i}eraseElementByKey(s){if(this.i===0)return!1;let l=this.I(this.Y,s);return l===this.h?!1:(this.V(l),!0)}eraseElementByIterator(s){let l=s.o;l===this.h&&(0,o.throwIteratorAccessError)();let c=l.W===void 0;return s.iteratorType===0?c&&s.next():(!c||l.U===void 0)&&s.next(),this.V(l),s}forEach(s){let l=0;for(let c of this)s(c,l++,this)}getElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;let l,c=0;for(let d of this){if(c===s){l=d;break}c+=1}return l}getHeight(){if(this.i===0)return 0;let s=function(l){return l?Math.max(s(l.U),s(l.W))+1:0};return s(this.Y)}},a=i;e.default=a}),Zg=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=an(),r=sn(),o=class extends t.ContainerIterator{constructor(a,s,l){super(l),this.o=a,this.h=s,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let a=this.o,s=this.h.tt;if(a===this.h)return s?s.rt-1:0;let l=0;for(a.U&&(l+=a.U.rt);a!==s;){let c=a.tt;a===c.W&&(l+=1,c.U&&(l+=c.U.rt)),a=c}return l}},i=o;e.default=i}),rI=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=i(Qg()),r=i(Zg()),o=sn();function i(c){return c&&c.t?c:{default:c}}var a=class Ny extends r.default{constructor(d,u,f,h){super(d,u,h),this.container=f}get pointer(){return this.o===this.h&&(0,o.throwIteratorAccessError)(),this.o.u}copy(){return new Ny(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.default{constructor(c=[],d,u){super(d,u);let f=this;c.forEach(function(h){f.insert(h)})}*K(c){c!==void 0&&(yield*this.K(c.U),yield c.u,yield*this.K(c.W))}begin(){return new a(this.h.U||this.h,this.h,this)}end(){return new a(this.h,this.h,this)}rBegin(){return new a(this.h.W||this.h,this.h,this,1)}rEnd(){return new a(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(c,d){return this.M(c,void 0,d)}find(c){let d=this.I(this.Y,c);return new a(d,this.h,this)}lowerBound(c){let d=this.X(this.Y,c);return new a(d,this.h,this)}upperBound(c){let d=this.Z(this.Y,c);return new a(d,this.h,this)}reverseLowerBound(c){let d=this.$(this.Y,c);return new a(d,this.h,this)}reverseUpperBound(c){let d=this.rr(this.Y,c);return new a(d,this.h,this)}union(c){let d=this;return c.forEach(function(u){d.insert(u)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},l=s;e.default=l}),nI=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=i(Qg()),r=i(Zg()),o=sn();function i(c){return c&&c.t?c:{default:c}}var a=class $y extends r.default{constructor(d,u,f,h){super(d,u,h),this.container=f}get pointer(){this.o===this.h&&(0,o.throwIteratorAccessError)();let d=this;return new Proxy([],{get(u,f){if(f==="0")return d.o.u;if(f==="1")return d.o.l},set(u,f,h){if(f!=="1")throw new TypeError("props must be 1");return d.o.l=h,!0}})}copy(){return new $y(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.default{constructor(c=[],d,u){super(d,u);let f=this;c.forEach(function(h){f.setElement(h[0],h[1])})}*K(c){c!==void 0&&(yield*this.K(c.U),yield[c.u,c.l],yield*this.K(c.W))}begin(){return new a(this.h.U||this.h,this.h,this)}end(){return new a(this.h,this.h,this)}rBegin(){return new a(this.h.W||this.h,this.h,this,1)}rEnd(){return new a(this.h,this.h,this,1)}front(){if(this.i===0)return;let c=this.h.U;return[c.u,c.l]}back(){if(this.i===0)return;let c=this.h.W;return[c.u,c.l]}lowerBound(c){let d=this.X(this.Y,c);return new a(d,this.h,this)}upperBound(c){let d=this.Z(this.Y,c);return new a(d,this.h,this)}reverseLowerBound(c){let d=this.$(this.Y,c);return new a(d,this.h,this)}reverseUpperBound(c){let d=this.rr(this.Y,c);return new a(d,this.h,this)}setElement(c,d,u){return this.M(c,d,u)}find(c){let d=this.I(this.Y,c);return new a(d,this.h,this)}getElementByKey(c){return this.I(this.Y,c).l}union(c){let d=this;return c.forEach(function(u){d.setElement(u[0],u[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},l=s;e.default=l}),em=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.default=t;function t(r){let o=typeof r;return o==="object"&&r!==null||o==="function"}}),tm=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.HashContainerIterator=e.HashContainer=void 0;var t=an(),r=i(em()),o=sn();function i(l){return l&&l.t?l:{default:l}}var a=class extends t.ContainerIterator{constructor(l,c,d){super(d),this.o=l,this.h=c,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.L,this})}};e.HashContainerIterator=a;var s=class extends t.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(l){let{L:c,B:d}=l;c.B=d,d.L=c,l===this.p&&(this.p=d),l===this._&&(this._=c),this.i-=1}M(l,c,d){d===void 0&&(d=(0,r.default)(l));let u;if(d){let f=l[this.HASH_TAG];if(f!==void 0)return this.H[f].l=c,this.i;Object.defineProperty(l,this.HASH_TAG,{value:this.H.length,configurable:!0}),u={u:l,l:c,L:this._,B:this.h},this.H.push(u)}else{let f=this.g[l];if(f)return f.l=c,this.i;u={u:l,l:c,L:this._,B:this.h},this.g[l]=u}return this.i===0?(this.p=u,this.h.B=u):this._.B=u,this._=u,this.h.L=u,++this.i}I(l,c){if(c===void 0&&(c=(0,r.default)(l)),c){let d=l[this.HASH_TAG];return d===void 0?this.h:this.H[d]}else return this.g[l]||this.h}clear(){let l=this.HASH_TAG;this.H.forEach(function(c){delete c.u[l]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(l,c){let d;if(c===void 0&&(c=(0,r.default)(l)),c){let u=l[this.HASH_TAG];if(u===void 0)return!1;delete l[this.HASH_TAG],d=this.H[u],delete this.H[u]}else{if(d=this.g[l],d===void 0)return!1;delete this.g[l]}return this.V(d),!0}eraseElementByIterator(l){let c=l.o;return c===this.h&&(0,o.throwIteratorAccessError)(),this.V(c),l.next()}eraseElementByPos(l){if(l<0||l>this.i-1)throw new RangeError;let c=this.p;for(;l--;)c=c.B;return this.V(c),this.i}};e.HashContainer=s}),oI=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=tm(),r=sn(),o=class Oy extends t.HashContainerIterator{constructor(l,c,d,u){super(l,c,u),this.container=d}get pointer(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.u}copy(){return new Oy(this.o,this.h,this.container,this.iteratorType)}},i=class extends t.HashContainer{constructor(s=[]){super();let l=this;s.forEach(function(c){l.insert(c)})}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(s,l){return this.M(s,void 0,l)}getElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;let l=this.p;for(;s--;)l=l.B;return l.u}find(s,l){let c=this.I(s,l);return new o(c,this.h,this)}forEach(s){let l=0,c=this.p;for(;c!==this.h;)s(c.u,l++,this),c=c.B}[Symbol.iterator](){return(function*(){let s=this.p;for(;s!==this.h;)yield s.u,s=s.B}).bind(this)()}},a=i;e.default=a}),iI=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=tm(),r=i(em()),o=sn();function i(c){return c&&c.t?c:{default:c}}var a=class By extends t.HashContainerIterator{constructor(d,u,f,h){super(d,u,h),this.container=f}get pointer(){this.o===this.h&&(0,o.throwIteratorAccessError)();let d=this;return new Proxy([],{get(u,f){if(f==="0")return d.o.u;if(f==="1")return d.o.l},set(u,f,h){if(f!=="1")throw new TypeError("props must be 1");return d.o.l=h,!0}})}copy(){return new By(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.HashContainer{constructor(c=[]){super();let d=this;c.forEach(function(u){d.setElement(u[0],u[1])})}begin(){return new a(this.p,this.h,this)}end(){return new a(this.h,this.h,this)}rBegin(){return new a(this._,this.h,this,1)}rEnd(){return new a(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(c,d,u){return this.M(c,d,u)}getElementByKey(c,d){if(d===void 0&&(d=(0,r.default)(c)),d){let f=c[this.HASH_TAG];return f!==void 0?this.H[f].l:void 0}let u=this.g[c];return u?u.l:void 0}getElementByPos(c){if(c<0||c>this.i-1)throw new RangeError;let d=this.p;for(;c--;)d=d.B;return[d.u,d.l]}find(c,d){let u=this.I(c,d);return new a(u,this.h,this)}forEach(c){let d=0,u=this.p;for(;u!==this.h;)c([u.u,u.l],d++,this),u=u.B}[Symbol.iterator](){return(function*(){let c=this.p;for(;c!==this.h;)yield[c.u,c.l],c=c.B}).bind(this)()}},l=s;e.default=l}),aI=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"t",{value:!0}),Object.defineProperty(e,"Deque",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"HashMap",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"HashSet",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"LinkList",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"OrderedMap",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"OrderedSet",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"PriorityQueue",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"Queue",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"Stack",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Vector",{enumerable:!0,get:function(){return i.default}});var t=f(YP()),r=f(XP()),o=f(JP()),i=f(QP()),a=f(ZP()),s=f(eI()),l=f(rI()),c=f(nI()),d=f(oI()),u=f(iI());function f(h){return h&&h.t?h:{default:h}}}),sI=Oe((e,t)=>{Ie(),Ne(),Re();var r=aI().OrderedSet,o=on()("number-allocator:trace"),i=on()("number-allocator:error");function a(l,c){this.low=l,this.high=c}a.prototype.equals=function(l){return this.low===l.low&&this.high===l.high},a.prototype.compare=function(l){return this.low<l.low&&this.high<l.low?-1:l.low<this.low&&l.high<this.low?1:0};function s(l,c){if(!(this instanceof s))return new s(l,c);this.min=l,this.max=c,this.ss=new r([],(d,u)=>d.compare(u)),o("Create"),this.clear()}s.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},s.prototype.alloc=function(){if(this.ss.size()===0)return o("alloc():empty"),null;let l=this.ss.begin(),c=l.pointer.low,d=l.pointer.high,u=c;return u+1<=d?this.ss.updateKeyByIterator(l,new a(c+1,d)):this.ss.eraseElementByPos(0),o("alloc():"+u),u},s.prototype.use=function(l){let c=new a(l,l),d=this.ss.lowerBound(c);if(!d.equals(this.ss.end())){let u=d.pointer.low,f=d.pointer.high;return d.pointer.equals(c)?(this.ss.eraseElementByIterator(d),o("use():"+l),!0):u>l?!1:u===l?(this.ss.updateKeyByIterator(d,new a(u+1,f)),o("use():"+l),!0):f===l?(this.ss.updateKeyByIterator(d,new a(u,f-1)),o("use():"+l),!0):(this.ss.updateKeyByIterator(d,new a(l+1,f)),this.ss.insert(new a(u,l-1)),o("use():"+l),!0)}return o("use():failed"),!1},s.prototype.free=function(l){if(l<this.min||l>this.max){i("free():"+l+" is out of range");return}let c=new a(l,l),d=this.ss.upperBound(c);if(d.equals(this.ss.end())){if(d.equals(this.ss.begin())){this.ss.insert(c);return}d.pre();let u=d.pointer.high;d.pointer.high+1===l?this.ss.updateKeyByIterator(d,new a(u,l)):this.ss.insert(c)}else if(d.equals(this.ss.begin()))if(l+1===d.pointer.low){let u=d.pointer.high;this.ss.updateKeyByIterator(d,new a(l,u))}else this.ss.insert(c);else{let u=d.pointer.low,f=d.pointer.high;d.pre();let h=d.pointer.low;d.pointer.high+1===l?l+1===u?(this.ss.eraseElementByIterator(d),this.ss.updateKeyByIterator(d,new a(h,f))):this.ss.updateKeyByIterator(d,new a(h,l)):l+1===u?(this.ss.eraseElementByIterator(d.next()),this.ss.insert(new a(l,f))):this.ss.insert(c)}o("free():"+l)},s.prototype.clear=function(){o("clear()"),this.ss.clear(),this.ss.insert(new a(this.min,this.max))},s.prototype.intervalCount=function(){return this.ss.size()},s.prototype.dump=function(){console.log("length:"+this.ss.size());for(let l of this.ss)console.log(l)},t.exports=s}),rm=Oe((e,t)=>{Ie(),Ne(),Re();var r=sI();t.exports.NumberAllocator=r}),lI=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"__esModule",{value:!0});var t=KP(),r=rm(),o=class{constructor(i){Pe(this,"aliasToTopic");Pe(this,"topicToAlias");Pe(this,"max");Pe(this,"numberAllocator");Pe(this,"length");i>0&&(this.aliasToTopic=new t.LRUCache({max:i}),this.topicToAlias={},this.numberAllocator=new r.NumberAllocator(1,i),this.max=i,this.length=0)}put(i,a){if(a===0||a>this.max)return!1;let s=this.aliasToTopic.get(a);return s&&delete this.topicToAlias[s],this.aliasToTopic.set(a,i),this.topicToAlias[i]=a,this.numberAllocator.use(a),this.length=this.aliasToTopic.size,!0}getTopicByAlias(i){return this.aliasToTopic.get(i)}getAliasByTopic(i){let a=this.topicToAlias[i];return typeof a<"u"&&this.aliasToTopic.get(a),a}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};e.default=o}),cI=Oe(e=>{Ie(),Ne(),Re();var t=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});var r=Oa(),o=t(lI()),i=$o(),a=(s,l)=>{s.log("_handleConnack");let{options:c}=s,d=c.protocolVersion===5?l.reasonCode:l.returnCode;if(clearTimeout(s.connackTimer),delete s.topicAliasSend,l.properties){if(l.properties.topicAliasMaximum){if(l.properties.topicAliasMaximum>65535){s.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}l.properties.topicAliasMaximum>0&&(s.topicAliasSend=new o.default(l.properties.topicAliasMaximum))}l.properties.serverKeepAlive&&c.keepalive&&(c.keepalive=l.properties.serverKeepAlive),l.properties.maximumPacketSize&&(c.properties||(c.properties={}),c.properties.maximumPacketSize=l.properties.maximumPacketSize)}if(d===0)s.reconnecting=!1,s._onConnect(l);else if(d>0){let u=new i.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[d]}`,d);s.emit("error",u),s.options.reconnectOnConnackError&&s._cleanUp(!0)}};e.default=a}),dI=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"__esModule",{value:!0});var t=(r,o,i)=>{r.log("handling pubrel packet");let a=typeof i<"u"?i:r.noop,{messageId:s}=o,l={cmd:"pubcomp",messageId:s};r.incomingStore.get(o,(c,d)=>{c?r._sendPacket(l,a):(r.emit("message",d.topic,d.payload,d),r.handleMessage(d,u=>{if(u)return a(u);r.incomingStore.del(d,r.noop),r._sendPacket(l,a)}))})};e.default=t}),uI=Oe(e=>{Ie(),Ne(),Re();var t=e&&e.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(HP()),o=t(GP()),i=t(cI()),a=t(Oa()),s=t(dI()),l=(c,d,u)=>{let{options:f}=c;if(f.protocolVersion===5&&f.properties&&f.properties.maximumPacketSize&&f.properties.maximumPacketSize<d.length)return c.emit("error",new Error(`exceeding packets size ${d.cmd}`)),c.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),c;switch(c.log("_handlePacket :: emitting packetreceive"),c.emit("packetreceive",d),d.cmd){case"publish":(0,r.default)(c,d,u);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":c.reschedulePing(),(0,a.default)(c,d),u();break;case"pubrel":c.reschedulePing(),(0,s.default)(c,d,u);break;case"connack":(0,i.default)(c,d),u();break;case"auth":c.reschedulePing(),(0,o.default)(c,d),u();break;case"pingresp":c.log("_handlePacket :: received pingresp"),c.reschedulePing(!0),u();break;case"disconnect":c.emit("disconnect",d),u();break;default:c.log("_handlePacket :: unknown command"),u();break}};e.default=l}),nm=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"__esModule",{value:!0});var t=class{constructor(){Pe(this,"nextId");this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let r=this.nextId++;return this.nextId===65536&&(this.nextId=1),r}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(r){return!0}deallocate(r){}clear(){}};e.default=t}),fI=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"__esModule",{value:!0});var t=class{constructor(r){Pe(this,"aliasToTopic");Pe(this,"max");Pe(this,"length");this.aliasToTopic={},this.max=r}put(r,o){return o===0||o>this.max?!1:(this.aliasToTopic[o]=r,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(r){return this.aliasToTopic[r]}clear(){this.aliasToTopic={}}};e.default=t}),hI=Oe(e=>{Ie(),Ne(),Re();var t=e&&e.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEventEmitter=void 0;var r=t((to(),mt(Sn))),o=$o(),i=class{};e.TypedEventEmitter=i,(0,o.applyMixin)(i,r.default)}),Ba=Oe((e,t)=>{Ie(),Ne(),Re();function r(o){"@babel/helpers - typeof";return t.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},t.exports.__esModule=!0,t.exports.default=t.exports,r(o)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),pI=Oe((e,t)=>{Ie(),Ne(),Re();var r=Ba().default;function o(i,a){if(r(i)!="object"||!i)return i;var s=i[Symbol.toPrimitive];if(s!==void 0){var l=s.call(i,a||"default");if(r(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}),gI=Oe((e,t)=>{Ie(),Ne(),Re();var r=Ba().default,o=pI();function i(a){var s=o(a,"string");return r(s)=="symbol"?s:s+""}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}),mI=Oe((e,t)=>{Ie(),Ne(),Re();var r=gI();function o(i,a,s){return(a=r(a))in i?Object.defineProperty(i,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[a]=s,i}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}),bI=Oe((e,t)=>{Ie(),Ne(),Re();function r(o){if(Array.isArray(o))return o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),yI=Oe((e,t)=>{Ie(),Ne(),Re();function r(o,i){var a=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(a!=null){var s,l,c,d,u=[],f=!0,h=!1;try{if(c=(a=a.call(o)).next,i===0){if(Object(a)!==a)return;f=!1}else for(;!(f=(s=c.call(a)).done)&&(u.push(s.value),u.length!==i);f=!0);}catch(g){h=!0,l=g}finally{try{if(!f&&a.return!=null&&(d=a.return(),Object(d)!==d))return}finally{if(h)throw l}}return u}}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),vI=Oe((e,t)=>{Ie(),Ne(),Re();function r(o,i){(i==null||i>o.length)&&(i=o.length);for(var a=0,s=Array(i);a<i;a++)s[a]=o[a];return s}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),wI=Oe((e,t)=>{Ie(),Ne(),Re();var r=vI();function o(i,a){if(i){if(typeof i=="string")return r(i,a);var s={}.toString.call(i).slice(8,-1);return s==="Object"&&i.constructor&&(s=i.constructor.name),s==="Map"||s==="Set"?Array.from(i):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?r(i,a):void 0}}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}),xI=Oe((e,t)=>{Ie(),Ne(),Re();function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2693
2693
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),CI=Oe((e,t)=>{Ie(),Ne(),Re();var r=bI(),o=yI(),i=wI(),a=xI();function s(l,c){return r(l)||o(l,c)||i(l,c)||a()}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}),om=Oe((e,t)=>{Ie(),Ne(),Re(),function(r,o){typeof e=="object"&&typeof t<"u"?o(e):typeof define=="function"&&define.amd?define(["exports"],o):(r=typeof globalThis<"u"?globalThis:r||self,o(r.fastUniqueNumbers={}))}(e,function(r){var o=function(g){return function(p){var m=g(p);return p.add(m),m}},i=function(g){return function(p,m){return g.set(p,m),m}},a=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,s=536870912,l=s*2,c=function(g,p){return function(m){var v=p.get(m),y=v===void 0?m.size:v<l?v+1:0;if(!m.has(y))return g(m,y);if(m.size<s){for(;m.has(y);)y=Math.floor(Math.random()*l);return g(m,y)}if(m.size>a)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;m.has(y);)y=Math.floor(Math.random()*a);return g(m,y)}},d=new WeakMap,u=i(d),f=c(u,d),h=o(f);r.addUniqueNumber=h,r.generateUniqueNumber=f})}),SI=Oe((e,t)=>{Ie(),Ne(),Re();function r(i,a,s,l,c,d,u){try{var f=i[d](u),h=f.value}catch(g){return void s(g)}f.done?a(h):Promise.resolve(h).then(l,c)}function o(i){return function(){var a=this,s=arguments;return new Promise(function(l,c){var d=i.apply(a,s);function u(h){r(d,l,c,u,f,"next",h)}function f(h){r(d,l,c,u,f,"throw",h)}u(void 0)})}}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}),im=Oe((e,t)=>{Ie(),Ne(),Re();function r(o,i){this.v=o,this.k=i}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),am=Oe((e,t)=>{Ie(),Ne(),Re();function r(o,i,a,s){var l=Object.defineProperty;try{l({},"",{})}catch{l=0}t.exports=r=function(c,d,u,f){function h(g,p){r(c,g,function(m){return this._invoke(g,p,m)})}d?l?l(c,d,{value:u,enumerable:!f,configurable:!f,writable:!f}):c[d]=u:(h("next",0),h("throw",1),h("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,r(o,i,a,s)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),sm=Oe((e,t)=>{Ie(),Ne(),Re();var r=am();function o(){var i,a,s=typeof Symbol=="function"?Symbol:{},l=s.iterator||"@@iterator",c=s.toStringTag||"@@toStringTag";function d(y,b,S,_){var C=b&&b.prototype instanceof f?b:f,A=Object.create(C.prototype);return r(A,"_invoke",function(k,T,I){var R,B,P,O=0,N=I||[],$=!1,q={p:0,n:0,v:i,a:z,f:z.bind(i,4),d:function(L,te){return R=L,B=0,P=i,q.n=te,u}};function z(L,te){for(B=L,P=te,a=0;!$&&O&&!j&&a<N.length;a++){var j,se=N[a],D=q.p,U=se[2];L>3?(j=U===te)&&(P=se[(B=se[4])?5:(B=3,3)],se[4]=se[5]=i):se[0]<=D&&((j=L<2&&D<se[1])?(B=0,q.v=te,q.n=se[1]):D<U&&(j=L<3||se[0]>te||te>U)&&(se[4]=L,se[5]=te,q.n=U,B=0))}if(j||L>1)return u;throw $=!0,te}return function(L,te,j){if(O>1)throw TypeError("Generator is already running");for($&&te===1&&z(te,j),B=te,P=j;(a=B<2?i:P)||!$;){R||(B?B<3?(B>1&&(q.n=-1),z(B,P)):q.n=P:q.v=P);try{if(O=2,R){if(B||(L="next"),a=R[L]){if(!(a=a.call(R,P)))throw TypeError("iterator result is not an object");if(!a.done)return a;P=a.value,B<2&&(B=0)}else B===1&&(a=R.return)&&a.call(R),B<2&&(P=TypeError("The iterator does not provide a '"+L+"' method"),B=1);R=i}else if((a=($=q.n<0)?P:k.call(T,q))!==u)break}catch(se){R=i,B=1,P=se}finally{O=1}}return{value:a,done:$}}}(y,S,_),!0),A}var u={};function f(){}function h(){}function g(){}a=Object.getPrototypeOf;var p=[][l]?a(a([][l]())):(r(a={},l,function(){return this}),a),m=g.prototype=f.prototype=Object.create(p);function v(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,g):(y.__proto__=g,r(y,c,"GeneratorFunction")),y.prototype=Object.create(m),y}return h.prototype=g,r(m,"constructor",g),r(g,"constructor",h),h.displayName="GeneratorFunction",r(g,c,"GeneratorFunction"),r(m),r(m,c,"Generator"),r(m,l,function(){return this}),r(m,"toString",function(){return"[object Generator]"}),(t.exports=o=function(){return{w:d,m:v}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}),lm=Oe((e,t)=>{Ie(),Ne(),Re();var r=im(),o=am();function i(a,s){function l(d,u,f,h){try{var g=a[d](u),p=g.value;return p instanceof r?s.resolve(p.v).then(function(m){l("next",m,f,h)},function(m){l("throw",m,f,h)}):s.resolve(p).then(function(m){g.value=m,f(g)},function(m){return l("throw",m,f,h)})}catch(m){h(m)}}var c;this.next||(o(i.prototype),o(i.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(d,u,f){function h(){return new s(function(g,p){l(d,f,g,p)})}return c=c?c.then(h,h):h()},!0)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}),cm=Oe((e,t)=>{Ie(),Ne(),Re();var r=sm(),o=lm();function i(a,s,l,c,d){return new o(r().w(a,s,l,c),d||Promise)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}),_I=Oe((e,t)=>{Ie(),Ne(),Re();var r=cm();function o(i,a,s,l,c){var d=r(i,a,s,l,c);return d.next().then(function(u){return u.done?u.value:d.next()})}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}),kI=Oe((e,t)=>{Ie(),Ne(),Re();function r(o){var i=Object(o),a=[];for(var s in i)a.unshift(s);return function l(){for(;a.length;)if((s=a.pop())in i)return l.value=s,l.done=!1,l;return l.done=!0,l}}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),EI=Oe((e,t)=>{Ie(),Ne(),Re();var r=Ba().default;function o(i){if(i!=null){var a=i[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],s=0;if(a)return a.call(i);if(typeof i.next=="function")return i;if(!isNaN(i.length))return{next:function(){return i&&s>=i.length&&(i=void 0),{value:i&&i[s++],done:!i}}}}throw new TypeError(r(i)+" is not iterable")}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}),TI=Oe((e,t)=>{Ie(),Ne(),Re();var r=im(),o=sm(),i=_I(),a=cm(),s=lm(),l=kI(),c=EI();function d(){var u=o(),f=u.m(d),h=(Object.getPrototypeOf?Object.getPrototypeOf(f):f.__proto__).constructor;function g(v){var y=typeof v=="function"&&v.constructor;return!!y&&(y===h||(y.displayName||y.name)==="GeneratorFunction")}var p={throw:1,return:2,break:3,continue:3};function m(v){var y,b;return function(S){y||(y={stop:function(){return b(S.a,2)},catch:function(){return S.v},abrupt:function(_,C){return b(S.a,p[_],C)},delegateYield:function(_,C,A){return y.resultName=C,b(S.d,c(_),A)},finish:function(_){return b(S.f,_)}},b=function(_,C,A){S.p=y.prev,S.n=y.next;try{return _(C,A)}finally{y.next=S.n}}),y.resultName&&(y[y.resultName]=S.v,y.resultName=void 0),y.sent=S.v,y.next=S.n;try{return v.call(this,y)}finally{S.p=y.prev,S.n=y.next}}}return(t.exports=d=function(){return{wrap:function(v,y,b,S){return u.w(m(v),y,b,S&&S.reverse())},isGeneratorFunction:g,mark:u.m,awrap:function(v,y){return new r(v,y)},AsyncIterator:s,async:function(v,y,b,S,_){return(g(y)?a:i)(m(v),y,b,S,_)},keys:l,values:c}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=d,t.exports.__esModule=!0,t.exports.default=t.exports}),AI=Oe((e,t)=>{Ie(),Ne(),Re();var r=TI()();t.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),PI=Oe((e,t)=>{Ie(),Ne(),Re(),function(r,o){typeof e=="object"&&typeof t<"u"?o(e,mI(),CI(),om(),SI(),AI()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","fast-unique-numbers","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],o):(r=typeof globalThis<"u"?globalThis:r||self,o(r.brokerFactory={},r._defineProperty,r._slicedToArray,r.fastUniqueNumbers,r._asyncToGenerator,r._regeneratorRuntime))}(e,function(r,o,i,a,s,l){var c=function(b){return typeof b.start=="function"},d=new WeakMap;function u(b,S){var _=Object.keys(b);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(b);S&&(C=C.filter(function(A){return Object.getOwnPropertyDescriptor(b,A).enumerable})),_.push.apply(_,C)}return _}function f(b){for(var S=1;S<arguments.length;S++){var _=arguments[S]!=null?arguments[S]:{};S%2?u(Object(_),!0).forEach(function(C){o(b,C,_[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(_)):u(Object(_)).forEach(function(C){Object.defineProperty(b,C,Object.getOwnPropertyDescriptor(_,C))})}return b}var h=function(b){return f(f({},b),{},{connect:function(S){var _=S.call;return s(l.mark(function C(){var A,k,T,I;return l.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return A=new MessageChannel,k=A.port1,T=A.port2,R.next=1,_("connect",{port:k},[k]);case 1:return I=R.sent,d.set(T,I),R.abrupt("return",T);case 2:case"end":return R.stop()}},C)}))},disconnect:function(S){var _=S.call;return function(){var C=s(l.mark(function A(k){var T;return l.wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(T=d.get(k),T!==void 0){I.next=1;break}throw new Error("The given port is not connected.");case 1:return I.next=2,_("disconnect",{portId:T});case 2:case"end":return I.stop()}},A)}));return function(A){return C.apply(this,arguments)}}()},isSupported:function(S){var _=S.call;return function(){return _("isSupported")}}})};function g(b,S){var _=Object.keys(b);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(b);S&&(C=C.filter(function(A){return Object.getOwnPropertyDescriptor(b,A).enumerable})),_.push.apply(_,C)}return _}function p(b){for(var S=1;S<arguments.length;S++){var _=arguments[S]!=null?arguments[S]:{};S%2?g(Object(_),!0).forEach(function(C){o(b,C,_[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(_)):g(Object(_)).forEach(function(C){Object.defineProperty(b,C,Object.getOwnPropertyDescriptor(_,C))})}return b}var m=new WeakMap,v=function(b){if(m.has(b))return m.get(b);var S=new Map;return m.set(b,S),S},y=function(b){var S=h(b);return function(_){var C=v(_);_.addEventListener("message",function(N){var $=N.data,q=$.id;if(q!==null&&C.has(q)){var z=C.get(q),L=z.reject,te=z.resolve;C.delete(q),$.error===void 0?te($.result):L(new Error($.error.message))}}),c(_)&&_.start();for(var A=function(N){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new Promise(function(z,L){var te=a.generateUniqueNumber(C);C.set(te,{reject:L,resolve:z}),$===null?_.postMessage({id:te,method:N},q):_.postMessage({id:te,method:N,params:$},q)})},k=function(N,$){var q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];_.postMessage({id:null,method:N,params:$},q)},T={},I=0,R=Object.entries(S);I<R.length;I++){var B=i(R[I],2),P=B[0],O=B[1];T=p(p({},T),{},o({},P,O({call:A,notify:k})))}return p({},T)}};r.createBroker=y})}),II=Oe((e,t)=>{Ie(),Ne(),Re(),function(r,o){typeof e=="object"&&typeof t<"u"?o(e,Ba(),PI(),om()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/typeof","broker-factory","fast-unique-numbers"],o):(r=typeof globalThis<"u"?globalThis:r||self,o(r.workerTimersBroker={},r._typeof,r.brokerFactory,r.fastUniqueNumbers))}(e,function(r,o,i,a){var s=new Map([[0,null]]),l=new Map([[0,null]]),c=i.createBroker({clearInterval:function(u){var f=u.call;return function(h){o(s.get(h))==="symbol"&&(s.set(h,null),f("clear",{timerId:h,timerType:"interval"}).then(function(){s.delete(h)}))}},clearTimeout:function(u){var f=u.call;return function(h){o(l.get(h))==="symbol"&&(l.set(h,null),f("clear",{timerId:h,timerType:"timeout"}).then(function(){l.delete(h)}))}},setInterval:function(u){var f=u.call;return function(h){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=arguments.length,m=new Array(p>2?p-2:0),v=2;v<p;v++)m[v-2]=arguments[v];var y=Symbol(),b=a.generateUniqueNumber(s);s.set(b,y);var S=function(){return f("set",{delay:g,now:performance.timeOrigin+performance.now(),timerId:b,timerType:"interval"}).then(function(){var _=s.get(b);if(_===void 0)throw new Error("The timer is in an undefined state.");_===y&&(h.apply(void 0,m),s.get(b)===y&&S())})};return S(),b}},setTimeout:function(u){var f=u.call;return function(h){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=arguments.length,m=new Array(p>2?p-2:0),v=2;v<p;v++)m[v-2]=arguments[v];var y=Symbol(),b=a.generateUniqueNumber(l);return l.set(b,y),f("set",{delay:g,now:performance.timeOrigin+performance.now(),timerId:b,timerType:"timeout"}).then(function(){var S=l.get(b);if(S===void 0)throw new Error("The timer is in an undefined state.");S===y&&(l.delete(b),h.apply(void 0,m))}),b}}}),d=function(u){var f=new Worker(u);return c(f)};r.load=d,r.wrap=c})}),RI=Oe((e,t)=>{Ie(),Ne(),Re(),function(r,o){typeof e=="object"&&typeof t<"u"?o(e,II()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],o):(r=typeof globalThis<"u"?globalThis:r||self,o(r.workerTimers={},r.workerTimersBroker))}(e,function(r,o){var i=function(f,h){var g=null;return function(){if(g!==null)return g;var p=new Blob([h],{type:"application/javascript; charset=utf-8"}),m=URL.createObjectURL(p);return g=f(m),setTimeout(function(){return URL.revokeObjectURL(m)}),g}},a=`(()=>{var e={45:(e,t,r)=>{var n=r(738).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},79:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},122:(e,t,r)=>{var n=r(79);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},156:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,u,a,i=[],s=!0,c=!1;try{if(u=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=u.call(r)).done)&&(i.push(n.value),i.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports},172:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},293:e=>{function t(e,t,r,n,o,u,a){try{var i=e[u](a),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,u){var a=e.apply(r,n);function i(e){t(a,o,u,i,s,"next",e)}function s(e){t(a,o,u,i,s,"throw",e)}i(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},373:e=>{e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},389:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,u=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<u?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*u);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,s=r(i),c=a(s,i),f=t(c);e.addUniqueNumber=f,e.generateUniqueNumber=c}(t)},472:function(e,t,r){!function(e,t,r,n){"use strict";var o=function(e,t){return function(r){var o=t.get(r);if(void 0===o)return Promise.resolve(!1);var u=n(o,2),a=u[0],i=u[1];return e(a),t.delete(r),i(!1),Promise.resolve(!0)}},u=function(e,t){var r=function(n,o,u,a){var i=n-e.now();i>0?o.set(a,[t(r,i,n,o,u,a),u]):(o.delete(a),u(!0))};return r},a=function(e,t,r,n){return function(o,u,a){var i=o+u-t.timeOrigin,s=i-t.now();return new Promise((function(t){e.set(a,[r(n,s,i,e,t,a),t])}))}},i=new Map,s=o(globalThis.clearTimeout,i),c=new Map,f=o(globalThis.clearTimeout,c),l=u(performance,globalThis.setTimeout),p=a(i,performance,globalThis.setTimeout,l),d=a(c,performance,globalThis.setTimeout,l);r.createWorker(self,{clear:function(){var r=e(t.mark((function e(r){var n,o,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.timerId,o=r.timerType,e.next=1,"interval"===o?s(n):f(n);case 1:return u=e.sent,e.abrupt("return",{result:u});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}(),set:function(){var r=e(t.mark((function e(r){var n,o,u,a,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.delay,o=r.now,u=r.timerId,a=r.timerType,e.next=1,("interval"===a?p:d)(n,o,u);case 1:return i=e.sent,e.abrupt("return",{result:i});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}()})}(r(293),r(756),r(623),r(715))},546:e=>{function t(r,n,o,u){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,o){if(r)a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n;else{var u=function(r,n){t(e,r,(function(e){return this._invoke(r,n,e)}))};u("next",0),u("throw",1),u("return",2)}},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,u)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},579:(e,t,r)=>{var n=r(738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},623:function(e,t,r){!function(e,t,r,n,o){"use strict";var u={INTERNAL_ERROR:-32603,INVALID_PARAMS:-32602,METHOD_NOT_FOUND:-32601},a=function(e,t){return Object.assign(new Error(e),{status:t})},i=function(e){return a('The requested method called "'.concat(e,'" is not supported.'),u.METHOD_NOT_FOUND)},s=function(e){return a('The handler of the method called "'.concat(e,'" returned no required result.'),u.INTERNAL_ERROR)},c=function(e){return a('The handler of the method called "'.concat(e,'" returned an unexpected result.'),u.INTERNAL_ERROR)},f=function(e){return a('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),u.INVALID_PARAMS)},l=function(e,n){return function(){var o=t(r.mark((function t(o){var u,a,f,l,p,d,v,x,y,b,h,m,_,g,w;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=o.data,a=u.id,f=u.method,l=u.params,p=n[f],t.prev=1,void 0!==p){t.next=2;break}throw i(f);case 2:if(void 0!==(d=void 0===l?p():p(l))){t.next=3;break}throw s(f);case 3:if(!(d instanceof Promise)){t.next=5;break}return t.next=4,d;case 4:g=t.sent,t.next=6;break;case 5:g=d;case 6:if(v=g,null!==a){t.next=8;break}if(void 0===v.result){t.next=7;break}throw c(f);case 7:t.next=10;break;case 8:if(void 0!==v.result){t.next=9;break}throw c(f);case 9:x=v.result,y=v.transferables,b=void 0===y?[]:y,e.postMessage({id:a,result:x},b);case 10:t.next=12;break;case 11:t.prev=11,w=t.catch(1),h=w.message,m=w.status,_=void 0===m?-32603:m,e.postMessage({error:{code:_,message:h},id:a});case 12:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(e){return o.apply(this,arguments)}}()},p=function(){return new Promise((function(e){var t=new ArrayBuffer(0),r=new MessageChannel,n=r.port1,o=r.port2;n.onmessage=function(t){var r=t.data;return e(null!==r)},o.postMessage(t,[t])}))};function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=new Map,y=function(e,n,u){return v(v({},n),{},{connect:function(t){var r=t.port;r.start();var u=e(r,n),a=o.generateUniqueNumber(x);return x.set(a,(function(){u(),r.close(),x.delete(a)})),{result:a}},disconnect:function(e){var t=e.portId,r=x.get(t);if(void 0===r)throw f(t);return r(),{result:null}},isSupported:function(){var e=t(r.mark((function e(){var t,n,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,p();case 1:if(!e.sent){e.next=5;break}if(!((t=u())instanceof Promise)){e.next=3;break}return e.next=2,t;case 2:o=e.sent,e.next=4;break;case 3:o=t;case 4:return n=o,e.abrupt("return",{result:n});case 5:return e.abrupt("return",{result:!1});case 6:case"end":return e.stop()}}),e)})));function n(){return e.apply(this,arguments)}return n}()})},b=function(e,t){var r=y(b,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0}),n=l(e,r);return e.addEventListener("message",n),function(){return e.removeEventListener("message",n)}};e.createWorker=b,e.isSupported=p}(t,r(293),r(756),r(693),r(389))},633:(e,t,r)=>{var n=r(172),o=r(993),u=r(869),a=r(887),i=r(791),s=r(373),c=r(579);function f(){"use strict";var t=o(),r=t.m(f),l=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))}var d={throw:1,return:2,break:3,continue:3};function v(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,d[e],t)},delegateYield:function(e,o,u){return t.resultName=o,r(n.d,c(e),u)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=f=function(){return{wrap:function(e,r,n,o){return t.w(v(e),r,n,o&&o.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:i,async:function(e,t,r,n,o){return(p(t)?a:u)(v(e),t,r,n,o)},keys:s,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports},693:(e,t,r)=>{var n=r(736);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},715:(e,t,r)=>{var n=r(987),o=r(156),u=r(122),a=r(752);e.exports=function(e,t){return n(e)||o(e,t)||u(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},736:(e,t,r)=>{var n=r(738).default,o=r(45);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},752:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},756:(e,t,r)=>{var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},791:(e,t,r)=>{var n=r(172),o=r(546);e.exports=function e(t,r){function u(e,o,a,i){try{var s=t[e](o),c=s.value;return c instanceof n?r.resolve(c.v).then((function(e){u("next",e,a,i)}),(function(e){u("throw",e,a,i)})):r.resolve(c).then((function(e){s.value=e,a(s)}),(function(e){return u("throw",e,a,i)}))}catch(e){i(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),o(this,"_invoke",(function(e,t,n){function o(){return new r((function(t,r){u(e,n,t,r)}))}return a=a?a.then(o,o):o()}),!0)},e.exports.__esModule=!0,e.exports.default=e.exports},869:(e,t,r)=>{var n=r(887);e.exports=function(e,t,r,o,u){var a=n(e,t,r,o,u);return a.next().then((function(e){return e.done?e.value:a.next()}))},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,r)=>{var n=r(993),o=r(791);e.exports=function(e,t,r,u,a){return new o(n().w(e,t,r,u),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},987:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},993:(e,t,r)=>{var n=r(546);function o(){var t,r,u="function"==typeof Symbol?Symbol:{},a=u.iterator||"@@iterator",i=u.toStringTag||"@@toStringTag";function s(e,o,u,a){var i=o&&o.prototype instanceof f?o:f,s=Object.create(i.prototype);return n(s,"_invoke",function(e,n,o){var u,a,i,s=0,f=o||[],l=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return u=e,a=0,i=t,p.n=r,c}};function d(e,n){for(a=e,i=n,r=0;!l&&s&&!o&&r<f.length;r++){var o,u=f[r],d=p.p,v=u[2];e>3?(o=v===n)&&(i=u[(a=u[4])?5:(a=3,3)],u[4]=u[5]=t):u[0]<=d&&((o=e<2&&d<u[1])?(a=0,p.v=n,p.n=u[1]):d<v&&(o=e<3||u[0]>n||n>v)&&(u[4]=e,u[5]=n,p.n=v,a=0))}if(o||e>1)return c;throw l=!0,n}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&d(f,v),a=f,i=v;(r=a<2?t:i)||!l;){u||(a?a<3?(a>1&&(p.n=-1),d(a,i)):p.n=i:p.v=i);try{if(s=2,u){if(a||(o="next"),r=u[o]){if(!(r=r.call(u,i)))throw TypeError("iterator result is not an object");if(!r.done)return r;i=r.value,a<2&&(a=0)}else 1===a&&(r=u.return)&&r.call(u),a<2&&(i=TypeError("The iterator does not provide a '"+o+"' method"),a=1);u=t}else if((r=(l=p.n<0)?i:e.call(n,p))!==c)break}catch(e){u=t,a=1,i=e}finally{s=1}}return{value:r,done:l}}}(e,u,a),!0),s}var c={};function f(){}function l(){}function p(){}r=Object.getPrototypeOf;var d=[][a]?r(r([][a]())):(n(r={},a,(function(){return this})),r),v=p.prototype=f.prototype=Object.create(d);function x(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,n(e,i,"GeneratorFunction")),e.prototype=Object.create(v),e}return l.prototype=p,n(v,"constructor",p),n(p,"constructor",l),l.displayName="GeneratorFunction",n(p,i,"GeneratorFunction"),n(v),n(v,i,"Generator"),n(v,a,(function(){return this})),n(v,"toString",(function(){return"[object Generator]"})),(e.exports=o=function(){return{w:s,m:x}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n].call(u.exports,u,u.exports,r),u.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,s=i(o.load,a),l=function(f){return s().clearInterval(f)},c=function(f){return s().clearTimeout(f)},d=function(){var f;return(f=s()).setInterval.apply(f,arguments)},u=function(){var f;return(f=s()).setTimeout.apply(f,arguments)};r.clearInterval=l,r.clearTimeout=c,r.setInterval=d,r.setTimeout=u})}),Ma=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"__esModule",{value:!0}),e.isReactNativeBrowser=e.isWebWorker=void 0;var t=()=>{var a;return typeof window<"u"?typeof navigator<"u"&&((a=navigator.userAgent)==null?void 0:a.toLowerCase().indexOf(" electron/"))>-1&&(ft!=null&&ft.versions)?!Object.prototype.hasOwnProperty.call(ft.versions,"electron"):typeof window.document<"u":!1},r=()=>{var a,s;return!!(typeof self=="object"&&((s=(a=self==null?void 0:self.constructor)==null?void 0:a.name)!=null&&s.includes("WorkerGlobalScope"))&&typeof Deno>"u")},o=()=>typeof navigator<"u"&&navigator.product==="ReactNative",i=t()||r()||o();e.isWebWorker=r(),e.isReactNativeBrowser=o(),e.default=i}),NI=Oe(e=>{Ie(),Ne(),Re();var t=e&&e.__createBinding||(Object.create?function(d,u,f,h){h===void 0&&(h=f);var g=Object.getOwnPropertyDescriptor(u,f);(!g||("get"in g?!u.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return u[f]}}),Object.defineProperty(d,h,g)}:function(d,u,f,h){h===void 0&&(h=f),d[h]=u[f]}),r=e&&e.__setModuleDefault||(Object.create?function(d,u){Object.defineProperty(d,"default",{enumerable:!0,value:u})}:function(d,u){d.default=u}),o=e&&e.__importStar||function(){var d=function(u){return d=Object.getOwnPropertyNames||function(f){var h=[];for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(h[h.length]=g);return h},d(u)};return function(u){if(u&&u.__esModule)return u;var f={};if(u!=null)for(var h=d(u),g=0;g<h.length;g++)h[g]!=="default"&&t(f,u,h[g]);return r(f,u),f}}();Object.defineProperty(e,"__esModule",{value:!0});var i=RI(),a=o(Ma()),s={set:i.setInterval,clear:i.clearInterval},l={set:(d,u)=>setInterval(d,u),clear:d=>clearInterval(d)},c=d=>{switch(d){case"native":return l;case"worker":return s;case"auto":default:return a.default&&!a.isWebWorker&&!a.isReactNativeBrowser?s:l}};e.default=c}),dm=Oe(e=>{Ie(),Ne(),Re();var t=e&&e.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(NI()),o=class{constructor(i,a){Pe(this,"_keepalive");Pe(this,"timerId");Pe(this,"timer");Pe(this,"destroyed",!1);Pe(this,"counter");Pe(this,"client");Pe(this,"_keepaliveTimeoutTimestamp");Pe(this,"_intervalEvery");this.client=i,this.timer=typeof a=="object"&&"set"in a&&"clear"in a?a:(0,r.default)(a),this.setKeepalive(i.options.keepalive)}get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(i){if(i*=1e3,isNaN(i)||i<=0||i>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${i}`);this._keepalive=i,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${i}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let i=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+i,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,this.counter===2?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}};e.default=o}),wd=Oe(e=>{var C;Ie(),Ne(),Re();var t=e&&e.__createBinding||(Object.create?function(A,k,T,I){I===void 0&&(I=T);var R=Object.getOwnPropertyDescriptor(k,T);(!R||("get"in R?!k.__esModule:R.writable||R.configurable))&&(R={enumerable:!0,get:function(){return k[T]}}),Object.defineProperty(A,I,R)}:function(A,k,T,I){I===void 0&&(I=T),A[I]=k[T]}),r=e&&e.__setModuleDefault||(Object.create?function(A,k){Object.defineProperty(A,"default",{enumerable:!0,value:k})}:function(A,k){A.default=k}),o=e&&e.__importStar||function(){var A=function(k){return A=Object.getOwnPropertyNames||function(T){var I=[];for(var R in T)Object.prototype.hasOwnProperty.call(T,R)&&(I[I.length]=R);return I},A(k)};return function(k){if(k&&k.__esModule)return k;var T={};if(k!=null)for(var I=A(k),R=0;R<I.length;R++)I[R]!=="default"&&t(T,k,I[R]);return r(T,k),T}}(),i=e&&e.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(e,"__esModule",{value:!0});var a=i(jP()),s=no(),l=i(WP()),c=i(on()),d=o(Yg()),u=i(Xg()),f=i(uI()),h=i(nm()),g=i(fI()),p=$o(),m=hI(),v=i(dm()),y=o(Ma()),b=globalThis.setImmediate||((...A)=>{let k=A.shift();(0,p.nextTick)(()=>{k(...A)})}),S={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},_=(C=class extends m.TypedEventEmitter{constructor(T,I){super();Pe(this,"connected");Pe(this,"disconnecting");Pe(this,"disconnected");Pe(this,"reconnecting");Pe(this,"incomingStore");Pe(this,"outgoingStore");Pe(this,"options");Pe(this,"queueQoSZero");Pe(this,"_reconnectCount");Pe(this,"log");Pe(this,"messageIdProvider");Pe(this,"outgoing");Pe(this,"messageIdToTopic");Pe(this,"noop");Pe(this,"keepaliveManager");Pe(this,"stream");Pe(this,"queue");Pe(this,"streamBuilder");Pe(this,"_resubscribeTopics");Pe(this,"connackTimer");Pe(this,"reconnectTimer");Pe(this,"_storeProcessing");Pe(this,"_packetIdsDuringStoreProcessing");Pe(this,"_storeProcessingQueue");Pe(this,"_firstConnection");Pe(this,"topicAliasRecv");Pe(this,"topicAliasSend");Pe(this,"_deferredReconnect");Pe(this,"connackPacket");this.options=I||{};for(let R in S)typeof this.options[R]>"u"?this.options[R]=S[R]:this.options[R]=I[R];this.log=this.options.log||(0,c.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",C.VERSION),y.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",y.default?"browser":"node"),this.log("MqttClient :: options.protocol",I.protocol),this.log("MqttClient :: options.protocolVersion",I.protocolVersion),this.log("MqttClient :: options.username",I.username),this.log("MqttClient :: options.keepalive",I.keepalive),this.log("MqttClient :: options.reconnectPeriod",I.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",I.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",I.properties?I.properties.topicAliasMaximum:void 0),this.options.clientId=typeof I.clientId=="string"?I.clientId:C.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=I.protocolVersion===5&&I.customHandleAcks?I.customHandleAcks:(...R)=>{R[3](null,0)},this.options.writeCache||(a.default.writeToStream.cacheNumbers=!1),this.streamBuilder=T,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new h.default:this.options.messageIdProvider,this.outgoingStore=I.outgoingStore||new u.default,this.incomingStore=I.incomingStore||new u.default,this.queueQoSZero=I.queueQoSZero===void 0?!0:I.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,I.properties&&I.properties.topicAliasMaximum>0&&(I.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new g.default(I.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:R}=this,B=()=>{let P=R.shift();this.log("deliver :: entry %o",P);let O=null;if(!P){this._resubscribe();return}O=P.packet,this.log("deliver :: call _sendPacket for %o",O);let N=!0;O.messageId&&O.messageId!==0&&(this.messageIdProvider.register(O.messageId)||(N=!1)),N?this._sendPacket(O,$=>{P.cb&&P.cb($),B()}):(this.log("messageId: %d has already used. The message is skipped and removed.",O.messageId),B())};this.log("connect :: sending queued packets"),B()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}handleAuth(T,I){I()}handleMessage(T,I){I()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var q;let T=new s.Writable,I=a.default.parser(this.options),R=null,B=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new u.default,this.outgoingStore=this.options.outgoingStore||new u.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),I.on("packet",z=>{this.log("parser :: on packet push to packets array."),B.push(z)});let P=()=>{this.log("work :: getting next packet in queue");let z=B.shift();if(z)this.log("work :: packet pulled from queue"),(0,f.default)(this,z,O);else{this.log("work :: no packets in queue");let L=R;R=null,this.log("work :: done flag is %s",!!L),L&&L()}},O=()=>{if(B.length)(0,p.nextTick)(P);else{let z=R;R=null,z()}};T._write=(z,L,te)=>{R=te,this.log("writable stream :: parsing buffer"),I.parse(z),P()};let N=z=>{this.log("streamErrorHandler :: error",z.message),z.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",z)):this.noop(z)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(T),this.stream.on("error",N),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");let $={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&($.will={...this.options.will,payload:(q=this.options.will)==null?void 0:q.payload}),this.topicAliasRecv&&($.properties||($.properties={}),this.topicAliasRecv&&($.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket($),I.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){let z={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(z)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0)},this.options.connectTimeout),this}publish(T,I,R,B){this.log("publish :: message `%s` to topic `%s`",I,T);let{options:P}=this;typeof R=="function"&&(B=R,R=null),R=R||{},R={qos:0,retain:!1,dup:!1,...R};let{qos:O,retain:N,dup:$,properties:q,cbStorePut:z}=R;if(this._checkDisconnecting(B))return this;let L=()=>{let te=0;if((O===1||O===2)&&(te=this._nextId(),te===null))return this.log("No messageId left"),!1;let j={cmd:"publish",topic:T,payload:I,qos:O,retain:N,messageId:te,dup:$};switch(P.protocolVersion===5&&(j.properties=q),this.log("publish :: qos",O),O){case 1:case 2:this.outgoing[j.messageId]={volatile:!1,cb:B||this.noop},this.log("MqttClient:publish: packet cmd: %s",j.cmd),this._sendPacket(j,void 0,z);break;default:this.log("MqttClient:publish: packet cmd: %s",j.cmd),this._sendPacket(j,B,z);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!L())&&this._storeProcessingQueue.push({invoke:L,cbStorePut:R.cbStorePut,callback:B}),this}publishAsync(T,I,R){return new Promise((B,P)=>{this.publish(T,I,R,(O,N)=>{O?P(O):B(N)})})}subscribe(T,I,R){let B=this.options.protocolVersion;typeof I=="function"&&(R=I),R=R||this.noop;let P=!1,O=[];typeof T=="string"?(T=[T],O=T):Array.isArray(T)?O=T:typeof T=="object"&&(P=T.resubscribe,delete T.resubscribe,O=Object.keys(T));let N=d.validateTopics(O);if(N!==null)return b(R,new Error(`Invalid topic ${N}`)),this;if(this._checkDisconnecting(R))return this.log("subscribe: discconecting true"),this;let $={qos:0};B===5&&($.nl=!1,$.rap=!1,$.rh=0),I={...$,...I};let{properties:q}=I,z=[],L=(se,D)=>{if(D=D||I,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,se)||this._resubscribeTopics[se].qos<D.qos||P){let U={topic:se,qos:D.qos};B===5&&(U.nl=D.nl,U.rap=D.rap,U.rh=D.rh,U.properties=q),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",U.topic,U.qos),z.push(U)}};if(Array.isArray(T)?T.forEach(se=>{this.log("subscribe: array topic %s",se),L(se)}):Object.keys(T).forEach(se=>{this.log("subscribe: object topic %s, %o",se,T[se]),L(se,T[se])}),!z.length)return R(null,[]),this;let te=(se,D)=>{let U={cmd:"subscribe",subscriptions:se,messageId:D};if(q&&(U.properties=q),this.options.resubscribe){this.log("subscribe :: resubscribe true");let X=[];se.forEach(Ce=>{if(this.options.reconnectPeriod>0){let ne={qos:Ce.qos};B===5&&(ne.nl=Ce.nl||!1,ne.rap=Ce.rap||!1,ne.rh=Ce.rh||0,ne.properties=Ce.properties),this._resubscribeTopics[Ce.topic]=ne,X.push(Ce.topic)}}),this.messageIdToTopic[U.messageId]=X}let xe=new Promise((X,Ce)=>{this.outgoing[U.messageId]={volatile:!0,cb(ne,Y){if(!ne){let{granted:be}=Y;for(let ce=0;ce<be.length;ce+=1)se[ce].qos=be[ce]}ne?Ce(new p.ErrorWithSubackPacket(ne.message,Y)):X(Y)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(U),xe},j=()=>{let se=this.options.subscribeBatchSize??z.length,D=[];for(let U=0;U<z.length;U+=se){let xe=z.slice(U,U+se),X=this._nextId();if(X===null)return this.log("No messageId left"),!1;D.push(te(xe,X))}return Promise.all(D).then(U=>{R(null,z,U.at(-1))}).catch(U=>{R(U,z,U.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!j())&&this._storeProcessingQueue.push({invoke:j,callback:R}),this}subscribeAsync(T,I){return new Promise((R,B)=>{this.subscribe(T,I,(P,O)=>{P?B(P):R(O)})})}unsubscribe(T,I,R){typeof T=="string"&&(T=[T]),typeof I=="function"&&(R=I),R=R||this.noop;let B=d.validateTopics(T);if(B!==null)return b(R,new Error(`Invalid topic ${B}`)),this;if(this._checkDisconnecting(R))return this;let P=()=>{let O=this._nextId();if(O===null)return this.log("No messageId left"),!1;let N={cmd:"unsubscribe",messageId:O,unsubscriptions:[]};return typeof T=="string"?N.unsubscriptions=[T]:Array.isArray(T)&&(N.unsubscriptions=T),this.options.resubscribe&&N.unsubscriptions.forEach($=>{delete this._resubscribeTopics[$]}),typeof I=="object"&&I.properties&&(N.properties=I.properties),this.outgoing[N.messageId]={volatile:!0,cb:R},this.log("unsubscribe: call _sendPacket"),this._sendPacket(N),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!P())&&this._storeProcessingQueue.push({invoke:P,callback:R}),this}unsubscribeAsync(T,I){return new Promise((R,B)=>{this.unsubscribe(T,I,(P,O)=>{P?B(P):R(O)})})}end(T,I,R){this.log("end :: (%s)",this.options.clientId),(T==null||typeof T!="boolean")&&(R=R||I,I=T,T=!1),typeof I!="object"&&(R=R||I,I=null),this.log("end :: cb? %s",!!R),(!R||typeof R!="function")&&(R=this.noop);let B=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(O=>{this.outgoingStore.close(N=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),R){let $=O||N;this.log("end :: closeStores: invoking callback with args"),R($)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},P=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,T),this._cleanUp(T,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,p.nextTick)(B)},I)};return this.disconnecting?(R(),this):(this._clearReconnect(),this.disconnecting=!0,!T&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,P,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),P()),this)}endAsync(T,I){return new Promise((R,B)=>{this.end(T,I,P=>{P?B(P):R()})})}removeOutgoingMessage(T){if(this.outgoing[T]){let{cb:I}=this.outgoing[T];this._removeOutgoingAndStoreMessage(T,()=>{I(new Error("Message removed"))})}return this}reconnect(T){this.log("client reconnect");let I=()=>{T?(this.options.incomingStore=T.incomingStore,this.options.outgoingStore=T.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new u.default,this.outgoingStore=this.options.outgoingStore||new u.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=I:I(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(T=>{this.outgoing[T].volatile&&typeof this.outgoing[T].cb=="function"&&(this.outgoing[T].cb(new Error("Connection closed")),delete this.outgoing[T])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(T=>{typeof this.outgoing[T].cb=="function"&&(this.outgoing[T].cb(new Error("Connection closed")),delete this.outgoing[T])}))}_removeTopicAliasAndRecoverTopicName(T){let I;T.properties&&(I=T.properties.topicAlias);let R=T.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",I,R),R.length===0){if(typeof I>"u")return new Error("Unregistered Topic Alias");if(R=this.topicAliasSend.getTopicByAlias(I),typeof R>"u")return new Error("Unregistered Topic Alias");T.topic=R}I&&delete T.properties.topicAlias}_checkDisconnecting(T){return this.disconnecting&&(T&&T!==this.noop?T(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(T,I,R={}){if(I&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",I)),this.log("_cleanUp :: forced? %s",T),T)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let B={cmd:"disconnect",...R};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(B,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),b(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),I&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",I),I())}_storeAndSend(T,I,R){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",T.cmd);let B=T,P;if(B.cmd==="publish"&&(B=(0,l.default)(T),P=this._removeTopicAliasAndRecoverTopicName(B),P))return I&&I(P);this.outgoingStore.put(B,O=>{if(O)return I&&I(O);R(),this._writePacket(T,I)})}_applyTopicAlias(T){if(this.options.protocolVersion===5&&T.cmd==="publish"){let I;T.properties&&(I=T.properties.topicAlias);let R=T.topic.toString();if(this.topicAliasSend)if(I){if(R.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",R,I),!this.topicAliasSend.put(R,I)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",R,I),new Error("Sending Topic Alias out of range")}else R.length!==0&&(this.options.autoAssignTopicAlias?(I=this.topicAliasSend.getAliasByTopic(R),I?(T.topic="",T.properties={...T.properties,topicAlias:I},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",R,I)):(I=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(R,I),T.properties={...T.properties,topicAlias:I},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",R,I))):this.options.autoUseTopicAlias&&(I=this.topicAliasSend.getAliasByTopic(R),I&&(T.topic="",T.properties={...T.properties,topicAlias:I},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",R,I))));else if(I)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",R,I),new Error("Sending Topic Alias out of range")}}_noop(T){this.log("noop ::",T)}_writePacket(T,I){this.log("_writePacket :: packet: %O",T),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",T),this.log("_writePacket :: writing to stream");let R=a.default.writeToStream(T,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",R),!R&&I&&I!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",I)):I&&(this.log("_writePacket :: invoking cb"),I())}_sendPacket(T,I,R,B){this.log("_sendPacket :: (%s) :: start",this.options.clientId),R=R||this.noop,I=I||this.noop;let P=this._applyTopicAlias(T);if(P){I(P);return}if(!this.connected){if(T.cmd==="auth"){this._writePacket(T,I);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(T,I,R);return}if(B){this._writePacket(T,I);return}switch(T.cmd){case"publish":break;case"pubrel":this._storeAndSend(T,I,R);return;default:this._writePacket(T,I);return}switch(T.qos){case 2:case 1:this._storeAndSend(T,I,R);break;case 0:default:this._writePacket(T,I);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(T,I,R){this.log("_storePacket :: packet: %o",T),this.log("_storePacket :: cb? %s",!!I),R=R||this.noop;let B=T;if(B.cmd==="publish"){B=(0,l.default)(T);let O=this._removeTopicAliasAndRecoverTopicName(B);if(O)return I&&I(O)}let P=B.qos||0;P===0&&this.queueQoSZero||B.cmd!=="publish"?this.queue.push({packet:B,cb:I}):P>0?(I=this.outgoing[B.messageId]?this.outgoing[B.messageId].cb:null,this.outgoingStore.put(B,O=>{if(O)return I&&I(O);R()})):I&&I(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new v.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(T=!1){this.keepaliveManager&&this.options.keepalive&&(T||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.emit("error",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let T=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&T.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let I=0;I<T.length;I++){let R={};R[T[I]]=this._resubscribeTopics[T[I]],R.resubscribe=!0,this.subscribe(R,{properties:R[T[I]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(T){if(this.disconnected){this.emit("connect",T);return}this.connackPacket=T,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let I=()=>{let R=this.outgoingStore.createStream(),B=()=>{R.destroy(),R=null,this._flushStoreProcessingQueue(),P()},P=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",B),R.on("error",N=>{P(),this._flushStoreProcessingQueue(),this.removeListener("close",B),this.emit("error",N)});let O=()=>{if(!R)return;let N=R.read(1),$;if(!N){R.once("readable",O);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[N.messageId]){O();return}!this.disconnecting&&!this.reconnectTimer?($=this.outgoing[N.messageId]?this.outgoing[N.messageId].cb:null,this.outgoing[N.messageId]={volatile:!1,cb(q,z){$&&$(q,z),O()}},this._packetIdsDuringStoreProcessing[N.messageId]=!0,this.messageIdProvider.register(N.messageId)?this._sendPacket(N,void 0,void 0,!0):this.log("messageId: %d has already used.",N.messageId)):R.destroy&&R.destroy()};R.on("end",()=>{let N=!0;for(let $ in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[$]){N=!1;break}this.removeListener("close",B),N?(P(),this._invokeAllStoreProcessingQueue(),this.emit("connect",T)):I()}),O()};I()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let T=this._storeProcessingQueue[0];if(T&&T.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let T of this._storeProcessingQueue)T.cbStorePut&&T.cbStorePut(new Error("Connection closed")),T.callback&&T.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(T,I){delete this.outgoing[T],this.outgoingStore.del({messageId:T},(R,B)=>{I(R,B),this.messageIdProvider.deallocate(T),this._invokeStoreProcessingQueue()})}},Pe(C,"VERSION",p.MQTTJS_VERSION),C);e.default=_}),$I=Oe(e=>{Ie(),Ne(),Re(),Object.defineProperty(e,"__esModule",{value:!0});var t=rm(),r=class{constructor(){Pe(this,"numberAllocator");Pe(this,"lastId");this.numberAllocator=new t.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(o){return this.numberAllocator.use(o)}deallocate(o){this.numberAllocator.free(o)}clear(){this.numberAllocator.clear()}};e.default=r});function OI(){if(xd)return za;xd=!0;let e=2147483647,t=36,r=1,o=26,i=38,a=700,s=72,l=128,c="-",d=/^xn--/,u=/[^\0-\x7F]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=t-r,p=Math.floor,m=String.fromCharCode;function v(R){throw new RangeError(h[R])}function y(R,B){let P=[],O=R.length;for(;O--;)P[O]=B(R[O]);return P}function b(R,B){let P=R.split("@"),O="";P.length>1&&(O=P[0]+"@",R=P[1]),R=R.replace(f,".");let N=R.split("."),$=y(N,B).join(".");return O+$}function S(R){let B=[],P=0,O=R.length;for(;P<O;){let N=R.charCodeAt(P++);if(N>=55296&&N<=56319&&P<O){let $=R.charCodeAt(P++);($&64512)==56320?B.push(((N&1023)<<10)+($&1023)+65536):(B.push(N),P--)}else B.push(N)}return B}let _=R=>String.fromCodePoint(...R),C=function(R){return R>=48&&R<58?26+(R-48):R>=65&&R<91?R-65:R>=97&&R<123?R-97:t},A=function(R,B){return R+22+75*(R<26)-((B!=0)<<5)},k=function(R,B,P){let O=0;for(R=P?p(R/a):R>>1,R+=p(R/B);R>g*o>>1;O+=t)R=p(R/g);return p(O+(g+1)*R/(R+i))},T=function(R){let B=[],P=R.length,O=0,N=l,$=s,q=R.lastIndexOf(c);q<0&&(q=0);for(let z=0;z<q;++z)R.charCodeAt(z)>=128&&v("not-basic"),B.push(R.charCodeAt(z));for(let z=q>0?q+1:0;z<P;){let L=O;for(let j=1,se=t;;se+=t){z>=P&&v("invalid-input");let D=C(R.charCodeAt(z++));D>=t&&v("invalid-input"),D>p((e-O)/j)&&v("overflow"),O+=D*j;let U=se<=$?r:se>=$+o?o:se-$;if(D<U)break;let xe=t-U;j>p(e/xe)&&v("overflow"),j*=xe}let te=B.length+1;$=k(O-L,te,L==0),p(O/te)>e-N&&v("overflow"),N+=p(O/te),O%=te,B.splice(O++,0,N)}return String.fromCodePoint(...B)},I=function(R){let B=[];R=S(R);let P=R.length,O=l,N=0,$=s;for(let L of R)L<128&&B.push(m(L));let q=B.length,z=q;for(q&&B.push(c);z<P;){let L=e;for(let j of R)j>=O&&j<L&&(L=j);let te=z+1;L-O>p((e-N)/te)&&v("overflow"),N+=(L-O)*te,O=L;for(let j of R)if(j<O&&++N>e&&v("overflow"),j===O){let se=N;for(let D=t;;D+=t){let U=D<=$?r:D>=$+o?o:D-$;if(se<U)break;let xe=se-U,X=t-U;B.push(m(A(U+xe%X,0))),se=p(xe/X)}B.push(m(A(se,0))),$=k(N,te,z===q),N=0,++z}++N,++O}return B.join("")};return za={version:"2.3.1",ucs2:{decode:S,encode:_},decode:T,encode:I,toASCII:function(R){return b(R,function(B){return u.test(B)?"xn--"+I(B):B})},toUnicode:function(R){return b(R,function(B){return d.test(B)?T(B.slice(4).toLowerCase()):B})}},za}var za,xd,kn,BI=cr(()=>{Ie(),Ne(),Re(),za={},xd=!1,kn=OI(),kn.decode,kn.encode,kn.toASCII,kn.toUnicode,kn.ucs2,kn.version});function MI(){return kd||(kd=!0,_d=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var o=42;e[t]=o;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==o||a.enumerable!==!0)return!1}return!0}),_d}function zI(){return Td||(Td=!0,Ed=Error),Ed}function DI(){return Pd||(Pd=!0,Ad=EvalError),Ad}function FI(){return Rd||(Rd=!0,Id=RangeError),Id}function VI(){return $d||($d=!0,Nd=ReferenceError),Nd}function um(){return Bd||(Bd=!0,Od=SyntaxError),Od}function _i(){return zd||(zd=!0,Md=TypeError),Md}function LI(){return Fd||(Fd=!0,Dd=URIError),Dd}function jI(){if(Vd)return Da;Vd=!0;var e=typeof Symbol<"u"&&Symbol,t=MI();return Da=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Da}function UI(){if(Ld)return Fa;Ld=!0;var e={__proto__:null,foo:{}},t=Object;return Fa=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)},Fa}function WI(){if(jd)return Va;jd=!0;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,o="[object Function]",i=function(l,c){for(var d=[],u=0;u<l.length;u+=1)d[u]=l[u];for(var f=0;f<c.length;f+=1)d[f+l.length]=c[f];return d},a=function(l,c){for(var d=[],u=c,f=0;u<l.length;u+=1,f+=1)d[f]=l[u];return d},s=function(l,c){for(var d="",u=0;u<l.length;u+=1)d+=l[u],u+1<l.length&&(d+=c);return d};return Va=function(l){var c=this;if(typeof c!="function"||t.apply(c)!==o)throw new TypeError(e+c);for(var d=a(arguments,1),u,f=function(){if(this instanceof u){var v=c.apply(this,i(d,arguments));return Object(v)===v?v:this}return c.apply(l,i(d,arguments))},h=r(0,c.length-d.length),g=[],p=0;p<h;p++)g[p]="$"+p;if(u=Function("binder","return function ("+s(g,",")+"){ return binder.apply(this,arguments); }")(f),c.prototype){var m=function(){};m.prototype=c.prototype,u.prototype=new m,m.prototype=null}return u},Va}function Cd(){if(Ud)return La;Ud=!0;var e=WI();return La=Function.prototype.bind||e,La}function HI(){if(Wd)return ja;Wd=!0;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=Cd();return ja=r.call(e,t),ja}function Oo(){if(Hd)return Ua;Hd=!0;var e,t=zI(),r=DI(),o=FI(),i=VI(),a=um(),s=_i(),l=LI(),c=Function,d=function(z){try{return c('"use strict"; return ('+z+").constructor;")()}catch{}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch{u=null}var f=function(){throw new s},h=u?function(){try{return arguments.callee,f}catch{try{return u(arguments,"callee").get}catch{return f}}}():f,g=jI()(),p=UI()(),m=Object.getPrototypeOf||(p?function(z){return z.__proto__}:null),v={},y=typeof Uint8Array>"u"||!m?e:m(Uint8Array),b={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":g&&m?m([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":c,"%GeneratorFunction%":v,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&m?m(m([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!g||!m?e:m(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":o,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!g||!m?e:m(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&m?m(""[Symbol.iterator]()):e,"%Symbol%":g?Symbol:e,"%SyntaxError%":a,"%ThrowTypeError%":h,"%TypedArray%":y,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};if(m)try{null.error}catch(z){var S=m(m(z));b["%Error.prototype%"]=S}var _=function z(L){var te;if(L==="%AsyncFunction%")te=d("async function () {}");else if(L==="%GeneratorFunction%")te=d("function* () {}");else if(L==="%AsyncGeneratorFunction%")te=d("async function* () {}");else if(L==="%AsyncGenerator%"){var j=z("%AsyncGeneratorFunction%");j&&(te=j.prototype)}else if(L==="%AsyncIteratorPrototype%"){var se=z("%AsyncGenerator%");se&&m&&(te=m(se.prototype))}return b[L]=te,te},C={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},A=Cd(),k=HI(),T=A.call(Function.call,Array.prototype.concat),I=A.call(Function.apply,Array.prototype.splice),R=A.call(Function.call,String.prototype.replace),B=A.call(Function.call,String.prototype.slice),P=A.call(Function.call,RegExp.prototype.exec),O=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,$=function(z){var L=B(z,0,1),te=B(z,-1);if(L==="%"&&te!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(te==="%"&&L!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var j=[];return R(z,O,function(se,D,U,xe){j[j.length]=U?R(xe,N,"$1"):D||se}),j},q=function(z,L){var te=z,j;if(k(C,te)&&(j=C[te],te="%"+j[0]+"%"),k(b,te)){var se=b[te];if(se===v&&(se=_(te)),typeof se>"u"&&!L)throw new s("intrinsic "+z+" exists, but is not available. Please file an issue!");return{alias:j,name:te,value:se}}throw new a("intrinsic "+z+" does not exist!")};return Ua=function(z,L){if(typeof z!="string"||z.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof L!="boolean")throw new s('"allowMissing" argument must be a boolean');if(P(/^%?[^%]*%?$/,z)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var te=$(z),j=te.length>0?te[0]:"",se=q("%"+j+"%",L),D=se.name,U=se.value,xe=!1,X=se.alias;X&&(j=X[0],I(te,T([0,1],X)));for(var Ce=1,ne=!0;Ce<te.length;Ce+=1){var Y=te[Ce],be=B(Y,0,1),ce=B(Y,-1);if((be==='"'||be==="'"||be==="`"||ce==='"'||ce==="'"||ce==="`")&&be!==ce)throw new a("property names with quotes must have matching quotes");if((Y==="constructor"||!ne)&&(xe=!0),j+="."+Y,D="%"+j+"%",k(b,D))U=b[D];else if(U!=null){if(!(Y in U)){if(!L)throw new s("base intrinsic for "+z+" exists, but the property is not available.");return}if(u&&Ce+1>=te.length){var pe=u(U,Y);ne=!!pe,ne&&"get"in pe&&!("originalValue"in pe.get)?U=pe.get:U=U[Y]}else ne=k(U,Y),U=U[Y];ne&&!xe&&(b[D]=U)}}return U},Ua}function Sd(){if(qd)return Wa;qd=!0;var e=Oo(),t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return Wa=t,Wa}function fm(){if(Gd)return Ha;Gd=!0;var e=Oo(),t=e("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch{t=null}return Ha=t,Ha}function qI(){if(Kd)return qa;Kd=!0;var e=Sd(),t=um(),r=_i(),o=fm();return qa=function(i,a,s){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,d=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,f=!!o&&o(i,a);if(e)e(i,a,{configurable:d===null&&f?f.configurable:!d,enumerable:l===null&&f?f.enumerable:!l,value:s,writable:c===null&&f?f.writable:!c});else if(u||!l&&!c&&!d)i[a]=s;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},qa}function GI(){if(Yd)return Ga;Yd=!0;var e=Sd(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Ga=t,Ga}function KI(){if(Xd)return Ka;Xd=!0;var e=Oo(),t=qI(),r=GI()(),o=fm(),i=_i(),a=e("%Math.floor%");return Ka=function(s,l){if(typeof s!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||a(l)!==l)throw new i("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],d=!0,u=!0;if("length"in s&&o){var f=o(s,"length");f&&!f.configurable&&(d=!1),f&&!f.writable&&(u=!1)}return(d||u||!c)&&(r?t(s,"length",l,!0,!0):t(s,"length",l)),s},Ka}function YI(){if(Jd)return Bo;Jd=!0;var e=Cd(),t=Oo(),r=KI(),o=_i(),i=t("%Function.prototype.apply%"),a=t("%Function.prototype.call%"),s=t("%Reflect.apply%",!0)||e.call(a,i),l=Sd(),c=t("%Math.max%");Bo=function(u){if(typeof u!="function")throw new o("a function is required");var f=s(e,a,arguments);return r(f,1+c(0,u.length-(arguments.length-1)),!0)};var d=function(){return s(e,i,arguments)};return l?l(Bo,"apply",{value:d}):Bo.apply=d,Bo}function XI(){if(Qd)return Ya;Qd=!0;var e=Oo(),t=YI(),r=t(e("String.prototype.indexOf"));return Ya=function(o,i){var a=e(o,!!i);return typeof a=="function"&&r(o,".prototype.")>-1?t(a):a},Ya}var _d,kd,Ed,Td,Ad,Pd,Id,Rd,Nd,$d,Od,Bd,Md,zd,Dd,Fd,Da,Vd,Fa,Ld,Va,jd,La,Ud,ja,Wd,Ua,Hd,Wa,qd,Ha,Gd,qa,Kd,Ga,Yd,Ka,Xd,Bo,Jd,Ya,Qd,JI=cr(()=>{Ie(),Ne(),Re(),_d={},kd=!1,Ed={},Td=!1,Ad={},Pd=!1,Id={},Rd=!1,Nd={},$d=!1,Od={},Bd=!1,Md={},zd=!1,Dd={},Fd=!1,Da={},Vd=!1,Fa={},Ld=!1,Va={},jd=!1,La={},Ud=!1,ja={},Wd=!1,Ua={},Hd=!1,Wa={},qd=!1,Ha={},Gd=!1,qa={},Kd=!1,Ga={},Yd=!1,Ka={},Xd=!1,Bo={},Jd=!1,Ya={},Qd=!1});function Zd(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function QI(){!oo||!io||(oo=!1,io.length?zr=io.concat(zr):ki=-1,zr.length&&hm())}function hm(){if(!oo){var e=setTimeout(QI,0);oo=!0;for(var t=zr.length;t;){for(io=zr,zr=[];++ki<t;)io&&io[ki].run();ki=-1,t=zr.length}io=null,oo=!1,clearTimeout(e)}}function ZI(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];zr.push(new pm(e,t)),zr.length===1&&!oo&&setTimeout(hm,0)}function pm(e,t){this.fun=e,this.array=t}function Kt(){}function eR(e){Zd("_linkedBinding")}function tR(e){Zd("dlopen")}function rR(){return[]}function nR(){return[]}function oR(e,t){if(!e)throw new Error(t||"assertion error")}function iR(){return!1}function aR(){return ln.now()/1e3}function eu(e){var t=Math.floor((Date.now()-ln.now())*.001),r=ln.now()*.001,o=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(o=o-e[0],i=i-e[1],i<0&&(o--,i+=Ja)),[o,i]}function En(){return ru}function sR(e){return[]}var zr,oo,io,ki,gm,mm,bm,ym,vm,wm,xm,Cm,Sm,_m,km,Em,Tm,Am,Pm,Im,Rm,Nm,$m,Om,Bm,Xa,Mm,zm,Dm,Fm,Vm,Lm,jm,Um,Wm,Hm,qm,Gm,Km,Ym,Xm,Jm,Qm,Zm,eb,tb,rb,nb,ob,ib,ab,ln,tu,Ja,sb,lb,cb,db,ub,fb,hb,pb,gb,mb,bb,ru,yb=cr(()=>{Ie(),Ne(),Re(),zr=[],oo=!1,ki=-1,pm.prototype.run=function(){this.fun.apply(null,this.array)},gm="browser",mm="x64",bm="browser",ym={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},vm=["/usr/bin/node"],wm=[],xm="v16.8.0",Cm={},Sm=function(e,t){console.warn((t?t+": ":"")+e)},_m=function(e){Zd("binding")},km=function(e){return 0},Em=function(){return"/"},Tm=function(e){},Am={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},Pm=Kt,Im=[],Rm={},Nm=!1,$m={},Om=Kt,Bm=Kt,Xa=function(){return{}},Mm=Xa,zm=Xa,Dm=Kt,Fm=Kt,Vm=Kt,Lm={},jm={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Um=Kt,Wm=Kt,Hm=Kt,qm=Kt,Gm=Kt,Km=Kt,Ym=Kt,Xm=void 0,Jm=void 0,Qm=void 0,Zm=Kt,eb=2,tb=1,rb="/bin/usr/node",nb=9229,ob="node",ib=[],ab=Kt,ln={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},ln.now===void 0&&(tu=Date.now(),ln.timing&&ln.timing.navigationStart&&(tu=ln.timing.navigationStart),ln.now=()=>Date.now()-tu),Ja=1e9,eu.bigint=function(e){var t=eu(e);return typeof BigInt>"u"?t[0]*Ja+t[1]:BigInt(t[0]*Ja)+BigInt(t[1])},sb=10,lb={},cb=0,db=En,ub=En,fb=En,hb=En,pb=En,gb=Kt,mb=En,bb=En,ru={version:xm,versions:Cm,arch:mm,platform:bm,release:Am,_rawDebug:Pm,moduleLoadList:Im,binding:_m,_linkedBinding:eR,_events:lb,_eventsCount:cb,_maxListeners:sb,on:En,addListener:db,once:ub,off:fb,removeListener:hb,removeAllListeners:pb,emit:gb,prependListener:mb,prependOnceListener:bb,listeners:sR,domain:Rm,_exiting:Nm,config:$m,dlopen:tR,uptime:aR,_getActiveRequests:rR,_getActiveHandles:nR,reallyExit:Om,_kill:Bm,cpuUsage:Xa,resourceUsage:Mm,memoryUsage:zm,kill:Dm,exit:Fm,openStdin:Vm,allowedNodeEnvironmentFlags:Lm,assert:oR,features:jm,_fatalExceptions:Um,setUncaughtExceptionCaptureCallback:Wm,hasUncaughtExceptionCaptureCallback:iR,emitWarning:Sm,nextTick:ZI,_tickCallback:Hm,_debugProcess:qm,_debugEnd:Gm,_startProfilerIdleNotifier:Km,_stopProfilerIdleNotifier:Ym,stdout:Xm,stdin:Qm,stderr:Jm,abort:Zm,umask:km,chdir:Tm,cwd:Em,env:ym,title:gm,argv:vm,execArgv:wm,pid:eb,ppid:tb,execPath:rb,debugPort:nb,hrtime:eu,argv0:ob,_preload_modules:ib,setSourceMapsEnabled:ab}});function lR(){if(nu)return Qa;nu=!0;var e=ru;function t(a){if(typeof a!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(a))}function r(a,s){for(var l="",c=0,d=-1,u=0,f,h=0;h<=a.length;++h){if(h<a.length)f=a.charCodeAt(h);else{if(f===47)break;f=47}if(f===47){if(!(d===h-1||u===1))if(d!==h-1&&u===2){if(l.length<2||c!==2||l.charCodeAt(l.length-1)!==46||l.charCodeAt(l.length-2)!==46){if(l.length>2){var g=l.lastIndexOf("/");if(g!==l.length-1){g===-1?(l="",c=0):(l=l.slice(0,g),c=l.length-1-l.lastIndexOf("/")),d=h,u=0;continue}}else if(l.length===2||l.length===1){l="",c=0,d=h,u=0;continue}}s&&(l.length>0?l+="/..":l="..",c=2)}else l.length>0?l+="/"+a.slice(d+1,h):l=a.slice(d+1,h),c=h-d-1;d=h,u=0}else f===46&&u!==-1?++u:u=-1}return l}function o(a,s){var l=s.dir||s.root,c=s.base||(s.name||"")+(s.ext||"");return l?l===s.root?l+c:l+a+c:c}var i={resolve:function(){for(var a="",s=!1,l,c=arguments.length-1;c>=-1&&!s;c--){var d;c>=0?d=arguments[c]:(l===void 0&&(l=e.cwd()),d=l),t(d),d.length!==0&&(a=d+"/"+a,s=d.charCodeAt(0)===47)}return a=r(a,!s),s?a.length>0?"/"+a:"/":a.length>0?a:"."},normalize:function(a){if(t(a),a.length===0)return".";var s=a.charCodeAt(0)===47,l=a.charCodeAt(a.length-1)===47;return a=r(a,!s),a.length===0&&!s&&(a="."),a.length>0&&l&&(a+="/"),s?"/"+a:a},isAbsolute:function(a){return t(a),a.length>0&&a.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var a,s=0;s<arguments.length;++s){var l=arguments[s];t(l),l.length>0&&(a===void 0?a=l:a+="/"+l)}return a===void 0?".":i.normalize(a)},relative:function(a,s){if(t(a),t(s),a===s||(a=i.resolve(a),s=i.resolve(s),a===s))return"";for(var l=1;l<a.length&&a.charCodeAt(l)===47;++l);for(var c=a.length,d=c-l,u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var f=s.length,h=f-u,g=d<h?d:h,p=-1,m=0;m<=g;++m){if(m===g){if(h>g){if(s.charCodeAt(u+m)===47)return s.slice(u+m+1);if(m===0)return s.slice(u+m)}else d>g&&(a.charCodeAt(l+m)===47?p=m:m===0&&(p=0));break}var v=a.charCodeAt(l+m),y=s.charCodeAt(u+m);if(v!==y)break;v===47&&(p=m)}var b="";for(m=l+p+1;m<=c;++m)(m===c||a.charCodeAt(m)===47)&&(b.length===0?b+="..":b+="/..");return b.length>0?b+s.slice(u+p):(u+=p,s.charCodeAt(u)===47&&++u,s.slice(u))},_makeLong:function(a){return a},dirname:function(a){if(t(a),a.length===0)return".";for(var s=a.charCodeAt(0),l=s===47,c=-1,d=!0,u=a.length-1;u>=1;--u)if(s=a.charCodeAt(u),s===47){if(!d){c=u;break}}else d=!1;return c===-1?l?"/":".":l&&c===1?"//":a.slice(0,c)},basename:function(a,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');t(a);var l=0,c=-1,d=!0,u;if(s!==void 0&&s.length>0&&s.length<=a.length){if(s.length===a.length&&s===a)return"";var f=s.length-1,h=-1;for(u=a.length-1;u>=0;--u){var g=a.charCodeAt(u);if(g===47){if(!d){l=u+1;break}}else h===-1&&(d=!1,h=u+1),f>=0&&(g===s.charCodeAt(f)?--f===-1&&(c=u):(f=-1,c=h))}return l===c?c=h:c===-1&&(c=a.length),a.slice(l,c)}else{for(u=a.length-1;u>=0;--u)if(a.charCodeAt(u)===47){if(!d){l=u+1;break}}else c===-1&&(d=!1,c=u+1);return c===-1?"":a.slice(l,c)}},extname:function(a){t(a);for(var s=-1,l=0,c=-1,d=!0,u=0,f=a.length-1;f>=0;--f){var h=a.charCodeAt(f);if(h===47){if(!d){l=f+1;break}continue}c===-1&&(d=!1,c=f+1),h===46?s===-1?s=f:u!==1&&(u=1):s!==-1&&(u=-1)}return s===-1||c===-1||u===0||u===1&&s===c-1&&s===l+1?"":a.slice(s,c)},format:function(a){if(a===null||typeof a!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof a);return o("/",a)},parse:function(a){t(a);var s={root:"",dir:"",base:"",ext:"",name:""};if(a.length===0)return s;var l=a.charCodeAt(0),c=l===47,d;c?(s.root="/",d=1):d=0;for(var u=-1,f=0,h=-1,g=!0,p=a.length-1,m=0;p>=d;--p){if(l=a.charCodeAt(p),l===47){if(!g){f=p+1;break}continue}h===-1&&(g=!1,h=p+1),l===46?u===-1?u=p:m!==1&&(m=1):u!==-1&&(m=-1)}return u===-1||h===-1||m===0||m===1&&u===h-1&&u===f+1?h!==-1&&(f===0&&c?s.base=s.name=a.slice(1,h):s.base=s.name=a.slice(f,h)):(f===0&&c?(s.name=a.slice(1,u),s.base=a.slice(1,h)):(s.name=a.slice(f,u),s.base=a.slice(f,h)),s.ext=a.slice(u,h)),f>0?s.dir=a.slice(0,f-1):c&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,Qa=i,Qa}var Qa,nu,ou,cR=cr(()=>{Ie(),Ne(),Re(),yb(),Qa={},nu=!1,ou=lR()}),vb={};Po(vb,{URL:()=>Ib,Url:()=>kb,default:()=>Yt,fileURLToPath:()=>xb,format:()=>Eb,parse:()=>Pb,pathToFileURL:()=>Cb,resolve:()=>Tb,resolveObject:()=>Ab});function dR(){if(au)return Za;au=!0;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,o=e&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=i&&a&&typeof a.get=="function"?a.get:null,l=i&&Set.prototype.forEach,c=typeof WeakMap=="function"&&WeakMap.prototype,d=c?WeakMap.prototype.has:null,u=typeof WeakSet=="function"&&WeakSet.prototype,f=u?WeakSet.prototype.has:null,h=typeof WeakRef=="function"&&WeakRef.prototype,g=h?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,m=Object.prototype.toString,v=Function.prototype.toString,y=String.prototype.match,b=String.prototype.slice,S=String.prototype.replace,_=String.prototype.toUpperCase,C=String.prototype.toLowerCase,A=RegExp.prototype.test,k=Array.prototype.concat,T=Array.prototype.join,I=Array.prototype.slice,R=Math.floor,B=typeof BigInt=="function"?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,N=typeof Symbol=="function"&&typeof Symbol.iterator=="object",$=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===N||!0)?Symbol.toStringTag:null,q=Object.prototype.propertyIsEnumerable,z=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(ae){return ae.__proto__}:null);function L(ae,ge){if(ae===1/0||ae===-1/0||ae!==ae||ae&&ae>-1e3&&ae<1e3||A.call(/e/,ge))return ge;var Be=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ae=="number"){var H=ae<0?-R(-ae):R(ae);if(H!==ae){var ve=String(H),Ae=b.call(ge,ve.length+1);return S.call(ve,Be,"$&_")+"."+S.call(S.call(Ae,/([0-9]{3})/g,"$&_"),/_$/,"")}}return S.call(ge,Be,"$&_")}var te=Sb,j=te.custom,se=pe(j)?j:null;Za=function ae(ge,Be,H,ve){var Ae=Be||{};if(_e(Ae,"quoteStyle")&&Ae.quoteStyle!=="single"&&Ae.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(_e(Ae,"maxStringLength")&&(typeof Ae.maxStringLength=="number"?Ae.maxStringLength<0&&Ae.maxStringLength!==1/0:Ae.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Le=_e(Ae,"customInspect")?Ae.customInspect:!0;if(typeof Le!="boolean"&&Le!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(_e(Ae,"indent")&&Ae.indent!==null&&Ae.indent!==" "&&!(parseInt(Ae.indent,10)===Ae.indent&&Ae.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(_e(Ae,"numericSeparator")&&typeof Ae.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var We=Ae.numericSeparator;if(typeof ge>"u")return"undefined";if(ge===null)return"null";if(typeof ge=="boolean")return ge?"true":"false";if(typeof ge=="string")return F(ge,Ae);if(typeof ge=="number"){if(ge===0)return 1/0/ge>0?"0":"-0";var Ve=String(ge);return We?L(ge,Ve):Ve}if(typeof ge=="bigint"){var Ue=String(ge)+"n";return We?L(ge,Ue):Ue}var De=typeof Ae.depth>"u"?5:Ae.depth;if(typeof H>"u"&&(H=0),H>=De&&De>0&&typeof ge=="object")return xe(ge)?"[Array]":"[Object]";var Ke=W(Ae,H);if(typeof ve>"u")ve=[];else if(ie(ve,ge)>=0)return"[Circular]";function et(It,Jt,ir){if(Jt&&(ve=I.call(ve),ve.push(Jt)),ir){var Qt={depth:Ae.depth};return _e(Ae,"quoteStyle")&&(Qt.quoteStyle=Ae.quoteStyle),ae(It,Qt,H+1,ve)}return ae(It,Ae,H+1,ve)}if(typeof ge=="function"&&!Ce(ge)){var ct=fe(ge),bt=we(ge,et);return"[Function"+(ct?": "+ct:" (anonymous)")+"]"+(bt.length>0?" { "+T.call(bt,", ")+" }":"")}if(pe(ge)){var Pt=N?S.call(String(ge),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(ge);return typeof ge=="object"&&!N?w(Pt):Pt}if(ee(ge)){for(var G="<"+C.call(String(ge.nodeName)),le=ge.attributes||[],ze=0;ze<le.length;ze++)G+=" "+le[ze].name+"="+D(U(le[ze].value),"double",Ae);return G+=">",ge.childNodes&&ge.childNodes.length&&(G+="..."),G+="</"+C.call(String(ge.nodeName))+">",G}if(xe(ge)){if(ge.length===0)return"[]";var je=we(ge,et);return Ke&&!M(je)?"["+Q(je,Ke)+"]":"[ "+T.call(je,", ")+" ]"}if(ne(ge)){var qe=we(ge,et);return!("cause"in Error.prototype)&&"cause"in ge&&!q.call(ge,"cause")?"{ ["+String(ge)+"] "+T.call(k.call("[cause]: "+et(ge.cause),qe),", ")+" }":qe.length===0?"["+String(ge)+"]":"{ ["+String(ge)+"] "+T.call(qe,", ")+" }"}if(typeof ge=="object"&&Le){if(se&&typeof ge[se]=="function"&&te)return te(ge,{depth:De-H});if(Le!=="symbol"&&typeof ge.inspect=="function")return ge.inspect()}if(re(ge)){var ke=[];return o&&o.call(ge,function(It,Jt){ke.push(et(Jt,ge,!0)+" => "+et(It,ge))}),E("Map",r.call(ge),ke,Ke)}if(V(ge)){var $e=[];return l&&l.call(ge,function(It){$e.push(et(It,ge))}),E("Set",s.call(ge),$e,Ke)}if(ye(ge))return x("WeakMap");if(me(ge))return x("WeakSet");if(J(ge))return x("WeakRef");if(be(ge))return w(et(Number(ge)));if(he(ge))return w(et(B.call(ge)));if(ce(ge))return w(p.call(ge));if(Y(ge))return w(et(String(ge)));if(typeof window<"u"&&ge===window)return"{ [object Window] }";if(typeof globalThis<"u"&&ge===globalThis||typeof es<"u"&&ge===es)return"{ [object globalThis] }";if(!X(ge)&&!Ce(ge)){var Ge=we(ge,et),ot=z?z(ge)===Object.prototype:ge instanceof Object||ge.constructor===Object,ht=ge instanceof Object?"":"null prototype",rt=!ot&&$&&Object(ge)===ge&&$ in ge?b.call(Z(ge),8,-1):ht?"Object":"",Xt=ot||typeof ge.constructor!="function"?"":ge.constructor.name?ge.constructor.name+" ":"",Mt=Xt+(rt||ht?"["+T.call(k.call([],rt||[],ht||[]),": ")+"] ":"");return Ge.length===0?Mt+"{}":Ke?Mt+"{"+Q(Ge,Ke)+"}":Mt+"{ "+T.call(Ge,", ")+" }"}return String(ge)};function D(ae,ge,Be){var H=(Be.quoteStyle||ge)==="double"?'"':"'";return H+ae+H}function U(ae){return S.call(String(ae),/"/g,""")}function xe(ae){return Z(ae)==="[object Array]"&&(!$||!(typeof ae=="object"&&$ in ae))}function X(ae){return Z(ae)==="[object Date]"&&(!$||!(typeof ae=="object"&&$ in ae))}function Ce(ae){return Z(ae)==="[object RegExp]"&&(!$||!(typeof ae=="object"&&$ in ae))}function ne(ae){return Z(ae)==="[object Error]"&&(!$||!(typeof ae=="object"&&$ in ae))}function Y(ae){return Z(ae)==="[object String]"&&(!$||!(typeof ae=="object"&&$ in ae))}function be(ae){return Z(ae)==="[object Number]"&&(!$||!(typeof ae=="object"&&$ in ae))}function ce(ae){return Z(ae)==="[object Boolean]"&&(!$||!(typeof ae=="object"&&$ in ae))}function pe(ae){if(N)return ae&&typeof ae=="object"&&ae instanceof Symbol;if(typeof ae=="symbol")return!0;if(!ae||typeof ae!="object"||!O)return!1;try{return O.call(ae),!0}catch{}return!1}function he(ae){if(!ae||typeof ae!="object"||!B)return!1;try{return B.call(ae),!0}catch{}return!1}var Te=Object.prototype.hasOwnProperty||function(ae){return ae in(this||es)};function _e(ae,ge){return Te.call(ae,ge)}function Z(ae){return m.call(ae)}function fe(ae){if(ae.name)return ae.name;var ge=y.call(v.call(ae),/^function\s*([\w$]+)/);return ge?ge[1]:null}function ie(ae,ge){if(ae.indexOf)return ae.indexOf(ge);for(var Be=0,H=ae.length;Be<H;Be++)if(ae[Be]===ge)return Be;return-1}function re(ae){if(!r||!ae||typeof ae!="object")return!1;try{r.call(ae);try{s.call(ae)}catch{return!0}return ae instanceof Map}catch{}return!1}function ye(ae){if(!d||!ae||typeof ae!="object")return!1;try{d.call(ae,d);try{f.call(ae,f)}catch{return!0}return ae instanceof WeakMap}catch{}return!1}function J(ae){if(!g||!ae||typeof ae!="object")return!1;try{return g.call(ae),!0}catch{}return!1}function V(ae){if(!s||!ae||typeof ae!="object")return!1;try{s.call(ae);try{r.call(ae)}catch{return!0}return ae instanceof Set}catch{}return!1}function me(ae){if(!f||!ae||typeof ae!="object")return!1;try{f.call(ae,f);try{d.call(ae,d)}catch{return!0}return ae instanceof WeakSet}catch{}return!1}function ee(ae){return!ae||typeof ae!="object"?!1:typeof HTMLElement<"u"&&ae instanceof HTMLElement?!0:typeof ae.nodeName=="string"&&typeof ae.getAttribute=="function"}function F(ae,ge){if(ae.length>ge.maxStringLength){var Be=ae.length-ge.maxStringLength,H="... "+Be+" more character"+(Be>1?"s":"");return F(b.call(ae,0,ge.maxStringLength),ge)+H}var ve=S.call(S.call(ae,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,oe);return D(ve,"single",ge)}function oe(ae){var ge=ae.charCodeAt(0),Be={8:"b",9:"t",10:"n",12:"f",13:"r"}[ge];return Be?"\\"+Be:"\\x"+(ge<16?"0":"")+_.call(ge.toString(16))}function w(ae){return"Object("+ae+")"}function x(ae){return ae+" { ? }"}function E(ae,ge,Be,H){var ve=H?Q(Be,H):T.call(Be,", ");return ae+" ("+ge+") {"+ve+"}"}function M(ae){for(var ge=0;ge<ae.length;ge++)if(ie(ae[ge],`
|
|
2694
2694
|
`)>=0)return!1;return!0}function W(ae,ge){var Be;if(ae.indent===" ")Be=" ";else if(typeof ae.indent=="number"&&ae.indent>0)Be=T.call(Array(ae.indent+1)," ");else return null;return{base:Be,prev:T.call(Array(ge+1),Be)}}function Q(ae,ge){if(ae.length===0)return"";var Be=`
|