@ramme-io/kernel 1.4.1 → 1.4.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/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(Re,Oe){typeof exports=="object"&&typeof module<"u"?Oe(exports,require("react"),require("@ramme-io/ui"),require("zod")):typeof define=="function"&&define.amd?define(["exports","react","@ramme-io/ui","zod"],Oe):(Re=typeof globalThis<"u"?globalThis:Re||self,Oe(Re.RammeKernel={},Re.React,Re.ui,Re.Zod))})(this,function(Re,Oe,qe,Se){"use strict";var Rh=Object.defineProperty;var au=Re=>{throw TypeError(Re)};var Mh=(Re,Oe,qe)=>Oe in Re?Rh(Re,Oe,{enumerable:!0,configurable:!0,writable:!0,value:qe}):Re[Oe]=qe;var Pe=(Re,Oe,qe)=>Mh(Re,typeof Oe!="symbol"?Oe+"":Oe,qe),Wo=(Re,Oe,qe)=>Oe.has(Re)||au("Cannot "+qe);var D=(Re,Oe,qe)=>(Wo(Re,Oe,"read from private field"),qe?qe.call(Re):Oe.get(Re)),Qe=(Re,Oe,qe)=>Oe.has(Re)?au("Cannot add the same private member more than once"):Oe instanceof WeakSet?Oe.add(Re):Oe.set(Re,qe),$e=(Re,Oe,qe,Se)=>(Wo(Re,Oe,"write to private field"),Se?Se.call(Re,qe):Oe.set(Re,qe),qe),Le=(Re,Oe,qe)=>(Wo(Re,Oe,"access private method"),qe);var ln=(Re,Oe,qe,Se)=>({set _(fn){$e(Re,Oe,fn,qe)},get _(){return D(Re,Oe,Se)}});function fn(o){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const s in o)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(o,s);Object.defineProperty(l,s,a.get?a:{enumerable:!0,get:()=>o[s]})}}return l.default=o,Object.freeze(l)}const st=fn(Oe);var hn={exports:{}},fr={};/**
1
+ (function(Re,Oe){typeof exports=="object"&&typeof module<"u"?Oe(exports,require("react"),require("@ramme-io/ui"),require("zod")):typeof define=="function"&&define.amd?define(["exports","react","@ramme-io/ui","zod"],Oe):(Re=typeof globalThis<"u"?globalThis:Re||self,Oe(Re.RammeKernel={},Re.React,Re.ui,Re.Zod))})(this,function(Re,Oe,qe,Se){"use strict";var Bh=Object.defineProperty;var lu=Re=>{throw TypeError(Re)};var Lh=(Re,Oe,qe)=>Oe in Re?Bh(Re,Oe,{enumerable:!0,configurable:!0,writable:!0,value:qe}):Re[Oe]=qe;var Pe=(Re,Oe,qe)=>Lh(Re,typeof Oe!="symbol"?Oe+"":Oe,qe),qo=(Re,Oe,qe)=>Oe.has(Re)||lu("Cannot "+qe);var D=(Re,Oe,qe)=>(qo(Re,Oe,"read from private field"),qe?qe.call(Re):Oe.get(Re)),Qe=(Re,Oe,qe)=>Oe.has(Re)?lu("Cannot add the same private member more than once"):Oe instanceof WeakSet?Oe.add(Re):Oe.set(Re,qe),$e=(Re,Oe,qe,Se)=>(qo(Re,Oe,"write to private field"),Se?Se.call(Re,qe):Oe.set(Re,qe),qe),Le=(Re,Oe,qe)=>(qo(Re,Oe,"access private method"),qe);var ln=(Re,Oe,qe,Se)=>({set _(fn){$e(Re,Oe,fn,qe)},get _(){return D(Re,Oe,Se)}});function fn(o){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const s in o)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(o,s);Object.defineProperty(l,s,a.get?a:{enumerable:!0,get:()=>o[s]})}}return l.default=o,Object.freeze(l)}const st=fn(Oe);var hn={exports:{}},fr={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Ho;function bu(){if(Ho)return fr;Ho=1;var o=Oe,l=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,c=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,t={key:!0,ref:!0,__self:!0,__source:!0};function r(n,e,i){var u,h={},d=null,y=null;i!==void 0&&(d=""+i),e.key!==void 0&&(d=""+e.key),e.ref!==void 0&&(y=e.ref);for(u in e)a.call(e,u)&&!t.hasOwnProperty(u)&&(h[u]=e[u]);if(n&&n.defaultProps)for(u in e=n.defaultProps,e)h[u]===void 0&&(h[u]=e[u]);return{$$typeof:l,type:n,key:d,ref:y,props:h,_owner:c.current}}return fr.Fragment=s,fr.jsx=r,fr.jsxs=r,fr}var hr={};/**
9
+ */var Yo;function vu(){if(Yo)return fr;Yo=1;var o=Oe,l=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,u=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,t={key:!0,ref:!0,__self:!0,__source:!0};function r(n,e,i){var c,h={},d=null,y=null;i!==void 0&&(d=""+i),e.key!==void 0&&(d=""+e.key),e.ref!==void 0&&(y=e.ref);for(c in e)a.call(e,c)&&!t.hasOwnProperty(c)&&(h[c]=e[c]);if(n&&n.defaultProps)for(c in e=n.defaultProps,e)h[c]===void 0&&(h[c]=e[c]);return{$$typeof:l,type:n,key:d,ref:y,props:h,_owner:u.current}}return fr.Fragment=s,fr.jsx=r,fr.jsxs=r,fr}var hr={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,27 +14,27 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Go;function vu(){return Go||(Go=1,process.env.NODE_ENV!=="production"&&function(){var o=Oe,l=Symbol.for("react.element"),s=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),t=Symbol.for("react.profiler"),r=Symbol.for("react.provider"),n=Symbol.for("react.context"),e=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),b=Symbol.iterator,w="@@iterator";function S(K){if(K===null||typeof K!="object")return null;var Ae=b&&K[b]||K[w];return typeof Ae=="function"?Ae:null}var A=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(K){{for(var Ae=arguments.length,je=new Array(Ae>1?Ae-1:0),We=1;We<Ae;We++)je[We-1]=arguments[We];_("error",K,je)}}function _(K,Ae,je){{var We=A.ReactDebugCurrentFrame,He=We.getStackAddendum();He!==""&&(Ae+="%s",je=je.concat([He]));var Ge=je.map(function(ze){return String(ze)});Ge.unshift("Warning: "+Ae),Function.prototype.apply.call(console[K],console,Ge)}}var E=!1,v=!1,C=!1,T=!1,x=!1,P;P=Symbol.for("react.module.reference");function O(K){return!!(typeof K=="string"||typeof K=="function"||K===a||K===t||x||K===c||K===i||K===u||T||K===y||E||v||C||typeof K=="object"&&K!==null&&(K.$$typeof===d||K.$$typeof===h||K.$$typeof===r||K.$$typeof===n||K.$$typeof===e||K.$$typeof===P||K.getModuleId!==void 0))}function F(K,Ae,je){var We=K.displayName;if(We)return We;var He=Ae.displayName||Ae.name||"";return He!==""?je+"("+He+")":je}function I(K){return K.displayName||"Context"}function W(K){if(K==null)return null;if(typeof K.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof K=="function")return K.displayName||K.name||null;if(typeof K=="string")return K;switch(K){case a:return"Fragment";case s:return"Portal";case t:return"Profiler";case c:return"StrictMode";case i:return"Suspense";case u:return"SuspenseList"}if(typeof K=="object")switch(K.$$typeof){case n:var Ae=K;return I(Ae)+".Consumer";case r:var je=K;return I(je._context)+".Provider";case e:return F(K,K.render,"ForwardRef");case h:var We=K.displayName||null;return We!==null?We:W(K.type)||"Memo";case d:{var He=K,Ge=He._payload,ze=He._init;try{return W(ze(Ge))}catch{return null}}}return null}var V=Object.assign,L=0,le,re,ee,ue,G,oe,R;function Q(){}Q.__reactDisabledLog=!0;function he(){{if(L===0){le=console.log,re=console.info,ee=console.warn,ue=console.error,G=console.group,oe=console.groupCollapsed,R=console.groupEnd;var K={configurable:!0,enumerable:!0,value:Q,writable:!0};Object.defineProperties(console,{info:K,log:K,warn:K,error:K,group:K,groupCollapsed:K,groupEnd:K})}L++}}function q(){{if(L--,L===0){var K={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},K,{value:le}),info:V({},K,{value:re}),warn:V({},K,{value:ee}),error:V({},K,{value:ue}),group:V({},K,{value:G}),groupCollapsed:V({},K,{value:oe}),groupEnd:V({},K,{value:R})})}L<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ee=A.ReactCurrentDispatcher,X;function U(K,Ae,je){{if(X===void 0)try{throw Error()}catch(He){var We=He.stack.trim().match(/\n( *(at )?)/);X=We&&We[1]||""}return`
17
+ */var Qo;function wu(){return Qo||(Qo=1,process.env.NODE_ENV!=="production"&&function(){var o=Oe,l=Symbol.for("react.element"),s=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),t=Symbol.for("react.profiler"),r=Symbol.for("react.provider"),n=Symbol.for("react.context"),e=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),b=Symbol.iterator,w="@@iterator";function S(K){if(K===null||typeof K!="object")return null;var Ae=b&&K[b]||K[w];return typeof Ae=="function"?Ae:null}var A=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(K){{for(var Ae=arguments.length,je=new Array(Ae>1?Ae-1:0),We=1;We<Ae;We++)je[We-1]=arguments[We];_("error",K,je)}}function _(K,Ae,je){{var We=A.ReactDebugCurrentFrame,He=We.getStackAddendum();He!==""&&(Ae+="%s",je=je.concat([He]));var Ge=je.map(function(ze){return String(ze)});Ge.unshift("Warning: "+Ae),Function.prototype.apply.call(console[K],console,Ge)}}var E=!1,v=!1,C=!1,T=!1,x=!1,P;P=Symbol.for("react.module.reference");function O(K){return!!(typeof K=="string"||typeof K=="function"||K===a||K===t||x||K===u||K===i||K===c||T||K===y||E||v||C||typeof K=="object"&&K!==null&&(K.$$typeof===d||K.$$typeof===h||K.$$typeof===r||K.$$typeof===n||K.$$typeof===e||K.$$typeof===P||K.getModuleId!==void 0))}function F(K,Ae,je){var We=K.displayName;if(We)return We;var He=Ae.displayName||Ae.name||"";return He!==""?je+"("+He+")":je}function I(K){return K.displayName||"Context"}function W(K){if(K==null)return null;if(typeof K.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof K=="function")return K.displayName||K.name||null;if(typeof K=="string")return K;switch(K){case a:return"Fragment";case s:return"Portal";case t:return"Profiler";case u:return"StrictMode";case i:return"Suspense";case c:return"SuspenseList"}if(typeof K=="object")switch(K.$$typeof){case n:var Ae=K;return I(Ae)+".Consumer";case r:var je=K;return I(je._context)+".Provider";case e:return F(K,K.render,"ForwardRef");case h:var We=K.displayName||null;return We!==null?We:W(K.type)||"Memo";case d:{var He=K,Ge=He._payload,ze=He._init;try{return W(ze(Ge))}catch{return null}}}return null}var V=Object.assign,L=0,le,re,ee,ue,G,oe,R;function Q(){}Q.__reactDisabledLog=!0;function he(){{if(L===0){le=console.log,re=console.info,ee=console.warn,ue=console.error,G=console.group,oe=console.groupCollapsed,R=console.groupEnd;var K={configurable:!0,enumerable:!0,value:Q,writable:!0};Object.defineProperties(console,{info:K,log:K,warn:K,error:K,group:K,groupCollapsed:K,groupEnd:K})}L++}}function q(){{if(L--,L===0){var K={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},K,{value:le}),info:V({},K,{value:re}),warn:V({},K,{value:ee}),error:V({},K,{value:ue}),group:V({},K,{value:G}),groupCollapsed:V({},K,{value:oe}),groupEnd:V({},K,{value:R})})}L<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ee=A.ReactCurrentDispatcher,X;function U(K,Ae,je){{if(X===void 0)try{throw Error()}catch(He){var We=He.stack.trim().match(/\n( *(at )?)/);X=We&&We[1]||""}return`
18
18
  `+X+K}}var ae=!1,H;{var te=typeof WeakMap=="function"?WeakMap:Map;H=new te}function ne(K,Ae){if(!K||ae)return"";{var je=H.get(K);if(je!==void 0)return je}var We;ae=!0;var He=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ge;Ge=Ee.current,Ee.current=null,he();try{if(Ae){var ze=function(){throw Error()};if(Object.defineProperty(ze.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ze,[])}catch(At){We=At}Reflect.construct(K,[],ze)}else{try{ze.call()}catch(At){We=At}K.call(ze.prototype)}}else{try{throw Error()}catch(At){We=At}K()}}catch(At){if(At&&We&&typeof At.stack=="string"){for(var Ve=At.stack.split(`
19
19
  `),it=We.stack.split(`
20
20
  `),et=Ve.length-1,ht=it.length-1;et>=1&&ht>=0&&Ve[et]!==it[ht];)ht--;for(;et>=1&&ht>=0;et--,ht--)if(Ve[et]!==it[ht]){if(et!==1||ht!==1)do if(et--,ht--,ht<0||Ve[et]!==it[ht]){var It=`
21
- `+Ve[et].replace(" at new "," at ");return K.displayName&&It.includes("<anonymous>")&&(It=It.replace("<anonymous>",K.displayName)),typeof K=="function"&&H.set(K,It),It}while(et>=1&&ht>=0);break}}}finally{ae=!1,Ee.current=Ge,q(),Error.prepareStackTrace=He}var cr=K?K.displayName||K.name:"",rr=cr?U(cr):"";return typeof K=="function"&&H.set(K,rr),rr}function be(K,Ae,je){return ne(K,!1)}function ce(K){var Ae=K.prototype;return!!(Ae&&Ae.isReactComponent)}function N(K,Ae,je){if(K==null)return"";if(typeof K=="function")return ne(K,ce(K));if(typeof K=="string")return U(K);switch(K){case i:return U("Suspense");case u:return U("SuspenseList")}if(typeof K=="object")switch(K.$$typeof){case e:return be(K.render);case h:return N(K.type,Ae,je);case d:{var We=K,He=We._payload,Ge=We._init;try{return N(Ge(He),Ae,je)}catch{}}}return""}var Y=Object.prototype.hasOwnProperty,se={},me=A.ReactDebugCurrentFrame;function pe(K){if(K){var Ae=K._owner,je=N(K.type,K._source,Ae?Ae.type:null);me.setExtraStackFrame(je)}else me.setExtraStackFrame(null)}function _e(K,Ae,je,We,He){{var Ge=Function.call.bind(Y);for(var ze in K)if(Ge(K,ze)){var Ve=void 0;try{if(typeof K[ze]!="function"){var it=Error((We||"React class")+": "+je+" type `"+ze+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof K[ze]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw it.name="Invariant Violation",it}Ve=K[ze](Ae,ze,We,je,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(et){Ve=et}Ve&&!(Ve instanceof Error)&&(pe(He),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",We||"React class",je,ze,typeof Ve),pe(null)),Ve instanceof Error&&!(Ve.message in se)&&(se[Ve.message]=!0,pe(He),g("Failed %s type: %s",je,Ve.message),pe(null))}}}var Z=Array.isArray;function ve(K){return Z(K)}function ke(K){{var Ae=typeof Symbol=="function"&&Symbol.toStringTag,je=Ae&&K[Symbol.toStringTag]||K.constructor.name||"Object";return je}}function fe(K){try{return De(K),!1}catch{return!0}}function De(K){return""+K}function f(K){if(fe(K))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ke(K)),De(K)}var p=A.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0},k,M;function z(K){if(Y.call(K,"ref")){var Ae=Object.getOwnPropertyDescriptor(K,"ref").get;if(Ae&&Ae.isReactWarning)return!1}return K.ref!==void 0}function ie(K){if(Y.call(K,"key")){var Ae=Object.getOwnPropertyDescriptor(K,"key").get;if(Ae&&Ae.isReactWarning)return!1}return K.key!==void 0}function $(K,Ae){typeof K.ref=="string"&&p.current}function J(K,Ae){{var je=function(){k||(k=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ae))};je.isReactWarning=!0,Object.defineProperty(K,"key",{get:je,configurable:!0})}}function Te(K,Ae){{var je=function(){M||(M=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ae))};je.isReactWarning=!0,Object.defineProperty(K,"ref",{get:je,configurable:!0})}}var Me=function(K,Ae,je,We,He,Ge,ze){var Ve={$$typeof:l,type:K,key:Ae,ref:je,props:ze,_owner:Ge};return Ve._store={},Object.defineProperty(Ve._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Ve,"_self",{configurable:!1,enumerable:!1,writable:!1,value:We}),Object.defineProperty(Ve,"_source",{configurable:!1,enumerable:!1,writable:!1,value:He}),Object.freeze&&(Object.freeze(Ve.props),Object.freeze(Ve)),Ve};function Ne(K,Ae,je,We,He){{var Ge,ze={},Ve=null,it=null;je!==void 0&&(f(je),Ve=""+je),ie(Ae)&&(f(Ae.key),Ve=""+Ae.key),z(Ae)&&(it=Ae.ref,$(Ae,He));for(Ge in Ae)Y.call(Ae,Ge)&&!m.hasOwnProperty(Ge)&&(ze[Ge]=Ae[Ge]);if(K&&K.defaultProps){var et=K.defaultProps;for(Ge in et)ze[Ge]===void 0&&(ze[Ge]=et[Ge])}if(Ve||it){var ht=typeof K=="function"?K.displayName||K.name||"Unknown":K;Ve&&J(ze,ht),it&&Te(ze,ht)}return Me(K,Ve,it,He,We,p.current,ze)}}var Fe=A.ReactCurrentOwner,nt=A.ReactDebugCurrentFrame;function rt(K){if(K){var Ae=K._owner,je=N(K.type,K._source,Ae?Ae.type:null);nt.setExtraStackFrame(je)}else nt.setExtraStackFrame(null)}var Ke;Ke=!1;function Xe(K){return typeof K=="object"&&K!==null&&K.$$typeof===l}function Ue(){{if(Fe.current){var K=W(Fe.current.type);if(K)return`
21
+ `+Ve[et].replace(" at new "," at ");return K.displayName&&It.includes("<anonymous>")&&(It=It.replace("<anonymous>",K.displayName)),typeof K=="function"&&H.set(K,It),It}while(et>=1&&ht>=0);break}}}finally{ae=!1,Ee.current=Ge,q(),Error.prepareStackTrace=He}var cr=K?K.displayName||K.name:"",rr=cr?U(cr):"";return typeof K=="function"&&H.set(K,rr),rr}function be(K,Ae,je){return ne(K,!1)}function ce(K){var Ae=K.prototype;return!!(Ae&&Ae.isReactComponent)}function N(K,Ae,je){if(K==null)return"";if(typeof K=="function")return ne(K,ce(K));if(typeof K=="string")return U(K);switch(K){case i:return U("Suspense");case c:return U("SuspenseList")}if(typeof K=="object")switch(K.$$typeof){case e:return be(K.render);case h:return N(K.type,Ae,je);case d:{var We=K,He=We._payload,Ge=We._init;try{return N(Ge(He),Ae,je)}catch{}}}return""}var Y=Object.prototype.hasOwnProperty,se={},me=A.ReactDebugCurrentFrame;function pe(K){if(K){var Ae=K._owner,je=N(K.type,K._source,Ae?Ae.type:null);me.setExtraStackFrame(je)}else me.setExtraStackFrame(null)}function _e(K,Ae,je,We,He){{var Ge=Function.call.bind(Y);for(var ze in K)if(Ge(K,ze)){var Ve=void 0;try{if(typeof K[ze]!="function"){var it=Error((We||"React class")+": "+je+" type `"+ze+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof K[ze]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw it.name="Invariant Violation",it}Ve=K[ze](Ae,ze,We,je,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(et){Ve=et}Ve&&!(Ve instanceof Error)&&(pe(He),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",We||"React class",je,ze,typeof Ve),pe(null)),Ve instanceof Error&&!(Ve.message in se)&&(se[Ve.message]=!0,pe(He),g("Failed %s type: %s",je,Ve.message),pe(null))}}}var Z=Array.isArray;function ve(K){return Z(K)}function ke(K){{var Ae=typeof Symbol=="function"&&Symbol.toStringTag,je=Ae&&K[Symbol.toStringTag]||K.constructor.name||"Object";return je}}function fe(K){try{return De(K),!1}catch{return!0}}function De(K){return""+K}function f(K){if(fe(K))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ke(K)),De(K)}var p=A.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0},k,M;function z(K){if(Y.call(K,"ref")){var Ae=Object.getOwnPropertyDescriptor(K,"ref").get;if(Ae&&Ae.isReactWarning)return!1}return K.ref!==void 0}function ie(K){if(Y.call(K,"key")){var Ae=Object.getOwnPropertyDescriptor(K,"key").get;if(Ae&&Ae.isReactWarning)return!1}return K.key!==void 0}function $(K,Ae){typeof K.ref=="string"&&p.current}function J(K,Ae){{var je=function(){k||(k=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ae))};je.isReactWarning=!0,Object.defineProperty(K,"key",{get:je,configurable:!0})}}function Te(K,Ae){{var je=function(){M||(M=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ae))};je.isReactWarning=!0,Object.defineProperty(K,"ref",{get:je,configurable:!0})}}var Me=function(K,Ae,je,We,He,Ge,ze){var Ve={$$typeof:l,type:K,key:Ae,ref:je,props:ze,_owner:Ge};return Ve._store={},Object.defineProperty(Ve._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Ve,"_self",{configurable:!1,enumerable:!1,writable:!1,value:We}),Object.defineProperty(Ve,"_source",{configurable:!1,enumerable:!1,writable:!1,value:He}),Object.freeze&&(Object.freeze(Ve.props),Object.freeze(Ve)),Ve};function Ne(K,Ae,je,We,He){{var Ge,ze={},Ve=null,it=null;je!==void 0&&(f(je),Ve=""+je),ie(Ae)&&(f(Ae.key),Ve=""+Ae.key),z(Ae)&&(it=Ae.ref,$(Ae,He));for(Ge in Ae)Y.call(Ae,Ge)&&!m.hasOwnProperty(Ge)&&(ze[Ge]=Ae[Ge]);if(K&&K.defaultProps){var et=K.defaultProps;for(Ge in et)ze[Ge]===void 0&&(ze[Ge]=et[Ge])}if(Ve||it){var ht=typeof K=="function"?K.displayName||K.name||"Unknown":K;Ve&&J(ze,ht),it&&Te(ze,ht)}return Me(K,Ve,it,He,We,p.current,ze)}}var Fe=A.ReactCurrentOwner,nt=A.ReactDebugCurrentFrame;function rt(K){if(K){var Ae=K._owner,je=N(K.type,K._source,Ae?Ae.type:null);nt.setExtraStackFrame(je)}else nt.setExtraStackFrame(null)}var Ke;Ke=!1;function Xe(K){return typeof K=="object"&&K!==null&&K.$$typeof===l}function Ue(){{if(Fe.current){var K=W(Fe.current.type);if(K)return`
22
22
 
23
23
  Check the render method of \``+K+"`."}return""}}function Ye(K){return""}var Ze={};function lt(K){{var Ae=Ue();if(!Ae){var je=typeof K=="string"?K:K.displayName||K.name;je&&(Ae=`
24
24
 
25
- Check the top-level render call using <`+je+">.")}return Ae}}function ct(K,Ae){{if(!K._store||K._store.validated||K.key!=null)return;K._store.validated=!0;var je=lt(Ae);if(Ze[je])return;Ze[je]=!0;var We="";K&&K._owner&&K._owner!==Fe.current&&(We=" It was passed a child from "+W(K._owner.type)+"."),rt(K),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',je,We),rt(null)}}function Et(K,Ae){{if(typeof K!="object")return;if(ve(K))for(var je=0;je<K.length;je++){var We=K[je];Xe(We)&&ct(We,Ae)}else if(Xe(K))K._store&&(K._store.validated=!0);else if(K){var He=S(K);if(typeof He=="function"&&He!==K.entries)for(var Ge=He.call(K),ze;!(ze=Ge.next()).done;)Xe(ze.value)&&ct(ze.value,Ae)}}}function j(K){{var Ae=K.type;if(Ae==null||typeof Ae=="string")return;var je;if(typeof Ae=="function")je=Ae.propTypes;else if(typeof Ae=="object"&&(Ae.$$typeof===e||Ae.$$typeof===h))je=Ae.propTypes;else return;if(je){var We=W(Ae);_e(je,K.props,"prop",We,K)}else if(Ae.PropTypes!==void 0&&!Ke){Ke=!0;var He=W(Ae);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",He||"Unknown")}typeof Ae.getDefaultProps=="function"&&!Ae.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function B(K){{for(var Ae=Object.keys(K.props),je=0;je<Ae.length;je++){var We=Ae[je];if(We!=="children"&&We!=="key"){rt(K),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",We),rt(null);break}}K.ref!==null&&(rt(K),g("Invalid attribute `ref` supplied to `React.Fragment`."),rt(null))}}var xe={};function Ce(K,Ae,je,We,He,Ge){{var ze=O(K);if(!ze){var Ve="";(K===void 0||typeof K=="object"&&K!==null&&Object.keys(K).length===0)&&(Ve+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var it=Ye();it?Ve+=it:Ve+=Ue();var et;K===null?et="null":ve(K)?et="array":K!==void 0&&K.$$typeof===l?(et="<"+(W(K.type)||"Unknown")+" />",Ve=" Did you accidentally export a JSX literal instead of a component?"):et=typeof K,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",et,Ve)}var ht=Ne(K,Ae,je,He,Ge);if(ht==null)return ht;if(ze){var It=Ae.children;if(It!==void 0)if(We)if(ve(It)){for(var cr=0;cr<It.length;cr++)Et(It[cr],K);Object.freeze&&Object.freeze(It)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Et(It,K)}if(Y.call(Ae,"key")){var rr=W(K),At=Object.keys(Ae).filter(function(jh){return jh!=="key"}),Fo=At.length>0?"{key: someKey, "+At.join(": ..., ")+": ...}":"{key: someKey}";if(!xe[rr+Fo]){var Ch=At.length>0?"{"+At.join(": ..., ")+": ...}":"{}";g(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+je+">.")}return Ae}}function ct(K,Ae){{if(!K._store||K._store.validated||K.key!=null)return;K._store.validated=!0;var je=lt(Ae);if(Ze[je])return;Ze[je]=!0;var We="";K&&K._owner&&K._owner!==Fe.current&&(We=" It was passed a child from "+W(K._owner.type)+"."),rt(K),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',je,We),rt(null)}}function Et(K,Ae){{if(typeof K!="object")return;if(ve(K))for(var je=0;je<K.length;je++){var We=K[je];Xe(We)&&ct(We,Ae)}else if(Xe(K))K._store&&(K._store.validated=!0);else if(K){var He=S(K);if(typeof He=="function"&&He!==K.entries)for(var Ge=He.call(K),ze;!(ze=Ge.next()).done;)Xe(ze.value)&&ct(ze.value,Ae)}}}function j(K){{var Ae=K.type;if(Ae==null||typeof Ae=="string")return;var je;if(typeof Ae=="function")je=Ae.propTypes;else if(typeof Ae=="object"&&(Ae.$$typeof===e||Ae.$$typeof===h))je=Ae.propTypes;else return;if(je){var We=W(Ae);_e(je,K.props,"prop",We,K)}else if(Ae.PropTypes!==void 0&&!Ke){Ke=!0;var He=W(Ae);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",He||"Unknown")}typeof Ae.getDefaultProps=="function"&&!Ae.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function B(K){{for(var Ae=Object.keys(K.props),je=0;je<Ae.length;je++){var We=Ae[je];if(We!=="children"&&We!=="key"){rt(K),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",We),rt(null);break}}K.ref!==null&&(rt(K),g("Invalid attribute `ref` supplied to `React.Fragment`."),rt(null))}}var xe={};function Ce(K,Ae,je,We,He,Ge){{var ze=O(K);if(!ze){var Ve="";(K===void 0||typeof K=="object"&&K!==null&&Object.keys(K).length===0)&&(Ve+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var it=Ye();it?Ve+=it:Ve+=Ue();var et;K===null?et="null":ve(K)?et="array":K!==void 0&&K.$$typeof===l?(et="<"+(W(K.type)||"Unknown")+" />",Ve=" Did you accidentally export a JSX literal instead of a component?"):et=typeof K,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",et,Ve)}var ht=Ne(K,Ae,je,He,Ge);if(ht==null)return ht;if(ze){var It=Ae.children;if(It!==void 0)if(We)if(ve(It)){for(var cr=0;cr<It.length;cr++)Et(It[cr],K);Object.freeze&&Object.freeze(It)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Et(It,K)}if(Y.call(Ae,"key")){var rr=W(K),At=Object.keys(Ae).filter(function(Nh){return Nh!=="key"}),$o=At.length>0?"{key: someKey, "+At.join(": ..., ")+": ...}":"{key: someKey}";if(!xe[rr+$o]){var Mh=At.length>0?"{"+At.join(": ..., ")+": ...}":"{}";g(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,Fo,rr,Ch,rr),xe[rr+Fo]=!0}}return K===a?B(ht):j(ht),ht}}function Be(K,Ae,je){return Ce(K,Ae,je,!0)}function ft(K,Ae,je){return Ce(K,Ae,je,!1)}var yt=ft,xt=Be;hr.Fragment=a,hr.jsx=yt,hr.jsxs=xt}()),hr}process.env.NODE_ENV==="production"?hn.exports=bu():hn.exports=vu();var Ie=hn.exports;const pn=Oe.createContext(null),wu=({children:o,manifest:l})=>{const[s,a]=Oe.useState(l),[c,t]=Oe.useState(!1),r=Oe.useRef(!1);return Oe.useEffect(()=>{if(r.current)return;r.current=!0;const n=e=>{var i;if(((i=e.data)==null?void 0:i.type)==="RAMME_SYNC_MANIFEST"){const u=e.data.payload;a(u),t(!0)}};return window.addEventListener("message",n),window.parent!==window&&!window.__RAMME_HANDSHAKE_SENT&&(console.log("🔌 [Context] Handshake Sent 🤝"),window.parent.postMessage({type:"RAMME_CLIENT_READY"},"*"),window.__RAMME_HANDSHAKE_SENT=!0),()=>{window.removeEventListener("message",n),r.current=!1}},[]),Ie.jsx(pn.Provider,{value:{manifest:s,isLive:c},children:o})},Ht=()=>{const o=Oe.useContext(pn);if(!o)throw new Error("useManifest must be used within a ManifestProvider");return o.manifest},dn=()=>{const o=Oe.useContext(pn);return o!=null&&o.isLive?"live":"static"};var gn=Object.defineProperty,_u=Object.getOwnPropertyDescriptor,Su=Object.getOwnPropertyNames,Eu=Object.prototype.hasOwnProperty,_t=(o,l)=>()=>(o&&(l=o(o=0)),l),we=(o,l)=>()=>(l||o((l={exports:{}}).exports,l),l.exports),nr=(o,l)=>{for(var s in l)gn(o,s,{get:l[s],enumerable:!0})},Au=(o,l,s,a)=>{if(l&&typeof l=="object"||typeof l=="function")for(let c of Su(l))!Eu.call(o,c)&&c!==s&&gn(o,c,{get:()=>l[c],enumerable:!(a=_u(l,c))||a.enumerable});return o},tt=o=>Au(gn({},"__esModule",{value:!0}),o),de=_t(()=>{}),Je={};nr(Je,{_debugEnd:()=>Qn,_debugProcess:()=>Yn,_events:()=>hi,_eventsCount:()=>pi,_exiting:()=>Nn,_fatalExceptions:()=>Kn,_getActiveHandles:()=>ts,_getActiveRequests:()=>es,_kill:()=>Un,_linkedBinding:()=>Xo,_maxListeners:()=>fi,_preload_modules:()=>li,_rawDebug:()=>jn,_startProfilerIdleNotifier:()=>Jn,_stopProfilerIdleNotifier:()=>Xn,_tickCallback:()=>Gn,abort:()=>ri,addListener:()=>di,allowedNodeEnvironmentFlags:()=>Vn,arch:()=>bn,argv:()=>_n,argv0:()=>ai,assert:()=>rs,binding:()=>In,browser:()=>Cn,chdir:()=>Tn,config:()=>Bn,cpuUsage:()=>dr,cwd:()=>On,debugPort:()=>si,default:()=>Si,dlopen:()=>Zo,domain:()=>Mn,emit:()=>vi,emitWarning:()=>xn,env:()=>wn,execArgv:()=>Sn,execPath:()=>oi,exit:()=>$n,features:()=>zn,hasUncaughtExceptionCaptureCallback:()=>ns,hrtime:()=>Er,kill:()=>Wn,listeners:()=>os,memoryUsage:()=>Fn,moduleLoadList:()=>Rn,nextTick:()=>Qo,off:()=>yi,on:()=>Tt,once:()=>gi,openStdin:()=>qn,pid:()=>ni,platform:()=>vn,ppid:()=>ii,prependListener:()=>wi,prependOnceListener:()=>_i,reallyExit:()=>Ln,release:()=>Pn,removeAllListeners:()=>bi,removeListener:()=>mi,resourceUsage:()=>Dn,setSourceMapsEnabled:()=>ui,setUncaughtExceptionCaptureCallback:()=>Hn,stderr:()=>ei,stdin:()=>ti,stdout:()=>Zn,title:()=>mn,umask:()=>kn,uptime:()=>is,version:()=>En,versions:()=>An});function yn(o){throw new Error("Node.js process "+o+" is not supported by JSPM core outside of Node.js")}function xu(){!Gt||!Yt||(Gt=!1,Yt.length?kt=Yt.concat(kt):pr=-1,kt.length&&Yo())}function Yo(){if(!Gt){var o=setTimeout(xu,0);Gt=!0;for(var l=kt.length;l;){for(Yt=kt,kt=[];++pr<l;)Yt&&Yt[pr].run();pr=-1,l=kt.length}Yt=null,Gt=!1,clearTimeout(o)}}function Qo(o){var l=new Array(arguments.length-1);if(arguments.length>1)for(var s=1;s<arguments.length;s++)l[s-1]=arguments[s];kt.push(new Jo(o,l)),kt.length===1&&!Gt&&setTimeout(Yo,0)}function Jo(o,l){this.fun=o,this.array=l}function mt(){}function Xo(o){yn("_linkedBinding")}function Zo(o){yn("dlopen")}function es(){return[]}function ts(){return[]}function rs(o,l){if(!o)throw new Error(l||"assertion error")}function ns(){return!1}function is(){return Pt.now()/1e3}function Er(o){var l=Math.floor((Date.now()-Pt.now())*.001),s=Pt.now()*.001,a=Math.floor(s)+l,c=Math.floor(s%1*1e9);return o&&(a=a-o[0],c=c-o[1],c<0&&(a--,c+=Ar)),[a,c]}function Tt(){return Si}function os(o){return[]}var kt,Gt,Yt,pr,mn,bn,vn,wn,_n,Sn,En,An,xn,In,kn,On,Tn,Pn,Cn,jn,Rn,Mn,Nn,Bn,Ln,Un,dr,Dn,Fn,Wn,$n,qn,Vn,zn,Kn,Hn,Gn,Yn,Qn,Jn,Xn,Zn,ei,ti,ri,ni,ii,oi,si,ai,li,ui,Pt,ci,Ar,fi,hi,pi,di,gi,yi,mi,bi,vi,wi,_i,Si,Iu=_t(()=>{de(),ye(),ge(),kt=[],Gt=!1,pr=-1,Jo.prototype.run=function(){this.fun.apply(null,this.array)},mn="browser",bn="x64",vn="browser",wn={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},_n=["/usr/bin/node"],Sn=[],En="v16.8.0",An={},xn=function(o,l){console.warn((l?l+": ":"")+o)},In=function(o){yn("binding")},kn=function(o){return 0},On=function(){return"/"},Tn=function(o){},Pn={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},Cn=!0,jn=mt,Rn=[],Mn={},Nn=!1,Bn={},Ln=mt,Un=mt,dr=function(){return{}},Dn=dr,Fn=dr,Wn=mt,$n=mt,qn=mt,Vn={},zn={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Kn=mt,Hn=mt,Gn=mt,Yn=mt,Qn=mt,Jn=mt,Xn=mt,Zn=void 0,ei=void 0,ti=void 0,ri=mt,ni=2,ii=1,oi="/bin/usr/node",si=9229,ai="node",li=[],ui=mt,Pt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},Pt.now===void 0&&(ci=Date.now(),Pt.timing&&Pt.timing.navigationStart&&(ci=Pt.timing.navigationStart),Pt.now=()=>Date.now()-ci),Ar=1e9,Er.bigint=function(o){var l=Er(o);return typeof BigInt>"u"?l[0]*Ar+l[1]:BigInt(l[0]*Ar)+BigInt(l[1])},fi=10,hi={},pi=0,di=Tt,gi=Tt,yi=Tt,mi=Tt,bi=Tt,vi=mt,wi=Tt,_i=Tt,Si={version:En,versions:An,arch:bn,platform:vn,browser:Cn,release:Pn,_rawDebug:jn,moduleLoadList:Rn,binding:In,_linkedBinding:Xo,_events:hi,_eventsCount:pi,_maxListeners:fi,on:Tt,addListener:di,once:gi,off:yi,removeListener:mi,removeAllListeners:bi,emit:vi,prependListener:wi,prependOnceListener:_i,listeners:os,domain:Mn,_exiting:Nn,config:Bn,dlopen:Zo,uptime:is,_getActiveRequests:es,_getActiveHandles:ts,reallyExit:Ln,_kill:Un,cpuUsage:dr,resourceUsage:Dn,memoryUsage:Fn,kill:Wn,exit:$n,openStdin:qn,allowedNodeEnvironmentFlags:Vn,assert:rs,features:zn,_fatalExceptions:Kn,setUncaughtExceptionCaptureCallback:Hn,hasUncaughtExceptionCaptureCallback:ns,emitWarning:xn,nextTick:Qo,_tickCallback:Gn,_debugProcess:Yn,_debugEnd:Qn,_startProfilerIdleNotifier:Jn,_stopProfilerIdleNotifier:Xn,stdout:Zn,stdin:ti,stderr:ei,abort:ri,umask:kn,chdir:Tn,cwd:On,env:wn,title:mn,argv:_n,execArgv:Sn,pid:ni,ppid:ii,execPath:oi,debugPort:si,hrtime:Er,argv0:ai,_preload_modules:li,setSourceMapsEnabled:ui}}),ge=_t(()=>{Iu()});function ku(){if(Ei)return ir;Ei=!0,ir.byteLength=n,ir.toByteArray=i,ir.fromByteArray=d;for(var o=[],l=[],s=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,t=a.length;c<t;++c)o[c]=a[c],l[a.charCodeAt(c)]=c;l[45]=62,l[95]=63;function r(y){var b=y.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var w=y.indexOf("=");w===-1&&(w=b);var S=w===b?0:4-w%4;return[w,S]}function n(y){var b=r(y),w=b[0],S=b[1];return(w+S)*3/4-S}function e(y,b,w){return(b+w)*3/4-w}function i(y){var b,w=r(y),S=w[0],A=w[1],g=new s(e(y,S,A)),_=0,E=A>0?S-4:S,v;for(v=0;v<E;v+=4)b=l[y.charCodeAt(v)]<<18|l[y.charCodeAt(v+1)]<<12|l[y.charCodeAt(v+2)]<<6|l[y.charCodeAt(v+3)],g[_++]=b>>16&255,g[_++]=b>>8&255,g[_++]=b&255;return A===2&&(b=l[y.charCodeAt(v)]<<2|l[y.charCodeAt(v+1)]>>4,g[_++]=b&255),A===1&&(b=l[y.charCodeAt(v)]<<10|l[y.charCodeAt(v+1)]<<4|l[y.charCodeAt(v+2)]>>2,g[_++]=b>>8&255,g[_++]=b&255),g}function u(y){return o[y>>18&63]+o[y>>12&63]+o[y>>6&63]+o[y&63]}function h(y,b,w){for(var S,A=[],g=b;g<w;g+=3)S=(y[g]<<16&16711680)+(y[g+1]<<8&65280)+(y[g+2]&255),A.push(u(S));return A.join("")}function d(y){for(var b,w=y.length,S=w%3,A=[],g=16383,_=0,E=w-S;_<E;_+=g)A.push(h(y,_,_+g>E?E:_+g));return S===1?(b=y[w-1],A.push(o[b>>2]+o[b<<4&63]+"==")):S===2&&(b=(y[w-2]<<8)+y[w-1],A.push(o[b>>10]+o[b>>4&63]+o[b<<2&63]+"=")),A.join("")}return ir}function Ou(){return Ai?gr:(Ai=!0,gr.read=function(o,l,s,a,c){var t,r,n=c*8-a-1,e=(1<<n)-1,i=e>>1,u=-7,h=s?c-1:0,d=s?-1:1,y=o[l+h];for(h+=d,t=y&(1<<-u)-1,y>>=-u,u+=n;u>0;t=t*256+o[l+h],h+=d,u-=8);for(r=t&(1<<-u)-1,t>>=-u,u+=a;u>0;r=r*256+o[l+h],h+=d,u-=8);if(t===0)t=1-i;else{if(t===e)return r?NaN:(y?-1:1)*(1/0);r=r+Math.pow(2,a),t=t-i}return(y?-1:1)*r*Math.pow(2,t-a)},gr.write=function(o,l,s,a,c,t){var r,n,e,i=t*8-c-1,u=(1<<i)-1,h=u>>1,d=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=a?0:t-1,b=a?1:-1,w=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(n=isNaN(l)?1:0,r=u):(r=Math.floor(Math.log(l)/Math.LN2),l*(e=Math.pow(2,-r))<1&&(r--,e*=2),r+h>=1?l+=d/e:l+=d*Math.pow(2,1-h),l*e>=2&&(r++,e/=2),r+h>=u?(n=0,r=u):r+h>=1?(n=(l*e-1)*Math.pow(2,c),r=r+h):(n=l*Math.pow(2,h-1)*Math.pow(2,c),r=0));c>=8;o[s+y]=n&255,y+=b,n/=256,c-=8);for(r=r<<c|n,i+=c;i>0;o[s+y]=r&255,y+=b,r/=256,i-=8);o[s+y-b]|=w*128},gr)}function Tu(){if(xi)return Ut;xi=!0;let o=ku(),l=Ou(),s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ut.Buffer=r,Ut.SlowBuffer=A,Ut.INSPECT_MAX_BYTES=50;let a=2147483647;Ut.kMaxLength=a,r.TYPED_ARRAY_SUPPORT=c(),!r.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 c(){try{let f=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(f,p),f.foo()===42}catch{return!1}}Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}});function t(f){if(f>a)throw new RangeError('The value "'+f+'" is invalid for option "size"');let p=new Uint8Array(f);return Object.setPrototypeOf(p,r.prototype),p}function r(f,p,m){if(typeof f=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(f)}return n(f,p,m)}r.poolSize=8192;function n(f,p,m){if(typeof f=="string")return h(f,p);if(ArrayBuffer.isView(f))return y(f);if(f==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f);if(Z(f,ArrayBuffer)||f&&Z(f.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Z(f,SharedArrayBuffer)||f&&Z(f.buffer,SharedArrayBuffer)))return b(f,p,m);if(typeof f=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let k=f.valueOf&&f.valueOf();if(k!=null&&k!==f)return r.from(k,p,m);let M=w(f);if(M)return M;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof f[Symbol.toPrimitive]=="function")return r.from(f[Symbol.toPrimitive]("string"),p,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f)}r.from=function(f,p,m){return n(f,p,m)},Object.setPrototypeOf(r.prototype,Uint8Array.prototype),Object.setPrototypeOf(r,Uint8Array);function e(f){if(typeof f!="number")throw new TypeError('"size" argument must be of type number');if(f<0)throw new RangeError('The value "'+f+'" is invalid for option "size"')}function i(f,p,m){return e(f),f<=0?t(f):p!==void 0?typeof m=="string"?t(f).fill(p,m):t(f).fill(p):t(f)}r.alloc=function(f,p,m){return i(f,p,m)};function u(f){return e(f),t(f<0?0:S(f)|0)}r.allocUnsafe=function(f){return u(f)},r.allocUnsafeSlow=function(f){return u(f)};function h(f,p){if((typeof p!="string"||p==="")&&(p="utf8"),!r.isEncoding(p))throw new TypeError("Unknown encoding: "+p);let m=g(f,p)|0,k=t(m),M=k.write(f,p);return M!==m&&(k=k.slice(0,M)),k}function d(f){let p=f.length<0?0:S(f.length)|0,m=t(p);for(let k=0;k<p;k+=1)m[k]=f[k]&255;return m}function y(f){if(Z(f,Uint8Array)){let p=new Uint8Array(f);return b(p.buffer,p.byteOffset,p.byteLength)}return d(f)}function b(f,p,m){if(p<0||f.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(f.byteLength<p+(m||0))throw new RangeError('"length" is outside of buffer bounds');let k;return p===void 0&&m===void 0?k=new Uint8Array(f):m===void 0?k=new Uint8Array(f,p):k=new Uint8Array(f,p,m),Object.setPrototypeOf(k,r.prototype),k}function w(f){if(r.isBuffer(f)){let p=S(f.length)|0,m=t(p);return m.length===0||f.copy(m,0,0,p),m}if(f.length!==void 0)return typeof f.length!="number"||ve(f.length)?t(0):d(f);if(f.type==="Buffer"&&Array.isArray(f.data))return d(f.data)}function S(f){if(f>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return f|0}function A(f){return+f!=f&&(f=0),r.alloc(+f)}r.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==r.prototype},r.compare=function(f,p){if(Z(f,Uint8Array)&&(f=r.from(f,f.offset,f.byteLength)),Z(p,Uint8Array)&&(p=r.from(p,p.offset,p.byteLength)),!r.isBuffer(f)||!r.isBuffer(p))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===p)return 0;let m=f.length,k=p.length;for(let M=0,z=Math.min(m,k);M<z;++M)if(f[M]!==p[M]){m=f[M],k=p[M];break}return m<k?-1:k<m?1:0},r.isEncoding=function(f){switch(String(f).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}},r.concat=function(f,p){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return r.alloc(0);let m;if(p===void 0)for(p=0,m=0;m<f.length;++m)p+=f[m].length;let k=r.allocUnsafe(p),M=0;for(m=0;m<f.length;++m){let z=f[m];if(Z(z,Uint8Array))M+z.length>k.length?(r.isBuffer(z)||(z=r.from(z)),z.copy(k,M)):Uint8Array.prototype.set.call(k,z,M);else if(r.isBuffer(z))z.copy(k,M);else throw new TypeError('"list" argument must be an Array of Buffers');M+=z.length}return k};function g(f,p){if(r.isBuffer(f))return f.length;if(ArrayBuffer.isView(f)||Z(f,ArrayBuffer))return f.byteLength;if(typeof f!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof f);let m=f.length,k=arguments.length>2&&arguments[2]===!0;if(!k&&m===0)return 0;let M=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Y(f).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return pe(f).length;default:if(M)return k?-1:Y(f).length;p=(""+p).toLowerCase(),M=!0}}r.byteLength=g;function _(f,p,m){let k=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,p>>>=0,m<=p))return"";for(f||(f="utf8");;)switch(f){case"hex":return ee(this,p,m);case"utf8":case"utf-8":return W(this,p,m);case"ascii":return le(this,p,m);case"latin1":case"binary":return re(this,p,m);case"base64":return I(this,p,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,p,m);default:if(k)throw new TypeError("Unknown encoding: "+f);f=(f+"").toLowerCase(),k=!0}}r.prototype._isBuffer=!0;function E(f,p,m){let k=f[p];f[p]=f[m],f[m]=k}r.prototype.swap16=function(){let f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let p=0;p<f;p+=2)E(this,p,p+1);return this},r.prototype.swap32=function(){let f=this.length;if(f%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let p=0;p<f;p+=4)E(this,p,p+3),E(this,p+1,p+2);return this},r.prototype.swap64=function(){let f=this.length;if(f%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let p=0;p<f;p+=8)E(this,p,p+7),E(this,p+1,p+6),E(this,p+2,p+5),E(this,p+3,p+4);return this},r.prototype.toString=function(){let f=this.length;return f===0?"":arguments.length===0?W(this,0,f):_.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(f){if(!r.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f?!0:r.compare(this,f)===0},r.prototype.inspect=function(){let f="",p=Ut.INSPECT_MAX_BYTES;return f=this.toString("hex",0,p).replace(/(.{2})/g,"$1 ").trim(),this.length>p&&(f+=" ... "),"<Buffer "+f+">"},s&&(r.prototype[s]=r.prototype.inspect),r.prototype.compare=function(f,p,m,k,M){if(Z(f,Uint8Array)&&(f=r.from(f,f.offset,f.byteLength)),!r.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(p===void 0&&(p=0),m===void 0&&(m=f?f.length:0),k===void 0&&(k=0),M===void 0&&(M=this.length),p<0||m>f.length||k<0||M>this.length)throw new RangeError("out of range index");if(k>=M&&p>=m)return 0;if(k>=M)return-1;if(p>=m)return 1;if(p>>>=0,m>>>=0,k>>>=0,M>>>=0,this===f)return 0;let z=M-k,ie=m-p,$=Math.min(z,ie),J=this.slice(k,M),Te=f.slice(p,m);for(let Me=0;Me<$;++Me)if(J[Me]!==Te[Me]){z=J[Me],ie=Te[Me];break}return z<ie?-1:ie<z?1:0};function v(f,p,m,k,M){if(f.length===0)return-1;if(typeof m=="string"?(k=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,ve(m)&&(m=M?0:f.length-1),m<0&&(m=f.length+m),m>=f.length){if(M)return-1;m=f.length-1}else if(m<0)if(M)m=0;else return-1;if(typeof p=="string"&&(p=r.from(p,k)),r.isBuffer(p))return p.length===0?-1:C(f,p,m,k,M);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?M?Uint8Array.prototype.indexOf.call(f,p,m):Uint8Array.prototype.lastIndexOf.call(f,p,m):C(f,[p],m,k,M);throw new TypeError("val must be string, number or Buffer")}function C(f,p,m,k,M){let z=1,ie=f.length,$=p.length;if(k!==void 0&&(k=String(k).toLowerCase(),k==="ucs2"||k==="ucs-2"||k==="utf16le"||k==="utf-16le")){if(f.length<2||p.length<2)return-1;z=2,ie/=2,$/=2,m/=2}function J(Me,Ne){return z===1?Me[Ne]:Me.readUInt16BE(Ne*z)}let Te;if(M){let Me=-1;for(Te=m;Te<ie;Te++)if(J(f,Te)===J(p,Me===-1?0:Te-Me)){if(Me===-1&&(Me=Te),Te-Me+1===$)return Me*z}else Me!==-1&&(Te-=Te-Me),Me=-1}else for(m+$>ie&&(m=ie-$),Te=m;Te>=0;Te--){let Me=!0;for(let Ne=0;Ne<$;Ne++)if(J(f,Te+Ne)!==J(p,Ne)){Me=!1;break}if(Me)return Te}return-1}r.prototype.includes=function(f,p,m){return this.indexOf(f,p,m)!==-1},r.prototype.indexOf=function(f,p,m){return v(this,f,p,m,!0)},r.prototype.lastIndexOf=function(f,p,m){return v(this,f,p,m,!1)};function T(f,p,m,k){m=Number(m)||0;let M=f.length-m;k?(k=Number(k),k>M&&(k=M)):k=M;let z=p.length;k>z/2&&(k=z/2);let ie;for(ie=0;ie<k;++ie){let $=parseInt(p.substr(ie*2,2),16);if(ve($))return ie;f[m+ie]=$}return ie}function x(f,p,m,k){return _e(Y(p,f.length-m),f,m,k)}function P(f,p,m,k){return _e(se(p),f,m,k)}function O(f,p,m,k){return _e(pe(p),f,m,k)}function F(f,p,m,k){return _e(me(p,f.length-m),f,m,k)}r.prototype.write=function(f,p,m,k){if(p===void 0)k="utf8",m=this.length,p=0;else if(m===void 0&&typeof p=="string")k=p,m=this.length,p=0;else if(isFinite(p))p=p>>>0,isFinite(m)?(m=m>>>0,k===void 0&&(k="utf8")):(k=m,m=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let M=this.length-p;if((m===void 0||m>M)&&(m=M),f.length>0&&(m<0||p<0)||p>this.length)throw new RangeError("Attempt to write outside buffer bounds");k||(k="utf8");let z=!1;for(;;)switch(k){case"hex":return T(this,f,p,m);case"utf8":case"utf-8":return x(this,f,p,m);case"ascii":case"latin1":case"binary":return P(this,f,p,m);case"base64":return O(this,f,p,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,f,p,m);default:if(z)throw new TypeError("Unknown encoding: "+k);k=(""+k).toLowerCase(),z=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(f,p,m){return p===0&&m===f.length?o.fromByteArray(f):o.fromByteArray(f.slice(p,m))}function W(f,p,m){m=Math.min(f.length,m);let k=[],M=p;for(;M<m;){let z=f[M],ie=null,$=z>239?4:z>223?3:z>191?2:1;if(M+$<=m){let J,Te,Me,Ne;switch($){case 1:z<128&&(ie=z);break;case 2:J=f[M+1],(J&192)===128&&(Ne=(z&31)<<6|J&63,Ne>127&&(ie=Ne));break;case 3:J=f[M+1],Te=f[M+2],(J&192)===128&&(Te&192)===128&&(Ne=(z&15)<<12|(J&63)<<6|Te&63,Ne>2047&&(Ne<55296||Ne>57343)&&(ie=Ne));break;case 4:J=f[M+1],Te=f[M+2],Me=f[M+3],(J&192)===128&&(Te&192)===128&&(Me&192)===128&&(Ne=(z&15)<<18|(J&63)<<12|(Te&63)<<6|Me&63,Ne>65535&&Ne<1114112&&(ie=Ne))}}ie===null?(ie=65533,$=1):ie>65535&&(ie-=65536,k.push(ie>>>10&1023|55296),ie=56320|ie&1023),k.push(ie),M+=$}return L(k)}let V=4096;function L(f){let p=f.length;if(p<=V)return String.fromCharCode.apply(String,f);let m="",k=0;for(;k<p;)m+=String.fromCharCode.apply(String,f.slice(k,k+=V));return m}function le(f,p,m){let k="";m=Math.min(f.length,m);for(let M=p;M<m;++M)k+=String.fromCharCode(f[M]&127);return k}function re(f,p,m){let k="";m=Math.min(f.length,m);for(let M=p;M<m;++M)k+=String.fromCharCode(f[M]);return k}function ee(f,p,m){let k=f.length;(!p||p<0)&&(p=0),(!m||m<0||m>k)&&(m=k);let M="";for(let z=p;z<m;++z)M+=ke[f[z]];return M}function ue(f,p,m){let k=f.slice(p,m),M="";for(let z=0;z<k.length-1;z+=2)M+=String.fromCharCode(k[z]+k[z+1]*256);return M}r.prototype.slice=function(f,p){let m=this.length;f=~~f,p=p===void 0?m:~~p,f<0?(f+=m,f<0&&(f=0)):f>m&&(f=m),p<0?(p+=m,p<0&&(p=0)):p>m&&(p=m),p<f&&(p=f);let k=this.subarray(f,p);return Object.setPrototypeOf(k,r.prototype),k};function G(f,p,m){if(f%1!==0||f<0)throw new RangeError("offset is not uint");if(f+p>m)throw new RangeError("Trying to access beyond buffer length")}r.prototype.readUintLE=r.prototype.readUIntLE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let k=this[f],M=1,z=0;for(;++z<p&&(M*=256);)k+=this[f+z]*M;return k},r.prototype.readUintBE=r.prototype.readUIntBE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let k=this[f+--p],M=1;for(;p>0&&(M*=256);)k+=this[f+--p]*M;return k},r.prototype.readUint8=r.prototype.readUInt8=function(f,p){return f=f>>>0,p||G(f,1,this.length),this[f]},r.prototype.readUint16LE=r.prototype.readUInt16LE=function(f,p){return f=f>>>0,p||G(f,2,this.length),this[f]|this[f+1]<<8},r.prototype.readUint16BE=r.prototype.readUInt16BE=function(f,p){return f=f>>>0,p||G(f,2,this.length),this[f]<<8|this[f+1]},r.prototype.readUint32LE=r.prototype.readUInt32LE=function(f,p){return f=f>>>0,p||G(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},r.prototype.readUint32BE=r.prototype.readUInt32BE=function(f,p){return f=f>>>0,p||G(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},r.prototype.readBigUInt64LE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let k=p+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,M=this[++f]+this[++f]*2**8+this[++f]*2**16+m*2**24;return BigInt(k)+(BigInt(M)<<BigInt(32))}),r.prototype.readBigUInt64BE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let k=p*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],M=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+m;return(BigInt(k)<<BigInt(32))+BigInt(M)}),r.prototype.readIntLE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let k=this[f],M=1,z=0;for(;++z<p&&(M*=256);)k+=this[f+z]*M;return M*=128,k>=M&&(k-=Math.pow(2,8*p)),k},r.prototype.readIntBE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let k=p,M=1,z=this[f+--k];for(;k>0&&(M*=256);)z+=this[f+--k]*M;return M*=128,z>=M&&(z-=Math.pow(2,8*p)),z},r.prototype.readInt8=function(f,p){return f=f>>>0,p||G(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},r.prototype.readInt16LE=function(f,p){f=f>>>0,p||G(f,2,this.length);let m=this[f]|this[f+1]<<8;return m&32768?m|4294901760:m},r.prototype.readInt16BE=function(f,p){f=f>>>0,p||G(f,2,this.length);let m=this[f+1]|this[f]<<8;return m&32768?m|4294901760:m},r.prototype.readInt32LE=function(f,p){return f=f>>>0,p||G(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},r.prototype.readInt32BE=function(f,p){return f=f>>>0,p||G(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},r.prototype.readBigInt64LE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let k=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(m<<24);return(BigInt(k)<<BigInt(32))+BigInt(p+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),r.prototype.readBigInt64BE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let k=(p<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(k)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+m)}),r.prototype.readFloatLE=function(f,p){return f=f>>>0,p||G(f,4,this.length),l.read(this,f,!0,23,4)},r.prototype.readFloatBE=function(f,p){return f=f>>>0,p||G(f,4,this.length),l.read(this,f,!1,23,4)},r.prototype.readDoubleLE=function(f,p){return f=f>>>0,p||G(f,8,this.length),l.read(this,f,!0,52,8)},r.prototype.readDoubleBE=function(f,p){return f=f>>>0,p||G(f,8,this.length),l.read(this,f,!1,52,8)};function oe(f,p,m,k,M,z){if(!r.isBuffer(f))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>M||p<z)throw new RangeError('"value" argument is out of bounds');if(m+k>f.length)throw new RangeError("Index out of range")}r.prototype.writeUintLE=r.prototype.writeUIntLE=function(f,p,m,k){if(f=+f,p=p>>>0,m=m>>>0,!k){let ie=Math.pow(2,8*m)-1;oe(this,f,p,m,ie,0)}let M=1,z=0;for(this[p]=f&255;++z<m&&(M*=256);)this[p+z]=f/M&255;return p+m},r.prototype.writeUintBE=r.prototype.writeUIntBE=function(f,p,m,k){if(f=+f,p=p>>>0,m=m>>>0,!k){let ie=Math.pow(2,8*m)-1;oe(this,f,p,m,ie,0)}let M=m-1,z=1;for(this[p+M]=f&255;--M>=0&&(z*=256);)this[p+M]=f/z&255;return p+m},r.prototype.writeUint8=r.prototype.writeUInt8=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,1,255,0),this[p]=f&255,p+1},r.prototype.writeUint16LE=r.prototype.writeUInt16LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,65535,0),this[p]=f&255,this[p+1]=f>>>8,p+2},r.prototype.writeUint16BE=r.prototype.writeUInt16BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,65535,0),this[p]=f>>>8,this[p+1]=f&255,p+2},r.prototype.writeUint32LE=r.prototype.writeUInt32LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,4294967295,0),this[p+3]=f>>>24,this[p+2]=f>>>16,this[p+1]=f>>>8,this[p]=f&255,p+4},r.prototype.writeUint32BE=r.prototype.writeUInt32BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,4294967295,0),this[p]=f>>>24,this[p+1]=f>>>16,this[p+2]=f>>>8,this[p+3]=f&255,p+4};function R(f,p,m,k,M){te(p,k,M,f,m,7);let z=Number(p&BigInt(4294967295));f[m++]=z,z=z>>8,f[m++]=z,z=z>>8,f[m++]=z,z=z>>8,f[m++]=z;let ie=Number(p>>BigInt(32)&BigInt(4294967295));return f[m++]=ie,ie=ie>>8,f[m++]=ie,ie=ie>>8,f[m++]=ie,ie=ie>>8,f[m++]=ie,m}function Q(f,p,m,k,M){te(p,k,M,f,m,7);let z=Number(p&BigInt(4294967295));f[m+7]=z,z=z>>8,f[m+6]=z,z=z>>8,f[m+5]=z,z=z>>8,f[m+4]=z;let ie=Number(p>>BigInt(32)&BigInt(4294967295));return f[m+3]=ie,ie=ie>>8,f[m+2]=ie,ie=ie>>8,f[m+1]=ie,ie=ie>>8,f[m]=ie,m+8}r.prototype.writeBigUInt64LE=fe(function(f,p=0){return R(this,f,p,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeBigUInt64BE=fe(function(f,p=0){return Q(this,f,p,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeIntLE=function(f,p,m,k){if(f=+f,p=p>>>0,!k){let $=Math.pow(2,8*m-1);oe(this,f,p,m,$-1,-$)}let M=0,z=1,ie=0;for(this[p]=f&255;++M<m&&(z*=256);)f<0&&ie===0&&this[p+M-1]!==0&&(ie=1),this[p+M]=(f/z>>0)-ie&255;return p+m},r.prototype.writeIntBE=function(f,p,m,k){if(f=+f,p=p>>>0,!k){let $=Math.pow(2,8*m-1);oe(this,f,p,m,$-1,-$)}let M=m-1,z=1,ie=0;for(this[p+M]=f&255;--M>=0&&(z*=256);)f<0&&ie===0&&this[p+M+1]!==0&&(ie=1),this[p+M]=(f/z>>0)-ie&255;return p+m},r.prototype.writeInt8=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,1,127,-128),f<0&&(f=255+f+1),this[p]=f&255,p+1},r.prototype.writeInt16LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,32767,-32768),this[p]=f&255,this[p+1]=f>>>8,p+2},r.prototype.writeInt16BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,32767,-32768),this[p]=f>>>8,this[p+1]=f&255,p+2},r.prototype.writeInt32LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,2147483647,-2147483648),this[p]=f&255,this[p+1]=f>>>8,this[p+2]=f>>>16,this[p+3]=f>>>24,p+4},r.prototype.writeInt32BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[p]=f>>>24,this[p+1]=f>>>16,this[p+2]=f>>>8,this[p+3]=f&255,p+4},r.prototype.writeBigInt64LE=fe(function(f,p=0){return R(this,f,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),r.prototype.writeBigInt64BE=fe(function(f,p=0){return Q(this,f,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function he(f,p,m,k,M,z){if(m+k>f.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function q(f,p,m,k,M){return p=+p,m=m>>>0,M||he(f,p,m,4),l.write(f,p,m,k,23,4),m+4}r.prototype.writeFloatLE=function(f,p,m){return q(this,f,p,!0,m)},r.prototype.writeFloatBE=function(f,p,m){return q(this,f,p,!1,m)};function Ee(f,p,m,k,M){return p=+p,m=m>>>0,M||he(f,p,m,8),l.write(f,p,m,k,52,8),m+8}r.prototype.writeDoubleLE=function(f,p,m){return Ee(this,f,p,!0,m)},r.prototype.writeDoubleBE=function(f,p,m){return Ee(this,f,p,!1,m)},r.prototype.copy=function(f,p,m,k){if(!r.isBuffer(f))throw new TypeError("argument should be a Buffer");if(m||(m=0),!k&&k!==0&&(k=this.length),p>=f.length&&(p=f.length),p||(p=0),k>0&&k<m&&(k=m),k===m||f.length===0||this.length===0)return 0;if(p<0)throw new RangeError("targetStart out of bounds");if(m<0||m>=this.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("sourceEnd out of bounds");k>this.length&&(k=this.length),f.length-p<k-m&&(k=f.length-p+m);let M=k-m;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(p,m,k):Uint8Array.prototype.set.call(f,this.subarray(m,k),p),M},r.prototype.fill=function(f,p,m,k){if(typeof f=="string"){if(typeof p=="string"?(k=p,p=0,m=this.length):typeof m=="string"&&(k=m,m=this.length),k!==void 0&&typeof k!="string")throw new TypeError("encoding must be a string");if(typeof k=="string"&&!r.isEncoding(k))throw new TypeError("Unknown encoding: "+k);if(f.length===1){let z=f.charCodeAt(0);(k==="utf8"&&z<128||k==="latin1")&&(f=z)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(p<0||this.length<p||this.length<m)throw new RangeError("Out of range index");if(m<=p)return this;p=p>>>0,m=m===void 0?this.length:m>>>0,f||(f=0);let M;if(typeof f=="number")for(M=p;M<m;++M)this[M]=f;else{let z=r.isBuffer(f)?f:r.from(f,k),ie=z.length;if(ie===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(M=0;M<m-p;++M)this[M+p]=z[M%ie]}return this};let X={};function U(f,p,m){X[f]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${f}]`,this.stack,delete this.name}get code(){return f}set code(k){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:k,writable:!0})}toString(){return`${this.name} [${f}]: ${this.message}`}}}U("ERR_BUFFER_OUT_OF_BOUNDS",function(f){return f?`${f} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(f,p){return`The "${f}" argument must be of type number. Received type ${typeof p}`},TypeError),U("ERR_OUT_OF_RANGE",function(f,p,m){let k=`The value of "${f}" is out of range.`,M=m;return Number.isInteger(m)&&Math.abs(m)>2**32?M=ae(String(m)):typeof m=="bigint"&&(M=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(M=ae(M)),M+="n"),k+=` It must be ${p}. Received ${M}`,k},RangeError);function ae(f){let p="",m=f.length,k=f[0]==="-"?1:0;for(;m>=k+4;m-=3)p=`_${f.slice(m-3,m)}${p}`;return`${f.slice(0,m)}${p}`}function H(f,p,m){ne(p,"offset"),(f[p]===void 0||f[p+m]===void 0)&&be(p,f.length-(m+1))}function te(f,p,m,k,M,z){if(f>m||f<p){let ie=typeof p=="bigint"?"n":"",$;throw p===0||p===BigInt(0)?$=`>= 0${ie} and < 2${ie} ** ${(z+1)*8}${ie}`:$=`>= -(2${ie} ** ${(z+1)*8-1}${ie}) and < 2 ** ${(z+1)*8-1}${ie}`,new X.ERR_OUT_OF_RANGE("value",$,f)}H(k,M,z)}function ne(f,p){if(typeof f!="number")throw new X.ERR_INVALID_ARG_TYPE(p,"number",f)}function be(f,p,m){throw Math.floor(f)!==f?(ne(f,m),new X.ERR_OUT_OF_RANGE("offset","an integer",f)):p<0?new X.ERR_BUFFER_OUT_OF_BOUNDS:new X.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,f)}let ce=/[^+/0-9A-Za-z-_]/g;function N(f){if(f=f.split("=")[0],f=f.trim().replace(ce,""),f.length<2)return"";for(;f.length%4!==0;)f=f+"=";return f}function Y(f,p){p=p||1/0;let m,k=f.length,M=null,z=[];for(let ie=0;ie<k;++ie){if(m=f.charCodeAt(ie),m>55295&&m<57344){if(!M){if(m>56319){(p-=3)>-1&&z.push(239,191,189);continue}else if(ie+1===k){(p-=3)>-1&&z.push(239,191,189);continue}M=m;continue}if(m<56320){(p-=3)>-1&&z.push(239,191,189),M=m;continue}m=(M-55296<<10|m-56320)+65536}else M&&(p-=3)>-1&&z.push(239,191,189);if(M=null,m<128){if((p-=1)<0)break;z.push(m)}else if(m<2048){if((p-=2)<0)break;z.push(m>>6|192,m&63|128)}else if(m<65536){if((p-=3)<0)break;z.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((p-=4)<0)break;z.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return z}function se(f){let p=[];for(let m=0;m<f.length;++m)p.push(f.charCodeAt(m)&255);return p}function me(f,p){let m,k,M,z=[];for(let ie=0;ie<f.length&&!((p-=2)<0);++ie)m=f.charCodeAt(ie),k=m>>8,M=m%256,z.push(M),z.push(k);return z}function pe(f){return o.toByteArray(N(f))}function _e(f,p,m,k){let M;for(M=0;M<k&&!(M+m>=p.length||M>=f.length);++M)p[M+m]=f[M];return M}function Z(f,p){return f instanceof p||f!=null&&f.constructor!=null&&f.constructor.name!=null&&f.constructor.name===p.name}function ve(f){return f!==f}let ke=function(){let f="0123456789abcdef",p=new Array(256);for(let m=0;m<16;++m){let k=m*16;for(let M=0;M<16;++M)p[k+M]=f[m]+f[M]}return p}();function fe(f){return typeof BigInt>"u"?De:f}function De(){throw new Error("BigInt not supported")}return Ut}var ir,Ei,gr,Ai,Ut,xi,Pu=_t(()=>{de(),ye(),ge(),ir={},Ei=!1,gr={},Ai=!1,Ut={},xi=!1}),pt={};nr(pt,{Buffer:()=>xr,INSPECT_MAX_BYTES:()=>ss,default:()=>Ct,kMaxLength:()=>as});var Ct,xr,ss,as,dt=_t(()=>{de(),ye(),ge(),Pu(),Ct=Tu(),Ct.Buffer,Ct.SlowBuffer,Ct.INSPECT_MAX_BYTES,Ct.kMaxLength,xr=Ct.Buffer,ss=Ct.INSPECT_MAX_BYTES,as=Ct.kMaxLength}),ye=_t(()=>{dt()}),ut=we((o,l)=>{de(),ye(),ge();var s=class extends Error{constructor(a){if(!Array.isArray(a))throw new TypeError(`Expected input to be an Array, got ${typeof a}`);let c="";for(let t=0;t<a.length;t++)c+=` ${a[t].stack}
31
- `;super(c),this.name="AggregateError",this.errors=a}};l.exports={AggregateError:s,ArrayIsArray(a){return Array.isArray(a)},ArrayPrototypeIncludes(a,c){return a.includes(c)},ArrayPrototypeIndexOf(a,c){return a.indexOf(c)},ArrayPrototypeJoin(a,c){return a.join(c)},ArrayPrototypeMap(a,c){return a.map(c)},ArrayPrototypePop(a,c){return a.pop(c)},ArrayPrototypePush(a,c){return a.push(c)},ArrayPrototypeSlice(a,c,t){return a.slice(c,t)},Error,FunctionPrototypeCall(a,c,...t){return a.call(c,...t)},FunctionPrototypeSymbolHasInstance(a,c){return Function.prototype[Symbol.hasInstance].call(a,c)},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(a,c){return Object.defineProperties(a,c)},ObjectDefineProperty(a,c,t){return Object.defineProperty(a,c,t)},ObjectGetOwnPropertyDescriptor(a,c){return Object.getOwnPropertyDescriptor(a,c)},ObjectKeys(a){return Object.keys(a)},ObjectSetPrototypeOf(a,c){return Object.setPrototypeOf(a,c)},Promise,PromisePrototypeCatch(a,c){return a.catch(c)},PromisePrototypeThen(a,c,t){return a.then(c,t)},PromiseReject(a){return Promise.reject(a)},PromiseResolve(a){return Promise.resolve(a)},ReflectApply:Reflect.apply,RegExpPrototypeTest(a,c){return a.test(c)},SafeSet:Set,String,StringPrototypeSlice(a,c,t){return a.slice(c,t)},StringPrototypeToLowerCase(a){return a.toLowerCase()},StringPrototypeToUpperCase(a){return a.toUpperCase()},StringPrototypeTrim(a){return a.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(a,c,t){return a.set(c,t)},Boolean,Uint8Array}}),ls=we((o,l)=>{de(),ye(),ge(),l.exports={format(s,...a){return s.replace(/%([sdifj])/g,function(...[c,t]){let r=a.shift();return t==="f"?r.toFixed(6):t==="j"?JSON.stringify(r):t==="s"&&typeof r=="object"?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})},inspect(s){switch(typeof s){case"string":if(s.includes("'"))if(s.includes('"')){if(!s.includes("`")&&!s.includes("${"))return`\`${s}\``}else return`"${s}"`;return`'${s}'`;case"number":return isNaN(s)?"NaN":Object.is(s,-0)?String(s):s;case"bigint":return`${String(s)}n`;case"boolean":case"undefined":return String(s);case"object":return"{}"}}}}),wt=we((o,l)=>{de(),ye(),ge();var{format:s,inspect:a}=ls(),{AggregateError:c}=ut(),t=globalThis.AggregateError||c,r=Symbol("kIsNodeError"),n=["string","function","number","object","Function","Object","boolean","bigint","symbol"],e=/^([A-Z][a-z0-9]*)+$/,i="__node_internal_",u={};function h(g,_){if(!g)throw new u.ERR_INTERNAL_ASSERTION(_)}function d(g){let _="",E=g.length,v=g[0]==="-"?1:0;for(;E>=v+4;E-=3)_=`_${g.slice(E-3,E)}${_}`;return`${g.slice(0,E)}${_}`}function y(g,_,E){if(typeof _=="function")return h(_.length<=E.length,`Code: ${g}; The provided arguments length (${E.length}) does not match the required ones (${_.length}).`),_(...E);let v=(_.match(/%[dfijoOs]/g)||[]).length;return h(v===E.length,`Code: ${g}; The provided arguments length (${E.length}) does not match the required ones (${v}).`),E.length===0?_:s(_,...E)}function b(g,_,E){E||(E=Error);class v extends E{constructor(...T){super(y(g,_,T))}toString(){return`${this.name} [${g}]: ${this.message}`}}Object.defineProperties(v.prototype,{name:{value:E.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${g}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),v.prototype.code=g,v.prototype[r]=!0,u[g]=v}function w(g){let _=i+g.name;return Object.defineProperty(g,"name",{value:_}),g}function S(g,_){if(g&&_&&g!==_){if(Array.isArray(_.errors))return _.errors.push(g),_;let E=new t([_,g],_.message);return E.code=_.code,E}return g||_}var A=class extends Error{constructor(g="The operation was aborted",_=void 0){if(_!==void 0&&typeof _!="object")throw new u.ERR_INVALID_ARG_TYPE("options","Object",_);super(g,_),this.code="ABORT_ERR",this.name="AbortError"}};b("ERR_ASSERTION","%s",Error),b("ERR_INVALID_ARG_TYPE",(g,_,E)=>{h(typeof g=="string","'name' must be a string"),Array.isArray(_)||(_=[_]);let v="The ";g.endsWith(" argument")?v+=`${g} `:v+=`"${g}" ${g.includes(".")?"property":"argument"} `,v+="must be ";let C=[],T=[],x=[];for(let O of _)h(typeof O=="string","All expected entries have to be of type string"),n.includes(O)?C.push(O.toLowerCase()):e.test(O)?T.push(O):(h(O!=="object",'The value "object" should be written as "Object"'),x.push(O));if(T.length>0){let O=C.indexOf("object");O!==-1&&(C.splice(C,O,1),T.push("Object"))}if(C.length>0){switch(C.length){case 1:v+=`of type ${C[0]}`;break;case 2:v+=`one of type ${C[0]} or ${C[1]}`;break;default:{let O=C.pop();v+=`one of type ${C.join(", ")}, or ${O}`}}(T.length>0||x.length>0)&&(v+=" or ")}if(T.length>0){switch(T.length){case 1:v+=`an instance of ${T[0]}`;break;case 2:v+=`an instance of ${T[0]} or ${T[1]}`;break;default:{let O=T.pop();v+=`an instance of ${T.join(", ")}, or ${O}`}}x.length>0&&(v+=" or ")}switch(x.length){case 0:break;case 1:x[0].toLowerCase()!==x[0]&&(v+="an "),v+=`${x[0]}`;break;case 2:v+=`one of ${x[0]} or ${x[1]}`;break;default:{let O=x.pop();v+=`one of ${x.join(", ")}, or ${O}`}}if(E==null)v+=`. Received ${E}`;else if(typeof E=="function"&&E.name)v+=`. Received function ${E.name}`;else if(typeof E=="object"){var P;if((P=E.constructor)!==null&&P!==void 0&&P.name)v+=`. Received an instance of ${E.constructor.name}`;else{let O=a(E,{depth:-1});v+=`. Received ${O}`}}else{let O=a(E,{colors:!1});O.length>25&&(O=`${O.slice(0,25)}...`),v+=`. Received type ${typeof E} (${O})`}return v},TypeError),b("ERR_INVALID_ARG_VALUE",(g,_,E="is invalid")=>{let v=a(_);return v.length>128&&(v=v.slice(0,128)+"..."),`The ${g.includes(".")?"property":"argument"} '${g}' ${E}. Received ${v}`},TypeError),b("ERR_INVALID_RETURN_VALUE",(g,_,E)=>{var v;let C=E!=null&&(v=E.constructor)!==null&&v!==void 0&&v.name?`instance of ${E.constructor.name}`:`type ${typeof E}`;return`Expected ${g} to be returned from the "${_}" function but got ${C}.`},TypeError),b("ERR_MISSING_ARGS",(...g)=>{h(g.length>0,"At least one arg needs to be specified");let _,E=g.length;switch(g=(Array.isArray(g)?g:[g]).map(v=>`"${v}"`).join(" or "),E){case 1:_+=`The ${g[0]} argument`;break;case 2:_+=`The ${g[0]} and ${g[1]} arguments`;break;default:{let v=g.pop();_+=`The ${g.join(", ")}, and ${v} arguments`}break}return`${_} must be specified`},TypeError),b("ERR_OUT_OF_RANGE",(g,_,E)=>{h(_,'Missing "range" argument');let v;if(Number.isInteger(E)&&Math.abs(E)>2**32)v=d(String(E));else if(typeof E=="bigint"){v=String(E);let C=BigInt(2)**BigInt(32);(E>C||E<-C)&&(v=d(v)),v+="n"}else v=a(E);return`The value of "${g}" is out of range. It must be ${_}. Received ${v}`},RangeError),b("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),b("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),b("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),b("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),b("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),b("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),b("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),b("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),b("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),b("ERR_STREAM_WRITE_AFTER_END","write after end",Error),b("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),l.exports={AbortError:A,aggregateTwoErrors:w(S),hideStackFrames:w,codes:u}}),yr=we((o,l)=>{de(),ye(),ge();var{AbortController:s,AbortSignal:a}=typeof self<"u"?self:typeof window<"u"?window:void 0;l.exports=s,l.exports.AbortSignal=a,l.exports.default=s}),Dt={};nr(Dt,{EventEmitter:()=>us,default:()=>or,defaultMaxListeners:()=>cs,init:()=>fs,listenerCount:()=>hs,on:()=>ps,once:()=>ds});function Cu(){if(Ii)return mr;Ii=!0;var o=typeof Reflect=="object"?Reflect:null,l=o&&typeof o.apply=="function"?o.apply:function(E,v,C){return Function.prototype.apply.call(E,v,C)},s;o&&typeof o.ownKeys=="function"?s=o.ownKeys:Object.getOwnPropertySymbols?s=function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:s=function(E){return Object.getOwnPropertyNames(E)};function a(E){console&&console.warn&&console.warn(E)}var c=Number.isNaN||function(E){return E!==E};function t(){t.init.call(this)}mr=t,mr.once=A,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var r=10;function n(E){if(typeof E!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(E){if(typeof E!="number"||E<0||c(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");r=E}}),t.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},t.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||c(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this};function e(E){return E._maxListeners===void 0?t.defaultMaxListeners:E._maxListeners}t.prototype.getMaxListeners=function(){return e(this)},t.prototype.emit=function(E){for(var v=[],C=1;C<arguments.length;C++)v.push(arguments[C]);var T=E==="error",x=this._events;if(x!==void 0)T=T&&x.error===void 0;else if(!T)return!1;if(T){var P;if(v.length>0&&(P=v[0]),P instanceof Error)throw P;var O=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw O.context=P,O}var F=x[E];if(F===void 0)return!1;if(typeof F=="function")l(F,this,v);else for(var I=F.length,W=b(F,I),C=0;C<I;++C)l(W[C],this,v);return!0};function i(E,v,C,T){var x,P,O;if(n(C),P=E._events,P===void 0?(P=E._events=Object.create(null),E._eventsCount=0):(P.newListener!==void 0&&(E.emit("newListener",v,C.listener?C.listener:C),P=E._events),O=P[v]),O===void 0)O=P[v]=C,++E._eventsCount;else if(typeof O=="function"?O=P[v]=T?[C,O]:[O,C]:T?O.unshift(C):O.push(C),x=e(E),x>0&&O.length>x&&!O.warned){O.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+O.length+" "+String(v)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=E,F.type=v,F.count=O.length,a(F)}return E}t.prototype.addListener=function(E,v){return i(this,E,v,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(E,v){return i(this,E,v,!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 h(E,v,C){var T={fired:!1,wrapFn:void 0,target:E,type:v,listener:C},x=u.bind(T);return x.listener=C,T.wrapFn=x,x}t.prototype.once=function(E,v){return n(v),this.on(E,h(this,E,v)),this},t.prototype.prependOnceListener=function(E,v){return n(v),this.prependListener(E,h(this,E,v)),this},t.prototype.removeListener=function(E,v){var C,T,x,P,O;if(n(v),T=this._events,T===void 0)return this;if(C=T[E],C===void 0)return this;if(C===v||C.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete T[E],T.removeListener&&this.emit("removeListener",E,C.listener||v));else if(typeof C!="function"){for(x=-1,P=C.length-1;P>=0;P--)if(C[P]===v||C[P].listener===v){O=C[P].listener,x=P;break}if(x<0)return this;x===0?C.shift():w(C,x),C.length===1&&(T[E]=C[0]),T.removeListener!==void 0&&this.emit("removeListener",E,O||v)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(E){var v,C,T;if(C=this._events,C===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete C[E]),this;if(arguments.length===0){var x=Object.keys(C),P;for(T=0;T<x.length;++T)P=x[T],P!=="removeListener"&&this.removeAllListeners(P);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=C[E],typeof v=="function")this.removeListener(E,v);else if(v!==void 0)for(T=v.length-1;T>=0;T--)this.removeListener(E,v[T]);return this};function d(E,v,C){var T=E._events;if(T===void 0)return[];var x=T[v];return x===void 0?[]:typeof x=="function"?C?[x.listener||x]:[x]:C?S(x):b(x,x.length)}t.prototype.listeners=function(E){return d(this,E,!0)},t.prototype.rawListeners=function(E){return d(this,E,!1)},t.listenerCount=function(E,v){return typeof E.listenerCount=="function"?E.listenerCount(v):y.call(E,v)},t.prototype.listenerCount=y;function y(E){var v=this._events;if(v!==void 0){var C=v[E];if(typeof C=="function")return 1;if(C!==void 0)return C.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function b(E,v){for(var C=new Array(v),T=0;T<v;++T)C[T]=E[T];return C}function w(E,v){for(;v+1<E.length;v++)E[v]=E[v+1];E.pop()}function S(E){for(var v=new Array(E.length),C=0;C<v.length;++C)v[C]=E[C].listener||E[C];return v}function A(E,v){return new Promise(function(C,T){function x(O){E.removeListener(v,P),T(O)}function P(){typeof E.removeListener=="function"&&E.removeListener("error",x),C([].slice.call(arguments))}_(E,v,P,{once:!0}),v!=="error"&&g(E,x,{once:!0})})}function g(E,v,C){typeof E.on=="function"&&_(E,"error",v,C)}function _(E,v,C,T){if(typeof E.on=="function")T.once?E.once(v,C):E.on(v,C);else if(typeof E.addEventListener=="function")E.addEventListener(v,function x(P){T.once&&E.removeEventListener(v,x),C(P)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E)}return mr}var mr,Ii,or,us,cs,fs,hs,ps,ds,Qt=_t(()=>{de(),ye(),ge(),mr={},Ii=!1,or=Cu(),or.once,or.once=function(o,l){return new Promise((s,a)=>{function c(...r){t!==void 0&&o.removeListener("error",t),s(r)}let t;l!=="error"&&(t=r=>{o.removeListener(name,c),a(r)},o.once("error",t)),o.once(l,c)})},or.on=function(o,l){let s=[],a=[],c=null,t=!1,r={async next(){let i=s.shift();if(i)return createIterResult(i,!1);if(c){let u=Promise.reject(c);return c=null,u}return t?createIterResult(void 0,!0):new Promise((u,h)=>a.push({resolve:u,reject:h}))},async return(){o.removeListener(l,n),o.removeListener("error",e),t=!0;for(let i of a)i.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(i){c=i,o.removeListener(l,n),o.removeListener("error",e)},[Symbol.asyncIterator](){return this}};return o.on(l,n),o.on("error",e),r;function n(...i){let u=a.shift();u?u.resolve(createIterResult(i,!1)):s.push(i)}function e(i){t=!0;let u=a.shift();u?u.reject(i):c=i,r.return()}},{EventEmitter:us,defaultMaxListeners:cs,init:fs,listenerCount:hs,on:ps,once:ds}=or}),St=we((o,l)=>{de(),ye(),ge();var s=(dt(),tt(pt)),{format:a,inspect:c}=ls(),{codes:{ERR_INVALID_ARG_TYPE:t}}=wt(),{kResistStopPropagation:r,AggregateError:n,SymbolDispose:e}=ut(),i=globalThis.AbortSignal||yr().AbortSignal,u=globalThis.AbortController||yr().AbortController,h=Object.getPrototypeOf(async function(){}).constructor,d=globalThis.Blob||s.Blob,y=typeof d<"u"?function(S){return S instanceof d}:function(S){return!1},b=(S,A)=>{if(S!==void 0&&(S===null||typeof S!="object"||!("aborted"in S)))throw new t(A,"AbortSignal",S)},w=(S,A)=>{if(typeof S!="function")throw new t(A,"Function",S)};l.exports={AggregateError:n,kEmptyObject:Object.freeze({}),once(S){let A=!1;return function(...g){A||(A=!0,S.apply(this,g))}},createDeferredPromise:function(){let S,A;return{promise:new Promise((g,_)=>{S=g,A=_}),resolve:S,reject:A}},promisify(S){return new Promise((A,g)=>{S((_,...E)=>_?g(_):A(...E))})},debuglog(){return function(){}},format:a,inspect:c,types:{isAsyncFunction(S){return S instanceof h},isArrayBufferView(S){return ArrayBuffer.isView(S)}},isBlob:y,deprecate(S,A){return S},addAbortListener:(Qt(),tt(Dt)).addAbortListener||function(S,A){if(S===void 0)throw new t("signal","AbortSignal",S);b(S,"signal"),w(A,"listener");let g;return S.aborted?queueMicrotask(()=>A()):(S.addEventListener("abort",A,{__proto__:null,once:!0,[r]:!0}),g=()=>{S.removeEventListener("abort",A)}),{__proto__:null,[e](){var _;(_=g)===null||_===void 0||_()}}},AbortSignalAny:i.any||function(S){if(S.length===1)return S[0];let A=new u,g=()=>A.abort();return S.forEach(_=>{b(_,"signals"),_.addEventListener("abort",g,{once:!0})}),A.signal.addEventListener("abort",()=>{S.forEach(_=>_.removeEventListener("abort",g))},{once:!0}),A.signal}},l.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),br=we((o,l)=>{de(),ye(),ge();var{ArrayIsArray:s,ArrayPrototypeIncludes:a,ArrayPrototypeJoin:c,ArrayPrototypeMap:t,NumberIsInteger:r,NumberIsNaN:n,NumberMAX_SAFE_INTEGER:e,NumberMIN_SAFE_INTEGER:i,NumberParseInt:u,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:d,String:y,StringPrototypeToUpperCase:b,StringPrototypeTrim:w}=ut(),{hideStackFrames:S,codes:{ERR_SOCKET_BAD_PORT:A,ERR_INVALID_ARG_TYPE:g,ERR_INVALID_ARG_VALUE:_,ERR_OUT_OF_RANGE:E,ERR_UNKNOWN_SIGNAL:v}}=wt(),{normalizeEncoding:C}=St(),{isAsyncFunction:T,isArrayBufferView:x}=St().types,P={};function O(Z){return Z===(Z|0)}function F(Z){return Z===Z>>>0}var I=/^[0-7]+$/,W="must be a 32-bit unsigned integer or an octal string";function V(Z,ve,ke){if(typeof Z>"u"&&(Z=ke),typeof Z=="string"){if(d(I,Z)===null)throw new _(ve,Z,W);Z=u(Z,8)}return re(Z,ve),Z}var L=S((Z,ve,ke=i,fe=e)=>{if(typeof Z!="number")throw new g(ve,"number",Z);if(!r(Z))throw new E(ve,"an integer",Z);if(Z<ke||Z>fe)throw new E(ve,`>= ${ke} && <= ${fe}`,Z)}),le=S((Z,ve,ke=-2147483648,fe=2147483647)=>{if(typeof Z!="number")throw new g(ve,"number",Z);if(!r(Z))throw new E(ve,"an integer",Z);if(Z<ke||Z>fe)throw new E(ve,`>= ${ke} && <= ${fe}`,Z)}),re=S((Z,ve,ke=!1)=>{if(typeof Z!="number")throw new g(ve,"number",Z);if(!r(Z))throw new E(ve,"an integer",Z);let fe=ke?1:0,De=4294967295;if(Z<fe||Z>De)throw new E(ve,`>= ${fe} && <= ${De}`,Z)});function ee(Z,ve){if(typeof Z!="string")throw new g(ve,"string",Z)}function ue(Z,ve,ke=void 0,fe){if(typeof Z!="number")throw new g(ve,"number",Z);if(ke!=null&&Z<ke||fe!=null&&Z>fe||(ke!=null||fe!=null)&&n(Z))throw new E(ve,`${ke!=null?`>= ${ke}`:""}${ke!=null&&fe!=null?" && ":""}${fe!=null?`<= ${fe}`:""}`,Z)}var G=S((Z,ve,ke)=>{if(!a(ke,Z)){let fe="must be one of: "+c(t(ke,De=>typeof De=="string"?`'${De}'`:y(De)),", ");throw new _(ve,Z,fe)}});function oe(Z,ve){if(typeof Z!="boolean")throw new g(ve,"boolean",Z)}function R(Z,ve,ke){return Z==null||!h(Z,ve)?ke:Z[ve]}var Q=S((Z,ve,ke=null)=>{let fe=R(ke,"allowArray",!1),De=R(ke,"allowFunction",!1);if(!R(ke,"nullable",!1)&&Z===null||!fe&&s(Z)||typeof Z!="object"&&(!De||typeof Z!="function"))throw new g(ve,"Object",Z)}),he=S((Z,ve)=>{if(Z!=null&&typeof Z!="object"&&typeof Z!="function")throw new g(ve,"a dictionary",Z)}),q=S((Z,ve,ke=0)=>{if(!s(Z))throw new g(ve,"Array",Z);if(Z.length<ke){let fe=`must be longer than ${ke}`;throw new _(ve,Z,fe)}});function Ee(Z,ve){q(Z,ve);for(let ke=0;ke<Z.length;ke++)ee(Z[ke],`${ve}[${ke}]`)}function X(Z,ve){q(Z,ve);for(let ke=0;ke<Z.length;ke++)oe(Z[ke],`${ve}[${ke}]`)}function U(Z,ve){q(Z,ve);for(let ke=0;ke<Z.length;ke++){let fe=Z[ke],De=`${ve}[${ke}]`;if(fe==null)throw new g(De,"AbortSignal",fe);be(fe,De)}}function ae(Z,ve="signal"){if(ee(Z,ve),P[Z]===void 0)throw P[b(Z)]!==void 0?new v(Z+" (signals must use all capital letters)"):new v(Z)}var H=S((Z,ve="buffer")=>{if(!x(Z))throw new g(ve,["Buffer","TypedArray","DataView"],Z)});function te(Z,ve){let ke=C(ve),fe=Z.length;if(ke==="hex"&&fe%2!==0)throw new _("encoding",ve,`is invalid for data of length ${fe}`)}function ne(Z,ve="Port",ke=!0){if(typeof Z!="number"&&typeof Z!="string"||typeof Z=="string"&&w(Z).length===0||+Z!==+Z>>>0||Z>65535||Z===0&&!ke)throw new A(ve,Z,ke);return Z|0}var be=S((Z,ve)=>{if(Z!==void 0&&(Z===null||typeof Z!="object"||!("aborted"in Z)))throw new g(ve,"AbortSignal",Z)}),ce=S((Z,ve)=>{if(typeof Z!="function")throw new g(ve,"Function",Z)}),N=S((Z,ve)=>{if(typeof Z!="function"||T(Z))throw new g(ve,"Function",Z)}),Y=S((Z,ve)=>{if(Z!==void 0)throw new g(ve,"undefined",Z)});function se(Z,ve,ke){if(!a(ke,Z))throw new g(ve,`('${c(ke,"|")}')`,Z)}var me=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function pe(Z,ve){if(typeof Z>"u"||!d(me,Z))throw new _(ve,Z,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function _e(Z){if(typeof Z=="string")return pe(Z,"hints"),Z;if(s(Z)){let ve=Z.length,ke="";if(ve===0)return ke;for(let fe=0;fe<ve;fe++){let De=Z[fe];pe(De,"hints"),ke+=De,fe!==ve-1&&(ke+=", ")}return ke}throw new _("hints",Z,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}l.exports={isInt32:O,isUint32:F,parseFileMode:V,validateArray:q,validateStringArray:Ee,validateBooleanArray:X,validateAbortSignalArray:U,validateBoolean:oe,validateBuffer:H,validateDictionary:he,validateEncoding:te,validateFunction:ce,validateInt32:le,validateInteger:L,validateNumber:ue,validateObject:Q,validateOneOf:G,validatePlainFunction:N,validatePort:ne,validateSignalName:ae,validateString:ee,validateUint32:re,validateUndefined:Y,validateUnion:se,validateAbortSignal:be,validateLinkHeaderValue:_e}}),Jt=we((o,l)=>{de(),ye(),ge();var s=l.exports={},a,c;function t(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=t}catch{a=t}try{typeof clearTimeout=="function"?c=clearTimeout:c=r}catch{c=r}})();function n(A){if(a===setTimeout)return setTimeout(A,0);if((a===t||!a)&&setTimeout)return a=setTimeout,setTimeout(A,0);try{return a(A,0)}catch{try{return a.call(null,A,0)}catch{return a.call(this,A,0)}}}function e(A){if(c===clearTimeout)return clearTimeout(A);if((c===r||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(A);try{return c(A)}catch{try{return c.call(null,A)}catch{return c.call(this,A)}}}var i=[],u=!1,h,d=-1;function y(){!u||!h||(u=!1,h.length?i=h.concat(i):d=-1,i.length&&b())}function b(){if(!u){var A=n(y);u=!0;for(var g=i.length;g;){for(h=i,i=[];++d<g;)h&&h[d].run();d=-1,g=i.length}h=null,u=!1,e(A)}}s.nextTick=function(A){var g=new Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)g[_-1]=arguments[_];i.push(new w(A,g)),i.length===1&&!u&&n(b)};function w(A,g){this.fun=A,this.array=g}w.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function S(){}s.on=S,s.addListener=S,s.once=S,s.off=S,s.removeListener=S,s.removeAllListeners=S,s.emit=S,s.prependListener=S,s.prependOnceListener=S,s.listeners=function(A){return[]},s.binding=function(A){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(A){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}}),jt=we((o,l)=>{de(),ye(),ge();var{SymbolAsyncIterator:s,SymbolIterator:a,SymbolFor:c}=ut(),t=c("nodejs.stream.destroyed"),r=c("nodejs.stream.errored"),n=c("nodejs.stream.readable"),e=c("nodejs.stream.writable"),i=c("nodejs.stream.disturbed"),u=c("nodejs.webstream.isClosedPromise"),h=c("nodejs.webstream.controllerErrorFunction");function d(R,Q=!1){var he;return!!(R&&typeof R.pipe=="function"&&typeof R.on=="function"&&(!Q||typeof R.pause=="function"&&typeof R.resume=="function")&&(!R._writableState||((he=R._readableState)===null||he===void 0?void 0:he.readable)!==!1)&&(!R._writableState||R._readableState))}function y(R){var Q;return!!(R&&typeof R.write=="function"&&typeof R.on=="function"&&(!R._readableState||((Q=R._writableState)===null||Q===void 0?void 0:Q.writable)!==!1))}function b(R){return!!(R&&typeof R.pipe=="function"&&R._readableState&&typeof R.on=="function"&&typeof R.write=="function")}function w(R){return R&&(R._readableState||R._writableState||typeof R.write=="function"&&typeof R.on=="function"||typeof R.pipe=="function"&&typeof R.on=="function")}function S(R){return!!(R&&!w(R)&&typeof R.pipeThrough=="function"&&typeof R.getReader=="function"&&typeof R.cancel=="function")}function A(R){return!!(R&&!w(R)&&typeof R.getWriter=="function"&&typeof R.abort=="function")}function g(R){return!!(R&&!w(R)&&typeof R.readable=="object"&&typeof R.writable=="object")}function _(R){return S(R)||A(R)||g(R)}function E(R,Q){return R==null?!1:Q===!0?typeof R[s]=="function":Q===!1?typeof R[a]=="function":typeof R[s]=="function"||typeof R[a]=="function"}function v(R){if(!w(R))return null;let Q=R._writableState,he=R._readableState,q=Q||he;return!!(R.destroyed||R[t]||q!=null&&q.destroyed)}function C(R){if(!y(R))return null;if(R.writableEnded===!0)return!0;let Q=R._writableState;return Q!=null&&Q.errored?!1:typeof(Q==null?void 0:Q.ended)!="boolean"?null:Q.ended}function T(R,Q){if(!y(R))return null;if(R.writableFinished===!0)return!0;let he=R._writableState;return he!=null&&he.errored?!1:typeof(he==null?void 0:he.finished)!="boolean"?null:!!(he.finished||Q===!1&&he.ended===!0&&he.length===0)}function x(R){if(!d(R))return null;if(R.readableEnded===!0)return!0;let Q=R._readableState;return!Q||Q.errored?!1:typeof(Q==null?void 0:Q.ended)!="boolean"?null:Q.ended}function P(R,Q){if(!d(R))return null;let he=R._readableState;return he!=null&&he.errored?!1:typeof(he==null?void 0:he.endEmitted)!="boolean"?null:!!(he.endEmitted||Q===!1&&he.ended===!0&&he.length===0)}function O(R){return R&&R[n]!=null?R[n]:typeof(R==null?void 0:R.readable)!="boolean"?null:v(R)?!1:d(R)&&R.readable&&!P(R)}function F(R){return R&&R[e]!=null?R[e]:typeof(R==null?void 0:R.writable)!="boolean"?null:v(R)?!1:y(R)&&R.writable&&!C(R)}function I(R,Q){return w(R)?v(R)?!0:!((Q==null?void 0:Q.readable)!==!1&&O(R)||(Q==null?void 0:Q.writable)!==!1&&F(R)):null}function W(R){var Q,he;return w(R)?R.writableErrored?R.writableErrored:(Q=(he=R._writableState)===null||he===void 0?void 0:he.errored)!==null&&Q!==void 0?Q:null:null}function V(R){var Q,he;return w(R)?R.readableErrored?R.readableErrored:(Q=(he=R._readableState)===null||he===void 0?void 0:he.errored)!==null&&Q!==void 0?Q:null:null}function L(R){if(!w(R))return null;if(typeof R.closed=="boolean")return R.closed;let Q=R._writableState,he=R._readableState;return typeof(Q==null?void 0:Q.closed)=="boolean"||typeof(he==null?void 0:he.closed)=="boolean"?(Q==null?void 0:Q.closed)||(he==null?void 0:he.closed):typeof R._closed=="boolean"&&le(R)?R._closed:null}function le(R){return typeof R._closed=="boolean"&&typeof R._defaultKeepAlive=="boolean"&&typeof R._removedConnection=="boolean"&&typeof R._removedContLen=="boolean"}function re(R){return typeof R._sent100=="boolean"&&le(R)}function ee(R){var Q;return typeof R._consuming=="boolean"&&typeof R._dumped=="boolean"&&((Q=R.req)===null||Q===void 0?void 0:Q.upgradeOrConnect)===void 0}function ue(R){if(!w(R))return null;let Q=R._writableState,he=R._readableState,q=Q||he;return!q&&re(R)||!!(q&&q.autoDestroy&&q.emitClose&&q.closed===!1)}function G(R){var Q;return!!(R&&((Q=R[i])!==null&&Q!==void 0?Q:R.readableDidRead||R.readableAborted))}function oe(R){var Q,he,q,Ee,X,U,ae,H,te,ne;return!!(R&&((Q=(he=(q=(Ee=(X=(U=R[r])!==null&&U!==void 0?U:R.readableErrored)!==null&&X!==void 0?X:R.writableErrored)!==null&&Ee!==void 0?Ee:(ae=R._readableState)===null||ae===void 0?void 0:ae.errorEmitted)!==null&&q!==void 0?q:(H=R._writableState)===null||H===void 0?void 0:H.errorEmitted)!==null&&he!==void 0?he:(te=R._readableState)===null||te===void 0?void 0:te.errored)!==null&&Q!==void 0?Q:!((ne=R._writableState)===null||ne===void 0)&&ne.errored))}l.exports={isDestroyed:v,kIsDestroyed:t,isDisturbed:G,kIsDisturbed:i,isErrored:oe,kIsErrored:r,isReadable:O,kIsReadable:n,kIsClosedPromise:u,kControllerErrorFunction:h,kIsWritable:e,isClosed:L,isDuplexNodeStream:b,isFinished:I,isIterable:E,isReadableNodeStream:d,isReadableStream:S,isReadableEnded:x,isReadableFinished:P,isReadableErrored:V,isNodeStream:w,isWebStream:_,isWritable:F,isWritableNodeStream:y,isWritableStream:A,isWritableEnded:C,isWritableFinished:T,isWritableErrored:W,isServerRequest:ee,isServerResponse:re,willEmitClose:ue,isTransformStream:g}}),Ft=we((o,l)=>{de(),ye(),ge();var s=Jt(),{AbortError:a,codes:c}=wt(),{ERR_INVALID_ARG_TYPE:t,ERR_STREAM_PREMATURE_CLOSE:r}=c,{kEmptyObject:n,once:e}=St(),{validateAbortSignal:i,validateFunction:u,validateObject:h,validateBoolean:d}=br(),{Promise:y,PromisePrototypeThen:b,SymbolDispose:w}=ut(),{isClosed:S,isReadable:A,isReadableNodeStream:g,isReadableStream:_,isReadableFinished:E,isReadableErrored:v,isWritable:C,isWritableNodeStream:T,isWritableStream:x,isWritableFinished:P,isWritableErrored:O,isNodeStream:F,willEmitClose:I,kIsClosedPromise:W}=jt(),V;function L(G){return G.setHeader&&typeof G.abort=="function"}var le=()=>{};function re(G,oe,R){var Q,he;if(arguments.length===2?(R=oe,oe=n):oe==null?oe=n:h(oe,"options"),u(R,"callback"),i(oe.signal,"options.signal"),R=e(R),_(G)||x(G))return ee(G,oe,R);if(!F(G))throw new t("stream",["ReadableStream","WritableStream","Stream"],G);let q=(Q=oe.readable)!==null&&Q!==void 0?Q:g(G),Ee=(he=oe.writable)!==null&&he!==void 0?he:T(G),X=G._writableState,U=G._readableState,ae=()=>{G.writable||ne()},H=I(G)&&g(G)===q&&T(G)===Ee,te=P(G,!1),ne=()=>{te=!0,G.destroyed&&(H=!1),!(H&&(!G.readable||q))&&(!q||be)&&R.call(G)},be=E(G,!1),ce=()=>{be=!0,G.destroyed&&(H=!1),!(H&&(!G.writable||Ee))&&(!Ee||te)&&R.call(G)},N=Z=>{R.call(G,Z)},Y=S(G),se=()=>{Y=!0;let Z=O(G)||v(G);if(Z&&typeof Z!="boolean")return R.call(G,Z);if(q&&!be&&g(G,!0)&&!E(G,!1))return R.call(G,new r);if(Ee&&!te&&!P(G,!1))return R.call(G,new r);R.call(G)},me=()=>{Y=!0;let Z=O(G)||v(G);if(Z&&typeof Z!="boolean")return R.call(G,Z);R.call(G)},pe=()=>{G.req.on("finish",ne)};L(G)?(G.on("complete",ne),H||G.on("abort",se),G.req?pe():G.on("request",pe)):Ee&&!X&&(G.on("end",ae),G.on("close",ae)),!H&&typeof G.aborted=="boolean"&&G.on("aborted",se),G.on("end",ce),G.on("finish",ne),oe.error!==!1&&G.on("error",N),G.on("close",se),Y?s.nextTick(se):X!=null&&X.errorEmitted||U!=null&&U.errorEmitted?H||s.nextTick(me):(!q&&(!H||A(G))&&(te||C(G)===!1)||!Ee&&(!H||C(G))&&(be||A(G)===!1)||U&&G.req&&G.aborted)&&s.nextTick(me);let _e=()=>{R=le,G.removeListener("aborted",se),G.removeListener("complete",ne),G.removeListener("abort",se),G.removeListener("request",pe),G.req&&G.req.removeListener("finish",ne),G.removeListener("end",ae),G.removeListener("close",ae),G.removeListener("finish",ne),G.removeListener("end",ce),G.removeListener("error",N),G.removeListener("close",se)};if(oe.signal&&!Y){let Z=()=>{let ve=R;_e(),ve.call(G,new a(void 0,{cause:oe.signal.reason}))};if(oe.signal.aborted)s.nextTick(Z);else{V=V||St().addAbortListener;let ve=V(oe.signal,Z),ke=R;R=e((...fe)=>{ve[w](),ke.apply(G,fe)})}}return _e}function ee(G,oe,R){let Q=!1,he=le;if(oe.signal)if(he=()=>{Q=!0,R.call(G,new a(void 0,{cause:oe.signal.reason}))},oe.signal.aborted)s.nextTick(he);else{V=V||St().addAbortListener;let Ee=V(oe.signal,he),X=R;R=e((...U)=>{Ee[w](),X.apply(G,U)})}let q=(...Ee)=>{Q||s.nextTick(()=>R.apply(G,Ee))};return b(G[W].promise,q,q),le}function ue(G,oe){var R;let Q=!1;return oe===null&&(oe=n),(R=oe)!==null&&R!==void 0&&R.cleanup&&(d(oe.cleanup,"cleanup"),Q=oe.cleanup),new y((he,q)=>{let Ee=re(G,oe,X=>{Q&&Ee(),X?q(X):he()})})}l.exports=re,l.exports.finished=ue}),sr=we((o,l)=>{de(),ye(),ge();var s=Jt(),{aggregateTwoErrors:a,codes:{ERR_MULTIPLE_CALLBACK:c},AbortError:t}=wt(),{Symbol:r}=ut(),{kIsDestroyed:n,isDestroyed:e,isFinished:i,isServerRequest:u}=jt(),h=r("kDestroy"),d=r("kConstruct");function y(I,W,V){I&&(I.stack,W&&!W.errored&&(W.errored=I),V&&!V.errored&&(V.errored=I))}function b(I,W){let V=this._readableState,L=this._writableState,le=L||V;return L!=null&&L.destroyed||V!=null&&V.destroyed?(typeof W=="function"&&W(),this):(y(I,L,V),L&&(L.destroyed=!0),V&&(V.destroyed=!0),le.constructed?w(this,I,W):this.once(h,function(re){w(this,a(re,I),W)}),this)}function w(I,W,V){let L=!1;function le(re){if(L)return;L=!0;let ee=I._readableState,ue=I._writableState;y(re,ue,ee),ue&&(ue.closed=!0),ee&&(ee.closed=!0),typeof V=="function"&&V(re),re?s.nextTick(S,I,re):s.nextTick(A,I)}try{I._destroy(W||null,le)}catch(re){le(re)}}function S(I,W){g(I,W),A(I)}function A(I){let W=I._readableState,V=I._writableState;V&&(V.closeEmitted=!0),W&&(W.closeEmitted=!0),(V!=null&&V.emitClose||W!=null&&W.emitClose)&&I.emit("close")}function g(I,W){let V=I._readableState,L=I._writableState;L!=null&&L.errorEmitted||V!=null&&V.errorEmitted||(L&&(L.errorEmitted=!0),V&&(V.errorEmitted=!0),I.emit("error",W))}function _(){let I=this._readableState,W=this._writableState;I&&(I.constructed=!0,I.closed=!1,I.closeEmitted=!1,I.destroyed=!1,I.errored=null,I.errorEmitted=!1,I.reading=!1,I.ended=I.readable===!1,I.endEmitted=I.readable===!1),W&&(W.constructed=!0,W.destroyed=!1,W.closed=!1,W.closeEmitted=!1,W.errored=null,W.errorEmitted=!1,W.finalCalled=!1,W.prefinished=!1,W.ended=W.writable===!1,W.ending=W.writable===!1,W.finished=W.writable===!1)}function E(I,W,V){let L=I._readableState,le=I._writableState;if(le!=null&&le.destroyed||L!=null&&L.destroyed)return this;L!=null&&L.autoDestroy||le!=null&&le.autoDestroy?I.destroy(W):W&&(W.stack,le&&!le.errored&&(le.errored=W),L&&!L.errored&&(L.errored=W),V?s.nextTick(g,I,W):g(I,W))}function v(I,W){if(typeof I._construct!="function")return;let V=I._readableState,L=I._writableState;V&&(V.constructed=!1),L&&(L.constructed=!1),I.once(d,W),!(I.listenerCount(d)>1)&&s.nextTick(C,I)}function C(I){let W=!1;function V(L){if(W){E(I,L??new c);return}W=!0;let le=I._readableState,re=I._writableState,ee=re||le;le&&(le.constructed=!0),re&&(re.constructed=!0),ee.destroyed?I.emit(h,L):L?E(I,L,!0):s.nextTick(T,I)}try{I._construct(L=>{s.nextTick(V,L)})}catch(L){s.nextTick(V,L)}}function T(I){I.emit(d)}function x(I){return(I==null?void 0:I.setHeader)&&typeof I.abort=="function"}function P(I){I.emit("close")}function O(I,W){I.emit("error",W),s.nextTick(P,I)}function F(I,W){!I||e(I)||(!W&&!i(I)&&(W=new t),u(I)?(I.socket=null,I.destroy(W)):x(I)?I.abort():x(I.req)?I.req.abort():typeof I.destroy=="function"?I.destroy(W):typeof I.close=="function"?I.close():W?s.nextTick(O,I,W):s.nextTick(P,I),I.destroyed||(I[n]=!0))}l.exports={construct:v,destroyer:F,destroy:b,undestroy:_,errorOrDestroy:E}}),ki=we((o,l)=>{de(),ye(),ge();var{ArrayIsArray:s,ObjectSetPrototypeOf:a}=ut(),{EventEmitter:c}=(Qt(),tt(Dt));function t(n){c.call(this,n)}a(t.prototype,c.prototype),a(t,c),t.prototype.pipe=function(n,e){let i=this;function u(A){n.writable&&n.write(A)===!1&&i.pause&&i.pause()}i.on("data",u);function h(){i.readable&&i.resume&&i.resume()}n.on("drain",h),!n._isStdio&&(!e||e.end!==!1)&&(i.on("end",y),i.on("close",b));let d=!1;function y(){d||(d=!0,n.end())}function b(){d||(d=!0,typeof n.destroy=="function"&&n.destroy())}function w(A){S(),c.listenerCount(this,"error")===0&&this.emit("error",A)}r(i,"error",w),r(n,"error",w);function S(){i.removeListener("data",u),n.removeListener("drain",h),i.removeListener("end",y),i.removeListener("close",b),i.removeListener("error",w),n.removeListener("error",w),i.removeListener("end",S),i.removeListener("close",S),n.removeListener("close",S)}return i.on("end",S),i.on("close",S),n.on("close",S),n.emit("pipe",i),n};function r(n,e,i){if(typeof n.prependListener=="function")return n.prependListener(e,i);!n._events||!n._events[e]?n.on(e,i):s(n._events[e])?n._events[e].unshift(i):n._events[e]=[i,n._events[e]]}l.exports={Stream:t,prependListener:r}}),Ir=we((o,l)=>{de(),ye(),ge();var{SymbolDispose:s}=ut(),{AbortError:a,codes:c}=wt(),{isNodeStream:t,isWebStream:r,kControllerErrorFunction:n}=jt(),e=Ft(),{ERR_INVALID_ARG_TYPE:i}=c,u,h=(d,y)=>{if(typeof d!="object"||!("aborted"in d))throw new i(y,"AbortSignal",d)};l.exports.addAbortSignal=function(d,y){if(h(d,"signal"),!t(y)&&!r(y))throw new i("stream",["ReadableStream","WritableStream","Stream"],y);return l.exports.addAbortSignalNoValidate(d,y)},l.exports.addAbortSignalNoValidate=function(d,y){if(typeof d!="object"||!("aborted"in d))return y;let b=t(y)?()=>{y.destroy(new a(void 0,{cause:d.reason}))}:()=>{y[n](new a(void 0,{cause:d.reason}))};if(d.aborted)b();else{u=u||St().addAbortListener;let w=u(d,b);e(y,w[s])}return y}}),ju=we((o,l)=>{de(),ye(),ge();var{StringPrototypeSlice:s,SymbolIterator:a,TypedArrayPrototypeSet:c,Uint8Array:t}=ut(),{Buffer:r}=(dt(),tt(pt)),{inspect:n}=St();l.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,u=""+i.data;for(;(i=i.next)!==null;)u+=e+i.data;return u}concat(e){if(this.length===0)return r.alloc(0);let i=r.allocUnsafe(e>>>0),u=this.head,h=0;for(;u;)c(i,u.data,h),h+=u.data.length,u=u.next;return i}consume(e,i){let u=this.head.data;if(e<u.length){let h=u.slice(0,e);return this.head.data=u.slice(e),h}return e===u.length?this.shift():i?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[a](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",u=this.head,h=0;do{let d=u.data;if(e>d.length)i+=d,e-=d.length;else{e===d.length?(i+=d,++h,u.next?this.head=u.next:this.head=this.tail=null):(i+=s(d,0,e),this.head=u,u.data=s(d,e));break}++h}while((u=u.next)!==null);return this.length-=h,i}_getBuffer(e){let i=r.allocUnsafe(e),u=e,h=this.head,d=0;do{let y=h.data;if(e>y.length)c(i,y,u-e),e-=y.length;else{e===y.length?(c(i,y,u-e),++d,h.next?this.head=h.next:this.head=this.tail=null):(c(i,new t(y.buffer,y.byteOffset,e),u-e),this.head=h,h.data=y.slice(e));break}++d}while((h=h.next)!==null);return this.length-=d,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return n(this,{...i,depth:0,customInspect:!1})}}}),kr=we((o,l)=>{de(),ye(),ge();var{MathFloor:s,NumberIsInteger:a}=ut(),{validateInteger:c}=br(),{ERR_INVALID_ARG_VALUE:t}=wt().codes,r=16*1024,n=16;function e(d,y,b){return d.highWaterMark!=null?d.highWaterMark:y?d[b]:null}function i(d){return d?n:r}function u(d,y){c(y,"value",0),d?n=y:r=y}function h(d,y,b,w){let S=e(y,w,b);if(S!=null){if(!a(S)||S<0){let A=w?`options.${b}`:"options.highWaterMark";throw new t(A,S)}return s(S)}return i(d.objectMode)}l.exports={getHighWaterMark:h,getDefaultHighWaterMark:i,setDefaultHighWaterMark:u}}),Ru=we((o,l)=>{de(),ye(),ge();var s=(dt(),tt(pt)),a=s.Buffer;function c(r,n){for(var e in r)n[e]=r[e]}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?l.exports=s:(c(s,o),o.Buffer=t);function t(r,n,e){return a(r,n,e)}t.prototype=Object.create(a.prototype),c(a,t),t.from=function(r,n,e){if(typeof r=="number")throw new TypeError("Argument must not be a number");return a(r,n,e)},t.alloc=function(r,n,e){if(typeof r!="number")throw new TypeError("Argument must be a number");var i=a(r);return n!==void 0?typeof e=="string"?i.fill(n,e):i.fill(n):i.fill(0),i},t.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return a(r)},t.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return s.SlowBuffer(r)}}),Mu=we(o=>{de(),ye(),ge();var l=Ru().Buffer,s=l.isEncoding||function(g){switch(g=""+g,g&&g.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 a(g){if(!g)return"utf8";for(var _;;)switch(g){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 g;default:if(_)return;g=(""+g).toLowerCase(),_=!0}}function c(g){var _=a(g);if(typeof _!="string"&&(l.isEncoding===s||!s(g)))throw new Error("Unknown encoding: "+g);return _||g}o.StringDecoder=t;function t(g){this.encoding=c(g);var _;switch(this.encoding){case"utf16le":this.text=d,this.end=y,_=4;break;case"utf8":this.fillLast=i,_=4;break;case"base64":this.text=b,this.end=w,_=3;break;default:this.write=S,this.end=A;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=l.allocUnsafe(_)}t.prototype.write=function(g){if(g.length===0)return"";var _,E;if(this.lastNeed){if(_=this.fillLast(g),_===void 0)return"";E=this.lastNeed,this.lastNeed=0}else E=0;return E<g.length?_?_+this.text(g,E):this.text(g,E):_||""},t.prototype.end=h,t.prototype.text=u,t.prototype.fillLast=function(g){if(this.lastNeed<=g.length)return g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,g.length),this.lastNeed-=g.length};function r(g){return g<=127?0:g>>5===6?2:g>>4===14?3:g>>3===30?4:g>>6===2?-1:-2}function n(g,_,E){var v=_.length-1;if(v<E)return 0;var C=r(_[v]);return C>=0?(C>0&&(g.lastNeed=C-1),C):--v<E||C===-2?0:(C=r(_[v]),C>=0?(C>0&&(g.lastNeed=C-2),C):--v<E||C===-2?0:(C=r(_[v]),C>=0?(C>0&&(C===2?C=0:g.lastNeed=C-3),C):0))}function e(g,_,E){if((_[0]&192)!==128)return g.lastNeed=0,"�";if(g.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return g.lastNeed=1,"�";if(g.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return g.lastNeed=2,"�"}}function i(g){var _=this.lastTotal-this.lastNeed,E=e(this,g);if(E!==void 0)return E;if(this.lastNeed<=g.length)return g.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,_,0,g.length),this.lastNeed-=g.length}function u(g,_){var E=n(this,g,_);if(!this.lastNeed)return g.toString("utf8",_);this.lastTotal=E;var v=g.length-(E-this.lastNeed);return g.copy(this.lastChar,0,v),g.toString("utf8",_,v)}function h(g){var _=g&&g.length?this.write(g):"";return this.lastNeed?_+"�":_}function d(g,_){if((g.length-_)%2===0){var E=g.toString("utf16le",_);if(E){var v=E.charCodeAt(E.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1],E.slice(0,-1)}return E}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=g[g.length-1],g.toString("utf16le",_,g.length-1)}function y(g){var _=g&&g.length?this.write(g):"";if(this.lastNeed){var E=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,E)}return _}function b(g,_){var E=(g.length-_)%3;return E===0?g.toString("base64",_):(this.lastNeed=3-E,this.lastTotal=3,E===1?this.lastChar[0]=g[g.length-1]:(this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1]),g.toString("base64",_,g.length-E))}function w(g){var _=g&&g.length?this.write(g):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function S(g){return g.toString(this.encoding)}function A(g){return g&&g.length?this.write(g):""}}),gs=we((o,l)=>{de(),ye(),ge();var s=Jt(),{PromisePrototypeThen:a,SymbolAsyncIterator:c,SymbolIterator:t}=ut(),{Buffer:r}=(dt(),tt(pt)),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_NULL_VALUES:e}=wt().codes;function i(u,h,d){let y;if(typeof h=="string"||h instanceof r)return new u({objectMode:!0,...d,read(){this.push(h),this.push(null)}});let b;if(h&&h[c])b=!0,y=h[c]();else if(h&&h[t])b=!1,y=h[t]();else throw new n("iterable",["Iterable"],h);let w=new u({objectMode:!0,highWaterMark:1,...d}),S=!1;w._read=function(){S||(S=!0,g())},w._destroy=function(_,E){a(A(_),()=>s.nextTick(E,_),v=>s.nextTick(E,v||_))};async function A(_){let E=_!=null,v=typeof y.throw=="function";if(E&&v){let{value:C,done:T}=await y.throw(_);if(await C,T)return}if(typeof y.return=="function"){let{value:C}=await y.return();await C}}async function g(){for(;;){try{let{value:_,done:E}=b?await y.next():y.next();if(E)w.push(null);else{let v=_&&typeof _.then=="function"?await _:_;if(v===null)throw S=!1,new e;if(w.push(v))continue;S=!1}}catch(_){w.destroy(_)}break}}return w}l.exports=i}),Or=we((o,l)=>{de(),ye(),ge();var s=Jt(),{ArrayPrototypeIndexOf:a,NumberIsInteger:c,NumberIsNaN:t,NumberParseInt:r,ObjectDefineProperties:n,ObjectKeys:e,ObjectSetPrototypeOf:i,Promise:u,SafeSet:h,SymbolAsyncDispose:d,SymbolAsyncIterator:y,Symbol:b}=ut();l.exports=fe,fe.ReadableState=ke;var{EventEmitter:w}=(Qt(),tt(Dt)),{Stream:S,prependListener:A}=ki(),{Buffer:g}=(dt(),tt(pt)),{addAbortSignal:_}=Ir(),E=Ft(),v=St().debuglog("stream",j=>{v=j}),C=ju(),T=sr(),{getHighWaterMark:x,getDefaultHighWaterMark:P}=kr(),{aggregateTwoErrors:O,codes:{ERR_INVALID_ARG_TYPE:F,ERR_METHOD_NOT_IMPLEMENTED:I,ERR_OUT_OF_RANGE:W,ERR_STREAM_PUSH_AFTER_EOF:V,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:L},AbortError:le}=wt(),{validateObject:re}=br(),ee=b("kPaused"),{StringDecoder:ue}=Mu(),G=gs();i(fe.prototype,S.prototype),i(fe,S);var oe=()=>{},{errorOrDestroy:R}=T,Q=1,he=2,q=4,Ee=8,X=16,U=32,ae=64,H=128,te=256,ne=512,be=1024,ce=2048,N=4096,Y=8192,se=16384,me=32768,pe=65536,_e=1<<17,Z=1<<18;function ve(j){return{enumerable:!1,get(){return(this.state&j)!==0},set(B){B?this.state|=j:this.state&=~j}}}n(ke.prototype,{objectMode:ve(Q),ended:ve(he),endEmitted:ve(q),reading:ve(Ee),constructed:ve(X),sync:ve(U),needReadable:ve(ae),emittedReadable:ve(H),readableListening:ve(te),resumeScheduled:ve(ne),errorEmitted:ve(be),emitClose:ve(ce),autoDestroy:ve(N),destroyed:ve(Y),closed:ve(se),closeEmitted:ve(me),multiAwaitDrain:ve(pe),readingMore:ve(_e),dataEmitted:ve(Z)});function ke(j,B,xe){typeof xe!="boolean"&&(xe=B instanceof Rt()),this.state=ce|N|X|U,j&&j.objectMode&&(this.state|=Q),xe&&j&&j.readableObjectMode&&(this.state|=Q),this.highWaterMark=j?x(this,j,"readableHighWaterMark",xe):P(!1),this.buffer=new C,this.length=0,this.pipes=[],this.flowing=null,this[ee]=null,j&&j.emitClose===!1&&(this.state&=~ce),j&&j.autoDestroy===!1&&(this.state&=~N),this.errored=null,this.defaultEncoding=j&&j.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,j&&j.encoding&&(this.decoder=new ue(j.encoding),this.encoding=j.encoding)}function fe(j){if(!(this instanceof fe))return new fe(j);let B=this instanceof Rt();this._readableState=new ke(j,this,B),j&&(typeof j.read=="function"&&(this._read=j.read),typeof j.destroy=="function"&&(this._destroy=j.destroy),typeof j.construct=="function"&&(this._construct=j.construct),j.signal&&!B&&_(j.signal,this)),S.call(this,j),T.construct(this,()=>{this._readableState.needReadable&&$(this,this._readableState)})}fe.prototype.destroy=T.destroy,fe.prototype._undestroy=T.undestroy,fe.prototype._destroy=function(j,B){B(j)},fe.prototype[w.captureRejectionSymbol]=function(j){this.destroy(j)},fe.prototype[d]=function(){let j;return this.destroyed||(j=this.readableEnded?null:new le,this.destroy(j)),new u((B,xe)=>E(this,Ce=>Ce&&Ce!==j?xe(Ce):B(null)))},fe.prototype.push=function(j,B){return De(this,j,B,!1)},fe.prototype.unshift=function(j,B){return De(this,j,B,!0)};function De(j,B,xe,Ce){v("readableAddChunk",B);let Be=j._readableState,ft;if(!(Be.state&Q)&&(typeof B=="string"?(xe=xe||Be.defaultEncoding,Be.encoding!==xe&&(Ce&&Be.encoding?B=g.from(B,xe).toString(Be.encoding):(B=g.from(B,xe),xe=""))):B instanceof g?xe="":S._isUint8Array(B)?(B=S._uint8ArrayToBuffer(B),xe=""):B!=null&&(ft=new F("chunk",["string","Buffer","Uint8Array"],B))),ft)R(j,ft);else if(B===null)Be.state&=~Ee,M(j,Be);else if(Be.state&Q||B&&B.length>0)if(Ce)if(Be.state&q)R(j,new L);else{if(Be.destroyed||Be.errored)return!1;f(j,Be,B,!0)}else if(Be.ended)R(j,new V);else{if(Be.destroyed||Be.errored)return!1;Be.state&=~Ee,Be.decoder&&!xe?(B=Be.decoder.write(B),Be.objectMode||B.length!==0?f(j,Be,B,!1):$(j,Be)):f(j,Be,B,!1)}else Ce||(Be.state&=~Ee,$(j,Be));return!Be.ended&&(Be.length<Be.highWaterMark||Be.length===0)}function f(j,B,xe,Ce){B.flowing&&B.length===0&&!B.sync&&j.listenerCount("data")>0?(B.state&pe?B.awaitDrainWriters.clear():B.awaitDrainWriters=null,B.dataEmitted=!0,j.emit("data",xe)):(B.length+=B.objectMode?1:xe.length,Ce?B.buffer.unshift(xe):B.buffer.push(xe),B.state&ae&&z(j)),$(j,B)}fe.prototype.isPaused=function(){let j=this._readableState;return j[ee]===!0||j.flowing===!1},fe.prototype.setEncoding=function(j){let B=new ue(j);this._readableState.decoder=B,this._readableState.encoding=this._readableState.decoder.encoding;let xe=this._readableState.buffer,Ce="";for(let Be of xe)Ce+=B.write(Be);return xe.clear(),Ce!==""&&xe.push(Ce),this._readableState.length=Ce.length,this};var p=1073741824;function m(j){if(j>p)throw new W("size","<= 1GiB",j);return j--,j|=j>>>1,j|=j>>>2,j|=j>>>4,j|=j>>>8,j|=j>>>16,j++,j}function k(j,B){return j<=0||B.length===0&&B.ended?0:B.state&Q?1:t(j)?B.flowing&&B.length?B.buffer.first().length:B.length:j<=B.length?j:B.ended?B.length:0}fe.prototype.read=function(j){v("read",j),j===void 0?j=NaN:c(j)||(j=r(j,10));let B=this._readableState,xe=j;if(j>B.highWaterMark&&(B.highWaterMark=m(j)),j!==0&&(B.state&=~H),j===0&&B.needReadable&&((B.highWaterMark!==0?B.length>=B.highWaterMark:B.length>0)||B.ended))return v("read: emitReadable",B.length,B.ended),B.length===0&&B.ended?Ye(this):z(this),null;if(j=k(j,B),j===0&&B.ended)return B.length===0&&Ye(this),null;let Ce=(B.state&ae)!==0;if(v("need readable",Ce),(B.length===0||B.length-j<B.highWaterMark)&&(Ce=!0,v("length less than watermark",Ce)),B.ended||B.reading||B.destroyed||B.errored||!B.constructed)Ce=!1,v("reading, ended or constructing",Ce);else if(Ce){v("do read"),B.state|=Ee|U,B.length===0&&(B.state|=ae);try{this._read(B.highWaterMark)}catch(ft){R(this,ft)}B.state&=~U,B.reading||(j=k(xe,B))}let Be;return j>0?Be=Ue(j,B):Be=null,Be===null?(B.needReadable=B.length<=B.highWaterMark,j=0):(B.length-=j,B.multiAwaitDrain?B.awaitDrainWriters.clear():B.awaitDrainWriters=null),B.length===0&&(B.ended||(B.needReadable=!0),xe!==j&&B.ended&&Ye(this)),Be!==null&&!B.errorEmitted&&!B.closeEmitted&&(B.dataEmitted=!0,this.emit("data",Be)),Be};function M(j,B){if(v("onEofChunk"),!B.ended){if(B.decoder){let xe=B.decoder.end();xe&&xe.length&&(B.buffer.push(xe),B.length+=B.objectMode?1:xe.length)}B.ended=!0,B.sync?z(j):(B.needReadable=!1,B.emittedReadable=!0,ie(j))}}function z(j){let B=j._readableState;v("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(v("emitReadable",B.flowing),B.emittedReadable=!0,s.nextTick(ie,j))}function ie(j){let B=j._readableState;v("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&!B.errored&&(B.length||B.ended)&&(j.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,rt(j)}function $(j,B){!B.readingMore&&B.constructed&&(B.readingMore=!0,s.nextTick(J,j,B))}function J(j,B){for(;!B.reading&&!B.ended&&(B.length<B.highWaterMark||B.flowing&&B.length===0);){let xe=B.length;if(v("maybeReadMore read 0"),j.read(0),xe===B.length)break}B.readingMore=!1}fe.prototype._read=function(j){throw new I("_read()")},fe.prototype.pipe=function(j,B){let xe=this,Ce=this._readableState;Ce.pipes.length===1&&(Ce.multiAwaitDrain||(Ce.multiAwaitDrain=!0,Ce.awaitDrainWriters=new h(Ce.awaitDrainWriters?[Ce.awaitDrainWriters]:[]))),Ce.pipes.push(j),v("pipe count=%d opts=%j",Ce.pipes.length,B);let Be=(!B||B.end!==!1)&&j!==s.stdout&&j!==s.stderr?yt:Ve;Ce.endEmitted?s.nextTick(Be):xe.once("end",Be),j.on("unpipe",ft);function ft(it,et){v("onunpipe"),it===xe&&et&&et.hasUnpiped===!1&&(et.hasUnpiped=!0,Ae())}function yt(){v("onend"),j.end()}let xt,K=!1;function Ae(){v("cleanup"),j.removeListener("close",Ge),j.removeListener("finish",ze),xt&&j.removeListener("drain",xt),j.removeListener("error",He),j.removeListener("unpipe",ft),xe.removeListener("end",yt),xe.removeListener("end",Ve),xe.removeListener("data",We),K=!0,xt&&Ce.awaitDrainWriters&&(!j._writableState||j._writableState.needDrain)&&xt()}function je(){K||(Ce.pipes.length===1&&Ce.pipes[0]===j?(v("false write response, pause",0),Ce.awaitDrainWriters=j,Ce.multiAwaitDrain=!1):Ce.pipes.length>1&&Ce.pipes.includes(j)&&(v("false write response, pause",Ce.awaitDrainWriters.size),Ce.awaitDrainWriters.add(j)),xe.pause()),xt||(xt=Te(xe,j),j.on("drain",xt))}xe.on("data",We);function We(it){v("ondata");let et=j.write(it);v("dest.write",et),et===!1&&je()}function He(it){if(v("onerror",it),Ve(),j.removeListener("error",He),j.listenerCount("error")===0){let et=j._writableState||j._readableState;et&&!et.errorEmitted?R(j,it):j.emit("error",it)}}A(j,"error",He);function Ge(){j.removeListener("finish",ze),Ve()}j.once("close",Ge);function ze(){v("onfinish"),j.removeListener("close",Ge),Ve()}j.once("finish",ze);function Ve(){v("unpipe"),xe.unpipe(j)}return j.emit("pipe",xe),j.writableNeedDrain===!0?je():Ce.flowing||(v("pipe resume"),xe.resume()),j};function Te(j,B){return function(){let xe=j._readableState;xe.awaitDrainWriters===B?(v("pipeOnDrain",1),xe.awaitDrainWriters=null):xe.multiAwaitDrain&&(v("pipeOnDrain",xe.awaitDrainWriters.size),xe.awaitDrainWriters.delete(B)),(!xe.awaitDrainWriters||xe.awaitDrainWriters.size===0)&&j.listenerCount("data")&&j.resume()}}fe.prototype.unpipe=function(j){let B=this._readableState,xe={hasUnpiped:!1};if(B.pipes.length===0)return this;if(!j){let Be=B.pipes;B.pipes=[],this.pause();for(let ft=0;ft<Be.length;ft++)Be[ft].emit("unpipe",this,{hasUnpiped:!1});return this}let Ce=a(B.pipes,j);return Ce===-1?this:(B.pipes.splice(Ce,1),B.pipes.length===0&&this.pause(),j.emit("unpipe",this,xe),this)},fe.prototype.on=function(j,B){let xe=S.prototype.on.call(this,j,B),Ce=this._readableState;return j==="data"?(Ce.readableListening=this.listenerCount("readable")>0,Ce.flowing!==!1&&this.resume()):j==="readable"&&!Ce.endEmitted&&!Ce.readableListening&&(Ce.readableListening=Ce.needReadable=!0,Ce.flowing=!1,Ce.emittedReadable=!1,v("on readable",Ce.length,Ce.reading),Ce.length?z(this):Ce.reading||s.nextTick(Ne,this)),xe},fe.prototype.addListener=fe.prototype.on,fe.prototype.removeListener=function(j,B){let xe=S.prototype.removeListener.call(this,j,B);return j==="readable"&&s.nextTick(Me,this),xe},fe.prototype.off=fe.prototype.removeListener,fe.prototype.removeAllListeners=function(j){let B=S.prototype.removeAllListeners.apply(this,arguments);return(j==="readable"||j===void 0)&&s.nextTick(Me,this),B};function Me(j){let B=j._readableState;B.readableListening=j.listenerCount("readable")>0,B.resumeScheduled&&B[ee]===!1?B.flowing=!0:j.listenerCount("data")>0?j.resume():B.readableListening||(B.flowing=null)}function Ne(j){v("readable nexttick read 0"),j.read(0)}fe.prototype.resume=function(){let j=this._readableState;return j.flowing||(v("resume"),j.flowing=!j.readableListening,Fe(this,j)),j[ee]=!1,this};function Fe(j,B){B.resumeScheduled||(B.resumeScheduled=!0,s.nextTick(nt,j,B))}function nt(j,B){v("resume",B.reading),B.reading||j.read(0),B.resumeScheduled=!1,j.emit("resume"),rt(j),B.flowing&&!B.reading&&j.read(0)}fe.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ee]=!0,this};function rt(j){let B=j._readableState;for(v("flow",B.flowing);B.flowing&&j.read()!==null;);}fe.prototype.wrap=function(j){let B=!1;j.on("data",Ce=>{!this.push(Ce)&&j.pause&&(B=!0,j.pause())}),j.on("end",()=>{this.push(null)}),j.on("error",Ce=>{R(this,Ce)}),j.on("close",()=>{this.destroy()}),j.on("destroy",()=>{this.destroy()}),this._read=()=>{B&&j.resume&&(B=!1,j.resume())};let xe=e(j);for(let Ce=1;Ce<xe.length;Ce++){let Be=xe[Ce];this[Be]===void 0&&typeof j[Be]=="function"&&(this[Be]=j[Be].bind(j))}return this},fe.prototype[y]=function(){return Ke(this)},fe.prototype.iterator=function(j){return j!==void 0&&re(j,"options"),Ke(this,j)};function Ke(j,B){typeof j.read!="function"&&(j=fe.wrap(j,{objectMode:!0}));let xe=Xe(j,B);return xe.stream=j,xe}async function*Xe(j,B){let xe=oe;function Ce(yt){this===j?(xe(),xe=oe):xe=yt}j.on("readable",Ce);let Be,ft=E(j,{writable:!1},yt=>{Be=yt?O(Be,yt):null,xe(),xe=oe});try{for(;;){let yt=j.destroyed?null:j.read();if(yt!==null)yield yt;else{if(Be)throw Be;if(Be===null)return;await new u(Ce)}}}catch(yt){throw Be=O(Be,yt),Be}finally{(Be||(B==null?void 0:B.destroyOnReturn)!==!1)&&(Be===void 0||j._readableState.autoDestroy)?T.destroyer(j,null):(j.off("readable",Ce),ft())}}n(fe.prototype,{readable:{__proto__:null,get(){let j=this._readableState;return!!j&&j.readable!==!1&&!j.destroyed&&!j.errorEmitted&&!j.endEmitted},set(j){this._readableState&&(this._readableState.readable=!!j)}},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(j){this._readableState&&(this._readableState.flowing=j)}},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(j){this._readableState&&(this._readableState.destroyed=j)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),n(ke.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ee]!==!1},set(j){this[ee]=!!j}}}),fe._fromList=Ue;function Ue(j,B){if(B.length===0)return null;let xe;return B.objectMode?xe=B.buffer.shift():!j||j>=B.length?(B.decoder?xe=B.buffer.join(""):B.buffer.length===1?xe=B.buffer.first():xe=B.buffer.concat(B.length),B.buffer.clear()):xe=B.buffer.consume(j,B.decoder),xe}function Ye(j){let B=j._readableState;v("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,s.nextTick(Ze,B,j))}function Ze(j,B){if(v("endReadableNT",j.endEmitted,j.length),!j.errored&&!j.closeEmitted&&!j.endEmitted&&j.length===0){if(j.endEmitted=!0,B.emit("end"),B.writable&&B.allowHalfOpen===!1)s.nextTick(lt,B);else if(j.autoDestroy){let xe=B._writableState;(!xe||xe.autoDestroy&&(xe.finished||xe.writable===!1))&&B.destroy()}}}function lt(j){j.writable&&!j.writableEnded&&!j.destroyed&&j.end()}fe.from=function(j,B){return G(fe,j,B)};var ct;function Et(){return ct===void 0&&(ct={}),ct}fe.fromWeb=function(j,B){return Et().newStreamReadableFromReadableStream(j,B)},fe.toWeb=function(j,B){return Et().newReadableStreamFromStreamReadable(j,B)},fe.wrap=function(j,B){var xe,Ce;return new fe({objectMode:(xe=(Ce=j.readableObjectMode)!==null&&Ce!==void 0?Ce:j.objectMode)!==null&&xe!==void 0?xe:!0,...B,destroy(Be,ft){T.destroyer(j,Be),ft(Be)}}).wrap(j)}}),Oi=we((o,l)=>{de(),ye(),ge();var s=Jt(),{ArrayPrototypeSlice:a,Error:c,FunctionPrototypeSymbolHasInstance:t,ObjectDefineProperty:r,ObjectDefineProperties:n,ObjectSetPrototypeOf:e,StringPrototypeToLowerCase:i,Symbol:u,SymbolHasInstance:h}=ut();l.exports=re,re.WritableState=L;var{EventEmitter:d}=(Qt(),tt(Dt)),y=ki().Stream,{Buffer:b}=(dt(),tt(pt)),w=sr(),{addAbortSignal:S}=Ir(),{getHighWaterMark:A,getDefaultHighWaterMark:g}=kr(),{ERR_INVALID_ARG_TYPE:_,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:v,ERR_STREAM_CANNOT_PIPE:C,ERR_STREAM_DESTROYED:T,ERR_STREAM_ALREADY_FINISHED:x,ERR_STREAM_NULL_VALUES:P,ERR_STREAM_WRITE_AFTER_END:O,ERR_UNKNOWN_ENCODING:F}=wt().codes,{errorOrDestroy:I}=w;e(re.prototype,y.prototype),e(re,y);function W(){}var V=u("kOnFinished");function L(N,Y,se){typeof se!="boolean"&&(se=Y instanceof Rt()),this.objectMode=!!(N&&N.objectMode),se&&(this.objectMode=this.objectMode||!!(N&&N.writableObjectMode)),this.highWaterMark=N?A(this,N,"writableHighWaterMark",se):g(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let me=!!(N&&N.decodeStrings===!1);this.decodeStrings=!me,this.defaultEncoding=N&&N.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=R.bind(void 0,Y),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,le(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!N||N.emitClose!==!1,this.autoDestroy=!N||N.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[V]=[]}function le(N){N.buffered=[],N.bufferedIndex=0,N.allBuffers=!0,N.allNoop=!0}L.prototype.getBuffer=function(){return a(this.buffered,this.bufferedIndex)},r(L.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function re(N){let Y=this instanceof Rt();if(!Y&&!t(re,this))return new re(N);this._writableState=new L(N,this,Y),N&&(typeof N.write=="function"&&(this._write=N.write),typeof N.writev=="function"&&(this._writev=N.writev),typeof N.destroy=="function"&&(this._destroy=N.destroy),typeof N.final=="function"&&(this._final=N.final),typeof N.construct=="function"&&(this._construct=N.construct),N.signal&&S(N.signal,this)),y.call(this,N),w.construct(this,()=>{let se=this._writableState;se.writing||Ee(this,se),H(this,se)})}r(re,h,{__proto__:null,value:function(N){return t(this,N)?!0:this!==re?!1:N&&N._writableState instanceof L}}),re.prototype.pipe=function(){I(this,new C)};function ee(N,Y,se,me){let pe=N._writableState;if(typeof se=="function")me=se,se=pe.defaultEncoding;else{if(!se)se=pe.defaultEncoding;else if(se!=="buffer"&&!b.isEncoding(se))throw new F(se);typeof me!="function"&&(me=W)}if(Y===null)throw new P;if(!pe.objectMode)if(typeof Y=="string")pe.decodeStrings!==!1&&(Y=b.from(Y,se),se="buffer");else if(Y instanceof b)se="buffer";else if(y._isUint8Array(Y))Y=y._uint8ArrayToBuffer(Y),se="buffer";else throw new _("chunk",["string","Buffer","Uint8Array"],Y);let _e;return pe.ending?_e=new O:pe.destroyed&&(_e=new T("write")),_e?(s.nextTick(me,_e),I(N,_e,!0),_e):(pe.pendingcb++,ue(N,pe,Y,se,me))}re.prototype.write=function(N,Y,se){return ee(this,N,Y,se)===!0},re.prototype.cork=function(){this._writableState.corked++},re.prototype.uncork=function(){let N=this._writableState;N.corked&&(N.corked--,N.writing||Ee(this,N))},re.prototype.setDefaultEncoding=function(N){if(typeof N=="string"&&(N=i(N)),!b.isEncoding(N))throw new F(N);return this._writableState.defaultEncoding=N,this};function ue(N,Y,se,me,pe){let _e=Y.objectMode?1:se.length;Y.length+=_e;let Z=Y.length<Y.highWaterMark;return Z||(Y.needDrain=!0),Y.writing||Y.corked||Y.errored||!Y.constructed?(Y.buffered.push({chunk:se,encoding:me,callback:pe}),Y.allBuffers&&me!=="buffer"&&(Y.allBuffers=!1),Y.allNoop&&pe!==W&&(Y.allNoop=!1)):(Y.writelen=_e,Y.writecb=pe,Y.writing=!0,Y.sync=!0,N._write(se,me,Y.onwrite),Y.sync=!1),Z&&!Y.errored&&!Y.destroyed}function G(N,Y,se,me,pe,_e,Z){Y.writelen=me,Y.writecb=Z,Y.writing=!0,Y.sync=!0,Y.destroyed?Y.onwrite(new T("write")):se?N._writev(pe,Y.onwrite):N._write(pe,_e,Y.onwrite),Y.sync=!1}function oe(N,Y,se,me){--Y.pendingcb,me(se),q(Y),I(N,se)}function R(N,Y){let se=N._writableState,me=se.sync,pe=se.writecb;if(typeof pe!="function"){I(N,new v);return}se.writing=!1,se.writecb=null,se.length-=se.writelen,se.writelen=0,Y?(Y.stack,se.errored||(se.errored=Y),N._readableState&&!N._readableState.errored&&(N._readableState.errored=Y),me?s.nextTick(oe,N,se,Y,pe):oe(N,se,Y,pe)):(se.buffered.length>se.bufferedIndex&&Ee(N,se),me?se.afterWriteTickInfo!==null&&se.afterWriteTickInfo.cb===pe?se.afterWriteTickInfo.count++:(se.afterWriteTickInfo={count:1,cb:pe,stream:N,state:se},s.nextTick(Q,se.afterWriteTickInfo)):he(N,se,1,pe))}function Q({stream:N,state:Y,count:se,cb:me}){return Y.afterWriteTickInfo=null,he(N,Y,se,me)}function he(N,Y,se,me){for(!Y.ending&&!N.destroyed&&Y.length===0&&Y.needDrain&&(Y.needDrain=!1,N.emit("drain"));se-- >0;)Y.pendingcb--,me();Y.destroyed&&q(Y),H(N,Y)}function q(N){if(N.writing)return;for(let pe=N.bufferedIndex;pe<N.buffered.length;++pe){var Y;let{chunk:_e,callback:Z}=N.buffered[pe],ve=N.objectMode?1:_e.length;N.length-=ve,Z((Y=N.errored)!==null&&Y!==void 0?Y:new T("write"))}let se=N[V].splice(0);for(let pe=0;pe<se.length;pe++){var me;se[pe]((me=N.errored)!==null&&me!==void 0?me:new T("end"))}le(N)}function Ee(N,Y){if(Y.corked||Y.bufferProcessing||Y.destroyed||!Y.constructed)return;let{buffered:se,bufferedIndex:me,objectMode:pe}=Y,_e=se.length-me;if(!_e)return;let Z=me;if(Y.bufferProcessing=!0,_e>1&&N._writev){Y.pendingcb-=_e-1;let ve=Y.allNoop?W:fe=>{for(let De=Z;De<se.length;++De)se[De].callback(fe)},ke=Y.allNoop&&Z===0?se:a(se,Z);ke.allBuffers=Y.allBuffers,G(N,Y,!0,Y.length,ke,"",ve),le(Y)}else{do{let{chunk:ve,encoding:ke,callback:fe}=se[Z];se[Z++]=null;let De=pe?1:ve.length;G(N,Y,!1,De,ve,ke,fe)}while(Z<se.length&&!Y.writing);Z===se.length?le(Y):Z>256?(se.splice(0,Z),Y.bufferedIndex=0):Y.bufferedIndex=Z}Y.bufferProcessing=!1}re.prototype._write=function(N,Y,se){if(this._writev)this._writev([{chunk:N,encoding:Y}],se);else throw new E("_write()")},re.prototype._writev=null,re.prototype.end=function(N,Y,se){let me=this._writableState;typeof N=="function"?(se=N,N=null,Y=null):typeof Y=="function"&&(se=Y,Y=null);let pe;if(N!=null){let _e=ee(this,N,Y);_e instanceof c&&(pe=_e)}return me.corked&&(me.corked=1,this.uncork()),pe||(!me.errored&&!me.ending?(me.ending=!0,H(this,me,!0),me.ended=!0):me.finished?pe=new x("end"):me.destroyed&&(pe=new T("end"))),typeof se=="function"&&(pe||me.finished?s.nextTick(se,pe):me[V].push(se)),this};function X(N){return N.ending&&!N.destroyed&&N.constructed&&N.length===0&&!N.errored&&N.buffered.length===0&&!N.finished&&!N.writing&&!N.errorEmitted&&!N.closeEmitted}function U(N,Y){let se=!1;function me(pe){if(se){I(N,pe??v());return}if(se=!0,Y.pendingcb--,pe){let _e=Y[V].splice(0);for(let Z=0;Z<_e.length;Z++)_e[Z](pe);I(N,pe,Y.sync)}else X(Y)&&(Y.prefinished=!0,N.emit("prefinish"),Y.pendingcb++,s.nextTick(te,N,Y))}Y.sync=!0,Y.pendingcb++;try{N._final(me)}catch(pe){me(pe)}Y.sync=!1}function ae(N,Y){!Y.prefinished&&!Y.finalCalled&&(typeof N._final=="function"&&!Y.destroyed?(Y.finalCalled=!0,U(N,Y)):(Y.prefinished=!0,N.emit("prefinish")))}function H(N,Y,se){X(Y)&&(ae(N,Y),Y.pendingcb===0&&(se?(Y.pendingcb++,s.nextTick((me,pe)=>{X(pe)?te(me,pe):pe.pendingcb--},N,Y)):X(Y)&&(Y.pendingcb++,te(N,Y))))}function te(N,Y){Y.pendingcb--,Y.finished=!0;let se=Y[V].splice(0);for(let me=0;me<se.length;me++)se[me]();if(N.emit("finish"),Y.autoDestroy){let me=N._readableState;(!me||me.autoDestroy&&(me.endEmitted||me.readable===!1))&&N.destroy()}}n(re.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(N){this._writableState&&(this._writableState.destroyed=N)}},writable:{__proto__:null,get(){let N=this._writableState;return!!N&&N.writable!==!1&&!N.destroyed&&!N.errored&&!N.ending&&!N.ended},set(N){this._writableState&&(this._writableState.writable=!!N)}},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 N=this._writableState;return N?!N.destroyed&&!N.ending&&N.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 ne=w.destroy;re.prototype.destroy=function(N,Y){let se=this._writableState;return!se.destroyed&&(se.bufferedIndex<se.buffered.length||se[V].length)&&s.nextTick(q,se),ne.call(this,N,Y),this},re.prototype._undestroy=w.undestroy,re.prototype._destroy=function(N,Y){Y(N)},re.prototype[d.captureRejectionSymbol]=function(N){this.destroy(N)};var be;function ce(){return be===void 0&&(be={}),be}re.fromWeb=function(N,Y){return ce().newStreamWritableFromWritableStream(N,Y)},re.toWeb=function(N){return ce().newWritableStreamFromStreamWritable(N)}}),Nu=we((o,l)=>{de(),ye(),ge();var s=Jt(),a=(dt(),tt(pt)),{isReadable:c,isWritable:t,isIterable:r,isNodeStream:n,isReadableNodeStream:e,isWritableNodeStream:i,isDuplexNodeStream:u,isReadableStream:h,isWritableStream:d}=jt(),y=Ft(),{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:w,ERR_INVALID_RETURN_VALUE:S}}=wt(),{destroyer:A}=sr(),g=Rt(),_=Or(),E=Oi(),{createDeferredPromise:v}=St(),C=gs(),T=globalThis.Blob||a.Blob,x=typeof T<"u"?function(V){return V instanceof T}:function(V){return!1},P=globalThis.AbortController||yr().AbortController,{FunctionPrototypeCall:O}=ut(),F=class extends g{constructor(V){super(V),(V==null?void 0:V.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(V==null?void 0:V.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};l.exports=function V(L,le){if(u(L))return L;if(e(L))return W({readable:L});if(i(L))return W({writable:L});if(n(L))return W({writable:!1,readable:!1});if(h(L))return W({readable:_.fromWeb(L)});if(d(L))return W({writable:E.fromWeb(L)});if(typeof L=="function"){let{value:ee,write:ue,final:G,destroy:oe}=I(L);if(r(ee))return C(F,ee,{objectMode:!0,write:ue,final:G,destroy:oe});let R=ee==null?void 0:ee.then;if(typeof R=="function"){let Q,he=O(R,ee,q=>{if(q!=null)throw new S("nully","body",q)},q=>{A(Q,q)});return Q=new F({objectMode:!0,readable:!1,write:ue,final(q){G(async()=>{try{await he,s.nextTick(q,null)}catch(Ee){s.nextTick(q,Ee)}})},destroy:oe})}throw new S("Iterable, AsyncIterable or AsyncFunction",le,ee)}if(x(L))return V(L.arrayBuffer());if(r(L))return C(F,L,{objectMode:!0,writable:!1});if(h(L==null?void 0:L.readable)&&d(L==null?void 0:L.writable))return F.fromWeb(L);if(typeof(L==null?void 0:L.writable)=="object"||typeof(L==null?void 0:L.readable)=="object"){let ee=L!=null&&L.readable?e(L==null?void 0:L.readable)?L==null?void 0:L.readable:V(L.readable):void 0,ue=L!=null&&L.writable?i(L==null?void 0:L.writable)?L==null?void 0:L.writable:V(L.writable):void 0;return W({readable:ee,writable:ue})}let re=L==null?void 0:L.then;if(typeof re=="function"){let ee;return O(re,L,ue=>{ue!=null&&ee.push(ue),ee.push(null)},ue=>{A(ee,ue)}),ee=new F({objectMode:!0,writable:!1,read(){}})}throw new w(le,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],L)};function I(V){let{promise:L,resolve:le}=v(),re=new P,ee=re.signal;return{value:V(async function*(){for(;;){let ue=L;L=null;let{chunk:G,done:oe,cb:R}=await ue;if(s.nextTick(R),oe)return;if(ee.aborted)throw new b(void 0,{cause:ee.reason});({promise:L,resolve:le}=v()),yield G}}(),{signal:ee}),write(ue,G,oe){let R=le;le=null,R({chunk:ue,done:!1,cb:oe})},final(ue){let G=le;le=null,G({done:!0,cb:ue})},destroy(ue,G){re.abort(),G(ue)}}}function W(V){let L=V.readable&&typeof V.readable.read!="function"?_.wrap(V.readable):V.readable,le=V.writable,re=!!c(L),ee=!!t(le),ue,G,oe,R,Q;function he(q){let Ee=R;R=null,Ee?Ee(q):q&&Q.destroy(q)}return Q=new F({readableObjectMode:!!(L!=null&&L.readableObjectMode),writableObjectMode:!!(le!=null&&le.writableObjectMode),readable:re,writable:ee}),ee&&(y(le,q=>{ee=!1,q&&A(L,q),he(q)}),Q._write=function(q,Ee,X){le.write(q,Ee)?X():ue=X},Q._final=function(q){le.end(),G=q},le.on("drain",function(){if(ue){let q=ue;ue=null,q()}}),le.on("finish",function(){if(G){let q=G;G=null,q()}})),re&&(y(L,q=>{re=!1,q&&A(L,q),he(q)}),L.on("readable",function(){if(oe){let q=oe;oe=null,q()}}),L.on("end",function(){Q.push(null)}),Q._read=function(){for(;;){let q=L.read();if(q===null){oe=Q._read;return}if(!Q.push(q))return}}),Q._destroy=function(q,Ee){!q&&R!==null&&(q=new b),oe=null,ue=null,G=null,R===null?Ee(q):(R=Ee,A(le,q),A(L,q))},Q}}),Rt=we((o,l)=>{de(),ye(),ge();var{ObjectDefineProperties:s,ObjectGetOwnPropertyDescriptor:a,ObjectKeys:c,ObjectSetPrototypeOf:t}=ut();l.exports=e;var r=Or(),n=Oi();t(e.prototype,r.prototype),t(e,r);{let d=c(n.prototype);for(let y=0;y<d.length;y++){let b=d[y];e.prototype[b]||(e.prototype[b]=n.prototype[b])}}function e(d){if(!(this instanceof e))return new e(d);r.call(this,d),n.call(this,d),d?(this.allowHalfOpen=d.allowHalfOpen!==!1,d.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),d.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(e.prototype,{writable:{__proto__:null,...a(n.prototype,"writable")},writableHighWaterMark:{__proto__:null,...a(n.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...a(n.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...a(n.prototype,"writableBuffer")},writableLength:{__proto__:null,...a(n.prototype,"writableLength")},writableFinished:{__proto__:null,...a(n.prototype,"writableFinished")},writableCorked:{__proto__:null,...a(n.prototype,"writableCorked")},writableEnded:{__proto__:null,...a(n.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...a(n.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(d){this._readableState&&this._writableState&&(this._readableState.destroyed=d,this._writableState.destroyed=d)}}});var i;function u(){return i===void 0&&(i={}),i}e.fromWeb=function(d,y){return u().newStreamDuplexFromReadableWritablePair(d,y)},e.toWeb=function(d){return u().newReadableWritablePairFromDuplex(d)};var h;e.from=function(d){return h||(h=Nu()),h(d,"body")}}),ys=we((o,l)=>{de(),ye(),ge();var{ObjectSetPrototypeOf:s,Symbol:a}=ut();l.exports=e;var{ERR_METHOD_NOT_IMPLEMENTED:c}=wt().codes,t=Rt(),{getHighWaterMark:r}=kr();s(e.prototype,t.prototype),s(e,t);var n=a("kCallback");function e(h){if(!(this instanceof e))return new e(h);let d=h?r(this,h,"readableHighWaterMark",!0):null;d===0&&(h={...h,highWaterMark:null,readableHighWaterMark:d,writableHighWaterMark:h.writableHighWaterMark||0}),t.call(this,h),this._readableState.sync=!1,this[n]=null,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",u)}function i(h){typeof this._flush=="function"&&!this.destroyed?this._flush((d,y)=>{if(d){h?h(d):this.destroy(d);return}y!=null&&this.push(y),this.push(null),h&&h()}):(this.push(null),h&&h())}function u(){this._final!==i&&i.call(this)}e.prototype._final=i,e.prototype._transform=function(h,d,y){throw new c("_transform()")},e.prototype._write=function(h,d,y){let b=this._readableState,w=this._writableState,S=b.length;this._transform(h,d,(A,g)=>{if(A){y(A);return}g!=null&&this.push(g),w.ended||S===b.length||b.length<b.highWaterMark?y():this[n]=y})},e.prototype._read=function(){if(this[n]){let h=this[n];this[n]=null,h()}}}),ms=we((o,l)=>{de(),ye(),ge();var{ObjectSetPrototypeOf:s}=ut();l.exports=c;var a=ys();s(c.prototype,a.prototype),s(c,a);function c(t){if(!(this instanceof c))return new c(t);a.call(this,t)}c.prototype._transform=function(t,r,n){n(null,t)}}),Ti=we((o,l)=>{de(),ye(),ge();var s=Jt(),{ArrayIsArray:a,Promise:c,SymbolAsyncIterator:t,SymbolDispose:r}=ut(),n=Ft(),{once:e}=St(),i=sr(),u=Rt(),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_RETURN_VALUE:y,ERR_MISSING_ARGS:b,ERR_STREAM_DESTROYED:w,ERR_STREAM_PREMATURE_CLOSE:S},AbortError:A}=wt(),{validateFunction:g,validateAbortSignal:_}=br(),{isIterable:E,isReadable:v,isReadableNodeStream:C,isNodeStream:T,isTransformStream:x,isWebStream:P,isReadableStream:O,isReadableFinished:F}=jt(),I=globalThis.AbortController||yr().AbortController,W,V,L;function le(q,Ee,X){let U=!1;q.on("close",()=>{U=!0});let ae=n(q,{readable:Ee,writable:X},H=>{U=!H});return{destroy:H=>{U||(U=!0,i.destroyer(q,H||new w("pipe")))},cleanup:ae}}function re(q){return g(q[q.length-1],"streams[stream.length - 1]"),q.pop()}function ee(q){if(E(q))return q;if(C(q))return ue(q);throw new d("val",["Readable","Iterable","AsyncIterable"],q)}async function*ue(q){V||(V=Or()),yield*V.prototype[t].call(q)}async function G(q,Ee,X,{end:U}){let ae,H=null,te=ce=>{if(ce&&(ae=ce),H){let N=H;H=null,N()}},ne=()=>new c((ce,N)=>{ae?N(ae):H=()=>{ae?N(ae):ce()}});Ee.on("drain",te);let be=n(Ee,{readable:!1},te);try{Ee.writableNeedDrain&&await ne();for await(let ce of q)Ee.write(ce)||await ne();U&&(Ee.end(),await ne()),X()}catch(ce){X(ae!==ce?h(ae,ce):ce)}finally{be(),Ee.off("drain",te)}}async function oe(q,Ee,X,{end:U}){x(Ee)&&(Ee=Ee.writable);let ae=Ee.getWriter();try{for await(let H of q)await ae.ready,ae.write(H).catch(()=>{});await ae.ready,U&&await ae.close(),X()}catch(H){try{await ae.abort(H),X(H)}catch(te){X(te)}}}function R(...q){return Q(q,e(re(q)))}function Q(q,Ee,X){if(q.length===1&&a(q[0])&&(q=q[0]),q.length<2)throw new b("streams");let U=new I,ae=U.signal,H=X==null?void 0:X.signal,te=[];_(H,"options.signal");function ne(){pe(new A)}L=L||St().addAbortListener;let be;H&&(be=L(H,ne));let ce,N,Y=[],se=0;function me(ke){pe(ke,--se===0)}function pe(ke,fe){var De;if(ke&&(!ce||ce.code==="ERR_STREAM_PREMATURE_CLOSE")&&(ce=ke),!(!ce&&!fe)){for(;Y.length;)Y.shift()(ce);(De=be)===null||De===void 0||De[r](),U.abort(),fe&&(ce||te.forEach(f=>f()),s.nextTick(Ee,ce,N))}}let _e;for(let ke=0;ke<q.length;ke++){let fe=q[ke],De=ke<q.length-1,f=ke>0,p=De||(X==null?void 0:X.end)!==!1,m=ke===q.length-1;if(T(fe)){let k=function(M){M&&M.name!=="AbortError"&&M.code!=="ERR_STREAM_PREMATURE_CLOSE"&&me(M)};if(p){let{destroy:M,cleanup:z}=le(fe,De,f);Y.push(M),v(fe)&&m&&te.push(z)}fe.on("error",k),v(fe)&&m&&te.push(()=>{fe.removeListener("error",k)})}if(ke===0)if(typeof fe=="function"){if(_e=fe({signal:ae}),!E(_e))throw new y("Iterable, AsyncIterable or Stream","source",_e)}else E(fe)||C(fe)||x(fe)?_e=fe:_e=u.from(fe);else if(typeof fe=="function"){if(x(_e)){var Z;_e=ee((Z=_e)===null||Z===void 0?void 0:Z.readable)}else _e=ee(_e);if(_e=fe(_e,{signal:ae}),De){if(!E(_e,!0))throw new y("AsyncIterable",`transform[${ke-1}]`,_e)}else{var ve;W||(W=ms());let k=new W({objectMode:!0}),M=(ve=_e)===null||ve===void 0?void 0:ve.then;if(typeof M=="function")se++,M.call(_e,$=>{N=$,$!=null&&k.write($),p&&k.end(),s.nextTick(me)},$=>{k.destroy($),s.nextTick(me,$)});else if(E(_e,!0))se++,G(_e,k,me,{end:p});else if(O(_e)||x(_e)){let $=_e.readable||_e;se++,G($,k,me,{end:p})}else throw new y("AsyncIterable or Promise","destination",_e);_e=k;let{destroy:z,cleanup:ie}=le(_e,!1,!0);Y.push(z),m&&te.push(ie)}}else if(T(fe)){if(C(_e)){se+=2;let k=he(_e,fe,me,{end:p});v(fe)&&m&&te.push(k)}else if(x(_e)||O(_e)){let k=_e.readable||_e;se++,G(k,fe,me,{end:p})}else if(E(_e))se++,G(_e,fe,me,{end:p});else throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_e);_e=fe}else if(P(fe)){if(C(_e))se++,oe(ee(_e),fe,me,{end:p});else if(O(_e)||E(_e))se++,oe(_e,fe,me,{end:p});else if(x(_e))se++,oe(_e.readable,fe,me,{end:p});else throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_e);_e=fe}else _e=u.from(fe)}return(ae!=null&&ae.aborted||H!=null&&H.aborted)&&s.nextTick(ne),_e}function he(q,Ee,X,{end:U}){let ae=!1;if(Ee.on("close",()=>{ae||X(new S)}),q.pipe(Ee,{end:!1}),U){let H=function(){ae=!0,Ee.end()};F(q)?s.nextTick(H):q.once("end",H)}else X();return n(q,{readable:!0,writable:!1},H=>{let te=q._readableState;H&&H.code==="ERR_STREAM_PREMATURE_CLOSE"&&te&&te.ended&&!te.errored&&!te.errorEmitted?q.once("end",X).once("error",X):X(H)}),n(Ee,{readable:!1,writable:!0},X)}l.exports={pipelineImpl:Q,pipeline:R}}),bs=we((o,l)=>{de(),ye(),ge();var{pipeline:s}=Ti(),a=Rt(),{destroyer:c}=sr(),{isNodeStream:t,isReadable:r,isWritable:n,isWebStream:e,isTransformStream:i,isWritableStream:u,isReadableStream:h}=jt(),{AbortError:d,codes:{ERR_INVALID_ARG_VALUE:y,ERR_MISSING_ARGS:b}}=wt(),w=Ft();l.exports=function(...S){if(S.length===0)throw new b("streams");if(S.length===1)return a.from(S[0]);let A=[...S];if(typeof S[0]=="function"&&(S[0]=a.from(S[0])),typeof S[S.length-1]=="function"){let I=S.length-1;S[I]=a.from(S[I])}for(let I=0;I<S.length;++I)if(!(!t(S[I])&&!e(S[I]))){if(I<S.length-1&&!(r(S[I])||h(S[I])||i(S[I])))throw new y(`streams[${I}]`,A[I],"must be readable");if(I>0&&!(n(S[I])||u(S[I])||i(S[I])))throw new y(`streams[${I}]`,A[I],"must be writable")}let g,_,E,v,C;function T(I){let W=v;v=null,W?W(I):I?C.destroy(I):!F&&!O&&C.destroy()}let x=S[0],P=s(S,T),O=!!(n(x)||u(x)||i(x)),F=!!(r(P)||h(P)||i(P));if(C=new a({writableObjectMode:!!(x!=null&&x.writableObjectMode),readableObjectMode:!!(P!=null&&P.readableObjectMode),writable:O,readable:F}),O){if(t(x))C._write=function(W,V,L){x.write(W,V)?L():g=L},C._final=function(W){x.end(),_=W},x.on("drain",function(){if(g){let W=g;g=null,W()}});else if(e(x)){let W=(i(x)?x.writable:x).getWriter();C._write=async function(V,L,le){try{await W.ready,W.write(V).catch(()=>{}),le()}catch(re){le(re)}},C._final=async function(V){try{await W.ready,W.close().catch(()=>{}),_=V}catch(L){V(L)}}}let I=i(P)?P.readable:P;w(I,()=>{if(_){let W=_;_=null,W()}})}if(F){if(t(P))P.on("readable",function(){if(E){let I=E;E=null,I()}}),P.on("end",function(){C.push(null)}),C._read=function(){for(;;){let I=P.read();if(I===null){E=C._read;return}if(!C.push(I))return}};else if(e(P)){let I=(i(P)?P.readable:P).getReader();C._read=async function(){for(;;)try{let{value:W,done:V}=await I.read();if(!C.push(W))return;if(V){C.push(null);return}}catch{return}}}}return C._destroy=function(I,W){!I&&v!==null&&(I=new d),E=null,g=null,_=null,v===null?W(I):(v=W,t(P)&&c(P,I))},C}}),Bu=we((o,l)=>{de(),ye(),ge();var s=globalThis.AbortController||yr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:a,ERR_INVALID_ARG_TYPE:c,ERR_MISSING_ARGS:t,ERR_OUT_OF_RANGE:r},AbortError:n}=wt(),{validateAbortSignal:e,validateInteger:i,validateObject:u}=br(),h=ut().Symbol("kWeak"),d=ut().Symbol("kResistStopPropagation"),{finished:y}=Ft(),b=bs(),{addAbortSignalNoValidate:w}=Ir(),{isWritable:S,isNodeStream:A}=jt(),{deprecate:g}=St(),{ArrayPrototypePush:_,Boolean:E,MathFloor:v,Number:C,NumberIsNaN:T,Promise:x,PromiseReject:P,PromiseResolve:O,PromisePrototypeThen:F,Symbol:I}=ut(),W=I("kEmpty"),V=I("kEof");function L(H,te){if(te!=null&&u(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal"),A(H)&&!S(H))throw new a("stream",H,"must be writable");let ne=b(this,H);return te!=null&&te.signal&&w(te.signal,ne),ne}function le(H,te){if(typeof H!="function")throw new c("fn",["Function","AsyncFunction"],H);te!=null&&u(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal");let ne=1;(te==null?void 0:te.concurrency)!=null&&(ne=v(te.concurrency));let be=ne-1;return(te==null?void 0:te.highWaterMark)!=null&&(be=v(te.highWaterMark)),i(ne,"options.concurrency",1),i(be,"options.highWaterMark",0),be+=ne,(async function*(){let ce=St().AbortSignalAny([te==null?void 0:te.signal].filter(E)),N=this,Y=[],se={signal:ce},me,pe,_e=!1,Z=0;function ve(){_e=!0,ke()}function ke(){Z-=1,fe()}function fe(){pe&&!_e&&Z<ne&&Y.length<be&&(pe(),pe=null)}async function De(){try{for await(let f of N){if(_e)return;if(ce.aborted)throw new n;try{if(f=H(f,se),f===W)continue;f=O(f)}catch(p){f=P(p)}Z+=1,F(f,ke,ve),Y.push(f),me&&(me(),me=null),!_e&&(Y.length>=be||Z>=ne)&&await new x(p=>{pe=p})}Y.push(V)}catch(f){let p=P(f);F(p,ke,ve),Y.push(p)}finally{_e=!0,me&&(me(),me=null)}}De();try{for(;;){for(;Y.length>0;){let f=await Y[0];if(f===V)return;if(ce.aborted)throw new n;f!==W&&(yield f),Y.shift(),fe()}await new x(f=>{me=f})}}finally{_e=!0,pe&&(pe(),pe=null)}}).call(this)}function re(H=void 0){return H!=null&&u(H,"options"),(H==null?void 0:H.signal)!=null&&e(H.signal,"options.signal"),(async function*(){let te=0;for await(let be of this){var ne;if(H!=null&&(ne=H.signal)!==null&&ne!==void 0&&ne.aborted)throw new n({cause:H.signal.reason});yield[te++,be]}}).call(this)}async function ee(H,te=void 0){for await(let ne of R.call(this,H,te))return!0;return!1}async function ue(H,te=void 0){if(typeof H!="function")throw new c("fn",["Function","AsyncFunction"],H);return!await ee.call(this,async(...ne)=>!await H(...ne),te)}async function G(H,te){for await(let ne of R.call(this,H,te))return ne}async function oe(H,te){if(typeof H!="function")throw new c("fn",["Function","AsyncFunction"],H);async function ne(be,ce){return await H(be,ce),W}for await(let be of le.call(this,ne,te));}function R(H,te){if(typeof H!="function")throw new c("fn",["Function","AsyncFunction"],H);async function ne(be,ce){return await H(be,ce)?be:W}return le.call(this,ne,te)}var Q=class extends t{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function he(H,te,ne){var be;if(typeof H!="function")throw new c("reducer",["Function","AsyncFunction"],H);ne!=null&&u(ne,"options"),(ne==null?void 0:ne.signal)!=null&&e(ne.signal,"options.signal");let ce=arguments.length>1;if(ne!=null&&(be=ne.signal)!==null&&be!==void 0&&be.aborted){let pe=new n(void 0,{cause:ne.signal.reason});throw this.once("error",()=>{}),await y(this.destroy(pe)),pe}let N=new s,Y=N.signal;if(ne!=null&&ne.signal){let pe={once:!0,[h]:this,[d]:!0};ne.signal.addEventListener("abort",()=>N.abort(),pe)}let se=!1;try{for await(let pe of this){var me;if(se=!0,ne!=null&&(me=ne.signal)!==null&&me!==void 0&&me.aborted)throw new n;ce?te=await H(te,pe,{signal:Y}):(te=pe,ce=!0)}if(!se&&!ce)throw new Q}finally{N.abort()}return te}async function q(H){H!=null&&u(H,"options"),(H==null?void 0:H.signal)!=null&&e(H.signal,"options.signal");let te=[];for await(let be of this){var ne;if(H!=null&&(ne=H.signal)!==null&&ne!==void 0&&ne.aborted)throw new n(void 0,{cause:H.signal.reason});_(te,be)}return te}function Ee(H,te){let ne=le.call(this,H,te);return(async function*(){for await(let be of ne)yield*be}).call(this)}function X(H){if(H=C(H),T(H))return 0;if(H<0)throw new r("number",">= 0",H);return H}function U(H,te=void 0){return te!=null&&u(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal"),H=X(H),(async function*(){var ne;if(te!=null&&(ne=te.signal)!==null&&ne!==void 0&&ne.aborted)throw new n;for await(let ce of this){var be;if(te!=null&&(be=te.signal)!==null&&be!==void 0&&be.aborted)throw new n;H--<=0&&(yield ce)}}).call(this)}function ae(H,te=void 0){return te!=null&&u(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal"),H=X(H),(async function*(){var ne;if(te!=null&&(ne=te.signal)!==null&&ne!==void 0&&ne.aborted)throw new n;for await(let ce of this){var be;if(te!=null&&(be=te.signal)!==null&&be!==void 0&&be.aborted)throw new n;if(H-- >0&&(yield ce),H<=0)return}}).call(this)}l.exports.streamReturningOperators={asIndexedPairs:g(re,"readable.asIndexedPairs will be removed in a future version."),drop:U,filter:R,flatMap:Ee,map:le,take:ae,compose:L},l.exports.promiseReturningOperators={every:ue,forEach:oe,reduce:he,toArray:q,some:ee,find:G}}),vs=we((o,l)=>{de(),ye(),ge();var{ArrayPrototypePop:s,Promise:a}=ut(),{isIterable:c,isNodeStream:t,isWebStream:r}=jt(),{pipelineImpl:n}=Ti(),{finished:e}=Ft();ws();function i(...u){return new a((h,d)=>{let y,b,w=u[u.length-1];if(w&&typeof w=="object"&&!t(w)&&!c(w)&&!r(w)){let S=s(u);y=S.signal,b=S.end}n(u,(S,A)=>{S?d(S):h(A)},{signal:y,end:b})})}l.exports={finished:e,pipeline:i}}),ws=we((o,l)=>{de(),ye(),ge();var{Buffer:s}=(dt(),tt(pt)),{ObjectDefineProperty:a,ObjectKeys:c,ReflectApply:t}=ut(),{promisify:{custom:r}}=St(),{streamReturningOperators:n,promiseReturningOperators:e}=Bu(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:i}}=wt(),u=bs(),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:d}=kr(),{pipeline:y}=Ti(),{destroyer:b}=sr(),w=Ft(),S=vs(),A=jt(),g=l.exports=ki().Stream;g.isDestroyed=A.isDestroyed,g.isDisturbed=A.isDisturbed,g.isErrored=A.isErrored,g.isReadable=A.isReadable,g.isWritable=A.isWritable,g.Readable=Or();for(let E of c(n)){let v=function(...T){if(new.target)throw i();return g.Readable.from(t(C,this,T))},C=n[E];a(v,"name",{__proto__:null,value:C.name}),a(v,"length",{__proto__:null,value:C.length}),a(g.Readable.prototype,E,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}for(let E of c(e)){let v=function(...T){if(new.target)throw i();return t(C,this,T)},C=e[E];a(v,"name",{__proto__:null,value:C.name}),a(v,"length",{__proto__:null,value:C.length}),a(g.Readable.prototype,E,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}g.Writable=Oi(),g.Duplex=Rt(),g.Transform=ys(),g.PassThrough=ms(),g.pipeline=y;var{addAbortSignal:_}=Ir();g.addAbortSignal=_,g.finished=w,g.destroy=b,g.compose=u,g.setDefaultHighWaterMark=h,g.getDefaultHighWaterMark=d,a(g,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return S}}),a(y,r,{__proto__:null,enumerable:!0,get(){return S.pipeline}}),a(w,r,{__proto__:null,enumerable:!0,get(){return S.finished}}),g.Stream=g,g._isUint8Array=function(E){return E instanceof Uint8Array},g._uint8ArrayToBuffer=function(E){return s.from(E.buffer,E.byteOffset,E.byteLength)}}),Xt=we((o,l)=>{de(),ye(),ge();var s=ws(),a=vs(),c=s.Readable.destroy;l.exports=s.Readable,l.exports._uint8ArrayToBuffer=s._uint8ArrayToBuffer,l.exports._isUint8Array=s._isUint8Array,l.exports.isDisturbed=s.isDisturbed,l.exports.isErrored=s.isErrored,l.exports.isReadable=s.isReadable,l.exports.Readable=s.Readable,l.exports.Writable=s.Writable,l.exports.Duplex=s.Duplex,l.exports.Transform=s.Transform,l.exports.PassThrough=s.PassThrough,l.exports.addAbortSignal=s.addAbortSignal,l.exports.finished=s.finished,l.exports.destroy=s.destroy,l.exports.destroy=c,l.exports.pipeline=s.pipeline,l.exports.compose=s.compose,Object.defineProperty(s,"promises",{configurable:!0,enumerable:!0,get(){return a}}),l.exports.Stream=s.Stream,l.exports.default=l.exports}),Lu=we((o,l)=>{de(),ye(),ge(),typeof Object.create=="function"?l.exports=function(s,a){a&&(s.super_=a,s.prototype=Object.create(a.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}))}:l.exports=function(s,a){if(a){s.super_=a;var c=function(){};c.prototype=a.prototype,s.prototype=new c,s.prototype.constructor=s}}}),Uu=we((o,l)=>{de(),ye(),ge();var{Buffer:s}=(dt(),tt(pt)),a=Symbol.for("BufferList");function c(t){if(!(this instanceof c))return new c(t);c._init.call(this,t)}c._init=function(t){Object.defineProperty(this,a,{value:!0}),this._bufs=[],this.length=0,t&&this.append(t)},c.prototype._new=function(t){return new c(t)},c.prototype._offset=function(t){if(t===0)return[0,0];let r=0;for(let n=0;n<this._bufs.length;n++){let e=r+this._bufs[n].length;if(t<e||n===this._bufs.length-1)return[n,t-r];r=e}},c.prototype._reverseOffset=function(t){let r=t[0],n=t[1];for(let e=0;e<r;e++)n+=this._bufs[e].length;return n},c.prototype.getBuffers=function(){return this._bufs},c.prototype.get=function(t){if(t>this.length||t<0)return;let r=this._offset(t);return this._bufs[r[0]][r[1]]},c.prototype.slice=function(t,r){return typeof t=="number"&&t<0&&(t+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,t,r)},c.prototype.copy=function(t,r,n,e){if((typeof n!="number"||n<0)&&(n=0),(typeof e!="number"||e>this.length)&&(e=this.length),n>=this.length||e<=0)return t||s.alloc(0);let i=!!t,u=this._offset(n),h=e-n,d=h,y=i&&r||0,b=u[1];if(n===0&&e===this.length){if(!i)return this._bufs.length===1?this._bufs[0]:s.concat(this._bufs,this.length);for(let w=0;w<this._bufs.length;w++)this._bufs[w].copy(t,y),y+=this._bufs[w].length;return t}if(d<=this._bufs[u[0]].length-b)return i?this._bufs[u[0]].copy(t,r,b,b+d):this._bufs[u[0]].slice(b,b+d);i||(t=s.allocUnsafe(h));for(let w=u[0];w<this._bufs.length;w++){let S=this._bufs[w].length-b;if(d>S)this._bufs[w].copy(t,y,b),y+=S;else{this._bufs[w].copy(t,y,b,b+d),y+=S;break}d-=S,b&&(b=0)}return t.length>y?t.slice(0,y):t},c.prototype.shallowSlice=function(t,r){if(t=t||0,r=typeof r!="number"?this.length:r,t<0&&(t+=this.length),r<0&&(r+=this.length),t===r)return this._new();let n=this._offset(t),e=this._offset(r),i=this._bufs.slice(n[0],e[0]+1);return e[1]===0?i.pop():i[i.length-1]=i[i.length-1].slice(0,e[1]),n[1]!==0&&(i[0]=i[0].slice(n[1])),this._new(i)},c.prototype.toString=function(t,r,n){return this.slice(r,n).toString(t)},c.prototype.consume=function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;)if(t>=this._bufs[0].length)t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}return this},c.prototype.duplicate=function(){let t=this._new();for(let r=0;r<this._bufs.length;r++)t.append(this._bufs[r]);return t},c.prototype.append=function(t){return this._attach(t,c.prototype._appendBuffer)},c.prototype.prepend=function(t){return this._attach(t,c.prototype._prependBuffer,!0)},c.prototype._attach=function(t,r,n){if(t==null)return this;if(t.buffer)r.call(this,s.from(t.buffer,t.byteOffset,t.byteLength));else if(Array.isArray(t)){let[e,i]=n?[t.length-1,-1]:[0,1];for(let u=e;u>=0&&u<t.length;u+=i)this._attach(t[u],r,n)}else if(this._isBufferList(t)){let[e,i]=n?[t._bufs.length-1,-1]:[0,1];for(let u=e;u>=0&&u<t._bufs.length;u+=i)this._attach(t._bufs[u],r,n)}else typeof t=="number"&&(t=t.toString()),r.call(this,s.from(t));return this},c.prototype._appendBuffer=function(t){this._bufs.push(t),this.length+=t.length},c.prototype._prependBuffer=function(t){this._bufs.unshift(t),this.length+=t.length},c.prototype.indexOf=function(t,r,n){if(n===void 0&&typeof r=="string"&&(n=r,r=void 0),typeof t=="function"||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t=="number"?t=s.from([t]):typeof t=="string"?t=s.from(t,n):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=s.from(t.buffer,t.byteOffset,t.byteLength):s.isBuffer(t)||(t=s.from(t)),r=Number(r||0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),t.length===0)return r>this.length?this.length:r;let e=this._offset(r),i=e[0],u=e[1];for(;i<this._bufs.length;i++){let h=this._bufs[i];for(;u<h.length;)if(h.length-u>=t.length){let d=h.indexOf(t,u);if(d!==-1)return this._reverseOffset([i,d]);u=h.length-t.length+1}else{let d=this._reverseOffset([i,u]);if(this._match(d,t))return d;u++}u=0}return-1},c.prototype._match=function(t,r){if(this.length-t<r.length)return!1;for(let n=0;n<r.length;n++)if(this.get(t+n)!==r[n])return!1;return!0},function(){let t={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 r in t)(function(n){t[n]===null?c.prototype[n]=function(e,i){return this.slice(e,e+i)[n](0,i)}:c.prototype[n]=function(e=0){return this.slice(e,e+t[n])[n](0)}})(r)}(),c.prototype._isBufferList=function(t){return t instanceof c||c.isBufferList(t)},c.isBufferList=function(t){return t!=null&&t[a]},l.exports=c}),Du=we((o,l)=>{de(),ye(),ge();var s=Xt().Duplex,a=Lu(),c=Uu();function t(r){if(!(this instanceof t))return new t(r);if(typeof r=="function"){this._callback=r;let n=(function(e){this._callback&&(this._callback(e),this._callback=null)}).bind(this);this.on("pipe",function(e){e.on("error",n)}),this.on("unpipe",function(e){e.removeListener("error",n)}),r=null}c._init.call(this,r),s.call(this)}a(t,s),Object.assign(t.prototype,c.prototype),t.prototype._new=function(r){return new t(r)},t.prototype._write=function(r,n,e){this._appendBuffer(r),typeof e=="function"&&e()},t.prototype._read=function(r){if(!this.length)return this.push(null);r=Math.min(r,this.length),this.push(this.slice(0,r)),this.consume(r)},t.prototype.end=function(r){s.prototype.end.call(this,r),this._callback&&(this._callback(null,this.slice()),this._callback=null)},t.prototype._destroy=function(r,n){this._bufs.length=0,this.length=0,n(r)},t.prototype._isBufferList=function(r){return r instanceof t||r instanceof c||t.isBufferList(r)},t.isBufferList=c.isBufferList,l.exports=t,l.exports.BufferListStream=t,l.exports.BufferList=c}),Fu=we((o,l)=>{de(),ye(),ge();var s=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};l.exports=s}),_s=we((o,l)=>{de(),ye(),ge();var s=l.exports,{Buffer:a}=(dt(),tt(pt));s.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"},s.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},s.requiredHeaderFlagsErrors={};for(let t in s.requiredHeaderFlags){let r=s.requiredHeaderFlags[t];s.requiredHeaderFlagsErrors[t]="Invalid header flag bits, must be 0x"+r.toString(16)+" for "+s.types[t]+" packet"}s.codes={};for(let t in s.types){let r=s.types[t];s.codes[r]=t}s.CMD_SHIFT=4,s.CMD_MASK=240,s.DUP_MASK=8,s.QOS_MASK=3,s.QOS_SHIFT=1,s.RETAIN_MASK=1,s.VARBYTEINT_MASK=127,s.VARBYTEINT_FIN_MASK=128,s.VARBYTEINT_MAX=268435455,s.SESSIONPRESENT_MASK=1,s.SESSIONPRESENT_HEADER=a.from([s.SESSIONPRESENT_MASK]),s.CONNACK_HEADER=a.from([s.codes.connack<<s.CMD_SHIFT]),s.USERNAME_MASK=128,s.PASSWORD_MASK=64,s.WILL_RETAIN_MASK=32,s.WILL_QOS_MASK=24,s.WILL_QOS_SHIFT=3,s.WILL_FLAG_MASK=4,s.CLEAN_SESSION_MASK=2,s.CONNECT_HEADER=a.from([s.codes.connect<<s.CMD_SHIFT]),s.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},s.propertiesCodes={};for(let t in s.properties){let r=s.properties[t];s.propertiesCodes[r]=t}s.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 c(t){return[0,1,2].map(r=>[0,1].map(n=>[0,1].map(e=>{let i=a.alloc(1);return i.writeUInt8(s.codes[t]<<s.CMD_SHIFT|(n?s.DUP_MASK:0)|r<<s.QOS_SHIFT|e,0,!0),i})))}s.PUBLISH_HEADER=c("publish"),s.SUBSCRIBE_HEADER=c("subscribe"),s.SUBSCRIBE_OPTIONS_QOS_MASK=3,s.SUBSCRIBE_OPTIONS_NL_MASK=1,s.SUBSCRIBE_OPTIONS_NL_SHIFT=2,s.SUBSCRIBE_OPTIONS_RAP_MASK=1,s.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,s.SUBSCRIBE_OPTIONS_RH_MASK=3,s.SUBSCRIBE_OPTIONS_RH_SHIFT=4,s.SUBSCRIBE_OPTIONS_RH=[0,16,32],s.SUBSCRIBE_OPTIONS_NL=4,s.SUBSCRIBE_OPTIONS_RAP=8,s.SUBSCRIBE_OPTIONS_QOS=[0,1,2],s.UNSUBSCRIBE_HEADER=c("unsubscribe"),s.ACKS={unsuback:c("unsuback"),puback:c("puback"),pubcomp:c("pubcomp"),pubrel:c("pubrel"),pubrec:c("pubrec")},s.SUBACK_HEADER=a.from([s.codes.suback<<s.CMD_SHIFT]),s.VERSION3=a.from([3]),s.VERSION4=a.from([4]),s.VERSION5=a.from([5]),s.VERSION131=a.from([131]),s.VERSION132=a.from([132]),s.QOS=[0,1,2].map(t=>a.from([t])),s.EMPTY={pingreq:a.from([s.codes.pingreq<<4,0]),pingresp:a.from([s.codes.pingresp<<4,0]),disconnect:a.from([s.codes.disconnect<<4,0])},s.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"},s.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},s.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"},s.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"},s.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"},s.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),Wu=we((o,l)=>{de(),ye(),ge();var s=1e3,a=s*60,c=a*60,t=c*24,r=t*7,n=t*365.25;l.exports=function(d,y){y=y||{};var b=typeof d;if(b==="string"&&d.length>0)return e(d);if(b==="number"&&isFinite(d))return y.long?u(d):i(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function e(d){if(d=String(d),!(d.length>100)){var y=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(y){var b=parseFloat(y[1]),w=(y[2]||"ms").toLowerCase();switch(w){case"years":case"year":case"yrs":case"yr":case"y":return b*n;case"weeks":case"week":case"w":return b*r;case"days":case"day":case"d":return b*t;case"hours":case"hour":case"hrs":case"hr":case"h":return b*c;case"minutes":case"minute":case"mins":case"min":case"m":return b*a;case"seconds":case"second":case"secs":case"sec":case"s":return b*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}}function i(d){var y=Math.abs(d);return y>=t?Math.round(d/t)+"d":y>=c?Math.round(d/c)+"h":y>=a?Math.round(d/a)+"m":y>=s?Math.round(d/s)+"s":d+"ms"}function u(d){var y=Math.abs(d);return y>=t?h(d,y,t,"day"):y>=c?h(d,y,c,"hour"):y>=a?h(d,y,a,"minute"):y>=s?h(d,y,s,"second"):d+" ms"}function h(d,y,b,w){var S=y>=b*1.5;return Math.round(d/b)+" "+w+(S?"s":"")}}),$u=we((o,l)=>{de(),ye(),ge();function s(a){t.debug=t,t.default=t,t.coerce=h,t.disable=i,t.enable=n,t.enabled=u,t.humanize=Wu(),t.destroy=d,Object.keys(a).forEach(y=>{t[y]=a[y]}),t.names=[],t.skips=[],t.formatters={};function c(y){let b=0;for(let w=0;w<y.length;w++)b=(b<<5)-b+y.charCodeAt(w),b|=0;return t.colors[Math.abs(b)%t.colors.length]}t.selectColor=c;function t(y){let b,w=null,S,A;function g(..._){if(!g.enabled)return;let E=g,v=Number(new Date),C=v-(b||v);E.diff=C,E.prev=b,E.curr=v,b=v,_[0]=t.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let T=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(x,P)=>{if(x==="%%")return"%";T++;let O=t.formatters[P];if(typeof O=="function"){let F=_[T];x=O.call(E,F),_.splice(T,1),T--}return x}),t.formatArgs.call(E,_),(E.log||t.log).apply(E,_)}return g.namespace=y,g.useColors=t.useColors(),g.color=t.selectColor(y),g.extend=r,g.destroy=t.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>w!==null?w:(S!==t.namespaces&&(S=t.namespaces,A=t.enabled(y)),A),set:_=>{w=_}}),typeof t.init=="function"&&t.init(g),g}function r(y,b){let w=t(this.namespace+(typeof b>"u"?":":b)+y);return w.log=this.log,w}function n(y){t.save(y),t.namespaces=y,t.names=[],t.skips=[];let b=(typeof y=="string"?y:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let w of b)w[0]==="-"?t.skips.push(w.slice(1)):t.names.push(w)}function e(y,b){let w=0,S=0,A=-1,g=0;for(;w<y.length;)if(S<b.length&&(b[S]===y[w]||b[S]==="*"))b[S]==="*"?(A=S,g=w,S++):(w++,S++);else if(A!==-1)S=A+1,g++,w=g;else return!1;for(;S<b.length&&b[S]==="*";)S++;return S===b.length}function i(){let y=[...t.names,...t.skips.map(b=>"-"+b)].join(",");return t.enable(""),y}function u(y){for(let b of t.skips)if(e(y,b))return!1;for(let b of t.names)if(e(y,b))return!0;return!1}function h(y){return y instanceof Error?y.stack||y.message:y}function d(){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 t.enable(t.load()),t}l.exports=s}),Mt=we((o,l)=>{de(),ye(),ge(),o.formatArgs=a,o.save=c,o.load=t,o.useColors=s,o.storage=r(),o.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})(),o.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 s(){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 e;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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+l.exports.humanize(this.diff),!this.useColors)return;let i="color: "+this.color;e.splice(1,0,i,"color: inherit");let u=0,h=0;e[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(u++,d==="%c"&&(h=u))}),e.splice(h,0,i)}o.log=console.debug||console.log||(()=>{});function c(e){try{e?o.storage.setItem("debug",e):o.storage.removeItem("debug")}catch{}}function t(){let e;try{e=o.storage.getItem("debug")||o.storage.getItem("DEBUG")}catch{}return!e&&typeof Je<"u"&&"env"in Je&&(e=Je.env.DEBUG),e}function r(){try{return localStorage}catch{}}l.exports=$u()(o);var{formatters:n}=l.exports;n.j=function(e){try{return JSON.stringify(e)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}}),qu=we((o,l)=>{de(),ye(),ge();var s=Du(),{EventEmitter:a}=(Qt(),tt(Dt)),c=Fu(),t=_s(),r=Mt()("mqtt-packet:parser"),n=class $o extends a{constructor(){super(),this.parser=this.constructor.parser}static parser(i){return this instanceof $o?(this.settings=i||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new $o().parser(i)}_resetState(){r("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new c,this.error=null,this._list=s(),this._stateCounter=0}parse(i){for(this.error&&this._resetState(),this._list.append(i),r("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++,r("parse: state complete. _stateCounter is now: %d",this._stateCounter),r("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return r("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let i=this._list.readUInt8(0),u=i>>t.CMD_SHIFT;this.packet.cmd=t.types[u];let h=i&15,d=t.requiredHeaderFlags[u];return d!=null&&h!==d?this._emitError(new Error(t.requiredHeaderFlagsErrors[u])):(this.packet.retain=(i&t.RETAIN_MASK)!==0,this.packet.qos=i>>t.QOS_SHIFT&t.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(i&t.DUP_MASK)!==0,r("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let i=this._parseVarByteNum(!0);return i&&(this.packet.length=i.value,this._list.consume(i.bytes)),r("_parseLength %d",i.value),!!i}_parsePayload(){r("_parsePayload: payload %O",this._list);let i=!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"))}i=!0}return r("_parsePayload complete result: %s",i),i}_parseConnect(){r("_parseConnect");let i,u,h,d,y={},b=this.packet,w=this._parseString();if(w===null)return this._emitError(new Error("Cannot parse protocolId"));if(w!=="MQTT"&&w!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(b.protocolId=w,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(b.protocolVersion=this._list.readUInt8(this._pos),b.protocolVersion>=128&&(b.bridgeMode=!0,b.protocolVersion=b.protocolVersion-128),b.protocolVersion!==3&&b.protocolVersion!==4&&b.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"));y.username=this._list.readUInt8(this._pos)&t.USERNAME_MASK,y.password=this._list.readUInt8(this._pos)&t.PASSWORD_MASK,y.will=this._list.readUInt8(this._pos)&t.WILL_FLAG_MASK;let S=!!(this._list.readUInt8(this._pos)&t.WILL_RETAIN_MASK),A=(this._list.readUInt8(this._pos)&t.WILL_QOS_MASK)>>t.WILL_QOS_SHIFT;if(y.will)b.will={},b.will.retain=S,b.will.qos=A;else{if(S)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(A)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(b.clean=(this._list.readUInt8(this._pos)&t.CLEAN_SESSION_MASK)!==0,this._pos++,b.keepalive=this._parseNum(),b.keepalive===-1)return this._emitError(new Error("Packet too short"));if(b.protocolVersion===5){let _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(b.properties=_)}let g=this._parseString();if(g===null)return this._emitError(new Error("Packet too short"));if(b.clientId=g,r("_parseConnect: packet.clientId: %s",b.clientId),y.will){if(b.protocolVersion===5){let _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(b.will.properties=_)}if(i=this._parseString(),i===null)return this._emitError(new Error("Cannot parse will topic"));if(b.will.topic=i,r("_parseConnect: packet.will.topic: %s",b.will.topic),u=this._parseBuffer(),u===null)return this._emitError(new Error("Cannot parse will payload"));b.will.payload=u,r("_parseConnect: packet.will.paylaod: %s",b.will.payload)}if(y.username){if(d=this._parseString(),d===null)return this._emitError(new Error("Cannot parse username"));b.username=d,r("_parseConnect: packet.username: %s",b.username)}if(y.password){if(h=this._parseBuffer(),h===null)return this._emitError(new Error("Cannot parse password"));b.password=h}return this.settings=b,r("_parseConnect: complete"),b}_parseConnack(){r("_parseConnack");let i=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(i.sessionPresent=!!(u&t.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?i.reasonCode=this._list.readUInt8(this._pos++):i.reasonCode=0;else{if(this._list.length<2)return null;i.returnCode=this._list.readUInt8(this._pos++)}if(i.returnCode===-1||i.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let h=this._parseProperties();Object.getOwnPropertyNames(h).length&&(i.properties=h)}r("_parseConnack: complete")}_parsePublish(){r("_parsePublish");let i=this.packet;if(i.topic=this._parseString(),i.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(i.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(i.properties=u)}i.payload=this._list.slice(this._pos,i.length),r("_parsePublish: payload from buffer list: %o",i.payload)}}_parseSubscribe(){r("_parseSubscribe");let i=this.packet,u,h,d,y,b,w,S;if(i.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let A=this._parseProperties();Object.getOwnPropertyNames(A).length&&(i.properties=A)}if(i.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<i.length;){if(u=this._parseString(),u===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=i.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(h=this._parseByte(),this.settings.protocolVersion===5){if(h&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(h&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(d=h&t.SUBSCRIBE_OPTIONS_QOS_MASK,d>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(w=(h>>t.SUBSCRIBE_OPTIONS_NL_SHIFT&t.SUBSCRIBE_OPTIONS_NL_MASK)!==0,b=(h>>t.SUBSCRIBE_OPTIONS_RAP_SHIFT&t.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,y=h>>t.SUBSCRIBE_OPTIONS_RH_SHIFT&t.SUBSCRIBE_OPTIONS_RH_MASK,y>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));S={topic:u,qos:d},this.settings.protocolVersion===5?(S.nl=w,S.rap=b,S.rh=y):this.settings.bridgeMode&&(S.rh=0,S.rap=!0,S.nl=!0),r("_parseSubscribe: push subscription `%s` to subscription",S),i.subscriptions.push(S)}}}_parseSuback(){r("_parseSuback");let i=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(i.properties=u)}if(i.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(!t.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(){r("_parseUnsubscribe");let i=this.packet;if(i.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(i.properties=u)}if(i.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<i.length;){let u=this._parseString();if(u===null)return this._emitError(new Error("Cannot parse topic"));r("_parseUnsubscribe: push topic `%s` to unsubscriptions",u),i.unsubscriptions.push(u)}}}_parseUnsuback(){r("_parseUnsuback");let i=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&i.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(i.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&&(i.properties=u),i.granted=[];this._pos<this.packet.length;){let h=this._list.readUInt8(this._pos++);if(!t.MQTT5_UNSUBACK_CODES[h])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(h)}}}_parseConfirmation(){r("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let i=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(i.length>2){switch(i.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!t.MQTT5_PUBACK_PUBREC_CODES[i.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!t.MQTT5_PUBREL_PUBCOMP_CODES[i.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}r("_parseConfirmation: packet.reasonCode `%d`",i.reasonCode)}else i.reasonCode=0;if(i.length>3){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(i.properties=u)}}return!0}_parseDisconnect(){let i=this.packet;if(r("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(i.reasonCode=this._parseByte(),t.MQTT5_DISCONNECT_CODES[i.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):i.reasonCode=0;let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(i.properties=u)}return r("_parseDisconnect result: true"),!0}_parseAuth(){r("_parseAuth");let i=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(i.reasonCode=this._parseByte(),!t.MQTT5_AUTH_CODES[i.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let u=this._parseProperties();return Object.getOwnPropertyNames(u).length&&(i.properties=u),r("_parseAuth: result: true"),!0}_parseMessageId(){let i=this.packet;return i.messageId=this._parseNum(),i.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(r("_parseMessageId: packet.messageId %d",i.messageId),!0)}_parseString(i){let u=this._parseNum(),h=u+this._pos;if(u===-1||h>this._list.length||h>this.packet.length)return null;let d=this._list.toString("utf8",this._pos,h);return this._pos+=u,r("_parseString: result: %s",d),d}_parseStringPair(){return r("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let i=this._parseNum(),u=i+this._pos;if(i===-1||u>this._list.length||u>this.packet.length)return null;let h=this._list.slice(this._pos,u);return this._pos+=i,r("_parseBuffer: result: %o",h),h}_parseNum(){if(this._list.length-this._pos<2)return-1;let i=this._list.readUInt16BE(this._pos);return this._pos+=2,r("_parseNum: result: %s",i),i}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let i=this._list.readUInt32BE(this._pos);return this._pos+=4,r("_parse4ByteNum: result: %s",i),i}_parseVarByteNum(i){r("_parseVarByteNum");let u=4,h=0,d=1,y=0,b=!1,w,S=this._pos?this._pos:0;for(;h<u&&S+h<this._list.length;){if(w=this._list.readUInt8(S+h++),y+=d*(w&t.VARBYTEINT_MASK),d*=128,(w&t.VARBYTEINT_FIN_MASK)===0){b=!0;break}if(this._list.length<=h)break}return!b&&h===u&&this._list.length>=h&&this._emitError(new Error("Invalid variable byte integer")),S&&(this._pos+=h),b?i?b={bytes:h,value:y}:b=y:b=!1,r("_parseVarByteNum: result: %o",b),b}_parseByte(){let i;return this._pos<this._list.length&&(i=this._list.readUInt8(this._pos),this._pos++),r("_parseByte: result: %o",i),i}_parseByType(i){switch(r("_parseByType: type: %s",i),i){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(){r("_parseProperties");let i=this._parseVarByteNum(),u=this._pos+i,h={};for(;this._pos<u;){let d=this._parseByte();if(!d)return this._emitError(new Error("Cannot parse property code type")),!1;let y=t.propertiesCodes[d];if(!y)return this._emitError(new Error("Unknown property")),!1;if(y==="userProperties"){h[y]||(h[y]=Object.create(null));let b=this._parseByType(t.propertiesTypes[y]);if(h[y][b.name])if(Array.isArray(h[y][b.name]))h[y][b.name].push(b.value);else{let w=h[y][b.name];h[y][b.name]=[w],h[y][b.name].push(b.value)}else h[y][b.name]=b.value;continue}h[y]?Array.isArray(h[y])?h[y].push(this._parseByType(t.propertiesTypes[y])):(h[y]=[h[y]],h[y].push(this._parseByType(t.propertiesTypes[y]))):h[y]=this._parseByType(t.propertiesTypes[y])}return h}_newPacket(){return r("_newPacket"),this.packet&&(this._list.consume(this.packet.length),r("_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)),r("_newPacket: new packet"),this.packet=new c,this._pos=0,!0}_emitError(i){r("_emitError",i),this.error=i,this.emit("error",i)}};l.exports=n}),Vu=we((o,l)=>{de(),ye(),ge();var{Buffer:s}=(dt(),tt(pt)),a=65536,c={},t=s.isBuffer(s.from([1,2]).subarray(0,1));function r(u){let h=s.allocUnsafe(2);return h.writeUInt8(u>>8,0),h.writeUInt8(u&255,1),h}function n(){for(let u=0;u<a;u++)c[u]=r(u)}function e(u){let h=0,d=0,y=s.allocUnsafe(4);do h=u%128|0,u=u/128|0,u>0&&(h=h|128),y.writeUInt8(h,d++);while(u>0&&d<4);return u>0&&(d=0),t?y.subarray(0,d):y.slice(0,d)}function i(u){let h=s.allocUnsafe(4);return h.writeUInt32BE(u,0),h}l.exports={cache:c,generateCache:n,generateNumber:r,genBufVariableByteInt:e,generate4ByteBuffer:i}}),zu=we((o,l)=>{de(),ye(),ge(),typeof Je>"u"||!Je.version||Je.version.indexOf("v0.")===0||Je.version.indexOf("v1.")===0&&Je.version.indexOf("v1.8.")!==0?l.exports={nextTick:s}:l.exports=Je;function s(a,c,t,r){if(typeof a!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,e,i;switch(n){case 0:case 1:return Je.nextTick(a);case 2:return Je.nextTick(function(){a.call(null,c)});case 3:return Je.nextTick(function(){a.call(null,c,t)});case 4:return Je.nextTick(function(){a.call(null,c,t,r)});default:for(e=new Array(n-1),i=0;i<e.length;)e[i++]=arguments[i];return Je.nextTick(function(){a.apply(null,e)})}}}),Ss=we((o,l)=>{de(),ye(),ge();var s=_s(),{Buffer:a}=(dt(),tt(pt)),c=a.allocUnsafe(0),t=a.from([0]),r=Vu(),n=zu().nextTick,e=Mt()("mqtt-packet:writeToStream"),i=r.cache,u=r.generateNumber,h=r.generateCache,d=r.genBufVariableByteInt,y=r.generate4ByteBuffer,b=re,w=!0;function S(X,U,ae){switch(e("generate called"),U.cork&&(U.cork(),n(A,U)),w&&(w=!1,h()),e("generate: packet.cmd: %s",X.cmd),X.cmd){case"connect":return g(X,U);case"connack":return _(X,U,ae);case"publish":return E(X,U,ae);case"puback":case"pubrec":case"pubrel":case"pubcomp":return v(X,U,ae);case"subscribe":return C(X,U,ae);case"suback":return T(X,U,ae);case"unsubscribe":return x(X,U,ae);case"unsuback":return P(X,U,ae);case"pingreq":case"pingresp":return O(X,U);case"disconnect":return F(X,U,ae);case"auth":return I(X,U,ae);default:return U.destroy(new Error("Unknown command")),!1}}Object.defineProperty(S,"cacheNumbers",{get(){return b===re},set(X){X?((!i||Object.keys(i).length===0)&&(w=!0),b=re):(w=!1,b=ee)}});function A(X){X.uncork()}function g(X,U,ae){let H=X||{},te=H.protocolId||"MQTT",ne=H.protocolVersion||4,be=H.will,ce=H.clean,N=H.keepalive||0,Y=H.clientId||"",se=H.username,me=H.password,pe=H.properties;ce===void 0&&(ce=!0);let _e=0;if(typeof te!="string"&&!a.isBuffer(te))return U.destroy(new Error("Invalid protocolId")),!1;if(_e+=te.length+2,ne!==3&&ne!==4&&ne!==5)return U.destroy(new Error("Invalid protocol version")),!1;if(_e+=1,(typeof Y=="string"||a.isBuffer(Y))&&(Y||ne>=4)&&(Y||ce))_e+=a.byteLength(Y)+2;else{if(ne<4)return U.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(ce*1===0)return U.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof N!="number"||N<0||N>65535||N%1!==0)return U.destroy(new Error("Invalid keepalive")),!1;_e+=2,_e+=1;let Z,ve;if(ne===5){if(Z=oe(U,pe),!Z)return!1;_e+=Z.length}if(be){if(typeof be!="object")return U.destroy(new Error("Invalid will")),!1;if(!be.topic||typeof be.topic!="string")return U.destroy(new Error("Invalid will topic")),!1;if(_e+=a.byteLength(be.topic)+2,_e+=2,be.payload)if(be.payload.length>=0)typeof be.payload=="string"?_e+=a.byteLength(be.payload):_e+=be.payload.length;else return U.destroy(new Error("Invalid will payload")),!1;if(ve={},ne===5){if(ve=oe(U,be.properties),!ve)return!1;_e+=ve.length}}let ke=!1;if(se!=null)if(Ee(se))ke=!0,_e+=a.byteLength(se)+2;else return U.destroy(new Error("Invalid username")),!1;if(me!=null){if(!ke)return U.destroy(new Error("Username is required to use password")),!1;if(Ee(me))_e+=q(me)+2;else return U.destroy(new Error("Invalid password")),!1}U.write(s.CONNECT_HEADER),V(U,_e),G(U,te),H.bridgeMode&&(ne+=128),U.write(ne===131?s.VERSION131:ne===132?s.VERSION132:ne===4?s.VERSION4:ne===5?s.VERSION5:s.VERSION3);let fe=0;return fe|=se!=null?s.USERNAME_MASK:0,fe|=me!=null?s.PASSWORD_MASK:0,fe|=be&&be.retain?s.WILL_RETAIN_MASK:0,fe|=be&&be.qos?be.qos<<s.WILL_QOS_SHIFT:0,fe|=be?s.WILL_FLAG_MASK:0,fe|=ce?s.CLEAN_SESSION_MASK:0,U.write(a.from([fe])),b(U,N),ne===5&&Z.write(),G(U,Y),be&&(ne===5&&ve.write(),L(U,be.topic),G(U,be.payload)),se!=null&&G(U,se),me!=null&&G(U,me),!0}function _(X,U,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=H===5?te.reasonCode:te.returnCode,be=te.properties,ce=2;if(typeof ne!="number")return U.destroy(new Error("Invalid return code")),!1;let N=null;if(H===5){if(N=oe(U,be),!N)return!1;ce+=N.length}return U.write(s.CONNACK_HEADER),V(U,ce),U.write(te.sessionPresent?s.SESSIONPRESENT_HEADER:t),U.write(a.from([ne])),N==null||N.write(),!0}function E(X,U,ae){e("publish: packet: %o",X);let H=ae?ae.protocolVersion:4,te=X||{},ne=te.qos||0,be=te.retain?s.RETAIN_MASK:0,ce=te.topic,N=te.payload||c,Y=te.messageId,se=te.properties,me=0;if(typeof ce=="string")me+=a.byteLength(ce)+2;else if(a.isBuffer(ce))me+=ce.length+2;else return U.destroy(new Error("Invalid topic")),!1;if(a.isBuffer(N)?me+=N.length:me+=a.byteLength(N),ne&&typeof Y!="number")return U.destroy(new Error("Invalid messageId")),!1;ne&&(me+=2);let pe=null;if(H===5){if(pe=oe(U,se),!pe)return!1;me+=pe.length}return U.write(s.PUBLISH_HEADER[ne][te.dup?1:0][be?1:0]),V(U,me),b(U,q(ce)),U.write(ce),ne>0&&b(U,Y),pe==null||pe.write(),e("publish: payload: %o",N),U.write(N)}function v(X,U,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.cmd||"puback",be=te.messageId,ce=te.dup&&ne==="pubrel"?s.DUP_MASK:0,N=0,Y=te.reasonCode,se=te.properties,me=H===5?3:2;if(ne==="pubrel"&&(N=1),typeof be!="number")return U.destroy(new Error("Invalid messageId")),!1;let pe=null;if(H===5&&typeof se=="object"){if(pe=R(U,se,ae,me),!pe)return!1;me+=pe.length}return U.write(s.ACKS[ne][N][ce][0]),me===3&&(me+=Y!==0?1:-1),V(U,me),b(U,be),H===5&&me!==2&&U.write(a.from([Y])),pe!==null?pe.write():me===4&&U.write(a.from([0])),!0}function C(X,U,ae){e("subscribe: packet: ");let H=ae?ae.protocolVersion:4,te=X||{},ne=te.dup?s.DUP_MASK:0,be=te.messageId,ce=te.subscriptions,N=te.properties,Y=0;if(typeof be!="number")return U.destroy(new Error("Invalid messageId")),!1;Y+=2;let se=null;if(H===5){if(se=oe(U,N),!se)return!1;Y+=se.length}if(typeof ce=="object"&&ce.length)for(let pe=0;pe<ce.length;pe+=1){let _e=ce[pe].topic,Z=ce[pe].qos;if(typeof _e!="string")return U.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof Z!="number")return U.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(H===5){if(typeof(ce[pe].nl||!1)!="boolean")return U.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(ce[pe].rap||!1)!="boolean")return U.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let ve=ce[pe].rh||0;if(typeof ve!="number"||ve>2)return U.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}Y+=a.byteLength(_e)+2+1}else return U.destroy(new Error("Invalid subscriptions")),!1;e("subscribe: writing to stream: %o",s.SUBSCRIBE_HEADER),U.write(s.SUBSCRIBE_HEADER[1][ne?1:0][0]),V(U,Y),b(U,be),se!==null&&se.write();let me=!0;for(let pe of ce){let _e=pe.topic,Z=pe.qos,ve=+pe.nl,ke=+pe.rap,fe=pe.rh,De;L(U,_e),De=s.SUBSCRIBE_OPTIONS_QOS[Z],H===5&&(De|=ve?s.SUBSCRIBE_OPTIONS_NL:0,De|=ke?s.SUBSCRIBE_OPTIONS_RAP:0,De|=fe?s.SUBSCRIBE_OPTIONS_RH[fe]:0),me=U.write(a.from([De]))}return me}function T(X,U,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.messageId,be=te.granted,ce=te.properties,N=0;if(typeof ne!="number")return U.destroy(new Error("Invalid messageId")),!1;if(N+=2,typeof be=="object"&&be.length)for(let se=0;se<be.length;se+=1){if(typeof be[se]!="number")return U.destroy(new Error("Invalid qos vector")),!1;N+=1}else return U.destroy(new Error("Invalid qos vector")),!1;let Y=null;if(H===5){if(Y=R(U,ce,ae,N),!Y)return!1;N+=Y.length}return U.write(s.SUBACK_HEADER),V(U,N),b(U,ne),Y!==null&&Y.write(),U.write(a.from(be))}function x(X,U,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.messageId,be=te.dup?s.DUP_MASK:0,ce=te.unsubscriptions,N=te.properties,Y=0;if(typeof ne!="number")return U.destroy(new Error("Invalid messageId")),!1;if(Y+=2,typeof ce=="object"&&ce.length)for(let pe=0;pe<ce.length;pe+=1){if(typeof ce[pe]!="string")return U.destroy(new Error("Invalid unsubscriptions")),!1;Y+=a.byteLength(ce[pe])+2}else return U.destroy(new Error("Invalid unsubscriptions")),!1;let se=null;if(H===5){if(se=oe(U,N),!se)return!1;Y+=se.length}U.write(s.UNSUBSCRIBE_HEADER[1][be?1:0][0]),V(U,Y),b(U,ne),se!==null&&se.write();let me=!0;for(let pe=0;pe<ce.length;pe++)me=L(U,ce[pe]);return me}function P(X,U,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.messageId,be=te.dup?s.DUP_MASK:0,ce=te.granted,N=te.properties,Y=te.cmd,se=0,me=2;if(typeof ne!="number")return U.destroy(new Error("Invalid messageId")),!1;if(H===5)if(typeof ce=="object"&&ce.length)for(let _e=0;_e<ce.length;_e+=1){if(typeof ce[_e]!="number")return U.destroy(new Error("Invalid qos vector")),!1;me+=1}else return U.destroy(new Error("Invalid qos vector")),!1;let pe=null;if(H===5){if(pe=R(U,N,ae,me),!pe)return!1;me+=pe.length}return U.write(s.ACKS[Y][se][be][0]),V(U,me),b(U,ne),pe!==null&&pe.write(),H===5&&U.write(a.from(ce)),!0}function O(X,U,ae){return U.write(s.EMPTY[X.cmd])}function F(X,U,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.reasonCode,be=te.properties,ce=H===5?1:0,N=null;if(H===5){if(N=R(U,be,ae,ce),!N)return!1;ce+=N.length}return U.write(a.from([s.codes.disconnect<<4])),V(U,ce),H===5&&U.write(a.from([ne])),N!==null&&N.write(),!0}function I(X,U,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.reasonCode,be=te.properties,ce=H===5?1:0;H!==5&&U.destroy(new Error("Invalid mqtt version for auth packet"));let N=R(U,be,ae,ce);return N?(ce+=N.length,U.write(a.from([s.codes.auth<<4])),V(U,ce),U.write(a.from([ne])),N!==null&&N.write(),!0):!1}var W={};function V(X,U){if(U>s.VARBYTEINT_MAX)return X.destroy(new Error(`Invalid variable byte integer: ${U}`)),!1;let ae=W[U];return ae||(ae=d(U),U<16384&&(W[U]=ae)),e("writeVarByteInt: writing to stream: %o",ae),X.write(ae)}function L(X,U){let ae=a.byteLength(U);return b(X,ae),e("writeString: %s",U),X.write(U,"utf8")}function le(X,U,ae){L(X,U),L(X,ae)}function re(X,U){return e("writeNumberCached: number: %d",U),e("writeNumberCached: %o",i[U]),X.write(i[U])}function ee(X,U){let ae=u(U);return e("writeNumberGenerated: %o",ae),X.write(ae)}function ue(X,U){let ae=y(U);return e("write4ByteNumber: %o",ae),X.write(ae)}function G(X,U){typeof U=="string"?L(X,U):U?(b(X,U.length),X.write(U)):b(X,0)}function oe(X,U){if(typeof U!="object"||U.length!=null)return{length:1,write(){he(X,{},0)}};let ae=0;function H(te,ne){let be=s.propertiesTypes[te],ce=0;switch(be){case"byte":{if(typeof ne!="boolean")return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=2;break}case"int8":{if(typeof ne!="number"||ne<0||ne>255)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=2;break}case"binary":{if(ne&&ne===null)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=1+a.byteLength(ne)+2;break}case"int16":{if(typeof ne!="number"||ne<0||ne>65535)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=3;break}case"int32":{if(typeof ne!="number"||ne<0||ne>4294967295)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=5;break}case"var":{if(typeof ne!="number"||ne<0||ne>268435455)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=1+a.byteLength(d(ne));break}case"string":{if(typeof ne!="string")return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=3+a.byteLength(ne.toString());break}case"pair":{if(typeof ne!="object")return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=Object.getOwnPropertyNames(ne).reduce((N,Y)=>{let se=ne[Y];return Array.isArray(se)?N+=se.reduce((me,pe)=>(me+=3+a.byteLength(Y.toString())+2+a.byteLength(pe.toString()),me),0):N+=3+a.byteLength(Y.toString())+2+a.byteLength(ne[Y].toString()),N},0);break}default:return X.destroy(new Error(`Invalid property ${te}: ${ne}`)),!1}return ce}if(U)for(let te in U){let ne=0,be=0,ce=U[te];if(ce!==void 0){if(Array.isArray(ce))for(let N=0;N<ce.length;N++){if(be=H(te,ce[N]),!be)return!1;ne+=be}else{if(be=H(te,ce),!be)return!1;ne=be}if(!ne)return!1;ae+=ne}}return{length:a.byteLength(d(ae))+ae,write(){he(X,U,ae)}}}function R(X,U,ae,H){let te=["reasonString","userProperties"],ne=ae&&ae.properties&&ae.properties.maximumPacketSize?ae.properties.maximumPacketSize:0,be=oe(X,U);if(ne)for(;H+be.length>ne;){let ce=te.shift();if(ce&&U[ce])delete U[ce],be=oe(X,U);else return!1}return be}function Q(X,U,ae){switch(s.propertiesTypes[U]){case"byte":{X.write(a.from([s.properties[U]])),X.write(a.from([+ae]));break}case"int8":{X.write(a.from([s.properties[U]])),X.write(a.from([ae]));break}case"binary":{X.write(a.from([s.properties[U]])),G(X,ae);break}case"int16":{X.write(a.from([s.properties[U]])),b(X,ae);break}case"int32":{X.write(a.from([s.properties[U]])),ue(X,ae);break}case"var":{X.write(a.from([s.properties[U]])),V(X,ae);break}case"string":{X.write(a.from([s.properties[U]])),L(X,ae);break}case"pair":{Object.getOwnPropertyNames(ae).forEach(H=>{let te=ae[H];Array.isArray(te)?te.forEach(ne=>{X.write(a.from([s.properties[U]])),le(X,H.toString(),ne.toString())}):(X.write(a.from([s.properties[U]])),le(X,H.toString(),te.toString()))});break}default:return X.destroy(new Error(`Invalid property ${U} value: ${ae}`)),!1}}function he(X,U,ae){V(X,ae);for(let H in U)if(Object.prototype.hasOwnProperty.call(U,H)&&U[H]!=null){let te=U[H];if(Array.isArray(te))for(let ne=0;ne<te.length;ne++)Q(X,H,te[ne]);else Q(X,H,te)}}function q(X){return X?X instanceof a?X.length:a.byteLength(X):0}function Ee(X){return typeof X=="string"||X instanceof a}l.exports=S}),Ku=we((o,l)=>{de(),ye(),ge();var s=Ss(),{EventEmitter:a}=(Qt(),tt(Dt)),{Buffer:c}=(dt(),tt(pt));function t(n,e){let i=new r;return s(n,i,e),i.concat()}var r=class extends a{constructor(){super(),this._array=new Array(20),this._i=0}write(n){return this._array[this._i++]=n,!0}concat(){let n=0,e=new Array(this._array.length),i=this._array,u=0,h;for(h=0;h<i.length&&i[h]!==void 0;h++)typeof i[h]!="string"?e[h]=i[h].length:e[h]=c.byteLength(i[h]),n+=e[h];let d=c.allocUnsafe(n);for(h=0;h<i.length&&i[h]!==void 0;h++)typeof i[h]!="string"?(i[h].copy(d,u),u+=e[h]):(d.write(i[h],u),u+=e[h]);return d}destroy(n){n&&this.emit("error",n)}};l.exports=t}),Hu=we(o=>{de(),ye(),ge(),o.parser=qu().parser,o.generate=Ku(),o.writeToStream=Ss()}),Gu=we((o,l)=>{de(),ye(),ge(),l.exports=a;function s(t){return t instanceof xr?xr.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function a(t){if(t=t||{},t.circles)return c(t);let r=new Map;if(r.set(Date,h=>new Date(h)),r.set(Map,(h,d)=>new Map(e(Array.from(h),d))),r.set(Set,(h,d)=>new Set(e(Array.from(h),d))),t.constructorHandlers)for(let h of t.constructorHandlers)r.set(h[0],h[1]);let n=null;return t.proto?u:i;function e(h,d){let y=Object.keys(h),b=new Array(y.length);for(let w=0;w<y.length;w++){let S=y[w],A=h[S];typeof A!="object"||A===null?b[S]=A:A.constructor!==Object&&(n=r.get(A.constructor))?b[S]=n(A,d):ArrayBuffer.isView(A)?b[S]=s(A):b[S]=d(A)}return b}function i(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return e(h,i);if(h.constructor!==Object&&(n=r.get(h.constructor)))return n(h,i);let d={};for(let y in h){if(Object.hasOwnProperty.call(h,y)===!1)continue;let b=h[y];typeof b!="object"||b===null?d[y]=b:b.constructor!==Object&&(n=r.get(b.constructor))?d[y]=n(b,i):ArrayBuffer.isView(b)?d[y]=s(b):d[y]=i(b)}return d}function u(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return e(h,u);if(h.constructor!==Object&&(n=r.get(h.constructor)))return n(h,u);let d={};for(let y in h){let b=h[y];typeof b!="object"||b===null?d[y]=b:b.constructor!==Object&&(n=r.get(b.constructor))?d[y]=n(b,u):ArrayBuffer.isView(b)?d[y]=s(b):d[y]=u(b)}return d}}function c(t){let r=[],n=[],e=new Map;if(e.set(Date,y=>new Date(y)),e.set(Map,(y,b)=>new Map(u(Array.from(y),b))),e.set(Set,(y,b)=>new Set(u(Array.from(y),b))),t.constructorHandlers)for(let y of t.constructorHandlers)e.set(y[0],y[1]);let i=null;return t.proto?d:h;function u(y,b){let w=Object.keys(y),S=new Array(w.length);for(let A=0;A<w.length;A++){let g=w[A],_=y[g];if(typeof _!="object"||_===null)S[g]=_;else if(_.constructor!==Object&&(i=e.get(_.constructor)))S[g]=i(_,b);else if(ArrayBuffer.isView(_))S[g]=s(_);else{let E=r.indexOf(_);E!==-1?S[g]=n[E]:S[g]=b(_)}}return S}function h(y){if(typeof y!="object"||y===null)return y;if(Array.isArray(y))return u(y,h);if(y.constructor!==Object&&(i=e.get(y.constructor)))return i(y,h);let b={};r.push(y),n.push(b);for(let w in y){if(Object.hasOwnProperty.call(y,w)===!1)continue;let S=y[w];if(typeof S!="object"||S===null)b[w]=S;else if(S.constructor!==Object&&(i=e.get(S.constructor)))b[w]=i(S,h);else if(ArrayBuffer.isView(S))b[w]=s(S);else{let A=r.indexOf(S);A!==-1?b[w]=n[A]:b[w]=h(S)}}return r.pop(),n.pop(),b}function d(y){if(typeof y!="object"||y===null)return y;if(Array.isArray(y))return u(y,d);if(y.constructor!==Object&&(i=e.get(y.constructor)))return i(y,d);let b={};r.push(y),n.push(b);for(let w in y){let S=y[w];if(typeof S!="object"||S===null)b[w]=S;else if(S.constructor!==Object&&(i=e.get(S.constructor)))b[w]=i(S,d);else if(ArrayBuffer.isView(S))b[w]=s(S);else{let A=r.indexOf(S);A!==-1?b[w]=n[A]:b[w]=d(S)}}return r.pop(),n.pop(),b}}}),Yu=we((o,l)=>{de(),ye(),ge(),l.exports=Gu()()}),Qu=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.validateTopic=l,o.validateTopics=s;function l(a){let c=a.split("/");for(let t=0;t<c.length;t++)if(c[t]!=="+"){if(c[t]==="#")return t===c.length-1;if(c[t].indexOf("+")!==-1||c[t].indexOf("#")!==-1)return!1}return!0}function s(a){if(a.length===0)return"empty_topic_list";for(let c=0;c<a.length;c++)if(!l(a[c]))return a[c];return null}}),Es=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=Xt(),s={objectMode:!0},a={clean:!0},c=class{constructor(t){Pe(this,"options");Pe(this,"_inflights");this.options=t||{},this.options={...a,...t},this._inflights=new Map}put(t,r){return this._inflights.set(t.messageId,t),r&&r(),this}createStream(){let t=new l.Readable(s),r=[],n=!1,e=0;return this._inflights.forEach((i,u)=>{r.push(i)}),t._read=()=>{!n&&e<r.length?t.push(r[e++]):t.push(null)},t.destroy=i=>{if(!n)return n=!0,setTimeout(()=>{t.emit("close")},0),t},t}del(t,r){let n=this._inflights.get(t.messageId);return n?(this._inflights.delete(t.messageId),r(null,n)):r&&r(new Error("missing packet")),this}get(t,r){let n=this._inflights.get(t.messageId);return n?r(null,n):r&&r(new Error("missing packet")),this}close(t){this.options.clean&&(this._inflights=null),t&&t()}};o.default=c}),Ju=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=[0,16,128,131,135,144,145,151,153],s=(a,c,t)=>{a.log("handlePublish: packet %o",c),t=typeof t<"u"?t:a.noop;let r=c.topic.toString(),n=c.payload,{qos:e}=c,{messageId:i}=c,{options:u}=a;if(a.options.protocolVersion===5){let h;if(c.properties&&(h=c.properties.topicAlias),typeof h<"u")if(r.length===0)if(h>0&&h<=65535){let d=a.topicAliasRecv.getTopicByAlias(h);if(d)r=d,a.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",r,h);else{a.log("handlePublish :: unregistered topic alias. alias: %d",h),a.emit("error",new Error("Received unregistered Topic Alias"));return}}else{a.log("handlePublish :: topic alias out of range. alias: %d",h),a.emit("error",new Error("Received Topic Alias is out of range"));return}else if(a.topicAliasRecv.put(r,h))a.log("handlePublish :: registered topic: %s - alias: %d",r,h);else{a.log("handlePublish :: topic alias out of range. alias: %d",h),a.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(a.log("handlePublish: qos %d",e),e){case 2:{u.customHandleAcks(r,n,c,(h,d)=>{if(typeof h=="number"&&(d=h,h=null),h)return a.emit("error",h);if(l.indexOf(d)===-1)return a.emit("error",new Error("Wrong reason code for pubrec"));d?a._sendPacket({cmd:"pubrec",messageId:i,reasonCode:d},t):a.incomingStore.put(c,()=>{a._sendPacket({cmd:"pubrec",messageId:i},t)})});break}case 1:{u.customHandleAcks(r,n,c,(h,d)=>{if(typeof h=="number"&&(d=h,h=null),h)return a.emit("error",h);if(l.indexOf(d)===-1)return a.emit("error",new Error("Wrong reason code for puback"));d||a.emit("message",r,n,c),a.handleMessage(c,y=>{if(y)return t&&t(y);a._sendPacket({cmd:"puback",messageId:i,reasonCode:d},t)})});break}case 0:a.emit("message",r,n,c),a.handleMessage(c,t);break;default:a.log("handlePublish: unknown QoS. Doing nothing.");break}};o.default=s}),Xu=we((o,l)=>{l.exports={version:"5.14.1"}}),ar=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.MQTTJS_VERSION=o.nextTick=o.ErrorWithSubackPacket=o.ErrorWithReasonCode=void 0,o.applyMixin=a;var l=class lu extends Error{constructor(r,n){super(r);Pe(this,"code");this.code=n,Object.setPrototypeOf(this,lu.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};o.ErrorWithReasonCode=l;var s=class uu extends Error{constructor(r,n){super(r);Pe(this,"packet");this.packet=n,Object.setPrototypeOf(this,uu.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};o.ErrorWithSubackPacket=s;function a(c,t,r=!1){let n=[t];for(;;){let e=n[0],i=Object.getPrototypeOf(e);if(i!=null&&i.prototype)n.unshift(i);else break}for(let e of n)for(let i of Object.getOwnPropertyNames(e.prototype))(r||i!=="constructor")&&Object.defineProperty(c.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i)??Object.create(null))}o.nextTick=typeof(Je==null?void 0:Je.nextTick)=="function"?Je.nextTick:c=>{setTimeout(c,0)},o.MQTTJS_VERSION=Xu().version}),Tr=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.ReasonCodes=void 0;var l=ar();o.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 s=(a,c)=>{let{messageId:t}=c,r=c.cmd,n=null,e=a.outgoing[t]?a.outgoing[t].cb:null,i=null;if(!e){a.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(a.log("_handleAck :: packet type",r),r){case"pubcomp":case"puback":{let u=c.reasonCode;u&&u>0&&u!==16?(i=new l.ErrorWithReasonCode(`Publish error: ${o.ReasonCodes[u]}`,u),a._removeOutgoingAndStoreMessage(t,()=>{e(i,c)})):a._removeOutgoingAndStoreMessage(t,e);break}case"pubrec":{n={cmd:"pubrel",qos:2,messageId:t};let u=c.reasonCode;u&&u>0&&u!==16?(i=new l.ErrorWithReasonCode(`Publish error: ${o.ReasonCodes[u]}`,u),a._removeOutgoingAndStoreMessage(t,()=>{e(i,c)})):a._sendPacket(n);break}case"suback":{delete a.outgoing[t],a.messageIdProvider.deallocate(t);let u=c.granted;for(let h=0;h<u.length;h++){let d=u[h];if(d&128){i=new Error(`Subscribe error: ${o.ReasonCodes[d]}`),i.code=d;let y=a.messageIdToTopic[t];y&&y.forEach(b=>{delete a._resubscribeTopics[b]})}}delete a.messageIdToTopic[t],a._invokeStoreProcessingQueue(),e(i,c);break}case"unsuback":{delete a.outgoing[t],a.messageIdProvider.deallocate(t),a._invokeStoreProcessingQueue(),e(null,c);break}default:a.emit("error",new Error("unrecognized packet type"))}a.disconnecting&&Object.keys(a.outgoing).length===0&&a.emit("outgoingEmpty")};o.default=s}),Zu=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=ar(),s=Tr(),a=(c,t)=>{let{options:r}=c,n=r.protocolVersion,e=n===5?t.reasonCode:t.returnCode;if(n!==5){let i=new l.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${n}`,e);c.emit("error",i);return}c.handleAuth(t,(i,u)=>{if(i){c.emit("error",i);return}if(e===24)c.reconnecting=!1,c._sendPacket(u);else{let h=new l.ErrorWithReasonCode(`Connection refused: ${s.ReasonCodes[e]}`,e);c.emit("error",h)}})};o.default=a}),ec=we(o=>{var y,b,w,S,A,g,_,E,v,C,T,x,P,O,F,I,W,V,L,le,re,ee,ue,G,oe,R,Q,he,q,qo,X,U,ae,H,cu,ne,be,ce,Vt,zt,Vo,un,cn,ot,zo,Sr,Kt,Ko,De;de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.LRUCache=void 0;var l=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,s=new Set,a=typeof Je=="object"&&Je?Je:{},c=(f,p,m,k)=>{typeof a.emitWarning=="function"?a.emitWarning(f,p,m,k):console.error(`[${m}] ${p}: ${f}`)},t=globalThis.AbortController,r=globalThis.AbortSignal;if(typeof t>"u"){r=class{constructor(){Pe(this,"onabort");Pe(this,"_onabort",[]);Pe(this,"reason");Pe(this,"aborted",!1)}addEventListener(m,k){this._onabort.push(k)}},t=class{constructor(){Pe(this,"signal",new r);p()}abort(m){var k,M;if(!this.signal.aborted){this.signal.reason=m,this.signal.aborted=!0;for(let z of this.signal._onabort)z(m);(M=(k=this.signal).onabort)==null||M.call(k,m)}}};let f=((y=a.env)==null?void 0:y.LRU_CACHE_IGNORE_AC_WARNING)!=="1",p=()=>{f&&(f=!1,c("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",p))}}var n=f=>!s.has(f),e=f=>f&&f===Math.floor(f)&&f>0&&isFinite(f),i=f=>e(f)?f<=Math.pow(2,8)?Uint8Array:f<=Math.pow(2,16)?Uint16Array:f<=Math.pow(2,32)?Uint32Array:f<=Number.MAX_SAFE_INTEGER?u:null:null,u=class extends Array{constructor(f){super(f),this.fill(0)}},h=(b=class{constructor(p,m){Pe(this,"heap");Pe(this,"length");if(!D(b,w))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new m(p),this.length=0}static create(p){let m=i(p);if(!m)return[];$e(b,w,!0);let k=new b(p,m);return $e(b,w,!1),k}push(p){this.heap[this.length++]=p}pop(){return this.heap[--this.length]}},w=new WeakMap,Qe(b,w,!1),b),d=(De=class{constructor(p){Qe(this,q);Qe(this,g);Qe(this,_);Qe(this,E);Qe(this,v);Qe(this,C);Qe(this,T);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");Qe(this,x);Qe(this,P);Qe(this,O);Qe(this,F);Qe(this,I);Qe(this,W);Qe(this,V);Qe(this,L);Qe(this,le);Qe(this,re);Qe(this,ee);Qe(this,ue);Qe(this,G);Qe(this,oe);Qe(this,R);Qe(this,Q);Qe(this,he);Qe(this,X,()=>{});Qe(this,U,()=>{});Qe(this,ae,()=>{});Qe(this,H,()=>!1);Qe(this,ne,p=>{});Qe(this,be,(p,m,k)=>{});Qe(this,ce,(p,m,k,M)=>{if(k||M)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Pe(this,S,"LRUCache");let{max:m=0,ttl:k,ttlResolution:M=1,ttlAutopurge:z,updateAgeOnGet:ie,updateAgeOnHas:$,allowStale:J,dispose:Te,disposeAfter:Me,noDisposeOnSet:Ne,noUpdateTTL:Fe,maxSize:nt=0,maxEntrySize:rt=0,sizeCalculation:Ke,fetchMethod:Xe,memoMethod:Ue,noDeleteOnFetchRejection:Ye,noDeleteOnStaleGet:Ze,allowStaleOnFetchRejection:lt,allowStaleOnFetchAbort:ct,ignoreFetchAbort:Et}=p;if(m!==0&&!e(m))throw new TypeError("max option must be a nonnegative integer");let j=m?i(m):Array;if(!j)throw new Error("invalid max value: "+m);if($e(this,g,m),$e(this,_,nt),this.maxEntrySize=rt||D(this,_),this.sizeCalculation=Ke,this.sizeCalculation){if(!D(this,_)&&!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(Ue!==void 0&&typeof Ue!="function")throw new TypeError("memoMethod must be a function if defined");if($e(this,T,Ue),Xe!==void 0&&typeof Xe!="function")throw new TypeError("fetchMethod must be a function if specified");if($e(this,C,Xe),$e(this,Q,!!Xe),$e(this,O,new Map),$e(this,F,new Array(m).fill(void 0)),$e(this,I,new Array(m).fill(void 0)),$e(this,W,new j(m)),$e(this,V,new j(m)),$e(this,L,0),$e(this,le,0),$e(this,re,h.create(m)),$e(this,x,0),$e(this,P,0),typeof Te=="function"&&$e(this,E,Te),typeof Me=="function"?($e(this,v,Me),$e(this,ee,[])):($e(this,v,void 0),$e(this,ee,void 0)),$e(this,R,!!D(this,E)),$e(this,he,!!D(this,v)),this.noDisposeOnSet=!!Ne,this.noUpdateTTL=!!Fe,this.noDeleteOnFetchRejection=!!Ye,this.allowStaleOnFetchRejection=!!lt,this.allowStaleOnFetchAbort=!!ct,this.ignoreFetchAbort=!!Et,this.maxEntrySize!==0){if(D(this,_)!==0&&!e(D(this,_)))throw new TypeError("maxSize must be a positive integer if specified");if(!e(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Le(this,q,cu).call(this)}if(this.allowStale=!!J,this.noDeleteOnStaleGet=!!Ze,this.updateAgeOnGet=!!ie,this.updateAgeOnHas=!!$,this.ttlResolution=e(M)||M===0?M:1,this.ttlAutopurge=!!z,this.ttl=k||0,this.ttl){if(!e(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Le(this,q,qo).call(this)}if(D(this,g)===0&&this.ttl===0&&D(this,_)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!D(this,g)&&!D(this,_)){let B="LRU_CACHE_UNBOUNDED";n(B)&&(s.add(B),c("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",B,De))}}static unsafeExposeInternals(p){return{starts:D(p,G),ttls:D(p,oe),sizes:D(p,ue),keyMap:D(p,O),keyList:D(p,F),valList:D(p,I),next:D(p,W),prev:D(p,V),get head(){return D(p,L)},get tail(){return D(p,le)},free:D(p,re),isBackgroundFetch:m=>{var k;return Le(k=p,q,ot).call(k,m)},backgroundFetch:(m,k,M,z)=>{var ie;return Le(ie=p,q,cn).call(ie,m,k,M,z)},moveToTail:m=>{var k;return Le(k=p,q,Sr).call(k,m)},indexes:m=>{var k;return Le(k=p,q,Vt).call(k,m)},rindexes:m=>{var k;return Le(k=p,q,zt).call(k,m)},isStale:m=>{var k;return D(k=p,H).call(k,m)}}}get max(){return D(this,g)}get maxSize(){return D(this,_)}get calculatedSize(){return D(this,P)}get size(){return D(this,x)}get fetchMethod(){return D(this,C)}get memoMethod(){return D(this,T)}get dispose(){return D(this,E)}get disposeAfter(){return D(this,v)}getRemainingTTL(p){return D(this,O).has(p)?1/0:0}*entries(){for(let p of Le(this,q,Vt).call(this))D(this,I)[p]!==void 0&&D(this,F)[p]!==void 0&&!Le(this,q,ot).call(this,D(this,I)[p])&&(yield[D(this,F)[p],D(this,I)[p]])}*rentries(){for(let p of Le(this,q,zt).call(this))D(this,I)[p]!==void 0&&D(this,F)[p]!==void 0&&!Le(this,q,ot).call(this,D(this,I)[p])&&(yield[D(this,F)[p],D(this,I)[p]])}*keys(){for(let p of Le(this,q,Vt).call(this)){let m=D(this,F)[p];m!==void 0&&!Le(this,q,ot).call(this,D(this,I)[p])&&(yield m)}}*rkeys(){for(let p of Le(this,q,zt).call(this)){let m=D(this,F)[p];m!==void 0&&!Le(this,q,ot).call(this,D(this,I)[p])&&(yield m)}}*values(){for(let p of Le(this,q,Vt).call(this))D(this,I)[p]!==void 0&&!Le(this,q,ot).call(this,D(this,I)[p])&&(yield D(this,I)[p])}*rvalues(){for(let p of Le(this,q,zt).call(this))D(this,I)[p]!==void 0&&!Le(this,q,ot).call(this,D(this,I)[p])&&(yield D(this,I)[p])}[(A=Symbol.iterator,S=Symbol.toStringTag,A)](){return this.entries()}find(p,m={}){for(let k of Le(this,q,Vt).call(this)){let M=D(this,I)[k],z=Le(this,q,ot).call(this,M)?M.__staleWhileFetching:M;if(z!==void 0&&p(z,D(this,F)[k],this))return this.get(D(this,F)[k],m)}}forEach(p,m=this){for(let k of Le(this,q,Vt).call(this)){let M=D(this,I)[k],z=Le(this,q,ot).call(this,M)?M.__staleWhileFetching:M;z!==void 0&&p.call(m,z,D(this,F)[k],this)}}rforEach(p,m=this){for(let k of Le(this,q,zt).call(this)){let M=D(this,I)[k],z=Le(this,q,ot).call(this,M)?M.__staleWhileFetching:M;z!==void 0&&p.call(m,z,D(this,F)[k],this)}}purgeStale(){let p=!1;for(let m of Le(this,q,zt).call(this,{allowStale:!0}))D(this,H).call(this,m)&&(Le(this,q,Kt).call(this,D(this,F)[m],"expire"),p=!0);return p}info(p){let m=D(this,O).get(p);if(m===void 0)return;let k=D(this,I)[m],M=Le(this,q,ot).call(this,k)?k.__staleWhileFetching:k;if(M===void 0)return;let z={value:M};if(D(this,oe)&&D(this,G)){let ie=D(this,oe)[m],$=D(this,G)[m];if(ie&&$){let J=ie-(l.now()-$);z.ttl=J,z.start=Date.now()}}return D(this,ue)&&(z.size=D(this,ue)[m]),z}dump(){let p=[];for(let m of Le(this,q,Vt).call(this,{allowStale:!0})){let k=D(this,F)[m],M=D(this,I)[m],z=Le(this,q,ot).call(this,M)?M.__staleWhileFetching:M;if(z===void 0||k===void 0)continue;let ie={value:z};if(D(this,oe)&&D(this,G)){ie.ttl=D(this,oe)[m];let $=l.now()-D(this,G)[m];ie.start=Math.floor(Date.now()-$)}D(this,ue)&&(ie.size=D(this,ue)[m]),p.unshift([k,ie])}return p}load(p){this.clear();for(let[m,k]of p){if(k.start){let M=Date.now()-k.start;k.start=l.now()-M}this.set(m,k.value,k)}}set(p,m,k={}){var Fe,nt,rt,Ke,Xe;if(m===void 0)return this.delete(p),this;let{ttl:M=this.ttl,start:z,noDisposeOnSet:ie=this.noDisposeOnSet,sizeCalculation:$=this.sizeCalculation,status:J}=k,{noUpdateTTL:Te=this.noUpdateTTL}=k,Me=D(this,ce).call(this,p,m,k.size||0,$);if(this.maxEntrySize&&Me>this.maxEntrySize)return J&&(J.set="miss",J.maxEntrySizeExceeded=!0),Le(this,q,Kt).call(this,p,"set"),this;let Ne=D(this,x)===0?void 0:D(this,O).get(p);if(Ne===void 0)Ne=D(this,x)===0?D(this,le):D(this,re).length!==0?D(this,re).pop():D(this,x)===D(this,g)?Le(this,q,un).call(this,!1):D(this,x),D(this,F)[Ne]=p,D(this,I)[Ne]=m,D(this,O).set(p,Ne),D(this,W)[D(this,le)]=Ne,D(this,V)[Ne]=D(this,le),$e(this,le,Ne),ln(this,x)._++,D(this,be).call(this,Ne,Me,J),J&&(J.set="add"),Te=!1;else{Le(this,q,Sr).call(this,Ne);let Ue=D(this,I)[Ne];if(m!==Ue){if(D(this,Q)&&Le(this,q,ot).call(this,Ue)){Ue.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Ye}=Ue;Ye!==void 0&&!ie&&(D(this,R)&&((Fe=D(this,E))==null||Fe.call(this,Ye,p,"set")),D(this,he)&&((nt=D(this,ee))==null||nt.push([Ye,p,"set"])))}else ie||(D(this,R)&&((rt=D(this,E))==null||rt.call(this,Ue,p,"set")),D(this,he)&&((Ke=D(this,ee))==null||Ke.push([Ue,p,"set"])));if(D(this,ne).call(this,Ne),D(this,be).call(this,Ne,Me,J),D(this,I)[Ne]=m,J){J.set="replace";let Ye=Ue&&Le(this,q,ot).call(this,Ue)?Ue.__staleWhileFetching:Ue;Ye!==void 0&&(J.oldValue=Ye)}}else J&&(J.set="update")}if(M!==0&&!D(this,oe)&&Le(this,q,qo).call(this),D(this,oe)&&(Te||D(this,ae).call(this,Ne,M,z),J&&D(this,U).call(this,J,Ne)),!ie&&D(this,he)&&D(this,ee)){let Ue=D(this,ee),Ye;for(;Ye=Ue==null?void 0:Ue.shift();)(Xe=D(this,v))==null||Xe.call(this,...Ye)}return this}pop(){var p;try{for(;D(this,x);){let m=D(this,I)[D(this,L)];if(Le(this,q,un).call(this,!0),Le(this,q,ot).call(this,m)){if(m.__staleWhileFetching)return m.__staleWhileFetching}else if(m!==void 0)return m}}finally{if(D(this,he)&&D(this,ee)){let m=D(this,ee),k;for(;k=m==null?void 0:m.shift();)(p=D(this,v))==null||p.call(this,...k)}}}has(p,m={}){let{updateAgeOnHas:k=this.updateAgeOnHas,status:M}=m,z=D(this,O).get(p);if(z!==void 0){let ie=D(this,I)[z];if(Le(this,q,ot).call(this,ie)&&ie.__staleWhileFetching===void 0)return!1;if(D(this,H).call(this,z))M&&(M.has="stale",D(this,U).call(this,M,z));else return k&&D(this,X).call(this,z),M&&(M.has="hit",D(this,U).call(this,M,z)),!0}else M&&(M.has="miss");return!1}peek(p,m={}){let{allowStale:k=this.allowStale}=m,M=D(this,O).get(p);if(M===void 0||!k&&D(this,H).call(this,M))return;let z=D(this,I)[M];return Le(this,q,ot).call(this,z)?z.__staleWhileFetching:z}async fetch(p,m={}){let{allowStale:k=this.allowStale,updateAgeOnGet:M=this.updateAgeOnGet,noDeleteOnStaleGet:z=this.noDeleteOnStaleGet,ttl:ie=this.ttl,noDisposeOnSet:$=this.noDisposeOnSet,size:J=0,sizeCalculation:Te=this.sizeCalculation,noUpdateTTL:Me=this.noUpdateTTL,noDeleteOnFetchRejection:Ne=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Fe=this.allowStaleOnFetchRejection,ignoreFetchAbort:nt=this.ignoreFetchAbort,allowStaleOnFetchAbort:rt=this.allowStaleOnFetchAbort,context:Ke,forceRefresh:Xe=!1,status:Ue,signal:Ye}=m;if(!D(this,Q))return Ue&&(Ue.fetch="get"),this.get(p,{allowStale:k,updateAgeOnGet:M,noDeleteOnStaleGet:z,status:Ue});let Ze={allowStale:k,updateAgeOnGet:M,noDeleteOnStaleGet:z,ttl:ie,noDisposeOnSet:$,size:J,sizeCalculation:Te,noUpdateTTL:Me,noDeleteOnFetchRejection:Ne,allowStaleOnFetchRejection:Fe,allowStaleOnFetchAbort:rt,ignoreFetchAbort:nt,status:Ue,signal:Ye},lt=D(this,O).get(p);if(lt===void 0){Ue&&(Ue.fetch="miss");let ct=Le(this,q,cn).call(this,p,lt,Ze,Ke);return ct.__returned=ct}else{let ct=D(this,I)[lt];if(Le(this,q,ot).call(this,ct)){let xe=k&&ct.__staleWhileFetching!==void 0;return Ue&&(Ue.fetch="inflight",xe&&(Ue.returnedStale=!0)),xe?ct.__staleWhileFetching:ct.__returned=ct}let Et=D(this,H).call(this,lt);if(!Xe&&!Et)return Ue&&(Ue.fetch="hit"),Le(this,q,Sr).call(this,lt),M&&D(this,X).call(this,lt),Ue&&D(this,U).call(this,Ue,lt),ct;let j=Le(this,q,cn).call(this,p,lt,Ze,Ke),B=j.__staleWhileFetching!==void 0&&k;return Ue&&(Ue.fetch=Et?"stale":"refresh",B&&Et&&(Ue.returnedStale=!0)),B?j.__staleWhileFetching:j.__returned=j}}async forceFetch(p,m={}){let k=await this.fetch(p,m);if(k===void 0)throw new Error("fetch() returned undefined");return k}memo(p,m={}){let k=D(this,T);if(!k)throw new Error("no memoMethod provided to constructor");let{context:M,forceRefresh:z,...ie}=m,$=this.get(p,ie);if(!z&&$!==void 0)return $;let J=k(p,$,{options:ie,context:M});return this.set(p,J,ie),J}get(p,m={}){let{allowStale:k=this.allowStale,updateAgeOnGet:M=this.updateAgeOnGet,noDeleteOnStaleGet:z=this.noDeleteOnStaleGet,status:ie}=m,$=D(this,O).get(p);if($!==void 0){let J=D(this,I)[$],Te=Le(this,q,ot).call(this,J);return ie&&D(this,U).call(this,ie,$),D(this,H).call(this,$)?(ie&&(ie.get="stale"),Te?(ie&&k&&J.__staleWhileFetching!==void 0&&(ie.returnedStale=!0),k?J.__staleWhileFetching:void 0):(z||Le(this,q,Kt).call(this,p,"expire"),ie&&k&&(ie.returnedStale=!0),k?J:void 0)):(ie&&(ie.get="hit"),Te?J.__staleWhileFetching:(Le(this,q,Sr).call(this,$),M&&D(this,X).call(this,$),J))}else ie&&(ie.get="miss")}delete(p){return Le(this,q,Kt).call(this,p,"delete")}clear(){return Le(this,q,Ko).call(this,"delete")}},g=new WeakMap,_=new WeakMap,E=new WeakMap,v=new WeakMap,C=new WeakMap,T=new WeakMap,x=new WeakMap,P=new WeakMap,O=new WeakMap,F=new WeakMap,I=new WeakMap,W=new WeakMap,V=new WeakMap,L=new WeakMap,le=new WeakMap,re=new WeakMap,ee=new WeakMap,ue=new WeakMap,G=new WeakMap,oe=new WeakMap,R=new WeakMap,Q=new WeakMap,he=new WeakMap,q=new WeakSet,qo=function(){let p=new u(D(this,g)),m=new u(D(this,g));$e(this,oe,p),$e(this,G,m),$e(this,ae,(z,ie,$=l.now())=>{if(m[z]=ie!==0?$:0,p[z]=ie,ie!==0&&this.ttlAutopurge){let J=setTimeout(()=>{D(this,H).call(this,z)&&Le(this,q,Kt).call(this,D(this,F)[z],"expire")},ie+1);J.unref&&J.unref()}}),$e(this,X,z=>{m[z]=p[z]!==0?l.now():0}),$e(this,U,(z,ie)=>{if(p[ie]){let $=p[ie],J=m[ie];if(!$||!J)return;z.ttl=$,z.start=J,z.now=k||M();let Te=z.now-J;z.remainingTTL=$-Te}});let k=0,M=()=>{let z=l.now();if(this.ttlResolution>0){k=z;let ie=setTimeout(()=>k=0,this.ttlResolution);ie.unref&&ie.unref()}return z};this.getRemainingTTL=z=>{let ie=D(this,O).get(z);if(ie===void 0)return 0;let $=p[ie],J=m[ie];if(!$||!J)return 1/0;let Te=(k||M())-J;return $-Te},$e(this,H,z=>{let ie=m[z],$=p[z];return!!$&&!!ie&&(k||M())-ie>$})},X=new WeakMap,U=new WeakMap,ae=new WeakMap,H=new WeakMap,cu=function(){let p=new u(D(this,g));$e(this,P,0),$e(this,ue,p),$e(this,ne,m=>{$e(this,P,D(this,P)-p[m]),p[m]=0}),$e(this,ce,(m,k,M,z)=>{if(Le(this,q,ot).call(this,k))return 0;if(!e(M))if(z){if(typeof z!="function")throw new TypeError("sizeCalculation must be a function");if(M=z(k,m),!e(M))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 M}),$e(this,be,(m,k,M)=>{if(p[m]=k,D(this,_)){let z=D(this,_)-p[m];for(;D(this,P)>z;)Le(this,q,un).call(this,!0)}$e(this,P,D(this,P)+p[m]),M&&(M.entrySize=k,M.totalCalculatedSize=D(this,P))})},ne=new WeakMap,be=new WeakMap,ce=new WeakMap,Vt=function*({allowStale:p=this.allowStale}={}){if(D(this,x))for(let m=D(this,le);!(!Le(this,q,Vo).call(this,m)||((p||!D(this,H).call(this,m))&&(yield m),m===D(this,L)));)m=D(this,V)[m]},zt=function*({allowStale:p=this.allowStale}={}){if(D(this,x))for(let m=D(this,L);!(!Le(this,q,Vo).call(this,m)||((p||!D(this,H).call(this,m))&&(yield m),m===D(this,le)));)m=D(this,W)[m]},Vo=function(p){return p!==void 0&&D(this,O).get(D(this,F)[p])===p},un=function(p){var z,ie;let m=D(this,L),k=D(this,F)[m],M=D(this,I)[m];return D(this,Q)&&Le(this,q,ot).call(this,M)?M.__abortController.abort(new Error("evicted")):(D(this,R)||D(this,he))&&(D(this,R)&&((z=D(this,E))==null||z.call(this,M,k,"evict")),D(this,he)&&((ie=D(this,ee))==null||ie.push([M,k,"evict"]))),D(this,ne).call(this,m),p&&(D(this,F)[m]=void 0,D(this,I)[m]=void 0,D(this,re).push(m)),D(this,x)===1?($e(this,L,$e(this,le,0)),D(this,re).length=0):$e(this,L,D(this,W)[m]),D(this,O).delete(k),ln(this,x)._--,m},cn=function(p,m,k,M){let z=m===void 0?void 0:D(this,I)[m];if(Le(this,q,ot).call(this,z))return z;let ie=new t,{signal:$}=k;$==null||$.addEventListener("abort",()=>ie.abort($.reason),{signal:ie.signal});let J={signal:ie.signal,options:k,context:M},Te=(Ke,Xe=!1)=>{let{aborted:Ue}=ie.signal,Ye=k.ignoreFetchAbort&&Ke!==void 0;if(k.status&&(Ue&&!Xe?(k.status.fetchAborted=!0,k.status.fetchError=ie.signal.reason,Ye&&(k.status.fetchAbortIgnored=!0)):k.status.fetchResolved=!0),Ue&&!Ye&&!Xe)return Ne(ie.signal.reason);let Ze=nt;return D(this,I)[m]===nt&&(Ke===void 0?Ze.__staleWhileFetching?D(this,I)[m]=Ze.__staleWhileFetching:Le(this,q,Kt).call(this,p,"fetch"):(k.status&&(k.status.fetchUpdated=!0),this.set(p,Ke,J.options))),Ke},Me=Ke=>(k.status&&(k.status.fetchRejected=!0,k.status.fetchError=Ke),Ne(Ke)),Ne=Ke=>{let{aborted:Xe}=ie.signal,Ue=Xe&&k.allowStaleOnFetchAbort,Ye=Ue||k.allowStaleOnFetchRejection,Ze=Ye||k.noDeleteOnFetchRejection,lt=nt;if(D(this,I)[m]===nt&&(!Ze||lt.__staleWhileFetching===void 0?Le(this,q,Kt).call(this,p,"fetch"):Ue||(D(this,I)[m]=lt.__staleWhileFetching)),Ye)return k.status&&lt.__staleWhileFetching!==void 0&&(k.status.returnedStale=!0),lt.__staleWhileFetching;if(lt.__returned===lt)throw Ke},Fe=(Ke,Xe)=>{var Ye;let Ue=(Ye=D(this,C))==null?void 0:Ye.call(this,p,z,J);Ue&&Ue instanceof Promise&&Ue.then(Ze=>Ke(Ze===void 0?void 0:Ze),Xe),ie.signal.addEventListener("abort",()=>{(!k.ignoreFetchAbort||k.allowStaleOnFetchAbort)&&(Ke(void 0),k.allowStaleOnFetchAbort&&(Ke=Ze=>Te(Ze,!0)))})};k.status&&(k.status.fetchDispatched=!0);let nt=new Promise(Fe).then(Te,Me),rt=Object.assign(nt,{__abortController:ie,__staleWhileFetching:z,__returned:void 0});return m===void 0?(this.set(p,rt,{...J.options,status:void 0}),m=D(this,O).get(p)):D(this,I)[m]=rt,rt},ot=function(p){if(!D(this,Q))return!1;let m=p;return!!m&&m instanceof Promise&&m.hasOwnProperty("__staleWhileFetching")&&m.__abortController instanceof t},zo=function(p,m){D(this,V)[m]=p,D(this,W)[p]=m},Sr=function(p){p!==D(this,le)&&(p===D(this,L)?$e(this,L,D(this,W)[p]):Le(this,q,zo).call(this,D(this,V)[p],D(this,W)[p]),Le(this,q,zo).call(this,D(this,le),p),$e(this,le,p))},Kt=function(p,m){var M,z,ie,$;let k=!1;if(D(this,x)!==0){let J=D(this,O).get(p);if(J!==void 0)if(k=!0,D(this,x)===1)Le(this,q,Ko).call(this,m);else{D(this,ne).call(this,J);let Te=D(this,I)[J];if(Le(this,q,ot).call(this,Te)?Te.__abortController.abort(new Error("deleted")):(D(this,R)||D(this,he))&&(D(this,R)&&((M=D(this,E))==null||M.call(this,Te,p,m)),D(this,he)&&((z=D(this,ee))==null||z.push([Te,p,m]))),D(this,O).delete(p),D(this,F)[J]=void 0,D(this,I)[J]=void 0,J===D(this,le))$e(this,le,D(this,V)[J]);else if(J===D(this,L))$e(this,L,D(this,W)[J]);else{let Me=D(this,V)[J];D(this,W)[Me]=D(this,W)[J];let Ne=D(this,W)[J];D(this,V)[Ne]=D(this,V)[J]}ln(this,x)._--,D(this,re).push(J)}}if(D(this,he)&&((ie=D(this,ee))!=null&&ie.length)){let J=D(this,ee),Te;for(;Te=J==null?void 0:J.shift();)($=D(this,v))==null||$.call(this,...Te)}return k},Ko=function(p){var m,k,M;for(let z of Le(this,q,zt).call(this,{allowStale:!0})){let ie=D(this,I)[z];if(Le(this,q,ot).call(this,ie))ie.__abortController.abort(new Error("deleted"));else{let $=D(this,F)[z];D(this,R)&&((m=D(this,E))==null||m.call(this,ie,$,p)),D(this,he)&&((k=D(this,ee))==null||k.push([ie,$,p]))}}if(D(this,O).clear(),D(this,I).fill(void 0),D(this,F).fill(void 0),D(this,oe)&&D(this,G)&&(D(this,oe).fill(0),D(this,G).fill(0)),D(this,ue)&&D(this,ue).fill(0),$e(this,L,0),$e(this,le,0),D(this,re).length=0,$e(this,P,0),$e(this,x,0),D(this,he)&&D(this,ee)){let z=D(this,ee),ie;for(;ie=z==null?void 0:z.shift();)(M=D(this,v))==null||M.call(this,...ie)}},De);o.LRUCache=d}),Nt=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.ContainerIterator=o.Container=o.Base=void 0;var l=class{constructor(c=0){this.iteratorType=c}equals(c){return this.o===c.o}};o.ContainerIterator=l;var s=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};o.Base=s;var a=class extends s{};o.Container=a}),tc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=class extends l.Base{constructor(c=[]){super(),this.S=[];let t=this;c.forEach(function(r){t.push(r)})}clear(){this.i=0,this.S=[]}push(c){return this.S.push(c),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},a=s;o.default=a}),rc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=class extends l.Base{constructor(c=[]){super(),this.j=0,this.q=[];let t=this;c.forEach(function(r){t.push(r)})}clear(){this.q=[],this.i=this.j=0}push(c){let t=this.q.length;if(this.j/t>.5&&this.j+this.i>=t&&t>4096){let r=this.i;for(let n=0;n<r;++n)this.q[n]=this.q[this.j+n];this.j=0,this.q[this.i]=c}else this.q[this.j+this.i]=c;return++this.i}pop(){if(this.i===0)return;let c=this.q[this.j++];return this.i-=1,c}front(){if(this.i!==0)return this.q[this.j]}},a=s;o.default=a}),nc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=class extends l.Base{constructor(c=[],t=function(n,e){return n>e?-1:n<e?1:0},r=!0){if(super(),this.v=t,Array.isArray(c))this.C=r?[...c]:c;else{this.C=[];let e=this;c.forEach(function(i){e.C.push(i)})}this.i=this.C.length;let n=this.i>>1;for(let e=this.i-1>>1;e>=0;--e)this.k(e,n)}m(c){let t=this.C[c];for(;c>0;){let r=c-1>>1,n=this.C[r];if(this.v(n,t)<=0)break;this.C[c]=n,c=r}this.C[c]=t}k(c,t){let r=this.C[c];for(;c<t;){let n=c<<1|1,e=n+1,i=this.C[n];if(e<this.i&&this.v(i,this.C[e])>0&&(n=e,i=this.C[e]),this.v(i,r)>=0)break;this.C[c]=i,c=n}this.C[c]=r}clear(){this.i=0,this.C.length=0}push(c){this.C.push(c),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let c=this.C[0],t=this.C.pop();return this.i-=1,this.i&&(this.C[0]=t,this.k(0,this.i>>1)),c}top(){return this.C[0]}find(c){return this.C.indexOf(c)>=0}remove(c){let t=this.C.indexOf(c);return t<0?!1:(t===0?this.pop():t===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(t,1,this.C.pop()),this.i-=1,this.m(t),this.k(t,this.i>>1)),!0)}updateItem(c){let t=this.C.indexOf(c);return t<0?!1:(this.m(t),this.k(t,this.i>>1),!0)}toArray(){return[...this.C]}},a=s;o.default=a}),Pi=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=class extends l.Container{},a=s;o.default=a}),Bt=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.throwIteratorAccessError=l;function l(){throw new RangeError("Iterator access denied!")}}),As=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.RandomIterator=void 0;var l=Nt(),s=Bt(),a=class extends l.ContainerIterator{constructor(c,t){super(t),this.o=c,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,s.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,s.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,s.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,s.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(c){this.container.setElementByPos(this.o,c)}};o.RandomIterator=a}),ic=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=a(Pi()),s=As();function a(n){return n&&n.t?n:{default:n}}var c=class fu extends s.RandomIterator{constructor(e,i,u){super(e,u),this.container=i}copy(){return new fu(this.o,this.container,this.iteratorType)}},t=class extends l.default{constructor(n=[],e=!0){if(super(),Array.isArray(n))this.J=e?[...n]:n,this.i=n.length;else{this.J=[];let i=this;n.forEach(function(u){i.pushBack(u)})}}clear(){this.i=0,this.J.length=0}begin(){return new c(0,this)}end(){return new c(this.i,this)}rBegin(){return new c(this.i-1,this,1)}rEnd(){return new c(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;return this.J[n]}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;return this.J.splice(n,1),this.i-=1,this.i}eraseElementByValue(n){let e=0;for(let i=0;i<this.i;++i)this.J[i]!==n&&(this.J[e++]=this.J[i]);return this.i=this.J.length=e,this.i}eraseElementByIterator(n){let e=n.o;return n=n.next(),this.eraseElementByPos(e),n}pushBack(n){return this.J.push(n),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(n,e){if(n<0||n>this.i-1)throw new RangeError;this.J[n]=e}insert(n,e,i=1){if(n<0||n>this.i)throw new RangeError;return this.J.splice(n,0,...new Array(i).fill(e)),this.i+=i,this.i}find(n){for(let e=0;e<this.i;++e)if(this.J[e]===n)return new c(e,this);return this.end()}reverse(){this.J.reverse()}unique(){let n=1;for(let e=1;e<this.i;++e)this.J[e]!==this.J[e-1]&&(this.J[n++]=this.J[e]);return this.i=this.J.length=n,this.i}sort(n){this.J.sort(n)}forEach(n){for(let e=0;e<this.i;++e)n(this.J[e],e,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}},r=t;o.default=r}),oc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=c(Pi()),s=Nt(),a=Bt();function c(e){return e&&e.t?e:{default:e}}var t=class hu extends s.ContainerIterator{constructor(i,u,h,d){super(d),this.o=i,this.h=u,this.container=h,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l}set pointer(i){this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l=i}copy(){return new hu(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.default{constructor(e=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let i=this;e.forEach(function(u){i.pushBack(u)})}V(e){let{L:i,B:u}=e;i.B=u,u.L=i,e===this.p&&(this.p=u),e===this._&&(this._=i),this.i-=1}G(e,i){let u=i.B,h={l:e,L:i,B:u};i.B=h,u.L=h,i===this.h&&(this.p=h),u===this.h&&(this._=h),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new t(this.p,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this._,this.h,this,1)}rEnd(){return new t(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;return i.l}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;return this.V(i),this.i}eraseElementByValue(e){let i=this.p;for(;i!==this.h;)i.l===e&&this.V(i),i=i.B;return this.i}eraseElementByIterator(e){let i=e.o;return i===this.h&&(0,a.throwIteratorAccessError)(),e=e.next(),this.V(i),e}pushBack(e){return this.G(e,this._),this.i}popBack(){if(this.i===0)return;let e=this._.l;return this.V(this._),e}pushFront(e){return this.G(e,this.h),this.i}popFront(){if(this.i===0)return;let e=this.p.l;return this.V(this.p),e}setElementByPos(e,i){if(e<0||e>this.i-1)throw new RangeError;let u=this.p;for(;e--;)u=u.B;u.l=i}insert(e,i,u=1){if(e<0||e>this.i)throw new RangeError;if(u<=0)return this.i;if(e===0)for(;u--;)this.pushFront(i);else if(e===this.i)for(;u--;)this.pushBack(i);else{let h=this.p;for(let y=1;y<e;++y)h=h.B;let d=h.B;for(this.i+=u;u--;)h.B={l:i,L:h},h.B.L=h,h=h.B;h.B=d,d.L=h}return this.i}find(e){let i=this.p;for(;i!==this.h;){if(i.l===e)return new t(i,this.h,this);i=i.B}return this.end()}reverse(){if(this.i<=1)return;let e=this.p,i=this._,u=0;for(;u<<1<this.i;){let h=e.l;e.l=i.l,i.l=h,e=e.B,i=i.L,u+=1}}unique(){if(this.i<=1)return this.i;let e=this.p;for(;e!==this.h;){let i=e;for(;i.B!==this.h&&i.l===i.B.l;)i=i.B,this.i-=1;e.B=i.B,e.B.L=e,e=e.B}return this.i}sort(e){if(this.i<=1)return;let i=[];this.forEach(function(h){i.push(h)}),i.sort(e);let u=this.p;i.forEach(function(h){u.l=h,u=u.B})}merge(e){let i=this;if(this.i===0)e.forEach(function(u){i.pushBack(u)});else{let u=this.p;e.forEach(function(h){for(;u!==i.h&&u.l<=h;)u=u.B;i.G(h,u.L)})}return this.i}forEach(e){let i=this.p,u=0;for(;i!==this.h;)e(i.l,u++,this),i=i.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let e=this.p;for(;e!==this.h;)yield e.l,e=e.B}).bind(this)()}},n=r;o.default=n}),sc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=a(Pi()),s=As();function a(n){return n&&n.t?n:{default:n}}var c=class pu extends s.RandomIterator{constructor(e,i,u){super(e,u),this.container=i}copy(){return new pu(this.o,this.container,this.iteratorType)}},t=class extends l.default{constructor(n=[],e=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let i=(()=>{if(typeof n.length=="number")return n.length;if(typeof n.size=="number")return n.size;if(typeof n.size=="function")return n.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=e,this.P=Math.max(Math.ceil(i/this.F),1);for(let d=0;d<this.P;++d)this.A.push(new Array(this.F));let u=Math.ceil(i/this.F);this.j=this.R=(this.P>>1)-(u>>1),this.D=this.N=this.F-i%this.F>>1;let h=this;n.forEach(function(d){h.pushBack(d)})}T(){let n=[],e=Math.max(this.P>>1,1);for(let i=0;i<e;++i)n[i]=new Array(this.F);for(let i=this.j;i<this.P;++i)n[n.length]=this.A[i];for(let i=0;i<this.R;++i)n[n.length]=this.A[i];n[n.length]=[...this.A[this.R]],this.j=e,this.R=n.length-1;for(let i=0;i<e;++i)n[n.length]=new Array(this.F);this.A=n,this.P=n.length}O(n){let e=this.D+n+1,i=e%this.F,u=i-1,h=this.j+(e-i)/this.F;return i===0&&(h-=1),h%=this.P,u<0&&(u+=this.F),{curNodeBucketIndex:h,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 c(0,this)}end(){return new c(this.i,this)}rBegin(){return new c(this.i-1,this,1)}rEnd(){return new c(-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(n){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]=n,this.i}popBack(){if(this.i===0)return;let n=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,n}pushFront(n){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]=n,this.i}popFront(){if(this.i===0)return;let n=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,n}getElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;let{curNodeBucketIndex:e,curNodePointerIndex:i}=this.O(n);return this.A[e][i]}setElementByPos(n,e){if(n<0||n>this.i-1)throw new RangeError;let{curNodeBucketIndex:i,curNodePointerIndex:u}=this.O(n);this.A[i][u]=e}insert(n,e,i=1){if(n<0||n>this.i)throw new RangeError;if(n===0)for(;i--;)this.pushFront(e);else if(n===this.i)for(;i--;)this.pushBack(e);else{let u=[];for(let h=n;h<this.i;++h)u.push(this.getElementByPos(h));this.cut(n-1);for(let h=0;h<i;++h)this.pushBack(e);for(let h=0;h<u.length;++h)this.pushBack(u[h])}return this.i}cut(n){if(n<0)return this.clear(),0;let{curNodeBucketIndex:e,curNodePointerIndex:i}=this.O(n);return this.R=e,this.N=i,this.i=n+1,this.i}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;if(n===0)this.popFront();else if(n===this.i-1)this.popBack();else{let e=[];for(let u=n+1;u<this.i;++u)e.push(this.getElementByPos(u));this.cut(n),this.popBack();let i=this;e.forEach(function(u){i.pushBack(u)})}return this.i}eraseElementByValue(n){if(this.i===0)return 0;let e=[];for(let u=0;u<this.i;++u){let h=this.getElementByPos(u);h!==n&&e.push(h)}let i=e.length;for(let u=0;u<i;++u)this.setElementByPos(u,e[u]);return this.cut(i-1)}eraseElementByIterator(n){let e=n.o;return this.eraseElementByPos(e),n=n.next(),n}find(n){for(let e=0;e<this.i;++e)if(this.getElementByPos(e)===n)return new c(e,this);return this.end()}reverse(){let n=0,e=this.i-1;for(;n<e;){let i=this.getElementByPos(n);this.setElementByPos(n,this.getElementByPos(e)),this.setElementByPos(e,i),n+=1,e-=1}}unique(){if(this.i<=1)return this.i;let n=1,e=this.getElementByPos(0);for(let i=1;i<this.i;++i){let u=this.getElementByPos(i);u!==e&&(e=u,this.setElementByPos(n++,u))}for(;this.i>n;)this.popBack();return this.i}sort(n){let e=[];for(let i=0;i<this.i;++i)e.push(this.getElementByPos(i));e.sort(n);for(let i=0;i<this.i;++i)this.setElementByPos(i,e[i])}shrinkToFit(){if(this.i===0)return;let n=[];this.forEach(function(e){n.push(e)}),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 e=0;e<this.P;++e)this.A.push(new Array(this.F));for(let e=0;e<n.length;++e)this.pushBack(n[e])}forEach(n){for(let e=0;e<this.i;++e)n(this.getElementByPos(e),e,this)}[Symbol.iterator](){return(function*(){for(let n=0;n<this.i;++n)yield this.getElementByPos(n)}).bind(this)()}},r=t;o.default=r}),ac=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.TreeNodeEnableIndex=o.TreeNode=void 0;var l=class{constructor(a,c){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=a,this.l=c}L(){let a=this;if(a.ee===1&&a.tt.tt===a)a=a.W;else if(a.U)for(a=a.U;a.W;)a=a.W;else{let c=a.tt;for(;c.U===a;)a=c,c=a.tt;a=c}return a}B(){let a=this;if(a.W){for(a=a.W;a.U;)a=a.U;return a}else{let c=a.tt;for(;c.W===a;)a=c,c=a.tt;return a.W!==c?c:a}}te(){let a=this.tt,c=this.W,t=c.U;return a.tt===this?a.tt=c:a.U===this?a.U=c:a.W=c,c.tt=a,c.U=this,this.tt=c,this.W=t,t&&(t.tt=this),c}se(){let a=this.tt,c=this.U,t=c.W;return a.tt===this?a.tt=c:a.U===this?a.U=c:a.W=c,c.tt=a,c.W=this,this.tt=c,this.U=t,t&&(t.tt=this),c}};o.TreeNode=l;var s=class extends l{constructor(){super(...arguments),this.rt=1}te(){let a=super.te();return this.ie(),a.ie(),a}se(){let a=super.se();return this.ie(),a.ie(),a}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};o.TreeNodeEnableIndex=s}),xs=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=ac(),s=Nt(),a=Bt(),c=class extends s.Container{constructor(r=function(e,i){return e<i?-1:e>i?1:0},n=!1){super(),this.Y=void 0,this.v=r,n?(this.re=l.TreeNodeEnableIndex,this.M=function(e,i,u){let h=this.ne(e,i,u);if(h){let d=h.tt;for(;d!==this.h;)d.rt+=1,d=d.tt;let y=this.he(h);if(y){let{parentNode:b,grandParent:w,curNode:S}=y;b.ie(),w.ie(),S.ie()}}return this.i},this.V=function(e){let i=this.fe(e);for(;i!==this.h;)i.rt-=1,i=i.tt}):(this.re=l.TreeNode,this.M=function(e,i,u){let h=this.ne(e,i,u);return h&&this.he(h),this.i},this.V=this.fe),this.h=new this.re}X(r,n){let e=this.h;for(;r;){let i=this.v(r.u,n);if(i<0)r=r.W;else if(i>0)e=r,r=r.U;else return r}return e}Z(r,n){let e=this.h;for(;r;)this.v(r.u,n)<=0?r=r.W:(e=r,r=r.U);return e}$(r,n){let e=this.h;for(;r;){let i=this.v(r.u,n);if(i<0)e=r,r=r.W;else if(i>0)r=r.U;else return r}return e}rr(r,n){let e=this.h;for(;r;)this.v(r.u,n)<0?(e=r,r=r.W):r=r.U;return e}ue(r){for(;;){let n=r.tt;if(n===this.h)return;if(r.ee===1){r.ee=0;return}if(r===n.U){let e=n.W;if(e.ee===1)e.ee=0,n.ee=1,n===this.Y?this.Y=n.te():n.te();else if(e.W&&e.W.ee===1){e.ee=n.ee,n.ee=0,e.W.ee=0,n===this.Y?this.Y=n.te():n.te();return}else e.U&&e.U.ee===1?(e.ee=1,e.U.ee=0,e.se()):(e.ee=1,r=n)}else{let e=n.U;if(e.ee===1)e.ee=0,n.ee=1,n===this.Y?this.Y=n.se():n.se();else if(e.U&&e.U.ee===1){e.ee=n.ee,n.ee=0,e.U.ee=0,n===this.Y?this.Y=n.se():n.se();return}else e.W&&e.W.ee===1?(e.ee=1,e.W.ee=0,e.te()):(e.ee=1,r=n)}}}fe(r){if(this.i===1)return this.clear(),this.h;let n=r;for(;n.U||n.W;){if(n.W)for(n=n.W;n.U;)n=n.U;else n=n.U;[r.u,n.u]=[n.u,r.u],[r.l,n.l]=[n.l,r.l],r=n}this.h.U===n?this.h.U=n.tt:this.h.W===n&&(this.h.W=n.tt),this.ue(n);let e=n.tt;return n===e.U?e.U=void 0:e.W=void 0,this.i-=1,this.Y.ee=0,e}oe(r,n){return r===void 0?!1:this.oe(r.U,n)||n(r)?!0:this.oe(r.W,n)}he(r){for(;;){let n=r.tt;if(n.ee===0)return;let e=n.tt;if(n===e.U){let i=e.W;if(i&&i.ee===1){if(i.ee=n.ee=0,e===this.Y)return;e.ee=1,r=e;continue}else if(r===n.W){if(r.ee=0,r.U&&(r.U.tt=n),r.W&&(r.W.tt=e),n.W=r.U,e.U=r.W,r.U=n,r.W=e,e===this.Y)this.Y=r,this.h.tt=r;else{let u=e.tt;u.U===e?u.U=r:u.W=r}return r.tt=e.tt,n.tt=r,e.tt=r,e.ee=1,{parentNode:n,grandParent:e,curNode:r}}else n.ee=0,e===this.Y?this.Y=e.se():e.se(),e.ee=1}else{let i=e.U;if(i&&i.ee===1){if(i.ee=n.ee=0,e===this.Y)return;e.ee=1,r=e;continue}else if(r===n.U){if(r.ee=0,r.U&&(r.U.tt=e),r.W&&(r.W.tt=n),e.W=r.U,n.U=r.W,r.U=e,r.W=n,e===this.Y)this.Y=r,this.h.tt=r;else{let u=e.tt;u.U===e?u.U=r:u.W=r}return r.tt=e.tt,n.tt=r,e.tt=r,e.ee=1,{parentNode:n,grandParent:e,curNode:r}}else n.ee=0,e===this.Y?this.Y=e.te():e.te(),e.ee=1}return}}ne(r,n,e){if(this.Y===void 0){this.i+=1,this.Y=new this.re(r,n),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 i,u=this.h.U,h=this.v(u.u,r);if(h===0){u.l=n;return}else if(h>0)u.U=new this.re(r,n),u.U.tt=u,i=u.U,this.h.U=i;else{let d=this.h.W,y=this.v(d.u,r);if(y===0){d.l=n;return}else if(y<0)d.W=new this.re(r,n),d.W.tt=d,i=d.W,this.h.W=i;else{if(e!==void 0){let b=e.o;if(b!==this.h){let w=this.v(b.u,r);if(w===0){b.l=n;return}else if(w>0){let S=b.L(),A=this.v(S.u,r);if(A===0){S.l=n;return}else A<0&&(i=new this.re(r,n),S.W===void 0?(S.W=i,i.tt=S):(b.U=i,i.tt=b))}}}if(i===void 0)for(i=this.Y;;){let b=this.v(i.u,r);if(b>0){if(i.U===void 0){i.U=new this.re(r,n),i.U.tt=i,i=i.U;break}i=i.U}else if(b<0){if(i.W===void 0){i.W=new this.re(r,n),i.W.tt=i,i=i.W;break}i=i.W}else{i.l=n;return}}}}return this.i+=1,i}I(r,n){for(;r;){let e=this.v(r.u,n);if(e<0)r=r.W;else if(e>0)r=r.U;else return r}return r||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(r,n){let e=r.o;if(e===this.h&&(0,a.throwIteratorAccessError)(),this.i===1)return e.u=n,!0;if(e===this.h.U)return this.v(e.B().u,n)>0?(e.u=n,!0):!1;if(e===this.h.W)return this.v(e.L().u,n)<0?(e.u=n,!0):!1;let i=e.L().u;if(this.v(i,n)>=0)return!1;let u=e.B().u;return this.v(u,n)<=0?!1:(e.u=n,!0)}eraseElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let n=0,e=this;return this.oe(this.Y,function(i){return r===n?(e.V(i),!0):(n+=1,!1)}),this.i}eraseElementByKey(r){if(this.i===0)return!1;let n=this.I(this.Y,r);return n===this.h?!1:(this.V(n),!0)}eraseElementByIterator(r){let n=r.o;n===this.h&&(0,a.throwIteratorAccessError)();let e=n.W===void 0;return r.iteratorType===0?e&&r.next():(!e||n.U===void 0)&&r.next(),this.V(n),r}forEach(r){let n=0;for(let e of this)r(e,n++,this)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let n,e=0;for(let i of this){if(e===r){n=i;break}e+=1}return n}getHeight(){if(this.i===0)return 0;let r=function(n){return n?Math.max(r(n.U),r(n.W))+1:0};return r(this.Y)}},t=c;o.default=t}),Is=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=Bt(),a=class extends l.ContainerIterator{constructor(t,r,n){super(n),this.o=t,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,s.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,s.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let t=this.o,r=this.h.tt;if(t===this.h)return r?r.rt-1:0;let n=0;for(t.U&&(n+=t.U.rt);t!==r;){let e=t.tt;t===e.W&&(n+=1,e.U&&(n+=e.U.rt)),t=e}return n}},c=a;o.default=c}),lc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=c(xs()),s=c(Is()),a=Bt();function c(e){return e&&e.t?e:{default:e}}var t=class du extends s.default{constructor(i,u,h,d){super(i,u,d),this.container=h}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.u}copy(){return new du(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.default{constructor(e=[],i,u){super(i,u);let h=this;e.forEach(function(d){h.insert(d)})}*K(e){e!==void 0&&(yield*this.K(e.U),yield e.u,yield*this.K(e.W))}begin(){return new t(this.h.U||this.h,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this.h.W||this.h,this.h,this,1)}rEnd(){return new t(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(e,i){return this.M(e,void 0,i)}find(e){let i=this.I(this.Y,e);return new t(i,this.h,this)}lowerBound(e){let i=this.X(this.Y,e);return new t(i,this.h,this)}upperBound(e){let i=this.Z(this.Y,e);return new t(i,this.h,this)}reverseLowerBound(e){let i=this.$(this.Y,e);return new t(i,this.h,this)}reverseUpperBound(e){let i=this.rr(this.Y,e);return new t(i,this.h,this)}union(e){let i=this;return e.forEach(function(u){i.insert(u)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},n=r;o.default=n}),uc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=c(xs()),s=c(Is()),a=Bt();function c(e){return e&&e.t?e:{default:e}}var t=class gu extends s.default{constructor(i,u,h,d){super(i,u,d),this.container=h}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let i=this;return new Proxy([],{get(u,h){if(h==="0")return i.o.u;if(h==="1")return i.o.l},set(u,h,d){if(h!=="1")throw new TypeError("props must be 1");return i.o.l=d,!0}})}copy(){return new gu(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.default{constructor(e=[],i,u){super(i,u);let h=this;e.forEach(function(d){h.setElement(d[0],d[1])})}*K(e){e!==void 0&&(yield*this.K(e.U),yield[e.u,e.l],yield*this.K(e.W))}begin(){return new t(this.h.U||this.h,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this.h.W||this.h,this.h,this,1)}rEnd(){return new t(this.h,this.h,this,1)}front(){if(this.i===0)return;let e=this.h.U;return[e.u,e.l]}back(){if(this.i===0)return;let e=this.h.W;return[e.u,e.l]}lowerBound(e){let i=this.X(this.Y,e);return new t(i,this.h,this)}upperBound(e){let i=this.Z(this.Y,e);return new t(i,this.h,this)}reverseLowerBound(e){let i=this.$(this.Y,e);return new t(i,this.h,this)}reverseUpperBound(e){let i=this.rr(this.Y,e);return new t(i,this.h,this)}setElement(e,i,u){return this.M(e,i,u)}find(e){let i=this.I(this.Y,e);return new t(i,this.h,this)}getElementByKey(e){return this.I(this.Y,e).l}union(e){let i=this;return e.forEach(function(u){i.setElement(u[0],u[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},n=r;o.default=n}),ks=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=l;function l(s){let a=typeof s;return a==="object"&&s!==null||a==="function"}}),Os=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.HashContainerIterator=o.HashContainer=void 0;var l=Nt(),s=c(ks()),a=Bt();function c(n){return n&&n.t?n:{default:n}}var t=class extends l.ContainerIterator{constructor(n,e,i){super(i),this.o=n,this.h=e,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this})}};o.HashContainerIterator=t;var r=class extends l.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(n){let{L:e,B:i}=n;e.B=i,i.L=e,n===this.p&&(this.p=i),n===this._&&(this._=e),this.i-=1}M(n,e,i){i===void 0&&(i=(0,s.default)(n));let u;if(i){let h=n[this.HASH_TAG];if(h!==void 0)return this.H[h].l=e,this.i;Object.defineProperty(n,this.HASH_TAG,{value:this.H.length,configurable:!0}),u={u:n,l:e,L:this._,B:this.h},this.H.push(u)}else{let h=this.g[n];if(h)return h.l=e,this.i;u={u:n,l:e,L:this._,B:this.h},this.g[n]=u}return this.i===0?(this.p=u,this.h.B=u):this._.B=u,this._=u,this.h.L=u,++this.i}I(n,e){if(e===void 0&&(e=(0,s.default)(n)),e){let i=n[this.HASH_TAG];return i===void 0?this.h:this.H[i]}else return this.g[n]||this.h}clear(){let n=this.HASH_TAG;this.H.forEach(function(e){delete e.u[n]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(n,e){let i;if(e===void 0&&(e=(0,s.default)(n)),e){let u=n[this.HASH_TAG];if(u===void 0)return!1;delete n[this.HASH_TAG],i=this.H[u],delete this.H[u]}else{if(i=this.g[n],i===void 0)return!1;delete this.g[n]}return this.V(i),!0}eraseElementByIterator(n){let e=n.o;return e===this.h&&(0,a.throwIteratorAccessError)(),this.V(e),n.next()}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;let e=this.p;for(;n--;)e=e.B;return this.V(e),this.i}};o.HashContainer=r}),cc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Os(),s=Bt(),a=class yu extends l.HashContainerIterator{constructor(n,e,i,u){super(n,e,u),this.container=i}get pointer(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o.u}copy(){return new yu(this.o,this.h,this.container,this.iteratorType)}},c=class extends l.HashContainer{constructor(r=[]){super();let n=this;r.forEach(function(e){n.insert(e)})}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.u}back(){return this._.u}insert(r,n){return this.M(r,void 0,n)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let n=this.p;for(;r--;)n=n.B;return n.u}find(r,n){let e=this.I(r,n);return new a(e,this.h,this)}forEach(r){let n=0,e=this.p;for(;e!==this.h;)r(e.u,n++,this),e=e.B}[Symbol.iterator](){return(function*(){let r=this.p;for(;r!==this.h;)yield r.u,r=r.B}).bind(this)()}},t=c;o.default=t}),fc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Os(),s=c(ks()),a=Bt();function c(e){return e&&e.t?e:{default:e}}var t=class mu extends l.HashContainerIterator{constructor(i,u,h,d){super(i,u,d),this.container=h}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let i=this;return new Proxy([],{get(u,h){if(h==="0")return i.o.u;if(h==="1")return i.o.l},set(u,h,d){if(h!=="1")throw new TypeError("props must be 1");return i.o.l=d,!0}})}copy(){return new mu(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.HashContainer{constructor(e=[]){super();let i=this;e.forEach(function(u){i.setElement(u[0],u[1])})}begin(){return new t(this.p,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this._,this.h,this,1)}rEnd(){return new t(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(e,i,u){return this.M(e,i,u)}getElementByKey(e,i){if(i===void 0&&(i=(0,s.default)(e)),i){let h=e[this.HASH_TAG];return h!==void 0?this.H[h].l:void 0}let u=this.g[e];return u?u.l:void 0}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;return[i.u,i.l]}find(e,i){let u=this.I(e,i);return new t(u,this.h,this)}forEach(e){let i=0,u=this.p;for(;u!==this.h;)e([u.u,u.l],i++,this),u=u.B}[Symbol.iterator](){return(function*(){let e=this.p;for(;e!==this.h;)yield[e.u,e.l],e=e.B}).bind(this)()}},n=r;o.default=n}),hc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),Object.defineProperty(o,"Deque",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(o,"HashMap",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(o,"HashSet",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(o,"LinkList",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(o,"OrderedMap",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(o,"OrderedSet",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(o,"PriorityQueue",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(o,"Queue",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(o,"Stack",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(o,"Vector",{enumerable:!0,get:function(){return c.default}});var l=h(tc()),s=h(rc()),a=h(nc()),c=h(ic()),t=h(oc()),r=h(sc()),n=h(lc()),e=h(uc()),i=h(cc()),u=h(fc());function h(d){return d&&d.t?d:{default:d}}}),pc=we((o,l)=>{de(),ye(),ge();var s=hc().OrderedSet,a=Mt()("number-allocator:trace"),c=Mt()("number-allocator:error");function t(n,e){this.low=n,this.high=e}t.prototype.equals=function(n){return this.low===n.low&&this.high===n.high},t.prototype.compare=function(n){return this.low<n.low&&this.high<n.low?-1:n.low<this.low&&n.high<this.low?1:0};function r(n,e){if(!(this instanceof r))return new r(n,e);this.min=n,this.max=e,this.ss=new s([],(i,u)=>i.compare(u)),a("Create"),this.clear()}r.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},r.prototype.alloc=function(){if(this.ss.size()===0)return a("alloc():empty"),null;let n=this.ss.begin(),e=n.pointer.low,i=n.pointer.high,u=e;return u+1<=i?this.ss.updateKeyByIterator(n,new t(e+1,i)):this.ss.eraseElementByPos(0),a("alloc():"+u),u},r.prototype.use=function(n){let e=new t(n,n),i=this.ss.lowerBound(e);if(!i.equals(this.ss.end())){let u=i.pointer.low,h=i.pointer.high;return i.pointer.equals(e)?(this.ss.eraseElementByIterator(i),a("use():"+n),!0):u>n?!1:u===n?(this.ss.updateKeyByIterator(i,new t(u+1,h)),a("use():"+n),!0):h===n?(this.ss.updateKeyByIterator(i,new t(u,h-1)),a("use():"+n),!0):(this.ss.updateKeyByIterator(i,new t(n+1,h)),this.ss.insert(new t(u,n-1)),a("use():"+n),!0)}return a("use():failed"),!1},r.prototype.free=function(n){if(n<this.min||n>this.max){c("free():"+n+" is out of range");return}let e=new t(n,n),i=this.ss.upperBound(e);if(i.equals(this.ss.end())){if(i.equals(this.ss.begin())){this.ss.insert(e);return}i.pre();let u=i.pointer.high;i.pointer.high+1===n?this.ss.updateKeyByIterator(i,new t(u,n)):this.ss.insert(e)}else if(i.equals(this.ss.begin()))if(n+1===i.pointer.low){let u=i.pointer.high;this.ss.updateKeyByIterator(i,new t(n,u))}else this.ss.insert(e);else{let u=i.pointer.low,h=i.pointer.high;i.pre();let d=i.pointer.low;i.pointer.high+1===n?n+1===u?(this.ss.eraseElementByIterator(i),this.ss.updateKeyByIterator(i,new t(d,h))):this.ss.updateKeyByIterator(i,new t(d,n)):n+1===u?(this.ss.eraseElementByIterator(i.next()),this.ss.insert(new t(n,h))):this.ss.insert(e)}a("free():"+n)},r.prototype.clear=function(){a("clear()"),this.ss.clear(),this.ss.insert(new t(this.min,this.max))},r.prototype.intervalCount=function(){return this.ss.size()},r.prototype.dump=function(){console.log("length:"+this.ss.size());for(let n of this.ss)console.log(n)},l.exports=r}),Ts=we((o,l)=>{de(),ye(),ge();var s=pc();l.exports.NumberAllocator=s}),dc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=ec(),s=Ts(),a=class{constructor(c){Pe(this,"aliasToTopic");Pe(this,"topicToAlias");Pe(this,"max");Pe(this,"numberAllocator");Pe(this,"length");c>0&&(this.aliasToTopic=new l.LRUCache({max:c}),this.topicToAlias={},this.numberAllocator=new s.NumberAllocator(1,c),this.max=c,this.length=0)}put(c,t){if(t===0||t>this.max)return!1;let r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,c),this.topicToAlias[c]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.size,!0}getTopicByAlias(c){return this.aliasToTopic.get(c)}getAliasByTopic(c){let t=this.topicToAlias[c];return typeof t<"u"&&this.aliasToTopic.get(t),t}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};o.default=a}),gc=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(o,"__esModule",{value:!0});var s=Tr(),a=l(dc()),c=ar(),t=(r,n)=>{r.log("_handleConnack");let{options:e}=r,i=e.protocolVersion===5?n.reasonCode:n.returnCode;if(clearTimeout(r.connackTimer),delete r.topicAliasSend,n.properties){if(n.properties.topicAliasMaximum){if(n.properties.topicAliasMaximum>65535){r.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}n.properties.topicAliasMaximum>0&&(r.topicAliasSend=new a.default(n.properties.topicAliasMaximum))}n.properties.serverKeepAlive&&e.keepalive&&(e.keepalive=n.properties.serverKeepAlive),n.properties.maximumPacketSize&&(e.properties||(e.properties={}),e.properties.maximumPacketSize=n.properties.maximumPacketSize)}if(i===0)r.reconnecting=!1,r._onConnect(n);else if(i>0){let u=new c.ErrorWithReasonCode(`Connection refused: ${s.ReasonCodes[i]}`,i);r.emit("error",u),r.options.reconnectOnConnackError&&r._cleanUp(!0)}};o.default=t}),yc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=(s,a,c)=>{s.log("handling pubrel packet");let t=typeof c<"u"?c:s.noop,{messageId:r}=a,n={cmd:"pubcomp",messageId:r};s.incomingStore.get(a,(e,i)=>{e?s._sendPacket(n,t):(s.emit("message",i.topic,i.payload,i),s.handleMessage(i,u=>{if(u)return t(u);s.incomingStore.del(i,s.noop),s._sendPacket(n,t)}))})};o.default=l}),mc=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0});var s=l(Ju()),a=l(Zu()),c=l(gc()),t=l(Tr()),r=l(yc()),n=(e,i,u)=>{let{options:h}=e;if(h.protocolVersion===5&&h.properties&&h.properties.maximumPacketSize&&h.properties.maximumPacketSize<i.length)return e.emit("error",new Error(`exceeding packets size ${i.cmd}`)),e.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",i),i.cmd){case"publish":(0,s.default)(e,i,u);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing(),(0,t.default)(e,i),u();break;case"pubrel":e.reschedulePing(),(0,r.default)(e,i,u);break;case"connack":(0,c.default)(e,i),u();break;case"auth":e.reschedulePing(),(0,a.default)(e,i),u();break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(!0),u();break;case"disconnect":e.emit("disconnect",i),u();break;default:e.log("_handlePacket :: unknown command"),u();break}};o.default=n}),Ps=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=class{constructor(){Pe(this,"nextId");this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let s=this.nextId++;return this.nextId===65536&&(this.nextId=1),s}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(s){return!0}deallocate(s){}clear(){}};o.default=l}),bc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=class{constructor(s){Pe(this,"aliasToTopic");Pe(this,"max");Pe(this,"length");this.aliasToTopic={},this.max=s}put(s,a){return a===0||a>this.max?!1:(this.aliasToTopic[a]=s,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(s){return this.aliasToTopic[s]}clear(){this.aliasToTopic={}}};o.default=l}),vc=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(o,"__esModule",{value:!0}),o.TypedEventEmitter=void 0;var s=l((Qt(),tt(Dt))),a=ar(),c=class{};o.TypedEventEmitter=c,(0,a.applyMixin)(c,s.default)}),Pr=we((o,l)=>{de(),ye(),ge();function s(a){"@babel/helpers - typeof";return l.exports=s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},l.exports.__esModule=!0,l.exports.default=l.exports,s(a)}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),wc=we((o,l)=>{de(),ye(),ge();var s=Pr().default;function a(c,t){if(s(c)!="object"||!c)return c;var r=c[Symbol.toPrimitive];if(r!==void 0){var n=r.call(c,t||"default");if(s(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),_c=we((o,l)=>{de(),ye(),ge();var s=Pr().default,a=wc();function c(t){var r=a(t,"string");return s(r)=="symbol"?r:r+""}l.exports=c,l.exports.__esModule=!0,l.exports.default=l.exports}),Sc=we((o,l)=>{de(),ye(),ge();var s=_c();function a(c,t,r){return(t=s(t))in c?Object.defineProperty(c,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):c[t]=r,c}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Ec=we((o,l)=>{de(),ye(),ge();function s(a){if(Array.isArray(a))return a}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Ac=we((o,l)=>{de(),ye(),ge();function s(a,c){var t=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(t!=null){var r,n,e,i,u=[],h=!0,d=!1;try{if(e=(t=t.call(a)).next,c===0){if(Object(t)!==t)return;h=!1}else for(;!(h=(r=e.call(t)).done)&&(u.push(r.value),u.length!==c);h=!0);}catch(y){d=!0,n=y}finally{try{if(!h&&t.return!=null&&(i=t.return(),Object(i)!==i))return}finally{if(d)throw n}}return u}}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),xc=we((o,l)=>{de(),ye(),ge();function s(a,c){(c==null||c>a.length)&&(c=a.length);for(var t=0,r=Array(c);t<c;t++)r[t]=a[t];return r}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Ic=we((o,l)=>{de(),ye(),ge();var s=xc();function a(c,t){if(c){if(typeof c=="string")return s(c,t);var r={}.toString.call(c).slice(8,-1);return r==="Object"&&c.constructor&&(r=c.constructor.name),r==="Map"||r==="Set"?Array.from(c):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(c,t):void 0}}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),kc=we((o,l)=>{de(),ye(),ge();function s(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
32
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Oc=we((o,l)=>{de(),ye(),ge();var s=Ec(),a=Ac(),c=Ic(),t=kc();function r(n,e){return s(n)||a(n,e)||c(n,e)||t()}l.exports=r,l.exports.__esModule=!0,l.exports.default=l.exports}),Cs=we((o,l)=>{de(),ye(),ge(),function(s,a){typeof o=="object"&&typeof l<"u"?a(o):typeof define=="function"&&define.amd?define(["exports"],a):(s=typeof globalThis<"u"?globalThis:s||self,a(s.fastUniqueNumbers={}))}(o,function(s){var a=function(y){return function(b){var w=y(b);return b.add(w),w}},c=function(y){return function(b,w){return y.set(b,w),w}},t=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,r=536870912,n=r*2,e=function(y,b){return function(w){var S=b.get(w),A=S===void 0?w.size:S<n?S+1:0;if(!w.has(A))return y(w,A);if(w.size<r){for(;w.has(A);)A=Math.floor(Math.random()*n);return y(w,A)}if(w.size>t)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;w.has(A);)A=Math.floor(Math.random()*t);return y(w,A)}},i=new WeakMap,u=c(i),h=e(u,i),d=a(h);s.addUniqueNumber=d,s.generateUniqueNumber=h})}),Tc=we((o,l)=>{de(),ye(),ge();function s(c,t,r,n,e,i,u){try{var h=c[i](u),d=h.value}catch(y){return void r(y)}h.done?t(d):Promise.resolve(d).then(n,e)}function a(c){return function(){var t=this,r=arguments;return new Promise(function(n,e){var i=c.apply(t,r);function u(d){s(i,n,e,u,h,"next",d)}function h(d){s(i,n,e,u,h,"throw",d)}u(void 0)})}}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),js=we((o,l)=>{de(),ye(),ge();function s(a,c){this.v=a,this.k=c}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Rs=we((o,l)=>{de(),ye(),ge();function s(a,c,t,r){var n=Object.defineProperty;try{n({},"",{})}catch{n=0}l.exports=s=function(e,i,u,h){function d(y,b){s(e,y,function(w){return this._invoke(y,b,w)})}i?n?n(e,i,{value:u,enumerable:!h,configurable:!h,writable:!h}):e[i]=u:(d("next",0),d("throw",1),d("return",2))},l.exports.__esModule=!0,l.exports.default=l.exports,s(a,c,t,r)}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Ms=we((o,l)=>{de(),ye(),ge();var s=Rs();function a(){var c,t,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",e=r.toStringTag||"@@toStringTag";function i(A,g,_,E){var v=g&&g.prototype instanceof h?g:h,C=Object.create(v.prototype);return s(C,"_invoke",function(T,x,P){var O,F,I,W=0,V=P||[],L=!1,le={p:0,n:0,v:c,a:re,f:re.bind(c,4),d:function(ee,ue){return O=ee,F=0,I=c,le.n=ue,u}};function re(ee,ue){for(F=ee,I=ue,t=0;!L&&W&&!G&&t<V.length;t++){var G,oe=V[t],R=le.p,Q=oe[2];ee>3?(G=Q===ue)&&(I=oe[(F=oe[4])?5:(F=3,3)],oe[4]=oe[5]=c):oe[0]<=R&&((G=ee<2&&R<oe[1])?(F=0,le.v=ue,le.n=oe[1]):R<Q&&(G=ee<3||oe[0]>ue||ue>Q)&&(oe[4]=ee,oe[5]=ue,le.n=Q,F=0))}if(G||ee>1)return u;throw L=!0,ue}return function(ee,ue,G){if(W>1)throw TypeError("Generator is already running");for(L&&ue===1&&re(ue,G),F=ue,I=G;(t=F<2?c:I)||!L;){O||(F?F<3?(F>1&&(le.n=-1),re(F,I)):le.n=I:le.v=I);try{if(W=2,O){if(F||(ee="next"),t=O[ee]){if(!(t=t.call(O,I)))throw TypeError("iterator result is not an object");if(!t.done)return t;I=t.value,F<2&&(F=0)}else F===1&&(t=O.return)&&t.call(O),F<2&&(I=TypeError("The iterator does not provide a '"+ee+"' method"),F=1);O=c}else if((t=(L=le.n<0)?I:T.call(x,le))!==u)break}catch(oe){O=c,F=1,I=oe}finally{W=1}}return{value:t,done:L}}}(A,_,E),!0),C}var u={};function h(){}function d(){}function y(){}t=Object.getPrototypeOf;var b=[][n]?t(t([][n]())):(s(t={},n,function(){return this}),t),w=y.prototype=h.prototype=Object.create(b);function S(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,y):(A.__proto__=y,s(A,e,"GeneratorFunction")),A.prototype=Object.create(w),A}return d.prototype=y,s(w,"constructor",y),s(y,"constructor",d),d.displayName="GeneratorFunction",s(y,e,"GeneratorFunction"),s(w),s(w,e,"Generator"),s(w,n,function(){return this}),s(w,"toString",function(){return"[object Generator]"}),(l.exports=a=function(){return{w:i,m:S}},l.exports.__esModule=!0,l.exports.default=l.exports)()}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Ns=we((o,l)=>{de(),ye(),ge();var s=js(),a=Rs();function c(t,r){function n(i,u,h,d){try{var y=t[i](u),b=y.value;return b instanceof s?r.resolve(b.v).then(function(w){n("next",w,h,d)},function(w){n("throw",w,h,d)}):r.resolve(b).then(function(w){y.value=w,h(y)},function(w){return n("throw",w,h,d)})}catch(w){d(w)}}var e;this.next||(a(c.prototype),a(c.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),a(this,"_invoke",function(i,u,h){function d(){return new r(function(y,b){n(i,h,y,b)})}return e=e?e.then(d,d):d()},!0)}l.exports=c,l.exports.__esModule=!0,l.exports.default=l.exports}),Bs=we((o,l)=>{de(),ye(),ge();var s=Ms(),a=Ns();function c(t,r,n,e,i){return new a(s().w(t,r,n,e),i||Promise)}l.exports=c,l.exports.__esModule=!0,l.exports.default=l.exports}),Pc=we((o,l)=>{de(),ye(),ge();var s=Bs();function a(c,t,r,n,e){var i=s(c,t,r,n,e);return i.next().then(function(u){return u.done?u.value:i.next()})}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Cc=we((o,l)=>{de(),ye(),ge();function s(a){var c=Object(a),t=[];for(var r in c)t.unshift(r);return function n(){for(;t.length;)if((r=t.pop())in c)return n.value=r,n.done=!1,n;return n.done=!0,n}}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),jc=we((o,l)=>{de(),ye(),ge();var s=Pr().default;function a(c){if(c!=null){var t=c[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(c);if(typeof c.next=="function")return c;if(!isNaN(c.length))return{next:function(){return c&&r>=c.length&&(c=void 0),{value:c&&c[r++],done:!c}}}}throw new TypeError(s(c)+" is not iterable")}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Rc=we((o,l)=>{de(),ye(),ge();var s=js(),a=Ms(),c=Pc(),t=Bs(),r=Ns(),n=Cc(),e=jc();function i(){var u=a(),h=u.m(i),d=(Object.getPrototypeOf?Object.getPrototypeOf(h):h.__proto__).constructor;function y(S){var A=typeof S=="function"&&S.constructor;return!!A&&(A===d||(A.displayName||A.name)==="GeneratorFunction")}var b={throw:1,return:2,break:3,continue:3};function w(S){var A,g;return function(_){A||(A={stop:function(){return g(_.a,2)},catch:function(){return _.v},abrupt:function(E,v){return g(_.a,b[E],v)},delegateYield:function(E,v,C){return A.resultName=v,g(_.d,e(E),C)},finish:function(E){return g(_.f,E)}},g=function(E,v,C){_.p=A.prev,_.n=A.next;try{return E(v,C)}finally{A.next=_.n}}),A.resultName&&(A[A.resultName]=_.v,A.resultName=void 0),A.sent=_.v,A.next=_.n;try{return S.call(this,A)}finally{_.p=A.prev,_.n=A.next}}}return(l.exports=i=function(){return{wrap:function(S,A,g,_){return u.w(w(S),A,g,_&&_.reverse())},isGeneratorFunction:y,mark:u.m,awrap:function(S,A){return new s(S,A)},AsyncIterator:r,async:function(S,A,g,_,E){return(y(A)?t:c)(w(S),A,g,_,E)},keys:n,values:e}},l.exports.__esModule=!0,l.exports.default=l.exports)()}l.exports=i,l.exports.__esModule=!0,l.exports.default=l.exports}),Mc=we((o,l)=>{de(),ye(),ge();var s=Rc()();l.exports=s;try{regeneratorRuntime=s}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}}),Nc=we((o,l)=>{de(),ye(),ge(),function(s,a){typeof o=="object"&&typeof l<"u"?a(o,Sc(),Oc(),Cs(),Tc(),Mc()):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"],a):(s=typeof globalThis<"u"?globalThis:s||self,a(s.brokerFactory={},s._defineProperty,s._slicedToArray,s.fastUniqueNumbers,s._asyncToGenerator,s._regeneratorRuntime))}(o,function(s,a,c,t,r,n){var e=function(g){return typeof g.start=="function"},i=new WeakMap;function u(g,_){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(g);_&&(v=v.filter(function(C){return Object.getOwnPropertyDescriptor(g,C).enumerable})),E.push.apply(E,v)}return E}function h(g){for(var _=1;_<arguments.length;_++){var E=arguments[_]!=null?arguments[_]:{};_%2?u(Object(E),!0).forEach(function(v){a(g,v,E[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):u(Object(E)).forEach(function(v){Object.defineProperty(g,v,Object.getOwnPropertyDescriptor(E,v))})}return g}var d=function(g){return h(h({},g),{},{connect:function(_){var E=_.call;return r(n.mark(function v(){var C,T,x,P;return n.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return C=new MessageChannel,T=C.port1,x=C.port2,O.next=1,E("connect",{port:T},[T]);case 1:return P=O.sent,i.set(x,P),O.abrupt("return",x);case 2:case"end":return O.stop()}},v)}))},disconnect:function(_){var E=_.call;return function(){var v=r(n.mark(function C(T){var x;return n.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(x=i.get(T),x!==void 0){P.next=1;break}throw new Error("The given port is not connected.");case 1:return P.next=2,E("disconnect",{portId:x});case 2:case"end":return P.stop()}},C)}));return function(C){return v.apply(this,arguments)}}()},isSupported:function(_){var E=_.call;return function(){return E("isSupported")}}})};function y(g,_){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(g);_&&(v=v.filter(function(C){return Object.getOwnPropertyDescriptor(g,C).enumerable})),E.push.apply(E,v)}return E}function b(g){for(var _=1;_<arguments.length;_++){var E=arguments[_]!=null?arguments[_]:{};_%2?y(Object(E),!0).forEach(function(v){a(g,v,E[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):y(Object(E)).forEach(function(v){Object.defineProperty(g,v,Object.getOwnPropertyDescriptor(E,v))})}return g}var w=new WeakMap,S=function(g){if(w.has(g))return w.get(g);var _=new Map;return w.set(g,_),_},A=function(g){var _=d(g);return function(E){var v=S(E);E.addEventListener("message",function(V){var L=V.data,le=L.id;if(le!==null&&v.has(le)){var re=v.get(le),ee=re.reject,ue=re.resolve;v.delete(le),L.error===void 0?ue(L.result):ee(new Error(L.error.message))}}),e(E)&&E.start();for(var C=function(V){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new Promise(function(re,ee){var ue=t.generateUniqueNumber(v);v.set(ue,{reject:ee,resolve:re}),L===null?E.postMessage({id:ue,method:V},le):E.postMessage({id:ue,method:V,params:L},le)})},T=function(V,L){var le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];E.postMessage({id:null,method:V,params:L},le)},x={},P=0,O=Object.entries(_);P<O.length;P++){var F=c(O[P],2),I=F[0],W=F[1];x=b(b({},x),{},a({},I,W({call:C,notify:T})))}return b({},x)}};s.createBroker=A})}),Bc=we((o,l)=>{de(),ye(),ge(),function(s,a){typeof o=="object"&&typeof l<"u"?a(o,Pr(),Nc(),Cs()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/typeof","broker-factory","fast-unique-numbers"],a):(s=typeof globalThis<"u"?globalThis:s||self,a(s.workerTimersBroker={},s._typeof,s.brokerFactory,s.fastUniqueNumbers))}(o,function(s,a,c,t){var r=new Map([[0,null]]),n=new Map([[0,null]]),e=c.createBroker({clearInterval:function(u){var h=u.call;return function(d){a(r.get(d))==="symbol"&&(r.set(d,null),h("clear",{timerId:d,timerType:"interval"}).then(function(){r.delete(d)}))}},clearTimeout:function(u){var h=u.call;return function(d){a(n.get(d))==="symbol"&&(n.set(d,null),h("clear",{timerId:d,timerType:"timeout"}).then(function(){n.delete(d)}))}},setInterval:function(u){var h=u.call;return function(d){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,b=arguments.length,w=new Array(b>2?b-2:0),S=2;S<b;S++)w[S-2]=arguments[S];var A=Symbol(),g=t.generateUniqueNumber(r);r.set(g,A);var _=function(){return h("set",{delay:y,now:performance.timeOrigin+performance.now(),timerId:g,timerType:"interval"}).then(function(){var E=r.get(g);if(E===void 0)throw new Error("The timer is in an undefined state.");E===A&&(d.apply(void 0,w),r.get(g)===A&&_())})};return _(),g}},setTimeout:function(u){var h=u.call;return function(d){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,b=arguments.length,w=new Array(b>2?b-2:0),S=2;S<b;S++)w[S-2]=arguments[S];var A=Symbol(),g=t.generateUniqueNumber(n);return n.set(g,A),h("set",{delay:y,now:performance.timeOrigin+performance.now(),timerId:g,timerType:"timeout"}).then(function(){var _=n.get(g);if(_===void 0)throw new Error("The timer is in an undefined state.");_===A&&(n.delete(g),d.apply(void 0,w))}),g}}}),i=function(u){var h=new Worker(u);return e(h)};s.load=i,s.wrap=e})}),Lc=we((o,l)=>{de(),ye(),ge(),function(s,a){typeof o=="object"&&typeof l<"u"?a(o,Bc()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],a):(s=typeof globalThis<"u"?globalThis:s||self,a(s.workerTimers={},s.workerTimersBroker))}(o,function(s,a){var c=function(h,d){var y=null;return function(){if(y!==null)return y;var b=new Blob([d],{type:"application/javascript; charset=utf-8"}),w=URL.createObjectURL(b);return y=h(w),setTimeout(function(){return URL.revokeObjectURL(w)}),y}},t=`(()=>{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)})()})();`,r=c(a.load,t),n=function(h){return r().clearInterval(h)},e=function(h){return r().clearTimeout(h)},i=function(){var h;return(h=r()).setInterval.apply(h,arguments)},u=function(){var h;return(h=r()).setTimeout.apply(h,arguments)};s.clearInterval=n,s.clearTimeout=e,s.setInterval=i,s.setTimeout=u})}),Cr=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.isReactNativeBrowser=o.isWebWorker=void 0;var l=()=>{var t;return typeof window<"u"?typeof navigator<"u"&&((t=navigator.userAgent)==null?void 0:t.toLowerCase().indexOf(" electron/"))>-1&&(Je!=null&&Je.versions)?!Object.prototype.hasOwnProperty.call(Je.versions,"electron"):typeof window.document<"u":!1},s=()=>{var t,r;return!!(typeof self=="object"&&((r=(t=self==null?void 0:self.constructor)==null?void 0:t.name)!=null&&r.includes("WorkerGlobalScope"))&&typeof Deno>"u")},a=()=>typeof navigator<"u"&&navigator.product==="ReactNative",c=l()||s()||a();o.isWebWorker=s(),o.isReactNativeBrowser=a(),o.default=c}),Uc=we(o=>{de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(i,u,h,d){d===void 0&&(d=h);var y=Object.getOwnPropertyDescriptor(u,h);(!y||("get"in y?!u.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return u[h]}}),Object.defineProperty(i,d,y)}:function(i,u,h,d){d===void 0&&(d=h),i[d]=u[h]}),s=o&&o.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,"default",{enumerable:!0,value:u})}:function(i,u){i.default=u}),a=o&&o.__importStar||function(){var i=function(u){return i=Object.getOwnPropertyNames||function(h){var d=[];for(var y in h)Object.prototype.hasOwnProperty.call(h,y)&&(d[d.length]=y);return d},i(u)};return function(u){if(u&&u.__esModule)return u;var h={};if(u!=null)for(var d=i(u),y=0;y<d.length;y++)d[y]!=="default"&&l(h,u,d[y]);return s(h,u),h}}();Object.defineProperty(o,"__esModule",{value:!0});var c=Lc(),t=a(Cr()),r={set:c.setInterval,clear:c.clearInterval},n={set:(i,u)=>setInterval(i,u),clear:i=>clearInterval(i)},e=i=>{switch(i){case"native":return n;case"worker":return r;case"auto":default:return t.default&&!t.isWebWorker&&!t.isReactNativeBrowser?r:n}};o.default=e}),Ls=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(o,"__esModule",{value:!0});var s=l(Uc()),a=class{constructor(c,t){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=c,this.timer=typeof t=="object"&&"set"in t&&"clear"in t?t:(0,s.default)(t),this.setKeepalive(c.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(c){if(c*=1e3,isNaN(c)||c<=0||c>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${c}`);this._keepalive=c,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${c}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let c=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+c,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)}};o.default=a}),Ci=we(o=>{var v;de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(C,T,x,P){P===void 0&&(P=x);var O=Object.getOwnPropertyDescriptor(T,x);(!O||("get"in O?!T.__esModule:O.writable||O.configurable))&&(O={enumerable:!0,get:function(){return T[x]}}),Object.defineProperty(C,P,O)}:function(C,T,x,P){P===void 0&&(P=x),C[P]=T[x]}),s=o&&o.__setModuleDefault||(Object.create?function(C,T){Object.defineProperty(C,"default",{enumerable:!0,value:T})}:function(C,T){C.default=T}),a=o&&o.__importStar||function(){var C=function(T){return C=Object.getOwnPropertyNames||function(x){var P=[];for(var O in x)Object.prototype.hasOwnProperty.call(x,O)&&(P[P.length]=O);return P},C(T)};return function(T){if(T&&T.__esModule)return T;var x={};if(T!=null)for(var P=C(T),O=0;O<P.length;O++)P[O]!=="default"&&l(x,T,P[O]);return s(x,T),x}}(),c=o&&o.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(o,"__esModule",{value:!0});var t=c(Hu()),r=Xt(),n=c(Yu()),e=c(Mt()),i=a(Qu()),u=c(Es()),h=c(mc()),d=c(Ps()),y=c(bc()),b=ar(),w=vc(),S=c(Ls()),A=a(Cr()),g=globalThis.setImmediate||((...C)=>{let T=C.shift();(0,b.nextTick)(()=>{T(...C)})}),_={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},E=(v=class extends w.TypedEventEmitter{constructor(x,P){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=P||{};for(let O in _)typeof this.options[O]>"u"?this.options[O]=_[O]:this.options[O]=P[O];this.log=this.options.log||(0,e.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",v.VERSION),A.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",A.default?"browser":"node"),this.log("MqttClient :: options.protocol",P.protocol),this.log("MqttClient :: options.protocolVersion",P.protocolVersion),this.log("MqttClient :: options.username",P.username),this.log("MqttClient :: options.keepalive",P.keepalive),this.log("MqttClient :: options.reconnectPeriod",P.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",P.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",P.properties?P.properties.topicAliasMaximum:void 0),this.options.clientId=typeof P.clientId=="string"?P.clientId:v.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=P.protocolVersion===5&&P.customHandleAcks?P.customHandleAcks:(...O)=>{O[3](null,0)},this.options.writeCache||(t.default.writeToStream.cacheNumbers=!1),this.streamBuilder=x,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new d.default:this.options.messageIdProvider,this.outgoingStore=P.outgoingStore||new u.default,this.incomingStore=P.incomingStore||new u.default,this.queueQoSZero=P.queueQoSZero===void 0?!0:P.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,P.properties&&P.properties.topicAliasMaximum>0&&(P.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new y.default(P.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:O}=this,F=()=>{let I=O.shift();this.log("deliver :: entry %o",I);let W=null;if(!I){this._resubscribe();return}W=I.packet,this.log("deliver :: call _sendPacket for %o",W);let V=!0;W.messageId&&W.messageId!==0&&(this.messageIdProvider.register(W.messageId)||(V=!1)),V?this._sendPacket(W,L=>{I.cb&&I.cb(L),F()}):(this.log("messageId: %d has already used. The message is skipped and removed.",W.messageId),F())};this.log("connect :: sending queued packets"),F()}),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(x,P){P()}handleMessage(x,P){P()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var le;let x=new r.Writable,P=t.default.parser(this.options),O=null,F=[];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),P.on("packet",re=>{this.log("parser :: on packet push to packets array."),F.push(re)});let I=()=>{this.log("work :: getting next packet in queue");let re=F.shift();if(re)this.log("work :: packet pulled from queue"),(0,h.default)(this,re,W);else{this.log("work :: no packets in queue");let ee=O;O=null,this.log("work :: done flag is %s",!!ee),ee&&ee()}},W=()=>{if(F.length)(0,b.nextTick)(I);else{let re=O;O=null,re()}};x._write=(re,ee,ue)=>{O=ue,this.log("writable stream :: parsing buffer"),P.parse(re),I()};let V=re=>{this.log("streamErrorHandler :: error",re.message),re.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",re)):this.noop(re)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(x),this.stream.on("error",V),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 L={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&&(L.will={...this.options.will,payload:(le=this.options.will)==null?void 0:le.payload}),this.topicAliasRecv&&(L.properties||(L.properties={}),this.topicAliasRecv&&(L.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(L),P.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 re={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(re)}}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(x,P,O,F){this.log("publish :: message `%s` to topic `%s`",P,x);let{options:I}=this;typeof O=="function"&&(F=O,O=null),O=O||{},O={qos:0,retain:!1,dup:!1,...O};let{qos:W,retain:V,dup:L,properties:le,cbStorePut:re}=O;if(this._checkDisconnecting(F))return this;let ee=()=>{let ue=0;if((W===1||W===2)&&(ue=this._nextId(),ue===null))return this.log("No messageId left"),!1;let G={cmd:"publish",topic:x,payload:P,qos:W,retain:V,messageId:ue,dup:L};switch(I.protocolVersion===5&&(G.properties=le),this.log("publish :: qos",W),W){case 1:case 2:this.outgoing[G.messageId]={volatile:!1,cb:F||this.noop},this.log("MqttClient:publish: packet cmd: %s",G.cmd),this._sendPacket(G,void 0,re);break;default:this.log("MqttClient:publish: packet cmd: %s",G.cmd),this._sendPacket(G,F,re);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ee())&&this._storeProcessingQueue.push({invoke:ee,cbStorePut:O.cbStorePut,callback:F}),this}publishAsync(x,P,O){return new Promise((F,I)=>{this.publish(x,P,O,(W,V)=>{W?I(W):F(V)})})}subscribe(x,P,O){let F=this.options.protocolVersion;typeof P=="function"&&(O=P),O=O||this.noop;let I=!1,W=[];typeof x=="string"?(x=[x],W=x):Array.isArray(x)?W=x:typeof x=="object"&&(I=x.resubscribe,delete x.resubscribe,W=Object.keys(x));let V=i.validateTopics(W);if(V!==null)return g(O,new Error(`Invalid topic ${V}`)),this;if(this._checkDisconnecting(O))return this.log("subscribe: discconecting true"),this;let L={qos:0};F===5&&(L.nl=!1,L.rap=!1,L.rh=0),P={...L,...P};let{properties:le}=P,re=[],ee=(oe,R)=>{if(R=R||P,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,oe)||this._resubscribeTopics[oe].qos<R.qos||I){let Q={topic:oe,qos:R.qos};F===5&&(Q.nl=R.nl,Q.rap=R.rap,Q.rh=R.rh,Q.properties=le),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",Q.topic,Q.qos),re.push(Q)}};if(Array.isArray(x)?x.forEach(oe=>{this.log("subscribe: array topic %s",oe),ee(oe)}):Object.keys(x).forEach(oe=>{this.log("subscribe: object topic %s, %o",oe,x[oe]),ee(oe,x[oe])}),!re.length)return O(null,[]),this;let ue=(oe,R)=>{let Q={cmd:"subscribe",subscriptions:oe,messageId:R};if(le&&(Q.properties=le),this.options.resubscribe){this.log("subscribe :: resubscribe true");let q=[];oe.forEach(Ee=>{if(this.options.reconnectPeriod>0){let X={qos:Ee.qos};F===5&&(X.nl=Ee.nl||!1,X.rap=Ee.rap||!1,X.rh=Ee.rh||0,X.properties=Ee.properties),this._resubscribeTopics[Ee.topic]=X,q.push(Ee.topic)}}),this.messageIdToTopic[Q.messageId]=q}let he=new Promise((q,Ee)=>{this.outgoing[Q.messageId]={volatile:!0,cb(X,U){if(!X){let{granted:ae}=U;for(let H=0;H<ae.length;H+=1)oe[H].qos=ae[H]}X?Ee(new b.ErrorWithSubackPacket(X.message,U)):q(U)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(Q),he},G=()=>{let oe=this.options.subscribeBatchSize??re.length,R=[];for(let Q=0;Q<re.length;Q+=oe){let he=re.slice(Q,Q+oe),q=this._nextId();if(q===null)return this.log("No messageId left"),!1;R.push(ue(he,q))}return Promise.all(R).then(Q=>{O(null,re,Q.at(-1))}).catch(Q=>{O(Q,re,Q.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!G())&&this._storeProcessingQueue.push({invoke:G,callback:O}),this}subscribeAsync(x,P){return new Promise((O,F)=>{this.subscribe(x,P,(I,W)=>{I?F(I):O(W)})})}unsubscribe(x,P,O){typeof x=="string"&&(x=[x]),typeof P=="function"&&(O=P),O=O||this.noop;let F=i.validateTopics(x);if(F!==null)return g(O,new Error(`Invalid topic ${F}`)),this;if(this._checkDisconnecting(O))return this;let I=()=>{let W=this._nextId();if(W===null)return this.log("No messageId left"),!1;let V={cmd:"unsubscribe",messageId:W,unsubscriptions:[]};return typeof x=="string"?V.unsubscriptions=[x]:Array.isArray(x)&&(V.unsubscriptions=x),this.options.resubscribe&&V.unsubscriptions.forEach(L=>{delete this._resubscribeTopics[L]}),typeof P=="object"&&P.properties&&(V.properties=P.properties),this.outgoing[V.messageId]={volatile:!0,cb:O},this.log("unsubscribe: call _sendPacket"),this._sendPacket(V),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!I())&&this._storeProcessingQueue.push({invoke:I,callback:O}),this}unsubscribeAsync(x,P){return new Promise((O,F)=>{this.unsubscribe(x,P,(I,W)=>{I?F(I):O(W)})})}end(x,P,O){this.log("end :: (%s)",this.options.clientId),(x==null||typeof x!="boolean")&&(O=O||P,P=x,x=!1),typeof P!="object"&&(O=O||P,P=null),this.log("end :: cb? %s",!!O),(!O||typeof O!="function")&&(O=this.noop);let F=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(W=>{this.outgoingStore.close(V=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),O){let L=W||V;this.log("end :: closeStores: invoking callback with args"),O(L)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},I=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,x),this._cleanUp(x,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,b.nextTick)(F)},P)};return this.disconnecting?(O(),this):(this._clearReconnect(),this.disconnecting=!0,!x&&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,I,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),I()),this)}endAsync(x,P){return new Promise((O,F)=>{this.end(x,P,I=>{I?F(I):O()})})}removeOutgoingMessage(x){if(this.outgoing[x]){let{cb:P}=this.outgoing[x];this._removeOutgoingAndStoreMessage(x,()=>{P(new Error("Message removed"))})}return this}reconnect(x){this.log("client reconnect");let P=()=>{x?(this.options.incomingStore=x.incomingStore,this.options.outgoingStore=x.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=P:P(),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(x=>{this.outgoing[x].volatile&&typeof this.outgoing[x].cb=="function"&&(this.outgoing[x].cb(new Error("Connection closed")),delete this.outgoing[x])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(x=>{typeof this.outgoing[x].cb=="function"&&(this.outgoing[x].cb(new Error("Connection closed")),delete this.outgoing[x])}))}_removeTopicAliasAndRecoverTopicName(x){let P;x.properties&&(P=x.properties.topicAlias);let O=x.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",P,O),O.length===0){if(typeof P>"u")return new Error("Unregistered Topic Alias");if(O=this.topicAliasSend.getTopicByAlias(P),typeof O>"u")return new Error("Unregistered Topic Alias");x.topic=O}P&&delete x.properties.topicAlias}_checkDisconnecting(x){return this.disconnecting&&(x&&x!==this.noop?x(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(x,P,O={}){if(P&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",P)),this.log("_cleanUp :: forced? %s",x),x)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let F={cmd:"disconnect",...O};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(F,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),g(()=>{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(),P&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",P),P())}_storeAndSend(x,P,O){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",x.cmd);let F=x,I;if(F.cmd==="publish"&&(F=(0,n.default)(x),I=this._removeTopicAliasAndRecoverTopicName(F),I))return P&&P(I);this.outgoingStore.put(F,W=>{if(W)return P&&P(W);O(),this._writePacket(x,P)})}_applyTopicAlias(x){if(this.options.protocolVersion===5&&x.cmd==="publish"){let P;x.properties&&(P=x.properties.topicAlias);let O=x.topic.toString();if(this.topicAliasSend)if(P){if(O.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",O,P),!this.topicAliasSend.put(O,P)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",O,P),new Error("Sending Topic Alias out of range")}else O.length!==0&&(this.options.autoAssignTopicAlias?(P=this.topicAliasSend.getAliasByTopic(O),P?(x.topic="",x.properties={...x.properties,topicAlias:P},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",O,P)):(P=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(O,P),x.properties={...x.properties,topicAlias:P},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",O,P))):this.options.autoUseTopicAlias&&(P=this.topicAliasSend.getAliasByTopic(O),P&&(x.topic="",x.properties={...x.properties,topicAlias:P},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",O,P))));else if(P)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",O,P),new Error("Sending Topic Alias out of range")}}_noop(x){this.log("noop ::",x)}_writePacket(x,P){this.log("_writePacket :: packet: %O",x),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",x),this.log("_writePacket :: writing to stream");let O=t.default.writeToStream(x,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",O),!O&&P&&P!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",P)):P&&(this.log("_writePacket :: invoking cb"),P())}_sendPacket(x,P,O,F){this.log("_sendPacket :: (%s) :: start",this.options.clientId),O=O||this.noop,P=P||this.noop;let I=this._applyTopicAlias(x);if(I){P(I);return}if(!this.connected){if(x.cmd==="auth"){this._writePacket(x,P);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(x,P,O);return}if(F){this._writePacket(x,P);return}switch(x.cmd){case"publish":break;case"pubrel":this._storeAndSend(x,P,O);return;default:this._writePacket(x,P);return}switch(x.qos){case 2:case 1:this._storeAndSend(x,P,O);break;case 0:default:this._writePacket(x,P);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(x,P,O){this.log("_storePacket :: packet: %o",x),this.log("_storePacket :: cb? %s",!!P),O=O||this.noop;let F=x;if(F.cmd==="publish"){F=(0,n.default)(x);let W=this._removeTopicAliasAndRecoverTopicName(F);if(W)return P&&P(W)}let I=F.qos||0;I===0&&this.queueQoSZero||F.cmd!=="publish"?this.queue.push({packet:F,cb:P}):I>0?(P=this.outgoing[F.messageId]?this.outgoing[F.messageId].cb:null,this.outgoingStore.put(F,W=>{if(W)return P&&P(W);O()})):P&&P(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new S.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(x=!1){this.keepaliveManager&&this.options.keepalive&&(x||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 x=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&x.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let P=0;P<x.length;P++){let O={};O[x[P]]=this._resubscribeTopics[x[P]],O.resubscribe=!0,this.subscribe(O,{properties:O[x[P]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(x){if(this.disconnected){this.emit("connect",x);return}this.connackPacket=x,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let P=()=>{let O=this.outgoingStore.createStream(),F=()=>{O.destroy(),O=null,this._flushStoreProcessingQueue(),I()},I=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",F),O.on("error",V=>{I(),this._flushStoreProcessingQueue(),this.removeListener("close",F),this.emit("error",V)});let W=()=>{if(!O)return;let V=O.read(1),L;if(!V){O.once("readable",W);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[V.messageId]){W();return}!this.disconnecting&&!this.reconnectTimer?(L=this.outgoing[V.messageId]?this.outgoing[V.messageId].cb:null,this.outgoing[V.messageId]={volatile:!1,cb(le,re){L&&L(le,re),W()}},this._packetIdsDuringStoreProcessing[V.messageId]=!0,this.messageIdProvider.register(V.messageId)?this._sendPacket(V,void 0,void 0,!0):this.log("messageId: %d has already used.",V.messageId)):O.destroy&&O.destroy()};O.on("end",()=>{let V=!0;for(let L in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[L]){V=!1;break}this.removeListener("close",F),V?(I(),this._invokeAllStoreProcessingQueue(),this.emit("connect",x)):P()}),W()};P()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let x=this._storeProcessingQueue[0];if(x&&x.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let x of this._storeProcessingQueue)x.cbStorePut&&x.cbStorePut(new Error("Connection closed")),x.callback&&x.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(x,P){delete this.outgoing[x],this.outgoingStore.del({messageId:x},(O,F)=>{P(O,F),this.messageIdProvider.deallocate(x),this._invokeStoreProcessingQueue()})}},Pe(v,"VERSION",b.MQTTJS_VERSION),v);o.default=E}),Dc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=Ts(),s=class{constructor(){Pe(this,"numberAllocator");Pe(this,"lastId");this.numberAllocator=new l.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(a){return this.numberAllocator.use(a)}deallocate(a){this.numberAllocator.free(a)}clear(){this.numberAllocator.clear()}};o.default=s});function Fc(){if(ji)return jr;ji=!0;let o=2147483647,l=36,s=1,a=26,c=38,t=700,r=72,n=128,e="-",i=/^xn--/,u=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=l-s,b=Math.floor,w=String.fromCharCode;function S(O){throw new RangeError(d[O])}function A(O,F){let I=[],W=O.length;for(;W--;)I[W]=F(O[W]);return I}function g(O,F){let I=O.split("@"),W="";I.length>1&&(W=I[0]+"@",O=I[1]),O=O.replace(h,".");let V=O.split("."),L=A(V,F).join(".");return W+L}function _(O){let F=[],I=0,W=O.length;for(;I<W;){let V=O.charCodeAt(I++);if(V>=55296&&V<=56319&&I<W){let L=O.charCodeAt(I++);(L&64512)==56320?F.push(((V&1023)<<10)+(L&1023)+65536):(F.push(V),I--)}else F.push(V)}return F}let E=O=>String.fromCodePoint(...O),v=function(O){return O>=48&&O<58?26+(O-48):O>=65&&O<91?O-65:O>=97&&O<123?O-97:l},C=function(O,F){return O+22+75*(O<26)-((F!=0)<<5)},T=function(O,F,I){let W=0;for(O=I?b(O/t):O>>1,O+=b(O/F);O>y*a>>1;W+=l)O=b(O/y);return b(W+(y+1)*O/(O+c))},x=function(O){let F=[],I=O.length,W=0,V=n,L=r,le=O.lastIndexOf(e);le<0&&(le=0);for(let re=0;re<le;++re)O.charCodeAt(re)>=128&&S("not-basic"),F.push(O.charCodeAt(re));for(let re=le>0?le+1:0;re<I;){let ee=W;for(let G=1,oe=l;;oe+=l){re>=I&&S("invalid-input");let R=v(O.charCodeAt(re++));R>=l&&S("invalid-input"),R>b((o-W)/G)&&S("overflow"),W+=R*G;let Q=oe<=L?s:oe>=L+a?a:oe-L;if(R<Q)break;let he=l-Q;G>b(o/he)&&S("overflow"),G*=he}let ue=F.length+1;L=T(W-ee,ue,ee==0),b(W/ue)>o-V&&S("overflow"),V+=b(W/ue),W%=ue,F.splice(W++,0,V)}return String.fromCodePoint(...F)},P=function(O){let F=[];O=_(O);let I=O.length,W=n,V=0,L=r;for(let ee of O)ee<128&&F.push(w(ee));let le=F.length,re=le;for(le&&F.push(e);re<I;){let ee=o;for(let G of O)G>=W&&G<ee&&(ee=G);let ue=re+1;ee-W>b((o-V)/ue)&&S("overflow"),V+=(ee-W)*ue,W=ee;for(let G of O)if(G<W&&++V>o&&S("overflow"),G===W){let oe=V;for(let R=l;;R+=l){let Q=R<=L?s:R>=L+a?a:R-L;if(oe<Q)break;let he=oe-Q,q=l-Q;F.push(w(C(Q+he%q,0))),oe=b(he/q)}F.push(w(C(oe,0))),L=T(V,ue,re===le),V=0,++re}++V,++W}return F.join("")};return jr={version:"2.3.1",ucs2:{decode:_,encode:E},decode:x,encode:P,toASCII:function(O){return g(O,function(F){return u.test(F)?"xn--"+P(F):F})},toUnicode:function(O){return g(O,function(F){return i.test(F)?x(F.slice(4).toLowerCase()):F})}},jr}var jr,ji,Wt,Wc=_t(()=>{de(),ye(),ge(),jr={},ji=!1,Wt=Fc(),Wt.decode,Wt.encode,Wt.toASCII,Wt.toUnicode,Wt.ucs2,Wt.version});function $c(){return Bi||(Bi=!0,Ni=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var o={},l=Symbol("test"),s=Object(l);if(typeof l=="string"||Object.prototype.toString.call(l)!=="[object Symbol]"||Object.prototype.toString.call(s)!=="[object Symbol]")return!1;var a=42;o[l]=a;for(l in o)return!1;if(typeof Object.keys=="function"&&Object.keys(o).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(o).length!==0)return!1;var c=Object.getOwnPropertySymbols(o);if(c.length!==1||c[0]!==l||!Object.prototype.propertyIsEnumerable.call(o,l))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var t=Object.getOwnPropertyDescriptor(o,l);if(t.value!==a||t.enumerable!==!0)return!1}return!0}),Ni}function qc(){return Ui||(Ui=!0,Li=Error),Li}function Vc(){return Fi||(Fi=!0,Di=EvalError),Di}function zc(){return $i||($i=!0,Wi=RangeError),Wi}function Kc(){return Vi||(Vi=!0,qi=ReferenceError),qi}function Us(){return Ki||(Ki=!0,zi=SyntaxError),zi}function vr(){return Gi||(Gi=!0,Hi=TypeError),Hi}function Hc(){return Qi||(Qi=!0,Yi=URIError),Yi}function Gc(){if(Ji)return Rr;Ji=!0;var o=typeof Symbol<"u"&&Symbol,l=$c();return Rr=function(){return typeof o!="function"||typeof Symbol!="function"||typeof o("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:l()},Rr}function Yc(){if(Xi)return Mr;Xi=!0;var o={__proto__:null,foo:{}},l=Object;return Mr=function(){return{__proto__:o}.foo===o.foo&&!(o instanceof l)},Mr}function Qc(){if(Zi)return Nr;Zi=!0;var o="Function.prototype.bind called on incompatible ",l=Object.prototype.toString,s=Math.max,a="[object Function]",c=function(n,e){for(var i=[],u=0;u<n.length;u+=1)i[u]=n[u];for(var h=0;h<e.length;h+=1)i[h+n.length]=e[h];return i},t=function(n,e){for(var i=[],u=e,h=0;u<n.length;u+=1,h+=1)i[h]=n[u];return i},r=function(n,e){for(var i="",u=0;u<n.length;u+=1)i+=n[u],u+1<n.length&&(i+=e);return i};return Nr=function(n){var e=this;if(typeof e!="function"||l.apply(e)!==a)throw new TypeError(o+e);for(var i=t(arguments,1),u,h=function(){if(this instanceof u){var S=e.apply(this,c(i,arguments));return Object(S)===S?S:this}return e.apply(n,c(i,arguments))},d=s(0,e.length-i.length),y=[],b=0;b<d;b++)y[b]="$"+b;if(u=Function("binder","return function ("+r(y,",")+"){ return binder.apply(this,arguments); }")(h),e.prototype){var w=function(){};w.prototype=e.prototype,u.prototype=new w,w.prototype=null}return u},Nr}function Ri(){if(eo)return Br;eo=!0;var o=Qc();return Br=Function.prototype.bind||o,Br}function Jc(){if(to)return Lr;to=!0;var o=Function.prototype.call,l=Object.prototype.hasOwnProperty,s=Ri();return Lr=s.call(o,l),Lr}function lr(){if(ro)return Ur;ro=!0;var o,l=qc(),s=Vc(),a=zc(),c=Kc(),t=Us(),r=vr(),n=Hc(),e=Function,i=function(re){try{return e('"use strict"; return ('+re+").constructor;")()}catch{}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch{u=null}var h=function(){throw new r},d=u?function(){try{return arguments.callee,h}catch{try{return u(arguments,"callee").get}catch{return h}}}():h,y=Gc()(),b=Yc()(),w=Object.getPrototypeOf||(b?function(re){return re.__proto__}:null),S={},A=typeof Uint8Array>"u"||!w?o:w(Uint8Array),g={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?o:ArrayBuffer,"%ArrayIteratorPrototype%":y&&w?w([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":S,"%AsyncGenerator%":S,"%AsyncGeneratorFunction%":S,"%AsyncIteratorPrototype%":S,"%Atomics%":typeof Atomics>"u"?o:Atomics,"%BigInt%":typeof BigInt>"u"?o:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?o:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?o:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":l,"%eval%":eval,"%EvalError%":s,"%Float32Array%":typeof Float32Array>"u"?o:Float32Array,"%Float64Array%":typeof Float64Array>"u"?o:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?o:FinalizationRegistry,"%Function%":e,"%GeneratorFunction%":S,"%Int8Array%":typeof Int8Array>"u"?o:Int8Array,"%Int16Array%":typeof Int16Array>"u"?o:Int16Array,"%Int32Array%":typeof Int32Array>"u"?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":y&&w?w(w([][Symbol.iterator]())):o,"%JSON%":typeof JSON=="object"?JSON:o,"%Map%":typeof Map>"u"?o:Map,"%MapIteratorPrototype%":typeof Map>"u"||!y||!w?o:w(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?o:Promise,"%Proxy%":typeof Proxy>"u"?o:Proxy,"%RangeError%":a,"%ReferenceError%":c,"%Reflect%":typeof Reflect>"u"?o:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?o:Set,"%SetIteratorPrototype%":typeof Set>"u"||!y||!w?o:w(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&w?w(""[Symbol.iterator]()):o,"%Symbol%":y?Symbol:o,"%SyntaxError%":t,"%ThrowTypeError%":d,"%TypedArray%":A,"%TypeError%":r,"%Uint8Array%":typeof Uint8Array>"u"?o:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?o:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?o:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?o:Uint32Array,"%URIError%":n,"%WeakMap%":typeof WeakMap>"u"?o:WeakMap,"%WeakRef%":typeof WeakRef>"u"?o:WeakRef,"%WeakSet%":typeof WeakSet>"u"?o:WeakSet};if(w)try{null.error}catch(re){var _=w(w(re));g["%Error.prototype%"]=_}var E=function re(ee){var ue;if(ee==="%AsyncFunction%")ue=i("async function () {}");else if(ee==="%GeneratorFunction%")ue=i("function* () {}");else if(ee==="%AsyncGeneratorFunction%")ue=i("async function* () {}");else if(ee==="%AsyncGenerator%"){var G=re("%AsyncGeneratorFunction%");G&&(ue=G.prototype)}else if(ee==="%AsyncIteratorPrototype%"){var oe=re("%AsyncGenerator%");oe&&w&&(ue=w(oe.prototype))}return g[ee]=ue,ue},v={__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"]},C=Ri(),T=Jc(),x=C.call(Function.call,Array.prototype.concat),P=C.call(Function.apply,Array.prototype.splice),O=C.call(Function.call,String.prototype.replace),F=C.call(Function.call,String.prototype.slice),I=C.call(Function.call,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V=/\\(\\)?/g,L=function(re){var ee=F(re,0,1),ue=F(re,-1);if(ee==="%"&&ue!=="%")throw new t("invalid intrinsic syntax, expected closing `%`");if(ue==="%"&&ee!=="%")throw new t("invalid intrinsic syntax, expected opening `%`");var G=[];return O(re,W,function(oe,R,Q,he){G[G.length]=Q?O(he,V,"$1"):R||oe}),G},le=function(re,ee){var ue=re,G;if(T(v,ue)&&(G=v[ue],ue="%"+G[0]+"%"),T(g,ue)){var oe=g[ue];if(oe===S&&(oe=E(ue)),typeof oe>"u"&&!ee)throw new r("intrinsic "+re+" exists, but is not available. Please file an issue!");return{alias:G,name:ue,value:oe}}throw new t("intrinsic "+re+" does not exist!")};return Ur=function(re,ee){if(typeof re!="string"||re.length===0)throw new r("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ee!="boolean")throw new r('"allowMissing" argument must be a boolean');if(I(/^%?[^%]*%?$/,re)===null)throw new t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ue=L(re),G=ue.length>0?ue[0]:"",oe=le("%"+G+"%",ee),R=oe.name,Q=oe.value,he=!1,q=oe.alias;q&&(G=q[0],P(ue,x([0,1],q)));for(var Ee=1,X=!0;Ee<ue.length;Ee+=1){var U=ue[Ee],ae=F(U,0,1),H=F(U,-1);if((ae==='"'||ae==="'"||ae==="`"||H==='"'||H==="'"||H==="`")&&ae!==H)throw new t("property names with quotes must have matching quotes");if((U==="constructor"||!X)&&(he=!0),G+="."+U,R="%"+G+"%",T(g,R))Q=g[R];else if(Q!=null){if(!(U in Q)){if(!ee)throw new r("base intrinsic for "+re+" exists, but the property is not available.");return}if(u&&Ee+1>=ue.length){var te=u(Q,U);X=!!te,X&&"get"in te&&!("originalValue"in te.get)?Q=te.get:Q=Q[U]}else X=T(Q,U),Q=Q[U];X&&!he&&(g[R]=Q)}}return Q},Ur}function Mi(){if(no)return Dr;no=!0;var o=lr(),l=o("%Object.defineProperty%",!0)||!1;if(l)try{l({},"a",{value:1})}catch{l=!1}return Dr=l,Dr}function Ds(){if(io)return Fr;io=!0;var o=lr(),l=o("%Object.getOwnPropertyDescriptor%",!0);if(l)try{l([],"length")}catch{l=null}return Fr=l,Fr}function Xc(){if(oo)return Wr;oo=!0;var o=Mi(),l=Us(),s=vr(),a=Ds();return Wr=function(c,t,r){if(!c||typeof c!="object"&&typeof c!="function")throw new s("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,e=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,h=!!a&&a(c,t);if(o)o(c,t,{configurable:i===null&&h?h.configurable:!i,enumerable:n===null&&h?h.enumerable:!n,value:r,writable:e===null&&h?h.writable:!e});else if(u||!n&&!e&&!i)c[t]=r;else throw new l("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Wr}function Zc(){if(so)return $r;so=!0;var o=Mi(),l=function(){return!!o};return l.hasArrayLengthDefineBug=function(){if(!o)return null;try{return o([],"length",{value:1}).length!==1}catch{return!0}},$r=l,$r}function ef(){if(ao)return qr;ao=!0;var o=lr(),l=Xc(),s=Zc()(),a=Ds(),c=vr(),t=o("%Math.floor%");return qr=function(r,n){if(typeof r!="function")throw new c("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||t(n)!==n)throw new c("`length` must be a positive 32-bit integer");var e=arguments.length>2&&!!arguments[2],i=!0,u=!0;if("length"in r&&a){var h=a(r,"length");h&&!h.configurable&&(i=!1),h&&!h.writable&&(u=!1)}return(i||u||!e)&&(s?l(r,"length",n,!0,!0):l(r,"length",n)),r},qr}function tf(){if(lo)return ur;lo=!0;var o=Ri(),l=lr(),s=ef(),a=vr(),c=l("%Function.prototype.apply%"),t=l("%Function.prototype.call%"),r=l("%Reflect.apply%",!0)||o.call(t,c),n=Mi(),e=l("%Math.max%");ur=function(u){if(typeof u!="function")throw new a("a function is required");var h=r(o,t,arguments);return s(h,1+e(0,u.length-(arguments.length-1)),!0)};var i=function(){return r(o,c,arguments)};return n?n(ur,"apply",{value:i}):ur.apply=i,ur}function rf(){if(uo)return Vr;uo=!0;var o=lr(),l=tf(),s=l(o("String.prototype.indexOf"));return Vr=function(a,c){var t=o(a,!!c);return typeof t=="function"&&s(a,".prototype.")>-1?l(t):t},Vr}var Ni,Bi,Li,Ui,Di,Fi,Wi,$i,qi,Vi,zi,Ki,Hi,Gi,Yi,Qi,Rr,Ji,Mr,Xi,Nr,Zi,Br,eo,Lr,to,Ur,ro,Dr,no,Fr,io,Wr,oo,$r,so,qr,ao,ur,lo,Vr,uo,nf=_t(()=>{de(),ye(),ge(),Ni={},Bi=!1,Li={},Ui=!1,Di={},Fi=!1,Wi={},$i=!1,qi={},Vi=!1,zi={},Ki=!1,Hi={},Gi=!1,Yi={},Qi=!1,Rr={},Ji=!1,Mr={},Xi=!1,Nr={},Zi=!1,Br={},eo=!1,Lr={},to=!1,Ur={},ro=!1,Dr={},no=!1,Fr={},io=!1,Wr={},oo=!1,$r={},so=!1,qr={},ao=!1,ur={},lo=!1,Vr={},uo=!1});function co(o){throw new Error("Node.js process "+o+" is not supported by JSPM core outside of Node.js")}function of(){!Zt||!er||(Zt=!1,er.length?Ot=er.concat(Ot):wr=-1,Ot.length&&Fs())}function Fs(){if(!Zt){var o=setTimeout(of,0);Zt=!0;for(var l=Ot.length;l;){for(er=Ot,Ot=[];++wr<l;)er&&er[wr].run();wr=-1,l=Ot.length}er=null,Zt=!1,clearTimeout(o)}}function sf(o){var l=new Array(arguments.length-1);if(arguments.length>1)for(var s=1;s<arguments.length;s++)l[s-1]=arguments[s];Ot.push(new Ws(o,l)),Ot.length===1&&!Zt&&setTimeout(Fs,0)}function Ws(o,l){this.fun=o,this.array=l}function bt(){}function af(o){co("_linkedBinding")}function lf(o){co("dlopen")}function uf(){return[]}function cf(){return[]}function ff(o,l){if(!o)throw new Error(l||"assertion error")}function hf(){return!1}function pf(){return Lt.now()/1e3}function fo(o){var l=Math.floor((Date.now()-Lt.now())*.001),s=Lt.now()*.001,a=Math.floor(s)+l,c=Math.floor(s%1*1e9);return o&&(a=a-o[0],c=c-o[1],c<0&&(a--,c+=Kr)),[a,c]}function $t(){return po}function df(o){return[]}var Ot,Zt,er,wr,$s,qs,Vs,zs,Ks,Hs,Gs,Ys,Qs,Js,Xs,Zs,ea,ta,ra,na,ia,oa,sa,aa,la,zr,ua,ca,fa,ha,pa,da,ga,ya,ma,ba,va,wa,_a,Sa,Ea,Aa,xa,Ia,ka,Oa,Ta,Pa,Ca,ja,Ra,Lt,ho,Kr,Ma,Na,Ba,La,Ua,Da,Fa,Wa,$a,qa,Va,po,za=_t(()=>{de(),ye(),ge(),Ot=[],Zt=!1,wr=-1,Ws.prototype.run=function(){this.fun.apply(null,this.array)},$s="browser",qs="x64",Vs="browser",zs={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Ks=["/usr/bin/node"],Hs=[],Gs="v16.8.0",Ys={},Qs=function(o,l){console.warn((l?l+": ":"")+o)},Js=function(o){co("binding")},Xs=function(o){return 0},Zs=function(){return"/"},ea=function(o){},ta={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},ra=bt,na=[],ia={},oa=!1,sa={},aa=bt,la=bt,zr=function(){return{}},ua=zr,ca=zr,fa=bt,ha=bt,pa=bt,da={},ga={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ya=bt,ma=bt,ba=bt,va=bt,wa=bt,_a=bt,Sa=bt,Ea=void 0,Aa=void 0,xa=void 0,Ia=bt,ka=2,Oa=1,Ta="/bin/usr/node",Pa=9229,Ca="node",ja=[],Ra=bt,Lt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},Lt.now===void 0&&(ho=Date.now(),Lt.timing&&Lt.timing.navigationStart&&(ho=Lt.timing.navigationStart),Lt.now=()=>Date.now()-ho),Kr=1e9,fo.bigint=function(o){var l=fo(o);return typeof BigInt>"u"?l[0]*Kr+l[1]:BigInt(l[0]*Kr)+BigInt(l[1])},Ma=10,Na={},Ba=0,La=$t,Ua=$t,Da=$t,Fa=$t,Wa=$t,$a=bt,qa=$t,Va=$t,po={version:Gs,versions:Ys,arch:qs,platform:Vs,release:ta,_rawDebug:ra,moduleLoadList:na,binding:Js,_linkedBinding:af,_events:Na,_eventsCount:Ba,_maxListeners:Ma,on:$t,addListener:La,once:Ua,off:Da,removeListener:Fa,removeAllListeners:Wa,emit:$a,prependListener:qa,prependOnceListener:Va,listeners:df,domain:ia,_exiting:oa,config:sa,dlopen:lf,uptime:pf,_getActiveRequests:uf,_getActiveHandles:cf,reallyExit:aa,_kill:la,cpuUsage:zr,resourceUsage:ua,memoryUsage:ca,kill:fa,exit:ha,openStdin:pa,allowedNodeEnvironmentFlags:da,assert:ff,features:ga,_fatalExceptions:ya,setUncaughtExceptionCaptureCallback:ma,hasUncaughtExceptionCaptureCallback:hf,emitWarning:Qs,nextTick:sf,_tickCallback:ba,_debugProcess:va,_debugEnd:wa,_startProfilerIdleNotifier:_a,_stopProfilerIdleNotifier:Sa,stdout:Ea,stdin:xa,stderr:Aa,abort:Ia,umask:Xs,chdir:ea,cwd:Zs,env:zs,title:$s,argv:Ks,execArgv:Hs,pid:ka,ppid:Oa,execPath:Ta,debugPort:Pa,hrtime:fo,argv0:Ca,_preload_modules:ja,setSourceMapsEnabled:Ra}});function gf(){if(go)return Hr;go=!0;var o=po;function l(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function s(t,r){for(var n="",e=0,i=-1,u=0,h,d=0;d<=t.length;++d){if(d<t.length)h=t.charCodeAt(d);else{if(h===47)break;h=47}if(h===47){if(!(i===d-1||u===1))if(i!==d-1&&u===2){if(n.length<2||e!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var y=n.lastIndexOf("/");if(y!==n.length-1){y===-1?(n="",e=0):(n=n.slice(0,y),e=n.length-1-n.lastIndexOf("/")),i=d,u=0;continue}}else if(n.length===2||n.length===1){n="",e=0,i=d,u=0;continue}}r&&(n.length>0?n+="/..":n="..",e=2)}else n.length>0?n+="/"+t.slice(i+1,d):n=t.slice(i+1,d),e=d-i-1;i=d,u=0}else h===46&&u!==-1?++u:u=-1}return n}function a(t,r){var n=r.dir||r.root,e=r.base||(r.name||"")+(r.ext||"");return n?n===r.root?n+e:n+t+e:e}var c={resolve:function(){for(var t="",r=!1,n,e=arguments.length-1;e>=-1&&!r;e--){var i;e>=0?i=arguments[e]:(n===void 0&&(n=o.cwd()),i=n),l(i),i.length!==0&&(t=i+"/"+t,r=i.charCodeAt(0)===47)}return t=s(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(l(t),t.length===0)return".";var r=t.charCodeAt(0)===47,n=t.charCodeAt(t.length-1)===47;return t=s(t,!r),t.length===0&&!r&&(t="."),t.length>0&&n&&(t+="/"),r?"/"+t:t},isAbsolute:function(t){return l(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,r=0;r<arguments.length;++r){var n=arguments[r];l(n),n.length>0&&(t===void 0?t=n:t+="/"+n)}return t===void 0?".":c.normalize(t)},relative:function(t,r){if(l(t),l(r),t===r||(t=c.resolve(t),r=c.resolve(r),t===r))return"";for(var n=1;n<t.length&&t.charCodeAt(n)===47;++n);for(var e=t.length,i=e-n,u=1;u<r.length&&r.charCodeAt(u)===47;++u);for(var h=r.length,d=h-u,y=i<d?i:d,b=-1,w=0;w<=y;++w){if(w===y){if(d>y){if(r.charCodeAt(u+w)===47)return r.slice(u+w+1);if(w===0)return r.slice(u+w)}else i>y&&(t.charCodeAt(n+w)===47?b=w:w===0&&(b=0));break}var S=t.charCodeAt(n+w),A=r.charCodeAt(u+w);if(S!==A)break;S===47&&(b=w)}var g="";for(w=n+b+1;w<=e;++w)(w===e||t.charCodeAt(w)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+r.slice(u+b):(u+=b,r.charCodeAt(u)===47&&++u,r.slice(u))},_makeLong:function(t){return t},dirname:function(t){if(l(t),t.length===0)return".";for(var r=t.charCodeAt(0),n=r===47,e=-1,i=!0,u=t.length-1;u>=1;--u)if(r=t.charCodeAt(u),r===47){if(!i){e=u;break}}else i=!1;return e===-1?n?"/":".":n&&e===1?"//":t.slice(0,e)},basename:function(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');l(t);var n=0,e=-1,i=!0,u;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var h=r.length-1,d=-1;for(u=t.length-1;u>=0;--u){var y=t.charCodeAt(u);if(y===47){if(!i){n=u+1;break}}else d===-1&&(i=!1,d=u+1),h>=0&&(y===r.charCodeAt(h)?--h===-1&&(e=u):(h=-1,e=d))}return n===e?e=d:e===-1&&(e=t.length),t.slice(n,e)}else{for(u=t.length-1;u>=0;--u)if(t.charCodeAt(u)===47){if(!i){n=u+1;break}}else e===-1&&(i=!1,e=u+1);return e===-1?"":t.slice(n,e)}},extname:function(t){l(t);for(var r=-1,n=0,e=-1,i=!0,u=0,h=t.length-1;h>=0;--h){var d=t.charCodeAt(h);if(d===47){if(!i){n=h+1;break}continue}e===-1&&(i=!1,e=h+1),d===46?r===-1?r=h:u!==1&&(u=1):r!==-1&&(u=-1)}return r===-1||e===-1||u===0||u===1&&r===e-1&&r===n+1?"":t.slice(r,e)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return a("/",t)},parse:function(t){l(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var n=t.charCodeAt(0),e=n===47,i;e?(r.root="/",i=1):i=0;for(var u=-1,h=0,d=-1,y=!0,b=t.length-1,w=0;b>=i;--b){if(n=t.charCodeAt(b),n===47){if(!y){h=b+1;break}continue}d===-1&&(y=!1,d=b+1),n===46?u===-1?u=b:w!==1&&(w=1):u!==-1&&(w=-1)}return u===-1||d===-1||w===0||w===1&&u===d-1&&u===h+1?d!==-1&&(h===0&&e?r.base=r.name=t.slice(1,d):r.base=r.name=t.slice(h,d)):(h===0&&e?(r.name=t.slice(1,u),r.base=t.slice(1,d)):(r.name=t.slice(h,u),r.base=t.slice(h,d)),r.ext=t.slice(u,d)),h>0?r.dir=t.slice(0,h-1):e&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return c.posix=c,Hr=c,Hr}var Hr,go,yo,yf=_t(()=>{de(),ye(),ge(),za(),Hr={},go=!1,yo=gf()}),Ka={};nr(Ka,{URL:()=>nl,Url:()=>Xa,default:()=>vt,fileURLToPath:()=>Ga,format:()=>Za,parse:()=>rl,pathToFileURL:()=>Ya,resolve:()=>el,resolveObject:()=>tl});function mf(){if(bo)return Gr;bo=!0;var o=typeof Map=="function"&&Map.prototype,l=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,s=o&&l&&typeof l.get=="function"?l.get:null,a=o&&Map.prototype.forEach,c=typeof Set=="function"&&Set.prototype,t=Object.getOwnPropertyDescriptor&&c?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,r=c&&t&&typeof t.get=="function"?t.get:null,n=c&&Set.prototype.forEach,e=typeof WeakMap=="function"&&WeakMap.prototype,i=e?WeakMap.prototype.has:null,u=typeof WeakSet=="function"&&WeakSet.prototype,h=u?WeakSet.prototype.has:null,d=typeof WeakRef=="function"&&WeakRef.prototype,y=d?WeakRef.prototype.deref:null,b=Boolean.prototype.valueOf,w=Object.prototype.toString,S=Function.prototype.toString,A=String.prototype.match,g=String.prototype.slice,_=String.prototype.replace,E=String.prototype.toUpperCase,v=String.prototype.toLowerCase,C=RegExp.prototype.test,T=Array.prototype.concat,x=Array.prototype.join,P=Array.prototype.slice,O=Math.floor,F=typeof BigInt=="function"?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,V=typeof Symbol=="function"&&typeof Symbol.iterator=="object",L=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===V||!0)?Symbol.toStringTag:null,le=Object.prototype.propertyIsEnumerable,re=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function($){return $.__proto__}:null);function ee($,J){if($===1/0||$===-1/0||$!==$||$&&$>-1e3&&$<1e3||C.call(/e/,J))return J;var Te=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof $=="number"){var Me=$<0?-O(-$):O($);if(Me!==$){var Ne=String(Me),Fe=g.call(J,Ne.length+1);return _.call(Ne,Te,"$&_")+"."+_.call(_.call(Fe,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(J,Te,"$&_")}var ue=Qa,G=ue.custom,oe=te(G)?G:null;Gr=function $(J,Te,Me,Ne){var Fe=Te||{};if(ce(Fe,"quoteStyle")&&Fe.quoteStyle!=="single"&&Fe.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ce(Fe,"maxStringLength")&&(typeof Fe.maxStringLength=="number"?Fe.maxStringLength<0&&Fe.maxStringLength!==1/0:Fe.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var nt=ce(Fe,"customInspect")?Fe.customInspect:!0;if(typeof nt!="boolean"&&nt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ce(Fe,"indent")&&Fe.indent!==null&&Fe.indent!==" "&&!(parseInt(Fe.indent,10)===Fe.indent&&Fe.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ce(Fe,"numericSeparator")&&typeof Fe.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var rt=Fe.numericSeparator;if(typeof J>"u")return"undefined";if(J===null)return"null";if(typeof J=="boolean")return J?"true":"false";if(typeof J=="string")return fe(J,Fe);if(typeof J=="number"){if(J===0)return 1/0/J>0?"0":"-0";var Ke=String(J);return rt?ee(J,Ke):Ke}if(typeof J=="bigint"){var Xe=String(J)+"n";return rt?ee(J,Xe):Xe}var Ue=typeof Fe.depth>"u"?5:Fe.depth;if(typeof Me>"u"&&(Me=0),Me>=Ue&&Ue>0&&typeof J=="object")return he(J)?"[Array]":"[Object]";var Ye=M(Fe,Me);if(typeof Ne>"u")Ne=[];else if(se(Ne,J)>=0)return"[Circular]";function Ze(Ge,ze,Ve){if(ze&&(Ne=P.call(Ne),Ne.push(ze)),Ve){var it={depth:Fe.depth};return ce(Fe,"quoteStyle")&&(it.quoteStyle=Fe.quoteStyle),$(Ge,it,Me+1,Ne)}return $(Ge,Fe,Me+1,Ne)}if(typeof J=="function"&&!Ee(J)){var lt=Y(J),ct=ie(J,Ze);return"[Function"+(lt?": "+lt:" (anonymous)")+"]"+(ct.length>0?" { "+x.call(ct,", ")+" }":"")}if(te(J)){var Et=V?_.call(String(J),/^(Symbol\(.*\))_[^)]*$/,"$1"):W.call(J);return typeof J=="object"&&!V?f(Et):Et}if(ke(J)){for(var j="<"+v.call(String(J.nodeName)),B=J.attributes||[],xe=0;xe<B.length;xe++)j+=" "+B[xe].name+"="+R(Q(B[xe].value),"double",Fe);return j+=">",J.childNodes&&J.childNodes.length&&(j+="..."),j+="</"+v.call(String(J.nodeName))+">",j}if(he(J)){if(J.length===0)return"[]";var Ce=ie(J,Ze);return Ye&&!k(Ce)?"["+z(Ce,Ye)+"]":"[ "+x.call(Ce,", ")+" ]"}if(X(J)){var Be=ie(J,Ze);return!("cause"in Error.prototype)&&"cause"in J&&!le.call(J,"cause")?"{ ["+String(J)+"] "+x.call(T.call("[cause]: "+Ze(J.cause),Be),", ")+" }":Be.length===0?"["+String(J)+"]":"{ ["+String(J)+"] "+x.call(Be,", ")+" }"}if(typeof J=="object"&&nt){if(oe&&typeof J[oe]=="function"&&ue)return ue(J,{depth:Ue-Me});if(nt!=="symbol"&&typeof J.inspect=="function")return J.inspect()}if(me(J)){var ft=[];return a&&a.call(J,function(Ge,ze){ft.push(Ze(ze,J,!0)+" => "+Ze(Ge,J))}),m("Map",s.call(J),ft,Ye)}if(Z(J)){var yt=[];return n&&n.call(J,function(Ge){yt.push(Ze(Ge,J))}),m("Set",r.call(J),yt,Ye)}if(pe(J))return p("WeakMap");if(ve(J))return p("WeakSet");if(_e(J))return p("WeakRef");if(ae(J))return f(Ze(Number(J)));if(ne(J))return f(Ze(F.call(J)));if(H(J))return f(b.call(J));if(U(J))return f(Ze(String(J)));if(typeof window<"u"&&J===window)return"{ [object Window] }";if(typeof globalThis<"u"&&J===globalThis||typeof Yr<"u"&&J===Yr)return"{ [object globalThis] }";if(!q(J)&&!Ee(J)){var xt=ie(J,Ze),K=re?re(J)===Object.prototype:J instanceof Object||J.constructor===Object,Ae=J instanceof Object?"":"null prototype",je=!K&&L&&Object(J)===J&&L in J?g.call(N(J),8,-1):Ae?"Object":"",We=K||typeof J.constructor!="function"?"":J.constructor.name?J.constructor.name+" ":"",He=We+(je||Ae?"["+x.call(T.call([],je||[],Ae||[]),": ")+"] ":"");return xt.length===0?He+"{}":Ye?He+"{"+z(xt,Ye)+"}":He+"{ "+x.call(xt,", ")+" }"}return String(J)};function R($,J,Te){var Me=(Te.quoteStyle||J)==="double"?'"':"'";return Me+$+Me}function Q($){return _.call(String($),/"/g,"&quot;")}function he($){return N($)==="[object Array]"&&(!L||!(typeof $=="object"&&L in $))}function q($){return N($)==="[object Date]"&&(!L||!(typeof $=="object"&&L in $))}function Ee($){return N($)==="[object RegExp]"&&(!L||!(typeof $=="object"&&L in $))}function X($){return N($)==="[object Error]"&&(!L||!(typeof $=="object"&&L in $))}function U($){return N($)==="[object String]"&&(!L||!(typeof $=="object"&&L in $))}function ae($){return N($)==="[object Number]"&&(!L||!(typeof $=="object"&&L in $))}function H($){return N($)==="[object Boolean]"&&(!L||!(typeof $=="object"&&L in $))}function te($){if(V)return $&&typeof $=="object"&&$ instanceof Symbol;if(typeof $=="symbol")return!0;if(!$||typeof $!="object"||!W)return!1;try{return W.call($),!0}catch{}return!1}function ne($){if(!$||typeof $!="object"||!F)return!1;try{return F.call($),!0}catch{}return!1}var be=Object.prototype.hasOwnProperty||function($){return $ in(this||Yr)};function ce($,J){return be.call($,J)}function N($){return w.call($)}function Y($){if($.name)return $.name;var J=A.call(S.call($),/^function\s*([\w$]+)/);return J?J[1]:null}function se($,J){if($.indexOf)return $.indexOf(J);for(var Te=0,Me=$.length;Te<Me;Te++)if($[Te]===J)return Te;return-1}function me($){if(!s||!$||typeof $!="object")return!1;try{s.call($);try{r.call($)}catch{return!0}return $ instanceof Map}catch{}return!1}function pe($){if(!i||!$||typeof $!="object")return!1;try{i.call($,i);try{h.call($,h)}catch{return!0}return $ instanceof WeakMap}catch{}return!1}function _e($){if(!y||!$||typeof $!="object")return!1;try{return y.call($),!0}catch{}return!1}function Z($){if(!r||!$||typeof $!="object")return!1;try{r.call($);try{s.call($)}catch{return!0}return $ instanceof Set}catch{}return!1}function ve($){if(!h||!$||typeof $!="object")return!1;try{h.call($,h);try{i.call($,i)}catch{return!0}return $ instanceof WeakSet}catch{}return!1}function ke($){return!$||typeof $!="object"?!1:typeof HTMLElement<"u"&&$ instanceof HTMLElement?!0:typeof $.nodeName=="string"&&typeof $.getAttribute=="function"}function fe($,J){if($.length>J.maxStringLength){var Te=$.length-J.maxStringLength,Me="... "+Te+" more character"+(Te>1?"s":"");return fe(g.call($,0,J.maxStringLength),J)+Me}var Ne=_.call(_.call($,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,De);return R(Ne,"single",J)}function De($){var J=$.charCodeAt(0),Te={8:"b",9:"t",10:"n",12:"f",13:"r"}[J];return Te?"\\"+Te:"\\x"+(J<16?"0":"")+E.call(J.toString(16))}function f($){return"Object("+$+")"}function p($){return $+" { ? }"}function m($,J,Te,Me){var Ne=Me?z(Te,Me):x.call(Te,", ");return $+" ("+J+") {"+Ne+"}"}function k($){for(var J=0;J<$.length;J++)if(se($[J],`
30
+ <%s key={someKey} {...props} />`,$o,rr,Mh,rr),xe[rr+$o]=!0}}return K===a?B(ht):j(ht),ht}}function Be(K,Ae,je){return Ce(K,Ae,je,!0)}function ft(K,Ae,je){return Ce(K,Ae,je,!1)}var yt=ft,xt=Be;hr.Fragment=a,hr.jsx=yt,hr.jsxs=xt}()),hr}process.env.NODE_ENV==="production"?hn.exports=vu():hn.exports=wu();var Ie=hn.exports;const pn=Oe.createContext(null),_u=({children:o,manifest:l})=>{const[s,a]=Oe.useState(l),[u,t]=Oe.useState(!1),r=Oe.useRef(!1);return Oe.useEffect(()=>{if(r.current)return;r.current=!0;const n=e=>{var i;if(((i=e.data)==null?void 0:i.type)==="RAMME_SYNC_MANIFEST"){const c=e.data.payload;a(c),t(!0)}};return window.addEventListener("message",n),window.parent!==window&&!window.__RAMME_HANDSHAKE_SENT&&(console.log("🔌 [Context] Handshake Sent 🤝"),window.parent.postMessage({type:"RAMME_CLIENT_READY"},"*"),window.__RAMME_HANDSHAKE_SENT=!0),()=>{window.removeEventListener("message",n),r.current=!1}},[]),Ie.jsx(pn.Provider,{value:{manifest:s,isLive:u},children:o})},Ht=()=>{const o=Oe.useContext(pn);if(!o)throw new Error("useManifest must be used within a ManifestProvider");return o.manifest},dn=()=>{const o=Oe.useContext(pn);return o!=null&&o.isLive?"live":"static"};var gn=Object.defineProperty,Su=Object.getOwnPropertyDescriptor,Eu=Object.getOwnPropertyNames,Au=Object.prototype.hasOwnProperty,_t=(o,l)=>()=>(o&&(l=o(o=0)),l),we=(o,l)=>()=>(l||o((l={exports:{}}).exports,l),l.exports),nr=(o,l)=>{for(var s in l)gn(o,s,{get:l[s],enumerable:!0})},xu=(o,l,s,a)=>{if(l&&typeof l=="object"||typeof l=="function")for(let u of Eu(l))!Au.call(o,u)&&u!==s&&gn(o,u,{get:()=>l[u],enumerable:!(a=Su(l,u))||a.enumerable});return o},tt=o=>xu(gn({},"__esModule",{value:!0}),o),de=_t(()=>{}),Je={};nr(Je,{_debugEnd:()=>Qn,_debugProcess:()=>Yn,_events:()=>hi,_eventsCount:()=>pi,_exiting:()=>Nn,_fatalExceptions:()=>Kn,_getActiveHandles:()=>ns,_getActiveRequests:()=>rs,_kill:()=>Un,_linkedBinding:()=>es,_maxListeners:()=>fi,_preload_modules:()=>li,_rawDebug:()=>jn,_startProfilerIdleNotifier:()=>Jn,_stopProfilerIdleNotifier:()=>Xn,_tickCallback:()=>Gn,abort:()=>ri,addListener:()=>di,allowedNodeEnvironmentFlags:()=>Vn,arch:()=>bn,argv:()=>_n,argv0:()=>ai,assert:()=>is,binding:()=>In,browser:()=>Cn,chdir:()=>Tn,config:()=>Bn,cpuUsage:()=>dr,cwd:()=>On,debugPort:()=>si,default:()=>Si,dlopen:()=>ts,domain:()=>Mn,emit:()=>vi,emitWarning:()=>xn,env:()=>wn,execArgv:()=>Sn,execPath:()=>oi,exit:()=>$n,features:()=>zn,hasUncaughtExceptionCaptureCallback:()=>os,hrtime:()=>Er,kill:()=>Wn,listeners:()=>as,memoryUsage:()=>Fn,moduleLoadList:()=>Rn,nextTick:()=>Xo,off:()=>yi,on:()=>Tt,once:()=>gi,openStdin:()=>qn,pid:()=>ni,platform:()=>vn,ppid:()=>ii,prependListener:()=>wi,prependOnceListener:()=>_i,reallyExit:()=>Ln,release:()=>Pn,removeAllListeners:()=>bi,removeListener:()=>mi,resourceUsage:()=>Dn,setSourceMapsEnabled:()=>ui,setUncaughtExceptionCaptureCallback:()=>Hn,stderr:()=>ei,stdin:()=>ti,stdout:()=>Zn,title:()=>mn,umask:()=>kn,uptime:()=>ss,version:()=>En,versions:()=>An});function yn(o){throw new Error("Node.js process "+o+" is not supported by JSPM core outside of Node.js")}function Iu(){!Gt||!Yt||(Gt=!1,Yt.length?kt=Yt.concat(kt):pr=-1,kt.length&&Jo())}function Jo(){if(!Gt){var o=setTimeout(Iu,0);Gt=!0;for(var l=kt.length;l;){for(Yt=kt,kt=[];++pr<l;)Yt&&Yt[pr].run();pr=-1,l=kt.length}Yt=null,Gt=!1,clearTimeout(o)}}function Xo(o){var l=new Array(arguments.length-1);if(arguments.length>1)for(var s=1;s<arguments.length;s++)l[s-1]=arguments[s];kt.push(new Zo(o,l)),kt.length===1&&!Gt&&setTimeout(Jo,0)}function Zo(o,l){this.fun=o,this.array=l}function mt(){}function es(o){yn("_linkedBinding")}function ts(o){yn("dlopen")}function rs(){return[]}function ns(){return[]}function is(o,l){if(!o)throw new Error(l||"assertion error")}function os(){return!1}function ss(){return Pt.now()/1e3}function Er(o){var l=Math.floor((Date.now()-Pt.now())*.001),s=Pt.now()*.001,a=Math.floor(s)+l,u=Math.floor(s%1*1e9);return o&&(a=a-o[0],u=u-o[1],u<0&&(a--,u+=Ar)),[a,u]}function Tt(){return Si}function as(o){return[]}var kt,Gt,Yt,pr,mn,bn,vn,wn,_n,Sn,En,An,xn,In,kn,On,Tn,Pn,Cn,jn,Rn,Mn,Nn,Bn,Ln,Un,dr,Dn,Fn,Wn,$n,qn,Vn,zn,Kn,Hn,Gn,Yn,Qn,Jn,Xn,Zn,ei,ti,ri,ni,ii,oi,si,ai,li,ui,Pt,ci,Ar,fi,hi,pi,di,gi,yi,mi,bi,vi,wi,_i,Si,ku=_t(()=>{de(),ye(),ge(),kt=[],Gt=!1,pr=-1,Zo.prototype.run=function(){this.fun.apply(null,this.array)},mn="browser",bn="x64",vn="browser",wn={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},_n=["/usr/bin/node"],Sn=[],En="v16.8.0",An={},xn=function(o,l){console.warn((l?l+": ":"")+o)},In=function(o){yn("binding")},kn=function(o){return 0},On=function(){return"/"},Tn=function(o){},Pn={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},Cn=!0,jn=mt,Rn=[],Mn={},Nn=!1,Bn={},Ln=mt,Un=mt,dr=function(){return{}},Dn=dr,Fn=dr,Wn=mt,$n=mt,qn=mt,Vn={},zn={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Kn=mt,Hn=mt,Gn=mt,Yn=mt,Qn=mt,Jn=mt,Xn=mt,Zn=void 0,ei=void 0,ti=void 0,ri=mt,ni=2,ii=1,oi="/bin/usr/node",si=9229,ai="node",li=[],ui=mt,Pt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},Pt.now===void 0&&(ci=Date.now(),Pt.timing&&Pt.timing.navigationStart&&(ci=Pt.timing.navigationStart),Pt.now=()=>Date.now()-ci),Ar=1e9,Er.bigint=function(o){var l=Er(o);return typeof BigInt>"u"?l[0]*Ar+l[1]:BigInt(l[0]*Ar)+BigInt(l[1])},fi=10,hi={},pi=0,di=Tt,gi=Tt,yi=Tt,mi=Tt,bi=Tt,vi=mt,wi=Tt,_i=Tt,Si={version:En,versions:An,arch:bn,platform:vn,browser:Cn,release:Pn,_rawDebug:jn,moduleLoadList:Rn,binding:In,_linkedBinding:es,_events:hi,_eventsCount:pi,_maxListeners:fi,on:Tt,addListener:di,once:gi,off:yi,removeListener:mi,removeAllListeners:bi,emit:vi,prependListener:wi,prependOnceListener:_i,listeners:as,domain:Mn,_exiting:Nn,config:Bn,dlopen:ts,uptime:ss,_getActiveRequests:rs,_getActiveHandles:ns,reallyExit:Ln,_kill:Un,cpuUsage:dr,resourceUsage:Dn,memoryUsage:Fn,kill:Wn,exit:$n,openStdin:qn,allowedNodeEnvironmentFlags:Vn,assert:is,features:zn,_fatalExceptions:Kn,setUncaughtExceptionCaptureCallback:Hn,hasUncaughtExceptionCaptureCallback:os,emitWarning:xn,nextTick:Xo,_tickCallback:Gn,_debugProcess:Yn,_debugEnd:Qn,_startProfilerIdleNotifier:Jn,_stopProfilerIdleNotifier:Xn,stdout:Zn,stdin:ti,stderr:ei,abort:ri,umask:kn,chdir:Tn,cwd:On,env:wn,title:mn,argv:_n,execArgv:Sn,pid:ni,ppid:ii,execPath:oi,debugPort:si,hrtime:Er,argv0:ai,_preload_modules:li,setSourceMapsEnabled:ui}}),ge=_t(()=>{ku()});function Ou(){if(Ei)return ir;Ei=!0,ir.byteLength=n,ir.toByteArray=i,ir.fromByteArray=d;for(var o=[],l=[],s=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,t=a.length;u<t;++u)o[u]=a[u],l[a.charCodeAt(u)]=u;l[45]=62,l[95]=63;function r(y){var b=y.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var w=y.indexOf("=");w===-1&&(w=b);var S=w===b?0:4-w%4;return[w,S]}function n(y){var b=r(y),w=b[0],S=b[1];return(w+S)*3/4-S}function e(y,b,w){return(b+w)*3/4-w}function i(y){var b,w=r(y),S=w[0],A=w[1],g=new s(e(y,S,A)),_=0,E=A>0?S-4:S,v;for(v=0;v<E;v+=4)b=l[y.charCodeAt(v)]<<18|l[y.charCodeAt(v+1)]<<12|l[y.charCodeAt(v+2)]<<6|l[y.charCodeAt(v+3)],g[_++]=b>>16&255,g[_++]=b>>8&255,g[_++]=b&255;return A===2&&(b=l[y.charCodeAt(v)]<<2|l[y.charCodeAt(v+1)]>>4,g[_++]=b&255),A===1&&(b=l[y.charCodeAt(v)]<<10|l[y.charCodeAt(v+1)]<<4|l[y.charCodeAt(v+2)]>>2,g[_++]=b>>8&255,g[_++]=b&255),g}function c(y){return o[y>>18&63]+o[y>>12&63]+o[y>>6&63]+o[y&63]}function h(y,b,w){for(var S,A=[],g=b;g<w;g+=3)S=(y[g]<<16&16711680)+(y[g+1]<<8&65280)+(y[g+2]&255),A.push(c(S));return A.join("")}function d(y){for(var b,w=y.length,S=w%3,A=[],g=16383,_=0,E=w-S;_<E;_+=g)A.push(h(y,_,_+g>E?E:_+g));return S===1?(b=y[w-1],A.push(o[b>>2]+o[b<<4&63]+"==")):S===2&&(b=(y[w-2]<<8)+y[w-1],A.push(o[b>>10]+o[b>>4&63]+o[b<<2&63]+"=")),A.join("")}return ir}function Tu(){return Ai?gr:(Ai=!0,gr.read=function(o,l,s,a,u){var t,r,n=u*8-a-1,e=(1<<n)-1,i=e>>1,c=-7,h=s?u-1:0,d=s?-1:1,y=o[l+h];for(h+=d,t=y&(1<<-c)-1,y>>=-c,c+=n;c>0;t=t*256+o[l+h],h+=d,c-=8);for(r=t&(1<<-c)-1,t>>=-c,c+=a;c>0;r=r*256+o[l+h],h+=d,c-=8);if(t===0)t=1-i;else{if(t===e)return r?NaN:(y?-1:1)*(1/0);r=r+Math.pow(2,a),t=t-i}return(y?-1:1)*r*Math.pow(2,t-a)},gr.write=function(o,l,s,a,u,t){var r,n,e,i=t*8-u-1,c=(1<<i)-1,h=c>>1,d=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=a?0:t-1,b=a?1:-1,w=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(n=isNaN(l)?1:0,r=c):(r=Math.floor(Math.log(l)/Math.LN2),l*(e=Math.pow(2,-r))<1&&(r--,e*=2),r+h>=1?l+=d/e:l+=d*Math.pow(2,1-h),l*e>=2&&(r++,e/=2),r+h>=c?(n=0,r=c):r+h>=1?(n=(l*e-1)*Math.pow(2,u),r=r+h):(n=l*Math.pow(2,h-1)*Math.pow(2,u),r=0));u>=8;o[s+y]=n&255,y+=b,n/=256,u-=8);for(r=r<<u|n,i+=u;i>0;o[s+y]=r&255,y+=b,r/=256,i-=8);o[s+y-b]|=w*128},gr)}function Pu(){if(xi)return Ut;xi=!0;let o=Ou(),l=Tu(),s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ut.Buffer=r,Ut.SlowBuffer=A,Ut.INSPECT_MAX_BYTES=50;let a=2147483647;Ut.kMaxLength=a,r.TYPED_ARRAY_SUPPORT=u(),!r.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 u(){try{let f=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(f,p),f.foo()===42}catch{return!1}}Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}});function t(f){if(f>a)throw new RangeError('The value "'+f+'" is invalid for option "size"');let p=new Uint8Array(f);return Object.setPrototypeOf(p,r.prototype),p}function r(f,p,m){if(typeof f=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(f)}return n(f,p,m)}r.poolSize=8192;function n(f,p,m){if(typeof f=="string")return h(f,p);if(ArrayBuffer.isView(f))return y(f);if(f==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f);if(Z(f,ArrayBuffer)||f&&Z(f.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Z(f,SharedArrayBuffer)||f&&Z(f.buffer,SharedArrayBuffer)))return b(f,p,m);if(typeof f=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let k=f.valueOf&&f.valueOf();if(k!=null&&k!==f)return r.from(k,p,m);let M=w(f);if(M)return M;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof f[Symbol.toPrimitive]=="function")return r.from(f[Symbol.toPrimitive]("string"),p,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f)}r.from=function(f,p,m){return n(f,p,m)},Object.setPrototypeOf(r.prototype,Uint8Array.prototype),Object.setPrototypeOf(r,Uint8Array);function e(f){if(typeof f!="number")throw new TypeError('"size" argument must be of type number');if(f<0)throw new RangeError('The value "'+f+'" is invalid for option "size"')}function i(f,p,m){return e(f),f<=0?t(f):p!==void 0?typeof m=="string"?t(f).fill(p,m):t(f).fill(p):t(f)}r.alloc=function(f,p,m){return i(f,p,m)};function c(f){return e(f),t(f<0?0:S(f)|0)}r.allocUnsafe=function(f){return c(f)},r.allocUnsafeSlow=function(f){return c(f)};function h(f,p){if((typeof p!="string"||p==="")&&(p="utf8"),!r.isEncoding(p))throw new TypeError("Unknown encoding: "+p);let m=g(f,p)|0,k=t(m),M=k.write(f,p);return M!==m&&(k=k.slice(0,M)),k}function d(f){let p=f.length<0?0:S(f.length)|0,m=t(p);for(let k=0;k<p;k+=1)m[k]=f[k]&255;return m}function y(f){if(Z(f,Uint8Array)){let p=new Uint8Array(f);return b(p.buffer,p.byteOffset,p.byteLength)}return d(f)}function b(f,p,m){if(p<0||f.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(f.byteLength<p+(m||0))throw new RangeError('"length" is outside of buffer bounds');let k;return p===void 0&&m===void 0?k=new Uint8Array(f):m===void 0?k=new Uint8Array(f,p):k=new Uint8Array(f,p,m),Object.setPrototypeOf(k,r.prototype),k}function w(f){if(r.isBuffer(f)){let p=S(f.length)|0,m=t(p);return m.length===0||f.copy(m,0,0,p),m}if(f.length!==void 0)return typeof f.length!="number"||ve(f.length)?t(0):d(f);if(f.type==="Buffer"&&Array.isArray(f.data))return d(f.data)}function S(f){if(f>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return f|0}function A(f){return+f!=f&&(f=0),r.alloc(+f)}r.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==r.prototype},r.compare=function(f,p){if(Z(f,Uint8Array)&&(f=r.from(f,f.offset,f.byteLength)),Z(p,Uint8Array)&&(p=r.from(p,p.offset,p.byteLength)),!r.isBuffer(f)||!r.isBuffer(p))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===p)return 0;let m=f.length,k=p.length;for(let M=0,z=Math.min(m,k);M<z;++M)if(f[M]!==p[M]){m=f[M],k=p[M];break}return m<k?-1:k<m?1:0},r.isEncoding=function(f){switch(String(f).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}},r.concat=function(f,p){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return r.alloc(0);let m;if(p===void 0)for(p=0,m=0;m<f.length;++m)p+=f[m].length;let k=r.allocUnsafe(p),M=0;for(m=0;m<f.length;++m){let z=f[m];if(Z(z,Uint8Array))M+z.length>k.length?(r.isBuffer(z)||(z=r.from(z)),z.copy(k,M)):Uint8Array.prototype.set.call(k,z,M);else if(r.isBuffer(z))z.copy(k,M);else throw new TypeError('"list" argument must be an Array of Buffers');M+=z.length}return k};function g(f,p){if(r.isBuffer(f))return f.length;if(ArrayBuffer.isView(f)||Z(f,ArrayBuffer))return f.byteLength;if(typeof f!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof f);let m=f.length,k=arguments.length>2&&arguments[2]===!0;if(!k&&m===0)return 0;let M=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Y(f).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return pe(f).length;default:if(M)return k?-1:Y(f).length;p=(""+p).toLowerCase(),M=!0}}r.byteLength=g;function _(f,p,m){let k=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,p>>>=0,m<=p))return"";for(f||(f="utf8");;)switch(f){case"hex":return ee(this,p,m);case"utf8":case"utf-8":return W(this,p,m);case"ascii":return le(this,p,m);case"latin1":case"binary":return re(this,p,m);case"base64":return I(this,p,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,p,m);default:if(k)throw new TypeError("Unknown encoding: "+f);f=(f+"").toLowerCase(),k=!0}}r.prototype._isBuffer=!0;function E(f,p,m){let k=f[p];f[p]=f[m],f[m]=k}r.prototype.swap16=function(){let f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let p=0;p<f;p+=2)E(this,p,p+1);return this},r.prototype.swap32=function(){let f=this.length;if(f%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let p=0;p<f;p+=4)E(this,p,p+3),E(this,p+1,p+2);return this},r.prototype.swap64=function(){let f=this.length;if(f%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let p=0;p<f;p+=8)E(this,p,p+7),E(this,p+1,p+6),E(this,p+2,p+5),E(this,p+3,p+4);return this},r.prototype.toString=function(){let f=this.length;return f===0?"":arguments.length===0?W(this,0,f):_.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(f){if(!r.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f?!0:r.compare(this,f)===0},r.prototype.inspect=function(){let f="",p=Ut.INSPECT_MAX_BYTES;return f=this.toString("hex",0,p).replace(/(.{2})/g,"$1 ").trim(),this.length>p&&(f+=" ... "),"<Buffer "+f+">"},s&&(r.prototype[s]=r.prototype.inspect),r.prototype.compare=function(f,p,m,k,M){if(Z(f,Uint8Array)&&(f=r.from(f,f.offset,f.byteLength)),!r.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(p===void 0&&(p=0),m===void 0&&(m=f?f.length:0),k===void 0&&(k=0),M===void 0&&(M=this.length),p<0||m>f.length||k<0||M>this.length)throw new RangeError("out of range index");if(k>=M&&p>=m)return 0;if(k>=M)return-1;if(p>=m)return 1;if(p>>>=0,m>>>=0,k>>>=0,M>>>=0,this===f)return 0;let z=M-k,ie=m-p,$=Math.min(z,ie),J=this.slice(k,M),Te=f.slice(p,m);for(let Me=0;Me<$;++Me)if(J[Me]!==Te[Me]){z=J[Me],ie=Te[Me];break}return z<ie?-1:ie<z?1:0};function v(f,p,m,k,M){if(f.length===0)return-1;if(typeof m=="string"?(k=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,ve(m)&&(m=M?0:f.length-1),m<0&&(m=f.length+m),m>=f.length){if(M)return-1;m=f.length-1}else if(m<0)if(M)m=0;else return-1;if(typeof p=="string"&&(p=r.from(p,k)),r.isBuffer(p))return p.length===0?-1:C(f,p,m,k,M);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?M?Uint8Array.prototype.indexOf.call(f,p,m):Uint8Array.prototype.lastIndexOf.call(f,p,m):C(f,[p],m,k,M);throw new TypeError("val must be string, number or Buffer")}function C(f,p,m,k,M){let z=1,ie=f.length,$=p.length;if(k!==void 0&&(k=String(k).toLowerCase(),k==="ucs2"||k==="ucs-2"||k==="utf16le"||k==="utf-16le")){if(f.length<2||p.length<2)return-1;z=2,ie/=2,$/=2,m/=2}function J(Me,Ne){return z===1?Me[Ne]:Me.readUInt16BE(Ne*z)}let Te;if(M){let Me=-1;for(Te=m;Te<ie;Te++)if(J(f,Te)===J(p,Me===-1?0:Te-Me)){if(Me===-1&&(Me=Te),Te-Me+1===$)return Me*z}else Me!==-1&&(Te-=Te-Me),Me=-1}else for(m+$>ie&&(m=ie-$),Te=m;Te>=0;Te--){let Me=!0;for(let Ne=0;Ne<$;Ne++)if(J(f,Te+Ne)!==J(p,Ne)){Me=!1;break}if(Me)return Te}return-1}r.prototype.includes=function(f,p,m){return this.indexOf(f,p,m)!==-1},r.prototype.indexOf=function(f,p,m){return v(this,f,p,m,!0)},r.prototype.lastIndexOf=function(f,p,m){return v(this,f,p,m,!1)};function T(f,p,m,k){m=Number(m)||0;let M=f.length-m;k?(k=Number(k),k>M&&(k=M)):k=M;let z=p.length;k>z/2&&(k=z/2);let ie;for(ie=0;ie<k;++ie){let $=parseInt(p.substr(ie*2,2),16);if(ve($))return ie;f[m+ie]=$}return ie}function x(f,p,m,k){return _e(Y(p,f.length-m),f,m,k)}function P(f,p,m,k){return _e(se(p),f,m,k)}function O(f,p,m,k){return _e(pe(p),f,m,k)}function F(f,p,m,k){return _e(me(p,f.length-m),f,m,k)}r.prototype.write=function(f,p,m,k){if(p===void 0)k="utf8",m=this.length,p=0;else if(m===void 0&&typeof p=="string")k=p,m=this.length,p=0;else if(isFinite(p))p=p>>>0,isFinite(m)?(m=m>>>0,k===void 0&&(k="utf8")):(k=m,m=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let M=this.length-p;if((m===void 0||m>M)&&(m=M),f.length>0&&(m<0||p<0)||p>this.length)throw new RangeError("Attempt to write outside buffer bounds");k||(k="utf8");let z=!1;for(;;)switch(k){case"hex":return T(this,f,p,m);case"utf8":case"utf-8":return x(this,f,p,m);case"ascii":case"latin1":case"binary":return P(this,f,p,m);case"base64":return O(this,f,p,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,f,p,m);default:if(z)throw new TypeError("Unknown encoding: "+k);k=(""+k).toLowerCase(),z=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(f,p,m){return p===0&&m===f.length?o.fromByteArray(f):o.fromByteArray(f.slice(p,m))}function W(f,p,m){m=Math.min(f.length,m);let k=[],M=p;for(;M<m;){let z=f[M],ie=null,$=z>239?4:z>223?3:z>191?2:1;if(M+$<=m){let J,Te,Me,Ne;switch($){case 1:z<128&&(ie=z);break;case 2:J=f[M+1],(J&192)===128&&(Ne=(z&31)<<6|J&63,Ne>127&&(ie=Ne));break;case 3:J=f[M+1],Te=f[M+2],(J&192)===128&&(Te&192)===128&&(Ne=(z&15)<<12|(J&63)<<6|Te&63,Ne>2047&&(Ne<55296||Ne>57343)&&(ie=Ne));break;case 4:J=f[M+1],Te=f[M+2],Me=f[M+3],(J&192)===128&&(Te&192)===128&&(Me&192)===128&&(Ne=(z&15)<<18|(J&63)<<12|(Te&63)<<6|Me&63,Ne>65535&&Ne<1114112&&(ie=Ne))}}ie===null?(ie=65533,$=1):ie>65535&&(ie-=65536,k.push(ie>>>10&1023|55296),ie=56320|ie&1023),k.push(ie),M+=$}return L(k)}let V=4096;function L(f){let p=f.length;if(p<=V)return String.fromCharCode.apply(String,f);let m="",k=0;for(;k<p;)m+=String.fromCharCode.apply(String,f.slice(k,k+=V));return m}function le(f,p,m){let k="";m=Math.min(f.length,m);for(let M=p;M<m;++M)k+=String.fromCharCode(f[M]&127);return k}function re(f,p,m){let k="";m=Math.min(f.length,m);for(let M=p;M<m;++M)k+=String.fromCharCode(f[M]);return k}function ee(f,p,m){let k=f.length;(!p||p<0)&&(p=0),(!m||m<0||m>k)&&(m=k);let M="";for(let z=p;z<m;++z)M+=ke[f[z]];return M}function ue(f,p,m){let k=f.slice(p,m),M="";for(let z=0;z<k.length-1;z+=2)M+=String.fromCharCode(k[z]+k[z+1]*256);return M}r.prototype.slice=function(f,p){let m=this.length;f=~~f,p=p===void 0?m:~~p,f<0?(f+=m,f<0&&(f=0)):f>m&&(f=m),p<0?(p+=m,p<0&&(p=0)):p>m&&(p=m),p<f&&(p=f);let k=this.subarray(f,p);return Object.setPrototypeOf(k,r.prototype),k};function G(f,p,m){if(f%1!==0||f<0)throw new RangeError("offset is not uint");if(f+p>m)throw new RangeError("Trying to access beyond buffer length")}r.prototype.readUintLE=r.prototype.readUIntLE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let k=this[f],M=1,z=0;for(;++z<p&&(M*=256);)k+=this[f+z]*M;return k},r.prototype.readUintBE=r.prototype.readUIntBE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let k=this[f+--p],M=1;for(;p>0&&(M*=256);)k+=this[f+--p]*M;return k},r.prototype.readUint8=r.prototype.readUInt8=function(f,p){return f=f>>>0,p||G(f,1,this.length),this[f]},r.prototype.readUint16LE=r.prototype.readUInt16LE=function(f,p){return f=f>>>0,p||G(f,2,this.length),this[f]|this[f+1]<<8},r.prototype.readUint16BE=r.prototype.readUInt16BE=function(f,p){return f=f>>>0,p||G(f,2,this.length),this[f]<<8|this[f+1]},r.prototype.readUint32LE=r.prototype.readUInt32LE=function(f,p){return f=f>>>0,p||G(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},r.prototype.readUint32BE=r.prototype.readUInt32BE=function(f,p){return f=f>>>0,p||G(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},r.prototype.readBigUInt64LE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let k=p+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,M=this[++f]+this[++f]*2**8+this[++f]*2**16+m*2**24;return BigInt(k)+(BigInt(M)<<BigInt(32))}),r.prototype.readBigUInt64BE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let k=p*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],M=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+m;return(BigInt(k)<<BigInt(32))+BigInt(M)}),r.prototype.readIntLE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let k=this[f],M=1,z=0;for(;++z<p&&(M*=256);)k+=this[f+z]*M;return M*=128,k>=M&&(k-=Math.pow(2,8*p)),k},r.prototype.readIntBE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let k=p,M=1,z=this[f+--k];for(;k>0&&(M*=256);)z+=this[f+--k]*M;return M*=128,z>=M&&(z-=Math.pow(2,8*p)),z},r.prototype.readInt8=function(f,p){return f=f>>>0,p||G(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},r.prototype.readInt16LE=function(f,p){f=f>>>0,p||G(f,2,this.length);let m=this[f]|this[f+1]<<8;return m&32768?m|4294901760:m},r.prototype.readInt16BE=function(f,p){f=f>>>0,p||G(f,2,this.length);let m=this[f+1]|this[f]<<8;return m&32768?m|4294901760:m},r.prototype.readInt32LE=function(f,p){return f=f>>>0,p||G(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},r.prototype.readInt32BE=function(f,p){return f=f>>>0,p||G(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},r.prototype.readBigInt64LE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let k=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(m<<24);return(BigInt(k)<<BigInt(32))+BigInt(p+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),r.prototype.readBigInt64BE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let k=(p<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(k)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+m)}),r.prototype.readFloatLE=function(f,p){return f=f>>>0,p||G(f,4,this.length),l.read(this,f,!0,23,4)},r.prototype.readFloatBE=function(f,p){return f=f>>>0,p||G(f,4,this.length),l.read(this,f,!1,23,4)},r.prototype.readDoubleLE=function(f,p){return f=f>>>0,p||G(f,8,this.length),l.read(this,f,!0,52,8)},r.prototype.readDoubleBE=function(f,p){return f=f>>>0,p||G(f,8,this.length),l.read(this,f,!1,52,8)};function oe(f,p,m,k,M,z){if(!r.isBuffer(f))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>M||p<z)throw new RangeError('"value" argument is out of bounds');if(m+k>f.length)throw new RangeError("Index out of range")}r.prototype.writeUintLE=r.prototype.writeUIntLE=function(f,p,m,k){if(f=+f,p=p>>>0,m=m>>>0,!k){let ie=Math.pow(2,8*m)-1;oe(this,f,p,m,ie,0)}let M=1,z=0;for(this[p]=f&255;++z<m&&(M*=256);)this[p+z]=f/M&255;return p+m},r.prototype.writeUintBE=r.prototype.writeUIntBE=function(f,p,m,k){if(f=+f,p=p>>>0,m=m>>>0,!k){let ie=Math.pow(2,8*m)-1;oe(this,f,p,m,ie,0)}let M=m-1,z=1;for(this[p+M]=f&255;--M>=0&&(z*=256);)this[p+M]=f/z&255;return p+m},r.prototype.writeUint8=r.prototype.writeUInt8=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,1,255,0),this[p]=f&255,p+1},r.prototype.writeUint16LE=r.prototype.writeUInt16LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,65535,0),this[p]=f&255,this[p+1]=f>>>8,p+2},r.prototype.writeUint16BE=r.prototype.writeUInt16BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,65535,0),this[p]=f>>>8,this[p+1]=f&255,p+2},r.prototype.writeUint32LE=r.prototype.writeUInt32LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,4294967295,0),this[p+3]=f>>>24,this[p+2]=f>>>16,this[p+1]=f>>>8,this[p]=f&255,p+4},r.prototype.writeUint32BE=r.prototype.writeUInt32BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,4294967295,0),this[p]=f>>>24,this[p+1]=f>>>16,this[p+2]=f>>>8,this[p+3]=f&255,p+4};function R(f,p,m,k,M){te(p,k,M,f,m,7);let z=Number(p&BigInt(4294967295));f[m++]=z,z=z>>8,f[m++]=z,z=z>>8,f[m++]=z,z=z>>8,f[m++]=z;let ie=Number(p>>BigInt(32)&BigInt(4294967295));return f[m++]=ie,ie=ie>>8,f[m++]=ie,ie=ie>>8,f[m++]=ie,ie=ie>>8,f[m++]=ie,m}function Q(f,p,m,k,M){te(p,k,M,f,m,7);let z=Number(p&BigInt(4294967295));f[m+7]=z,z=z>>8,f[m+6]=z,z=z>>8,f[m+5]=z,z=z>>8,f[m+4]=z;let ie=Number(p>>BigInt(32)&BigInt(4294967295));return f[m+3]=ie,ie=ie>>8,f[m+2]=ie,ie=ie>>8,f[m+1]=ie,ie=ie>>8,f[m]=ie,m+8}r.prototype.writeBigUInt64LE=fe(function(f,p=0){return R(this,f,p,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeBigUInt64BE=fe(function(f,p=0){return Q(this,f,p,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeIntLE=function(f,p,m,k){if(f=+f,p=p>>>0,!k){let $=Math.pow(2,8*m-1);oe(this,f,p,m,$-1,-$)}let M=0,z=1,ie=0;for(this[p]=f&255;++M<m&&(z*=256);)f<0&&ie===0&&this[p+M-1]!==0&&(ie=1),this[p+M]=(f/z>>0)-ie&255;return p+m},r.prototype.writeIntBE=function(f,p,m,k){if(f=+f,p=p>>>0,!k){let $=Math.pow(2,8*m-1);oe(this,f,p,m,$-1,-$)}let M=m-1,z=1,ie=0;for(this[p+M]=f&255;--M>=0&&(z*=256);)f<0&&ie===0&&this[p+M+1]!==0&&(ie=1),this[p+M]=(f/z>>0)-ie&255;return p+m},r.prototype.writeInt8=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,1,127,-128),f<0&&(f=255+f+1),this[p]=f&255,p+1},r.prototype.writeInt16LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,32767,-32768),this[p]=f&255,this[p+1]=f>>>8,p+2},r.prototype.writeInt16BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,32767,-32768),this[p]=f>>>8,this[p+1]=f&255,p+2},r.prototype.writeInt32LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,2147483647,-2147483648),this[p]=f&255,this[p+1]=f>>>8,this[p+2]=f>>>16,this[p+3]=f>>>24,p+4},r.prototype.writeInt32BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[p]=f>>>24,this[p+1]=f>>>16,this[p+2]=f>>>8,this[p+3]=f&255,p+4},r.prototype.writeBigInt64LE=fe(function(f,p=0){return R(this,f,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),r.prototype.writeBigInt64BE=fe(function(f,p=0){return Q(this,f,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function he(f,p,m,k,M,z){if(m+k>f.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function q(f,p,m,k,M){return p=+p,m=m>>>0,M||he(f,p,m,4),l.write(f,p,m,k,23,4),m+4}r.prototype.writeFloatLE=function(f,p,m){return q(this,f,p,!0,m)},r.prototype.writeFloatBE=function(f,p,m){return q(this,f,p,!1,m)};function Ee(f,p,m,k,M){return p=+p,m=m>>>0,M||he(f,p,m,8),l.write(f,p,m,k,52,8),m+8}r.prototype.writeDoubleLE=function(f,p,m){return Ee(this,f,p,!0,m)},r.prototype.writeDoubleBE=function(f,p,m){return Ee(this,f,p,!1,m)},r.prototype.copy=function(f,p,m,k){if(!r.isBuffer(f))throw new TypeError("argument should be a Buffer");if(m||(m=0),!k&&k!==0&&(k=this.length),p>=f.length&&(p=f.length),p||(p=0),k>0&&k<m&&(k=m),k===m||f.length===0||this.length===0)return 0;if(p<0)throw new RangeError("targetStart out of bounds");if(m<0||m>=this.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("sourceEnd out of bounds");k>this.length&&(k=this.length),f.length-p<k-m&&(k=f.length-p+m);let M=k-m;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(p,m,k):Uint8Array.prototype.set.call(f,this.subarray(m,k),p),M},r.prototype.fill=function(f,p,m,k){if(typeof f=="string"){if(typeof p=="string"?(k=p,p=0,m=this.length):typeof m=="string"&&(k=m,m=this.length),k!==void 0&&typeof k!="string")throw new TypeError("encoding must be a string");if(typeof k=="string"&&!r.isEncoding(k))throw new TypeError("Unknown encoding: "+k);if(f.length===1){let z=f.charCodeAt(0);(k==="utf8"&&z<128||k==="latin1")&&(f=z)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(p<0||this.length<p||this.length<m)throw new RangeError("Out of range index");if(m<=p)return this;p=p>>>0,m=m===void 0?this.length:m>>>0,f||(f=0);let M;if(typeof f=="number")for(M=p;M<m;++M)this[M]=f;else{let z=r.isBuffer(f)?f:r.from(f,k),ie=z.length;if(ie===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(M=0;M<m-p;++M)this[M+p]=z[M%ie]}return this};let X={};function U(f,p,m){X[f]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${f}]`,this.stack,delete this.name}get code(){return f}set code(k){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:k,writable:!0})}toString(){return`${this.name} [${f}]: ${this.message}`}}}U("ERR_BUFFER_OUT_OF_BOUNDS",function(f){return f?`${f} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(f,p){return`The "${f}" argument must be of type number. Received type ${typeof p}`},TypeError),U("ERR_OUT_OF_RANGE",function(f,p,m){let k=`The value of "${f}" is out of range.`,M=m;return Number.isInteger(m)&&Math.abs(m)>2**32?M=ae(String(m)):typeof m=="bigint"&&(M=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(M=ae(M)),M+="n"),k+=` It must be ${p}. Received ${M}`,k},RangeError);function ae(f){let p="",m=f.length,k=f[0]==="-"?1:0;for(;m>=k+4;m-=3)p=`_${f.slice(m-3,m)}${p}`;return`${f.slice(0,m)}${p}`}function H(f,p,m){ne(p,"offset"),(f[p]===void 0||f[p+m]===void 0)&&be(p,f.length-(m+1))}function te(f,p,m,k,M,z){if(f>m||f<p){let ie=typeof p=="bigint"?"n":"",$;throw p===0||p===BigInt(0)?$=`>= 0${ie} and < 2${ie} ** ${(z+1)*8}${ie}`:$=`>= -(2${ie} ** ${(z+1)*8-1}${ie}) and < 2 ** ${(z+1)*8-1}${ie}`,new X.ERR_OUT_OF_RANGE("value",$,f)}H(k,M,z)}function ne(f,p){if(typeof f!="number")throw new X.ERR_INVALID_ARG_TYPE(p,"number",f)}function be(f,p,m){throw Math.floor(f)!==f?(ne(f,m),new X.ERR_OUT_OF_RANGE("offset","an integer",f)):p<0?new X.ERR_BUFFER_OUT_OF_BOUNDS:new X.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,f)}let ce=/[^+/0-9A-Za-z-_]/g;function N(f){if(f=f.split("=")[0],f=f.trim().replace(ce,""),f.length<2)return"";for(;f.length%4!==0;)f=f+"=";return f}function Y(f,p){p=p||1/0;let m,k=f.length,M=null,z=[];for(let ie=0;ie<k;++ie){if(m=f.charCodeAt(ie),m>55295&&m<57344){if(!M){if(m>56319){(p-=3)>-1&&z.push(239,191,189);continue}else if(ie+1===k){(p-=3)>-1&&z.push(239,191,189);continue}M=m;continue}if(m<56320){(p-=3)>-1&&z.push(239,191,189),M=m;continue}m=(M-55296<<10|m-56320)+65536}else M&&(p-=3)>-1&&z.push(239,191,189);if(M=null,m<128){if((p-=1)<0)break;z.push(m)}else if(m<2048){if((p-=2)<0)break;z.push(m>>6|192,m&63|128)}else if(m<65536){if((p-=3)<0)break;z.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((p-=4)<0)break;z.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return z}function se(f){let p=[];for(let m=0;m<f.length;++m)p.push(f.charCodeAt(m)&255);return p}function me(f,p){let m,k,M,z=[];for(let ie=0;ie<f.length&&!((p-=2)<0);++ie)m=f.charCodeAt(ie),k=m>>8,M=m%256,z.push(M),z.push(k);return z}function pe(f){return o.toByteArray(N(f))}function _e(f,p,m,k){let M;for(M=0;M<k&&!(M+m>=p.length||M>=f.length);++M)p[M+m]=f[M];return M}function Z(f,p){return f instanceof p||f!=null&&f.constructor!=null&&f.constructor.name!=null&&f.constructor.name===p.name}function ve(f){return f!==f}let ke=function(){let f="0123456789abcdef",p=new Array(256);for(let m=0;m<16;++m){let k=m*16;for(let M=0;M<16;++M)p[k+M]=f[m]+f[M]}return p}();function fe(f){return typeof BigInt>"u"?De:f}function De(){throw new Error("BigInt not supported")}return Ut}var ir,Ei,gr,Ai,Ut,xi,Cu=_t(()=>{de(),ye(),ge(),ir={},Ei=!1,gr={},Ai=!1,Ut={},xi=!1}),pt={};nr(pt,{Buffer:()=>xr,INSPECT_MAX_BYTES:()=>ls,default:()=>Ct,kMaxLength:()=>us});var Ct,xr,ls,us,dt=_t(()=>{de(),ye(),ge(),Cu(),Ct=Pu(),Ct.Buffer,Ct.SlowBuffer,Ct.INSPECT_MAX_BYTES,Ct.kMaxLength,xr=Ct.Buffer,ls=Ct.INSPECT_MAX_BYTES,us=Ct.kMaxLength}),ye=_t(()=>{dt()}),ut=we((o,l)=>{de(),ye(),ge();var s=class extends Error{constructor(a){if(!Array.isArray(a))throw new TypeError(`Expected input to be an Array, got ${typeof a}`);let u="";for(let t=0;t<a.length;t++)u+=` ${a[t].stack}
31
+ `;super(u),this.name="AggregateError",this.errors=a}};l.exports={AggregateError:s,ArrayIsArray(a){return Array.isArray(a)},ArrayPrototypeIncludes(a,u){return a.includes(u)},ArrayPrototypeIndexOf(a,u){return a.indexOf(u)},ArrayPrototypeJoin(a,u){return a.join(u)},ArrayPrototypeMap(a,u){return a.map(u)},ArrayPrototypePop(a,u){return a.pop(u)},ArrayPrototypePush(a,u){return a.push(u)},ArrayPrototypeSlice(a,u,t){return a.slice(u,t)},Error,FunctionPrototypeCall(a,u,...t){return a.call(u,...t)},FunctionPrototypeSymbolHasInstance(a,u){return Function.prototype[Symbol.hasInstance].call(a,u)},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(a,u){return Object.defineProperties(a,u)},ObjectDefineProperty(a,u,t){return Object.defineProperty(a,u,t)},ObjectGetOwnPropertyDescriptor(a,u){return Object.getOwnPropertyDescriptor(a,u)},ObjectKeys(a){return Object.keys(a)},ObjectSetPrototypeOf(a,u){return Object.setPrototypeOf(a,u)},Promise,PromisePrototypeCatch(a,u){return a.catch(u)},PromisePrototypeThen(a,u,t){return a.then(u,t)},PromiseReject(a){return Promise.reject(a)},PromiseResolve(a){return Promise.resolve(a)},ReflectApply:Reflect.apply,RegExpPrototypeTest(a,u){return a.test(u)},SafeSet:Set,String,StringPrototypeSlice(a,u,t){return a.slice(u,t)},StringPrototypeToLowerCase(a){return a.toLowerCase()},StringPrototypeToUpperCase(a){return a.toUpperCase()},StringPrototypeTrim(a){return a.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(a,u,t){return a.set(u,t)},Boolean,Uint8Array}}),cs=we((o,l)=>{de(),ye(),ge(),l.exports={format(s,...a){return s.replace(/%([sdifj])/g,function(...[u,t]){let r=a.shift();return t==="f"?r.toFixed(6):t==="j"?JSON.stringify(r):t==="s"&&typeof r=="object"?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})},inspect(s){switch(typeof s){case"string":if(s.includes("'"))if(s.includes('"')){if(!s.includes("`")&&!s.includes("${"))return`\`${s}\``}else return`"${s}"`;return`'${s}'`;case"number":return isNaN(s)?"NaN":Object.is(s,-0)?String(s):s;case"bigint":return`${String(s)}n`;case"boolean":case"undefined":return String(s);case"object":return"{}"}}}}),wt=we((o,l)=>{de(),ye(),ge();var{format:s,inspect:a}=cs(),{AggregateError:u}=ut(),t=globalThis.AggregateError||u,r=Symbol("kIsNodeError"),n=["string","function","number","object","Function","Object","boolean","bigint","symbol"],e=/^([A-Z][a-z0-9]*)+$/,i="__node_internal_",c={};function h(g,_){if(!g)throw new c.ERR_INTERNAL_ASSERTION(_)}function d(g){let _="",E=g.length,v=g[0]==="-"?1:0;for(;E>=v+4;E-=3)_=`_${g.slice(E-3,E)}${_}`;return`${g.slice(0,E)}${_}`}function y(g,_,E){if(typeof _=="function")return h(_.length<=E.length,`Code: ${g}; The provided arguments length (${E.length}) does not match the required ones (${_.length}).`),_(...E);let v=(_.match(/%[dfijoOs]/g)||[]).length;return h(v===E.length,`Code: ${g}; The provided arguments length (${E.length}) does not match the required ones (${v}).`),E.length===0?_:s(_,...E)}function b(g,_,E){E||(E=Error);class v extends E{constructor(...T){super(y(g,_,T))}toString(){return`${this.name} [${g}]: ${this.message}`}}Object.defineProperties(v.prototype,{name:{value:E.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${g}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),v.prototype.code=g,v.prototype[r]=!0,c[g]=v}function w(g){let _=i+g.name;return Object.defineProperty(g,"name",{value:_}),g}function S(g,_){if(g&&_&&g!==_){if(Array.isArray(_.errors))return _.errors.push(g),_;let E=new t([_,g],_.message);return E.code=_.code,E}return g||_}var A=class extends Error{constructor(g="The operation was aborted",_=void 0){if(_!==void 0&&typeof _!="object")throw new c.ERR_INVALID_ARG_TYPE("options","Object",_);super(g,_),this.code="ABORT_ERR",this.name="AbortError"}};b("ERR_ASSERTION","%s",Error),b("ERR_INVALID_ARG_TYPE",(g,_,E)=>{h(typeof g=="string","'name' must be a string"),Array.isArray(_)||(_=[_]);let v="The ";g.endsWith(" argument")?v+=`${g} `:v+=`"${g}" ${g.includes(".")?"property":"argument"} `,v+="must be ";let C=[],T=[],x=[];for(let O of _)h(typeof O=="string","All expected entries have to be of type string"),n.includes(O)?C.push(O.toLowerCase()):e.test(O)?T.push(O):(h(O!=="object",'The value "object" should be written as "Object"'),x.push(O));if(T.length>0){let O=C.indexOf("object");O!==-1&&(C.splice(C,O,1),T.push("Object"))}if(C.length>0){switch(C.length){case 1:v+=`of type ${C[0]}`;break;case 2:v+=`one of type ${C[0]} or ${C[1]}`;break;default:{let O=C.pop();v+=`one of type ${C.join(", ")}, or ${O}`}}(T.length>0||x.length>0)&&(v+=" or ")}if(T.length>0){switch(T.length){case 1:v+=`an instance of ${T[0]}`;break;case 2:v+=`an instance of ${T[0]} or ${T[1]}`;break;default:{let O=T.pop();v+=`an instance of ${T.join(", ")}, or ${O}`}}x.length>0&&(v+=" or ")}switch(x.length){case 0:break;case 1:x[0].toLowerCase()!==x[0]&&(v+="an "),v+=`${x[0]}`;break;case 2:v+=`one of ${x[0]} or ${x[1]}`;break;default:{let O=x.pop();v+=`one of ${x.join(", ")}, or ${O}`}}if(E==null)v+=`. Received ${E}`;else if(typeof E=="function"&&E.name)v+=`. Received function ${E.name}`;else if(typeof E=="object"){var P;if((P=E.constructor)!==null&&P!==void 0&&P.name)v+=`. Received an instance of ${E.constructor.name}`;else{let O=a(E,{depth:-1});v+=`. Received ${O}`}}else{let O=a(E,{colors:!1});O.length>25&&(O=`${O.slice(0,25)}...`),v+=`. Received type ${typeof E} (${O})`}return v},TypeError),b("ERR_INVALID_ARG_VALUE",(g,_,E="is invalid")=>{let v=a(_);return v.length>128&&(v=v.slice(0,128)+"..."),`The ${g.includes(".")?"property":"argument"} '${g}' ${E}. Received ${v}`},TypeError),b("ERR_INVALID_RETURN_VALUE",(g,_,E)=>{var v;let C=E!=null&&(v=E.constructor)!==null&&v!==void 0&&v.name?`instance of ${E.constructor.name}`:`type ${typeof E}`;return`Expected ${g} to be returned from the "${_}" function but got ${C}.`},TypeError),b("ERR_MISSING_ARGS",(...g)=>{h(g.length>0,"At least one arg needs to be specified");let _,E=g.length;switch(g=(Array.isArray(g)?g:[g]).map(v=>`"${v}"`).join(" or "),E){case 1:_+=`The ${g[0]} argument`;break;case 2:_+=`The ${g[0]} and ${g[1]} arguments`;break;default:{let v=g.pop();_+=`The ${g.join(", ")}, and ${v} arguments`}break}return`${_} must be specified`},TypeError),b("ERR_OUT_OF_RANGE",(g,_,E)=>{h(_,'Missing "range" argument');let v;if(Number.isInteger(E)&&Math.abs(E)>2**32)v=d(String(E));else if(typeof E=="bigint"){v=String(E);let C=BigInt(2)**BigInt(32);(E>C||E<-C)&&(v=d(v)),v+="n"}else v=a(E);return`The value of "${g}" is out of range. It must be ${_}. Received ${v}`},RangeError),b("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),b("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),b("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),b("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),b("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),b("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),b("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),b("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),b("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),b("ERR_STREAM_WRITE_AFTER_END","write after end",Error),b("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),l.exports={AbortError:A,aggregateTwoErrors:w(S),hideStackFrames:w,codes:c}}),yr=we((o,l)=>{de(),ye(),ge();var{AbortController:s,AbortSignal:a}=typeof self<"u"?self:typeof window<"u"?window:void 0;l.exports=s,l.exports.AbortSignal=a,l.exports.default=s}),Dt={};nr(Dt,{EventEmitter:()=>fs,default:()=>or,defaultMaxListeners:()=>hs,init:()=>ps,listenerCount:()=>ds,on:()=>gs,once:()=>ys});function ju(){if(Ii)return mr;Ii=!0;var o=typeof Reflect=="object"?Reflect:null,l=o&&typeof o.apply=="function"?o.apply:function(E,v,C){return Function.prototype.apply.call(E,v,C)},s;o&&typeof o.ownKeys=="function"?s=o.ownKeys:Object.getOwnPropertySymbols?s=function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:s=function(E){return Object.getOwnPropertyNames(E)};function a(E){console&&console.warn&&console.warn(E)}var u=Number.isNaN||function(E){return E!==E};function t(){t.init.call(this)}mr=t,mr.once=A,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var r=10;function n(E){if(typeof E!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(E){if(typeof E!="number"||E<0||u(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");r=E}}),t.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},t.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||u(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this};function e(E){return E._maxListeners===void 0?t.defaultMaxListeners:E._maxListeners}t.prototype.getMaxListeners=function(){return e(this)},t.prototype.emit=function(E){for(var v=[],C=1;C<arguments.length;C++)v.push(arguments[C]);var T=E==="error",x=this._events;if(x!==void 0)T=T&&x.error===void 0;else if(!T)return!1;if(T){var P;if(v.length>0&&(P=v[0]),P instanceof Error)throw P;var O=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw O.context=P,O}var F=x[E];if(F===void 0)return!1;if(typeof F=="function")l(F,this,v);else for(var I=F.length,W=b(F,I),C=0;C<I;++C)l(W[C],this,v);return!0};function i(E,v,C,T){var x,P,O;if(n(C),P=E._events,P===void 0?(P=E._events=Object.create(null),E._eventsCount=0):(P.newListener!==void 0&&(E.emit("newListener",v,C.listener?C.listener:C),P=E._events),O=P[v]),O===void 0)O=P[v]=C,++E._eventsCount;else if(typeof O=="function"?O=P[v]=T?[C,O]:[O,C]:T?O.unshift(C):O.push(C),x=e(E),x>0&&O.length>x&&!O.warned){O.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+O.length+" "+String(v)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=E,F.type=v,F.count=O.length,a(F)}return E}t.prototype.addListener=function(E,v){return i(this,E,v,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(E,v){return i(this,E,v,!0)};function c(){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 h(E,v,C){var T={fired:!1,wrapFn:void 0,target:E,type:v,listener:C},x=c.bind(T);return x.listener=C,T.wrapFn=x,x}t.prototype.once=function(E,v){return n(v),this.on(E,h(this,E,v)),this},t.prototype.prependOnceListener=function(E,v){return n(v),this.prependListener(E,h(this,E,v)),this},t.prototype.removeListener=function(E,v){var C,T,x,P,O;if(n(v),T=this._events,T===void 0)return this;if(C=T[E],C===void 0)return this;if(C===v||C.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete T[E],T.removeListener&&this.emit("removeListener",E,C.listener||v));else if(typeof C!="function"){for(x=-1,P=C.length-1;P>=0;P--)if(C[P]===v||C[P].listener===v){O=C[P].listener,x=P;break}if(x<0)return this;x===0?C.shift():w(C,x),C.length===1&&(T[E]=C[0]),T.removeListener!==void 0&&this.emit("removeListener",E,O||v)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(E){var v,C,T;if(C=this._events,C===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete C[E]),this;if(arguments.length===0){var x=Object.keys(C),P;for(T=0;T<x.length;++T)P=x[T],P!=="removeListener"&&this.removeAllListeners(P);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=C[E],typeof v=="function")this.removeListener(E,v);else if(v!==void 0)for(T=v.length-1;T>=0;T--)this.removeListener(E,v[T]);return this};function d(E,v,C){var T=E._events;if(T===void 0)return[];var x=T[v];return x===void 0?[]:typeof x=="function"?C?[x.listener||x]:[x]:C?S(x):b(x,x.length)}t.prototype.listeners=function(E){return d(this,E,!0)},t.prototype.rawListeners=function(E){return d(this,E,!1)},t.listenerCount=function(E,v){return typeof E.listenerCount=="function"?E.listenerCount(v):y.call(E,v)},t.prototype.listenerCount=y;function y(E){var v=this._events;if(v!==void 0){var C=v[E];if(typeof C=="function")return 1;if(C!==void 0)return C.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function b(E,v){for(var C=new Array(v),T=0;T<v;++T)C[T]=E[T];return C}function w(E,v){for(;v+1<E.length;v++)E[v]=E[v+1];E.pop()}function S(E){for(var v=new Array(E.length),C=0;C<v.length;++C)v[C]=E[C].listener||E[C];return v}function A(E,v){return new Promise(function(C,T){function x(O){E.removeListener(v,P),T(O)}function P(){typeof E.removeListener=="function"&&E.removeListener("error",x),C([].slice.call(arguments))}_(E,v,P,{once:!0}),v!=="error"&&g(E,x,{once:!0})})}function g(E,v,C){typeof E.on=="function"&&_(E,"error",v,C)}function _(E,v,C,T){if(typeof E.on=="function")T.once?E.once(v,C):E.on(v,C);else if(typeof E.addEventListener=="function")E.addEventListener(v,function x(P){T.once&&E.removeEventListener(v,x),C(P)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E)}return mr}var mr,Ii,or,fs,hs,ps,ds,gs,ys,Qt=_t(()=>{de(),ye(),ge(),mr={},Ii=!1,or=ju(),or.once,or.once=function(o,l){return new Promise((s,a)=>{function u(...r){t!==void 0&&o.removeListener("error",t),s(r)}let t;l!=="error"&&(t=r=>{o.removeListener(name,u),a(r)},o.once("error",t)),o.once(l,u)})},or.on=function(o,l){let s=[],a=[],u=null,t=!1,r={async next(){let i=s.shift();if(i)return createIterResult(i,!1);if(u){let c=Promise.reject(u);return u=null,c}return t?createIterResult(void 0,!0):new Promise((c,h)=>a.push({resolve:c,reject:h}))},async return(){o.removeListener(l,n),o.removeListener("error",e),t=!0;for(let i of a)i.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(i){u=i,o.removeListener(l,n),o.removeListener("error",e)},[Symbol.asyncIterator](){return this}};return o.on(l,n),o.on("error",e),r;function n(...i){let c=a.shift();c?c.resolve(createIterResult(i,!1)):s.push(i)}function e(i){t=!0;let c=a.shift();c?c.reject(i):u=i,r.return()}},{EventEmitter:fs,defaultMaxListeners:hs,init:ps,listenerCount:ds,on:gs,once:ys}=or}),St=we((o,l)=>{de(),ye(),ge();var s=(dt(),tt(pt)),{format:a,inspect:u}=cs(),{codes:{ERR_INVALID_ARG_TYPE:t}}=wt(),{kResistStopPropagation:r,AggregateError:n,SymbolDispose:e}=ut(),i=globalThis.AbortSignal||yr().AbortSignal,c=globalThis.AbortController||yr().AbortController,h=Object.getPrototypeOf(async function(){}).constructor,d=globalThis.Blob||s.Blob,y=typeof d<"u"?function(S){return S instanceof d}:function(S){return!1},b=(S,A)=>{if(S!==void 0&&(S===null||typeof S!="object"||!("aborted"in S)))throw new t(A,"AbortSignal",S)},w=(S,A)=>{if(typeof S!="function")throw new t(A,"Function",S)};l.exports={AggregateError:n,kEmptyObject:Object.freeze({}),once(S){let A=!1;return function(...g){A||(A=!0,S.apply(this,g))}},createDeferredPromise:function(){let S,A;return{promise:new Promise((g,_)=>{S=g,A=_}),resolve:S,reject:A}},promisify(S){return new Promise((A,g)=>{S((_,...E)=>_?g(_):A(...E))})},debuglog(){return function(){}},format:a,inspect:u,types:{isAsyncFunction(S){return S instanceof h},isArrayBufferView(S){return ArrayBuffer.isView(S)}},isBlob:y,deprecate(S,A){return S},addAbortListener:(Qt(),tt(Dt)).addAbortListener||function(S,A){if(S===void 0)throw new t("signal","AbortSignal",S);b(S,"signal"),w(A,"listener");let g;return S.aborted?queueMicrotask(()=>A()):(S.addEventListener("abort",A,{__proto__:null,once:!0,[r]:!0}),g=()=>{S.removeEventListener("abort",A)}),{__proto__:null,[e](){var _;(_=g)===null||_===void 0||_()}}},AbortSignalAny:i.any||function(S){if(S.length===1)return S[0];let A=new c,g=()=>A.abort();return S.forEach(_=>{b(_,"signals"),_.addEventListener("abort",g,{once:!0})}),A.signal.addEventListener("abort",()=>{S.forEach(_=>_.removeEventListener("abort",g))},{once:!0}),A.signal}},l.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),br=we((o,l)=>{de(),ye(),ge();var{ArrayIsArray:s,ArrayPrototypeIncludes:a,ArrayPrototypeJoin:u,ArrayPrototypeMap:t,NumberIsInteger:r,NumberIsNaN:n,NumberMAX_SAFE_INTEGER:e,NumberMIN_SAFE_INTEGER:i,NumberParseInt:c,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:d,String:y,StringPrototypeToUpperCase:b,StringPrototypeTrim:w}=ut(),{hideStackFrames:S,codes:{ERR_SOCKET_BAD_PORT:A,ERR_INVALID_ARG_TYPE:g,ERR_INVALID_ARG_VALUE:_,ERR_OUT_OF_RANGE:E,ERR_UNKNOWN_SIGNAL:v}}=wt(),{normalizeEncoding:C}=St(),{isAsyncFunction:T,isArrayBufferView:x}=St().types,P={};function O(Z){return Z===(Z|0)}function F(Z){return Z===Z>>>0}var I=/^[0-7]+$/,W="must be a 32-bit unsigned integer or an octal string";function V(Z,ve,ke){if(typeof Z>"u"&&(Z=ke),typeof Z=="string"){if(d(I,Z)===null)throw new _(ve,Z,W);Z=c(Z,8)}return re(Z,ve),Z}var L=S((Z,ve,ke=i,fe=e)=>{if(typeof Z!="number")throw new g(ve,"number",Z);if(!r(Z))throw new E(ve,"an integer",Z);if(Z<ke||Z>fe)throw new E(ve,`>= ${ke} && <= ${fe}`,Z)}),le=S((Z,ve,ke=-2147483648,fe=2147483647)=>{if(typeof Z!="number")throw new g(ve,"number",Z);if(!r(Z))throw new E(ve,"an integer",Z);if(Z<ke||Z>fe)throw new E(ve,`>= ${ke} && <= ${fe}`,Z)}),re=S((Z,ve,ke=!1)=>{if(typeof Z!="number")throw new g(ve,"number",Z);if(!r(Z))throw new E(ve,"an integer",Z);let fe=ke?1:0,De=4294967295;if(Z<fe||Z>De)throw new E(ve,`>= ${fe} && <= ${De}`,Z)});function ee(Z,ve){if(typeof Z!="string")throw new g(ve,"string",Z)}function ue(Z,ve,ke=void 0,fe){if(typeof Z!="number")throw new g(ve,"number",Z);if(ke!=null&&Z<ke||fe!=null&&Z>fe||(ke!=null||fe!=null)&&n(Z))throw new E(ve,`${ke!=null?`>= ${ke}`:""}${ke!=null&&fe!=null?" && ":""}${fe!=null?`<= ${fe}`:""}`,Z)}var G=S((Z,ve,ke)=>{if(!a(ke,Z)){let fe="must be one of: "+u(t(ke,De=>typeof De=="string"?`'${De}'`:y(De)),", ");throw new _(ve,Z,fe)}});function oe(Z,ve){if(typeof Z!="boolean")throw new g(ve,"boolean",Z)}function R(Z,ve,ke){return Z==null||!h(Z,ve)?ke:Z[ve]}var Q=S((Z,ve,ke=null)=>{let fe=R(ke,"allowArray",!1),De=R(ke,"allowFunction",!1);if(!R(ke,"nullable",!1)&&Z===null||!fe&&s(Z)||typeof Z!="object"&&(!De||typeof Z!="function"))throw new g(ve,"Object",Z)}),he=S((Z,ve)=>{if(Z!=null&&typeof Z!="object"&&typeof Z!="function")throw new g(ve,"a dictionary",Z)}),q=S((Z,ve,ke=0)=>{if(!s(Z))throw new g(ve,"Array",Z);if(Z.length<ke){let fe=`must be longer than ${ke}`;throw new _(ve,Z,fe)}});function Ee(Z,ve){q(Z,ve);for(let ke=0;ke<Z.length;ke++)ee(Z[ke],`${ve}[${ke}]`)}function X(Z,ve){q(Z,ve);for(let ke=0;ke<Z.length;ke++)oe(Z[ke],`${ve}[${ke}]`)}function U(Z,ve){q(Z,ve);for(let ke=0;ke<Z.length;ke++){let fe=Z[ke],De=`${ve}[${ke}]`;if(fe==null)throw new g(De,"AbortSignal",fe);be(fe,De)}}function ae(Z,ve="signal"){if(ee(Z,ve),P[Z]===void 0)throw P[b(Z)]!==void 0?new v(Z+" (signals must use all capital letters)"):new v(Z)}var H=S((Z,ve="buffer")=>{if(!x(Z))throw new g(ve,["Buffer","TypedArray","DataView"],Z)});function te(Z,ve){let ke=C(ve),fe=Z.length;if(ke==="hex"&&fe%2!==0)throw new _("encoding",ve,`is invalid for data of length ${fe}`)}function ne(Z,ve="Port",ke=!0){if(typeof Z!="number"&&typeof Z!="string"||typeof Z=="string"&&w(Z).length===0||+Z!==+Z>>>0||Z>65535||Z===0&&!ke)throw new A(ve,Z,ke);return Z|0}var be=S((Z,ve)=>{if(Z!==void 0&&(Z===null||typeof Z!="object"||!("aborted"in Z)))throw new g(ve,"AbortSignal",Z)}),ce=S((Z,ve)=>{if(typeof Z!="function")throw new g(ve,"Function",Z)}),N=S((Z,ve)=>{if(typeof Z!="function"||T(Z))throw new g(ve,"Function",Z)}),Y=S((Z,ve)=>{if(Z!==void 0)throw new g(ve,"undefined",Z)});function se(Z,ve,ke){if(!a(ke,Z))throw new g(ve,`('${u(ke,"|")}')`,Z)}var me=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function pe(Z,ve){if(typeof Z>"u"||!d(me,Z))throw new _(ve,Z,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function _e(Z){if(typeof Z=="string")return pe(Z,"hints"),Z;if(s(Z)){let ve=Z.length,ke="";if(ve===0)return ke;for(let fe=0;fe<ve;fe++){let De=Z[fe];pe(De,"hints"),ke+=De,fe!==ve-1&&(ke+=", ")}return ke}throw new _("hints",Z,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}l.exports={isInt32:O,isUint32:F,parseFileMode:V,validateArray:q,validateStringArray:Ee,validateBooleanArray:X,validateAbortSignalArray:U,validateBoolean:oe,validateBuffer:H,validateDictionary:he,validateEncoding:te,validateFunction:ce,validateInt32:le,validateInteger:L,validateNumber:ue,validateObject:Q,validateOneOf:G,validatePlainFunction:N,validatePort:ne,validateSignalName:ae,validateString:ee,validateUint32:re,validateUndefined:Y,validateUnion:se,validateAbortSignal:be,validateLinkHeaderValue:_e}}),Jt=we((o,l)=>{de(),ye(),ge();var s=l.exports={},a,u;function t(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=t}catch{a=t}try{typeof clearTimeout=="function"?u=clearTimeout:u=r}catch{u=r}})();function n(A){if(a===setTimeout)return setTimeout(A,0);if((a===t||!a)&&setTimeout)return a=setTimeout,setTimeout(A,0);try{return a(A,0)}catch{try{return a.call(null,A,0)}catch{return a.call(this,A,0)}}}function e(A){if(u===clearTimeout)return clearTimeout(A);if((u===r||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(A);try{return u(A)}catch{try{return u.call(null,A)}catch{return u.call(this,A)}}}var i=[],c=!1,h,d=-1;function y(){!c||!h||(c=!1,h.length?i=h.concat(i):d=-1,i.length&&b())}function b(){if(!c){var A=n(y);c=!0;for(var g=i.length;g;){for(h=i,i=[];++d<g;)h&&h[d].run();d=-1,g=i.length}h=null,c=!1,e(A)}}s.nextTick=function(A){var g=new Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)g[_-1]=arguments[_];i.push(new w(A,g)),i.length===1&&!c&&n(b)};function w(A,g){this.fun=A,this.array=g}w.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function S(){}s.on=S,s.addListener=S,s.once=S,s.off=S,s.removeListener=S,s.removeAllListeners=S,s.emit=S,s.prependListener=S,s.prependOnceListener=S,s.listeners=function(A){return[]},s.binding=function(A){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(A){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}}),jt=we((o,l)=>{de(),ye(),ge();var{SymbolAsyncIterator:s,SymbolIterator:a,SymbolFor:u}=ut(),t=u("nodejs.stream.destroyed"),r=u("nodejs.stream.errored"),n=u("nodejs.stream.readable"),e=u("nodejs.stream.writable"),i=u("nodejs.stream.disturbed"),c=u("nodejs.webstream.isClosedPromise"),h=u("nodejs.webstream.controllerErrorFunction");function d(R,Q=!1){var he;return!!(R&&typeof R.pipe=="function"&&typeof R.on=="function"&&(!Q||typeof R.pause=="function"&&typeof R.resume=="function")&&(!R._writableState||((he=R._readableState)===null||he===void 0?void 0:he.readable)!==!1)&&(!R._writableState||R._readableState))}function y(R){var Q;return!!(R&&typeof R.write=="function"&&typeof R.on=="function"&&(!R._readableState||((Q=R._writableState)===null||Q===void 0?void 0:Q.writable)!==!1))}function b(R){return!!(R&&typeof R.pipe=="function"&&R._readableState&&typeof R.on=="function"&&typeof R.write=="function")}function w(R){return R&&(R._readableState||R._writableState||typeof R.write=="function"&&typeof R.on=="function"||typeof R.pipe=="function"&&typeof R.on=="function")}function S(R){return!!(R&&!w(R)&&typeof R.pipeThrough=="function"&&typeof R.getReader=="function"&&typeof R.cancel=="function")}function A(R){return!!(R&&!w(R)&&typeof R.getWriter=="function"&&typeof R.abort=="function")}function g(R){return!!(R&&!w(R)&&typeof R.readable=="object"&&typeof R.writable=="object")}function _(R){return S(R)||A(R)||g(R)}function E(R,Q){return R==null?!1:Q===!0?typeof R[s]=="function":Q===!1?typeof R[a]=="function":typeof R[s]=="function"||typeof R[a]=="function"}function v(R){if(!w(R))return null;let Q=R._writableState,he=R._readableState,q=Q||he;return!!(R.destroyed||R[t]||q!=null&&q.destroyed)}function C(R){if(!y(R))return null;if(R.writableEnded===!0)return!0;let Q=R._writableState;return Q!=null&&Q.errored?!1:typeof(Q==null?void 0:Q.ended)!="boolean"?null:Q.ended}function T(R,Q){if(!y(R))return null;if(R.writableFinished===!0)return!0;let he=R._writableState;return he!=null&&he.errored?!1:typeof(he==null?void 0:he.finished)!="boolean"?null:!!(he.finished||Q===!1&&he.ended===!0&&he.length===0)}function x(R){if(!d(R))return null;if(R.readableEnded===!0)return!0;let Q=R._readableState;return!Q||Q.errored?!1:typeof(Q==null?void 0:Q.ended)!="boolean"?null:Q.ended}function P(R,Q){if(!d(R))return null;let he=R._readableState;return he!=null&&he.errored?!1:typeof(he==null?void 0:he.endEmitted)!="boolean"?null:!!(he.endEmitted||Q===!1&&he.ended===!0&&he.length===0)}function O(R){return R&&R[n]!=null?R[n]:typeof(R==null?void 0:R.readable)!="boolean"?null:v(R)?!1:d(R)&&R.readable&&!P(R)}function F(R){return R&&R[e]!=null?R[e]:typeof(R==null?void 0:R.writable)!="boolean"?null:v(R)?!1:y(R)&&R.writable&&!C(R)}function I(R,Q){return w(R)?v(R)?!0:!((Q==null?void 0:Q.readable)!==!1&&O(R)||(Q==null?void 0:Q.writable)!==!1&&F(R)):null}function W(R){var Q,he;return w(R)?R.writableErrored?R.writableErrored:(Q=(he=R._writableState)===null||he===void 0?void 0:he.errored)!==null&&Q!==void 0?Q:null:null}function V(R){var Q,he;return w(R)?R.readableErrored?R.readableErrored:(Q=(he=R._readableState)===null||he===void 0?void 0:he.errored)!==null&&Q!==void 0?Q:null:null}function L(R){if(!w(R))return null;if(typeof R.closed=="boolean")return R.closed;let Q=R._writableState,he=R._readableState;return typeof(Q==null?void 0:Q.closed)=="boolean"||typeof(he==null?void 0:he.closed)=="boolean"?(Q==null?void 0:Q.closed)||(he==null?void 0:he.closed):typeof R._closed=="boolean"&&le(R)?R._closed:null}function le(R){return typeof R._closed=="boolean"&&typeof R._defaultKeepAlive=="boolean"&&typeof R._removedConnection=="boolean"&&typeof R._removedContLen=="boolean"}function re(R){return typeof R._sent100=="boolean"&&le(R)}function ee(R){var Q;return typeof R._consuming=="boolean"&&typeof R._dumped=="boolean"&&((Q=R.req)===null||Q===void 0?void 0:Q.upgradeOrConnect)===void 0}function ue(R){if(!w(R))return null;let Q=R._writableState,he=R._readableState,q=Q||he;return!q&&re(R)||!!(q&&q.autoDestroy&&q.emitClose&&q.closed===!1)}function G(R){var Q;return!!(R&&((Q=R[i])!==null&&Q!==void 0?Q:R.readableDidRead||R.readableAborted))}function oe(R){var Q,he,q,Ee,X,U,ae,H,te,ne;return!!(R&&((Q=(he=(q=(Ee=(X=(U=R[r])!==null&&U!==void 0?U:R.readableErrored)!==null&&X!==void 0?X:R.writableErrored)!==null&&Ee!==void 0?Ee:(ae=R._readableState)===null||ae===void 0?void 0:ae.errorEmitted)!==null&&q!==void 0?q:(H=R._writableState)===null||H===void 0?void 0:H.errorEmitted)!==null&&he!==void 0?he:(te=R._readableState)===null||te===void 0?void 0:te.errored)!==null&&Q!==void 0?Q:!((ne=R._writableState)===null||ne===void 0)&&ne.errored))}l.exports={isDestroyed:v,kIsDestroyed:t,isDisturbed:G,kIsDisturbed:i,isErrored:oe,kIsErrored:r,isReadable:O,kIsReadable:n,kIsClosedPromise:c,kControllerErrorFunction:h,kIsWritable:e,isClosed:L,isDuplexNodeStream:b,isFinished:I,isIterable:E,isReadableNodeStream:d,isReadableStream:S,isReadableEnded:x,isReadableFinished:P,isReadableErrored:V,isNodeStream:w,isWebStream:_,isWritable:F,isWritableNodeStream:y,isWritableStream:A,isWritableEnded:C,isWritableFinished:T,isWritableErrored:W,isServerRequest:ee,isServerResponse:re,willEmitClose:ue,isTransformStream:g}}),Ft=we((o,l)=>{de(),ye(),ge();var s=Jt(),{AbortError:a,codes:u}=wt(),{ERR_INVALID_ARG_TYPE:t,ERR_STREAM_PREMATURE_CLOSE:r}=u,{kEmptyObject:n,once:e}=St(),{validateAbortSignal:i,validateFunction:c,validateObject:h,validateBoolean:d}=br(),{Promise:y,PromisePrototypeThen:b,SymbolDispose:w}=ut(),{isClosed:S,isReadable:A,isReadableNodeStream:g,isReadableStream:_,isReadableFinished:E,isReadableErrored:v,isWritable:C,isWritableNodeStream:T,isWritableStream:x,isWritableFinished:P,isWritableErrored:O,isNodeStream:F,willEmitClose:I,kIsClosedPromise:W}=jt(),V;function L(G){return G.setHeader&&typeof G.abort=="function"}var le=()=>{};function re(G,oe,R){var Q,he;if(arguments.length===2?(R=oe,oe=n):oe==null?oe=n:h(oe,"options"),c(R,"callback"),i(oe.signal,"options.signal"),R=e(R),_(G)||x(G))return ee(G,oe,R);if(!F(G))throw new t("stream",["ReadableStream","WritableStream","Stream"],G);let q=(Q=oe.readable)!==null&&Q!==void 0?Q:g(G),Ee=(he=oe.writable)!==null&&he!==void 0?he:T(G),X=G._writableState,U=G._readableState,ae=()=>{G.writable||ne()},H=I(G)&&g(G)===q&&T(G)===Ee,te=P(G,!1),ne=()=>{te=!0,G.destroyed&&(H=!1),!(H&&(!G.readable||q))&&(!q||be)&&R.call(G)},be=E(G,!1),ce=()=>{be=!0,G.destroyed&&(H=!1),!(H&&(!G.writable||Ee))&&(!Ee||te)&&R.call(G)},N=Z=>{R.call(G,Z)},Y=S(G),se=()=>{Y=!0;let Z=O(G)||v(G);if(Z&&typeof Z!="boolean")return R.call(G,Z);if(q&&!be&&g(G,!0)&&!E(G,!1))return R.call(G,new r);if(Ee&&!te&&!P(G,!1))return R.call(G,new r);R.call(G)},me=()=>{Y=!0;let Z=O(G)||v(G);if(Z&&typeof Z!="boolean")return R.call(G,Z);R.call(G)},pe=()=>{G.req.on("finish",ne)};L(G)?(G.on("complete",ne),H||G.on("abort",se),G.req?pe():G.on("request",pe)):Ee&&!X&&(G.on("end",ae),G.on("close",ae)),!H&&typeof G.aborted=="boolean"&&G.on("aborted",se),G.on("end",ce),G.on("finish",ne),oe.error!==!1&&G.on("error",N),G.on("close",se),Y?s.nextTick(se):X!=null&&X.errorEmitted||U!=null&&U.errorEmitted?H||s.nextTick(me):(!q&&(!H||A(G))&&(te||C(G)===!1)||!Ee&&(!H||C(G))&&(be||A(G)===!1)||U&&G.req&&G.aborted)&&s.nextTick(me);let _e=()=>{R=le,G.removeListener("aborted",se),G.removeListener("complete",ne),G.removeListener("abort",se),G.removeListener("request",pe),G.req&&G.req.removeListener("finish",ne),G.removeListener("end",ae),G.removeListener("close",ae),G.removeListener("finish",ne),G.removeListener("end",ce),G.removeListener("error",N),G.removeListener("close",se)};if(oe.signal&&!Y){let Z=()=>{let ve=R;_e(),ve.call(G,new a(void 0,{cause:oe.signal.reason}))};if(oe.signal.aborted)s.nextTick(Z);else{V=V||St().addAbortListener;let ve=V(oe.signal,Z),ke=R;R=e((...fe)=>{ve[w](),ke.apply(G,fe)})}}return _e}function ee(G,oe,R){let Q=!1,he=le;if(oe.signal)if(he=()=>{Q=!0,R.call(G,new a(void 0,{cause:oe.signal.reason}))},oe.signal.aborted)s.nextTick(he);else{V=V||St().addAbortListener;let Ee=V(oe.signal,he),X=R;R=e((...U)=>{Ee[w](),X.apply(G,U)})}let q=(...Ee)=>{Q||s.nextTick(()=>R.apply(G,Ee))};return b(G[W].promise,q,q),le}function ue(G,oe){var R;let Q=!1;return oe===null&&(oe=n),(R=oe)!==null&&R!==void 0&&R.cleanup&&(d(oe.cleanup,"cleanup"),Q=oe.cleanup),new y((he,q)=>{let Ee=re(G,oe,X=>{Q&&Ee(),X?q(X):he()})})}l.exports=re,l.exports.finished=ue}),sr=we((o,l)=>{de(),ye(),ge();var s=Jt(),{aggregateTwoErrors:a,codes:{ERR_MULTIPLE_CALLBACK:u},AbortError:t}=wt(),{Symbol:r}=ut(),{kIsDestroyed:n,isDestroyed:e,isFinished:i,isServerRequest:c}=jt(),h=r("kDestroy"),d=r("kConstruct");function y(I,W,V){I&&(I.stack,W&&!W.errored&&(W.errored=I),V&&!V.errored&&(V.errored=I))}function b(I,W){let V=this._readableState,L=this._writableState,le=L||V;return L!=null&&L.destroyed||V!=null&&V.destroyed?(typeof W=="function"&&W(),this):(y(I,L,V),L&&(L.destroyed=!0),V&&(V.destroyed=!0),le.constructed?w(this,I,W):this.once(h,function(re){w(this,a(re,I),W)}),this)}function w(I,W,V){let L=!1;function le(re){if(L)return;L=!0;let ee=I._readableState,ue=I._writableState;y(re,ue,ee),ue&&(ue.closed=!0),ee&&(ee.closed=!0),typeof V=="function"&&V(re),re?s.nextTick(S,I,re):s.nextTick(A,I)}try{I._destroy(W||null,le)}catch(re){le(re)}}function S(I,W){g(I,W),A(I)}function A(I){let W=I._readableState,V=I._writableState;V&&(V.closeEmitted=!0),W&&(W.closeEmitted=!0),(V!=null&&V.emitClose||W!=null&&W.emitClose)&&I.emit("close")}function g(I,W){let V=I._readableState,L=I._writableState;L!=null&&L.errorEmitted||V!=null&&V.errorEmitted||(L&&(L.errorEmitted=!0),V&&(V.errorEmitted=!0),I.emit("error",W))}function _(){let I=this._readableState,W=this._writableState;I&&(I.constructed=!0,I.closed=!1,I.closeEmitted=!1,I.destroyed=!1,I.errored=null,I.errorEmitted=!1,I.reading=!1,I.ended=I.readable===!1,I.endEmitted=I.readable===!1),W&&(W.constructed=!0,W.destroyed=!1,W.closed=!1,W.closeEmitted=!1,W.errored=null,W.errorEmitted=!1,W.finalCalled=!1,W.prefinished=!1,W.ended=W.writable===!1,W.ending=W.writable===!1,W.finished=W.writable===!1)}function E(I,W,V){let L=I._readableState,le=I._writableState;if(le!=null&&le.destroyed||L!=null&&L.destroyed)return this;L!=null&&L.autoDestroy||le!=null&&le.autoDestroy?I.destroy(W):W&&(W.stack,le&&!le.errored&&(le.errored=W),L&&!L.errored&&(L.errored=W),V?s.nextTick(g,I,W):g(I,W))}function v(I,W){if(typeof I._construct!="function")return;let V=I._readableState,L=I._writableState;V&&(V.constructed=!1),L&&(L.constructed=!1),I.once(d,W),!(I.listenerCount(d)>1)&&s.nextTick(C,I)}function C(I){let W=!1;function V(L){if(W){E(I,L??new u);return}W=!0;let le=I._readableState,re=I._writableState,ee=re||le;le&&(le.constructed=!0),re&&(re.constructed=!0),ee.destroyed?I.emit(h,L):L?E(I,L,!0):s.nextTick(T,I)}try{I._construct(L=>{s.nextTick(V,L)})}catch(L){s.nextTick(V,L)}}function T(I){I.emit(d)}function x(I){return(I==null?void 0:I.setHeader)&&typeof I.abort=="function"}function P(I){I.emit("close")}function O(I,W){I.emit("error",W),s.nextTick(P,I)}function F(I,W){!I||e(I)||(!W&&!i(I)&&(W=new t),c(I)?(I.socket=null,I.destroy(W)):x(I)?I.abort():x(I.req)?I.req.abort():typeof I.destroy=="function"?I.destroy(W):typeof I.close=="function"?I.close():W?s.nextTick(O,I,W):s.nextTick(P,I),I.destroyed||(I[n]=!0))}l.exports={construct:v,destroyer:F,destroy:b,undestroy:_,errorOrDestroy:E}}),ki=we((o,l)=>{de(),ye(),ge();var{ArrayIsArray:s,ObjectSetPrototypeOf:a}=ut(),{EventEmitter:u}=(Qt(),tt(Dt));function t(n){u.call(this,n)}a(t.prototype,u.prototype),a(t,u),t.prototype.pipe=function(n,e){let i=this;function c(A){n.writable&&n.write(A)===!1&&i.pause&&i.pause()}i.on("data",c);function h(){i.readable&&i.resume&&i.resume()}n.on("drain",h),!n._isStdio&&(!e||e.end!==!1)&&(i.on("end",y),i.on("close",b));let d=!1;function y(){d||(d=!0,n.end())}function b(){d||(d=!0,typeof n.destroy=="function"&&n.destroy())}function w(A){S(),u.listenerCount(this,"error")===0&&this.emit("error",A)}r(i,"error",w),r(n,"error",w);function S(){i.removeListener("data",c),n.removeListener("drain",h),i.removeListener("end",y),i.removeListener("close",b),i.removeListener("error",w),n.removeListener("error",w),i.removeListener("end",S),i.removeListener("close",S),n.removeListener("close",S)}return i.on("end",S),i.on("close",S),n.on("close",S),n.emit("pipe",i),n};function r(n,e,i){if(typeof n.prependListener=="function")return n.prependListener(e,i);!n._events||!n._events[e]?n.on(e,i):s(n._events[e])?n._events[e].unshift(i):n._events[e]=[i,n._events[e]]}l.exports={Stream:t,prependListener:r}}),Ir=we((o,l)=>{de(),ye(),ge();var{SymbolDispose:s}=ut(),{AbortError:a,codes:u}=wt(),{isNodeStream:t,isWebStream:r,kControllerErrorFunction:n}=jt(),e=Ft(),{ERR_INVALID_ARG_TYPE:i}=u,c,h=(d,y)=>{if(typeof d!="object"||!("aborted"in d))throw new i(y,"AbortSignal",d)};l.exports.addAbortSignal=function(d,y){if(h(d,"signal"),!t(y)&&!r(y))throw new i("stream",["ReadableStream","WritableStream","Stream"],y);return l.exports.addAbortSignalNoValidate(d,y)},l.exports.addAbortSignalNoValidate=function(d,y){if(typeof d!="object"||!("aborted"in d))return y;let b=t(y)?()=>{y.destroy(new a(void 0,{cause:d.reason}))}:()=>{y[n](new a(void 0,{cause:d.reason}))};if(d.aborted)b();else{c=c||St().addAbortListener;let w=c(d,b);e(y,w[s])}return y}}),Ru=we((o,l)=>{de(),ye(),ge();var{StringPrototypeSlice:s,SymbolIterator:a,TypedArrayPrototypeSet:u,Uint8Array:t}=ut(),{Buffer:r}=(dt(),tt(pt)),{inspect:n}=St();l.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,c=""+i.data;for(;(i=i.next)!==null;)c+=e+i.data;return c}concat(e){if(this.length===0)return r.alloc(0);let i=r.allocUnsafe(e>>>0),c=this.head,h=0;for(;c;)u(i,c.data,h),h+=c.data.length,c=c.next;return i}consume(e,i){let c=this.head.data;if(e<c.length){let h=c.slice(0,e);return this.head.data=c.slice(e),h}return e===c.length?this.shift():i?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[a](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",c=this.head,h=0;do{let d=c.data;if(e>d.length)i+=d,e-=d.length;else{e===d.length?(i+=d,++h,c.next?this.head=c.next:this.head=this.tail=null):(i+=s(d,0,e),this.head=c,c.data=s(d,e));break}++h}while((c=c.next)!==null);return this.length-=h,i}_getBuffer(e){let i=r.allocUnsafe(e),c=e,h=this.head,d=0;do{let y=h.data;if(e>y.length)u(i,y,c-e),e-=y.length;else{e===y.length?(u(i,y,c-e),++d,h.next?this.head=h.next:this.head=this.tail=null):(u(i,new t(y.buffer,y.byteOffset,e),c-e),this.head=h,h.data=y.slice(e));break}++d}while((h=h.next)!==null);return this.length-=d,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return n(this,{...i,depth:0,customInspect:!1})}}}),kr=we((o,l)=>{de(),ye(),ge();var{MathFloor:s,NumberIsInteger:a}=ut(),{validateInteger:u}=br(),{ERR_INVALID_ARG_VALUE:t}=wt().codes,r=16*1024,n=16;function e(d,y,b){return d.highWaterMark!=null?d.highWaterMark:y?d[b]:null}function i(d){return d?n:r}function c(d,y){u(y,"value",0),d?n=y:r=y}function h(d,y,b,w){let S=e(y,w,b);if(S!=null){if(!a(S)||S<0){let A=w?`options.${b}`:"options.highWaterMark";throw new t(A,S)}return s(S)}return i(d.objectMode)}l.exports={getHighWaterMark:h,getDefaultHighWaterMark:i,setDefaultHighWaterMark:c}}),Mu=we((o,l)=>{de(),ye(),ge();var s=(dt(),tt(pt)),a=s.Buffer;function u(r,n){for(var e in r)n[e]=r[e]}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?l.exports=s:(u(s,o),o.Buffer=t);function t(r,n,e){return a(r,n,e)}t.prototype=Object.create(a.prototype),u(a,t),t.from=function(r,n,e){if(typeof r=="number")throw new TypeError("Argument must not be a number");return a(r,n,e)},t.alloc=function(r,n,e){if(typeof r!="number")throw new TypeError("Argument must be a number");var i=a(r);return n!==void 0?typeof e=="string"?i.fill(n,e):i.fill(n):i.fill(0),i},t.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return a(r)},t.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return s.SlowBuffer(r)}}),Nu=we(o=>{de(),ye(),ge();var l=Mu().Buffer,s=l.isEncoding||function(g){switch(g=""+g,g&&g.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 a(g){if(!g)return"utf8";for(var _;;)switch(g){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 g;default:if(_)return;g=(""+g).toLowerCase(),_=!0}}function u(g){var _=a(g);if(typeof _!="string"&&(l.isEncoding===s||!s(g)))throw new Error("Unknown encoding: "+g);return _||g}o.StringDecoder=t;function t(g){this.encoding=u(g);var _;switch(this.encoding){case"utf16le":this.text=d,this.end=y,_=4;break;case"utf8":this.fillLast=i,_=4;break;case"base64":this.text=b,this.end=w,_=3;break;default:this.write=S,this.end=A;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=l.allocUnsafe(_)}t.prototype.write=function(g){if(g.length===0)return"";var _,E;if(this.lastNeed){if(_=this.fillLast(g),_===void 0)return"";E=this.lastNeed,this.lastNeed=0}else E=0;return E<g.length?_?_+this.text(g,E):this.text(g,E):_||""},t.prototype.end=h,t.prototype.text=c,t.prototype.fillLast=function(g){if(this.lastNeed<=g.length)return g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,g.length),this.lastNeed-=g.length};function r(g){return g<=127?0:g>>5===6?2:g>>4===14?3:g>>3===30?4:g>>6===2?-1:-2}function n(g,_,E){var v=_.length-1;if(v<E)return 0;var C=r(_[v]);return C>=0?(C>0&&(g.lastNeed=C-1),C):--v<E||C===-2?0:(C=r(_[v]),C>=0?(C>0&&(g.lastNeed=C-2),C):--v<E||C===-2?0:(C=r(_[v]),C>=0?(C>0&&(C===2?C=0:g.lastNeed=C-3),C):0))}function e(g,_,E){if((_[0]&192)!==128)return g.lastNeed=0,"�";if(g.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return g.lastNeed=1,"�";if(g.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return g.lastNeed=2,"�"}}function i(g){var _=this.lastTotal-this.lastNeed,E=e(this,g);if(E!==void 0)return E;if(this.lastNeed<=g.length)return g.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,_,0,g.length),this.lastNeed-=g.length}function c(g,_){var E=n(this,g,_);if(!this.lastNeed)return g.toString("utf8",_);this.lastTotal=E;var v=g.length-(E-this.lastNeed);return g.copy(this.lastChar,0,v),g.toString("utf8",_,v)}function h(g){var _=g&&g.length?this.write(g):"";return this.lastNeed?_+"�":_}function d(g,_){if((g.length-_)%2===0){var E=g.toString("utf16le",_);if(E){var v=E.charCodeAt(E.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1],E.slice(0,-1)}return E}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=g[g.length-1],g.toString("utf16le",_,g.length-1)}function y(g){var _=g&&g.length?this.write(g):"";if(this.lastNeed){var E=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,E)}return _}function b(g,_){var E=(g.length-_)%3;return E===0?g.toString("base64",_):(this.lastNeed=3-E,this.lastTotal=3,E===1?this.lastChar[0]=g[g.length-1]:(this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1]),g.toString("base64",_,g.length-E))}function w(g){var _=g&&g.length?this.write(g):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function S(g){return g.toString(this.encoding)}function A(g){return g&&g.length?this.write(g):""}}),ms=we((o,l)=>{de(),ye(),ge();var s=Jt(),{PromisePrototypeThen:a,SymbolAsyncIterator:u,SymbolIterator:t}=ut(),{Buffer:r}=(dt(),tt(pt)),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_NULL_VALUES:e}=wt().codes;function i(c,h,d){let y;if(typeof h=="string"||h instanceof r)return new c({objectMode:!0,...d,read(){this.push(h),this.push(null)}});let b;if(h&&h[u])b=!0,y=h[u]();else if(h&&h[t])b=!1,y=h[t]();else throw new n("iterable",["Iterable"],h);let w=new c({objectMode:!0,highWaterMark:1,...d}),S=!1;w._read=function(){S||(S=!0,g())},w._destroy=function(_,E){a(A(_),()=>s.nextTick(E,_),v=>s.nextTick(E,v||_))};async function A(_){let E=_!=null,v=typeof y.throw=="function";if(E&&v){let{value:C,done:T}=await y.throw(_);if(await C,T)return}if(typeof y.return=="function"){let{value:C}=await y.return();await C}}async function g(){for(;;){try{let{value:_,done:E}=b?await y.next():y.next();if(E)w.push(null);else{let v=_&&typeof _.then=="function"?await _:_;if(v===null)throw S=!1,new e;if(w.push(v))continue;S=!1}}catch(_){w.destroy(_)}break}}return w}l.exports=i}),Or=we((o,l)=>{de(),ye(),ge();var s=Jt(),{ArrayPrototypeIndexOf:a,NumberIsInteger:u,NumberIsNaN:t,NumberParseInt:r,ObjectDefineProperties:n,ObjectKeys:e,ObjectSetPrototypeOf:i,Promise:c,SafeSet:h,SymbolAsyncDispose:d,SymbolAsyncIterator:y,Symbol:b}=ut();l.exports=fe,fe.ReadableState=ke;var{EventEmitter:w}=(Qt(),tt(Dt)),{Stream:S,prependListener:A}=ki(),{Buffer:g}=(dt(),tt(pt)),{addAbortSignal:_}=Ir(),E=Ft(),v=St().debuglog("stream",j=>{v=j}),C=Ru(),T=sr(),{getHighWaterMark:x,getDefaultHighWaterMark:P}=kr(),{aggregateTwoErrors:O,codes:{ERR_INVALID_ARG_TYPE:F,ERR_METHOD_NOT_IMPLEMENTED:I,ERR_OUT_OF_RANGE:W,ERR_STREAM_PUSH_AFTER_EOF:V,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:L},AbortError:le}=wt(),{validateObject:re}=br(),ee=b("kPaused"),{StringDecoder:ue}=Nu(),G=ms();i(fe.prototype,S.prototype),i(fe,S);var oe=()=>{},{errorOrDestroy:R}=T,Q=1,he=2,q=4,Ee=8,X=16,U=32,ae=64,H=128,te=256,ne=512,be=1024,ce=2048,N=4096,Y=8192,se=16384,me=32768,pe=65536,_e=1<<17,Z=1<<18;function ve(j){return{enumerable:!1,get(){return(this.state&j)!==0},set(B){B?this.state|=j:this.state&=~j}}}n(ke.prototype,{objectMode:ve(Q),ended:ve(he),endEmitted:ve(q),reading:ve(Ee),constructed:ve(X),sync:ve(U),needReadable:ve(ae),emittedReadable:ve(H),readableListening:ve(te),resumeScheduled:ve(ne),errorEmitted:ve(be),emitClose:ve(ce),autoDestroy:ve(N),destroyed:ve(Y),closed:ve(se),closeEmitted:ve(me),multiAwaitDrain:ve(pe),readingMore:ve(_e),dataEmitted:ve(Z)});function ke(j,B,xe){typeof xe!="boolean"&&(xe=B instanceof Rt()),this.state=ce|N|X|U,j&&j.objectMode&&(this.state|=Q),xe&&j&&j.readableObjectMode&&(this.state|=Q),this.highWaterMark=j?x(this,j,"readableHighWaterMark",xe):P(!1),this.buffer=new C,this.length=0,this.pipes=[],this.flowing=null,this[ee]=null,j&&j.emitClose===!1&&(this.state&=~ce),j&&j.autoDestroy===!1&&(this.state&=~N),this.errored=null,this.defaultEncoding=j&&j.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,j&&j.encoding&&(this.decoder=new ue(j.encoding),this.encoding=j.encoding)}function fe(j){if(!(this instanceof fe))return new fe(j);let B=this instanceof Rt();this._readableState=new ke(j,this,B),j&&(typeof j.read=="function"&&(this._read=j.read),typeof j.destroy=="function"&&(this._destroy=j.destroy),typeof j.construct=="function"&&(this._construct=j.construct),j.signal&&!B&&_(j.signal,this)),S.call(this,j),T.construct(this,()=>{this._readableState.needReadable&&$(this,this._readableState)})}fe.prototype.destroy=T.destroy,fe.prototype._undestroy=T.undestroy,fe.prototype._destroy=function(j,B){B(j)},fe.prototype[w.captureRejectionSymbol]=function(j){this.destroy(j)},fe.prototype[d]=function(){let j;return this.destroyed||(j=this.readableEnded?null:new le,this.destroy(j)),new c((B,xe)=>E(this,Ce=>Ce&&Ce!==j?xe(Ce):B(null)))},fe.prototype.push=function(j,B){return De(this,j,B,!1)},fe.prototype.unshift=function(j,B){return De(this,j,B,!0)};function De(j,B,xe,Ce){v("readableAddChunk",B);let Be=j._readableState,ft;if(!(Be.state&Q)&&(typeof B=="string"?(xe=xe||Be.defaultEncoding,Be.encoding!==xe&&(Ce&&Be.encoding?B=g.from(B,xe).toString(Be.encoding):(B=g.from(B,xe),xe=""))):B instanceof g?xe="":S._isUint8Array(B)?(B=S._uint8ArrayToBuffer(B),xe=""):B!=null&&(ft=new F("chunk",["string","Buffer","Uint8Array"],B))),ft)R(j,ft);else if(B===null)Be.state&=~Ee,M(j,Be);else if(Be.state&Q||B&&B.length>0)if(Ce)if(Be.state&q)R(j,new L);else{if(Be.destroyed||Be.errored)return!1;f(j,Be,B,!0)}else if(Be.ended)R(j,new V);else{if(Be.destroyed||Be.errored)return!1;Be.state&=~Ee,Be.decoder&&!xe?(B=Be.decoder.write(B),Be.objectMode||B.length!==0?f(j,Be,B,!1):$(j,Be)):f(j,Be,B,!1)}else Ce||(Be.state&=~Ee,$(j,Be));return!Be.ended&&(Be.length<Be.highWaterMark||Be.length===0)}function f(j,B,xe,Ce){B.flowing&&B.length===0&&!B.sync&&j.listenerCount("data")>0?(B.state&pe?B.awaitDrainWriters.clear():B.awaitDrainWriters=null,B.dataEmitted=!0,j.emit("data",xe)):(B.length+=B.objectMode?1:xe.length,Ce?B.buffer.unshift(xe):B.buffer.push(xe),B.state&ae&&z(j)),$(j,B)}fe.prototype.isPaused=function(){let j=this._readableState;return j[ee]===!0||j.flowing===!1},fe.prototype.setEncoding=function(j){let B=new ue(j);this._readableState.decoder=B,this._readableState.encoding=this._readableState.decoder.encoding;let xe=this._readableState.buffer,Ce="";for(let Be of xe)Ce+=B.write(Be);return xe.clear(),Ce!==""&&xe.push(Ce),this._readableState.length=Ce.length,this};var p=1073741824;function m(j){if(j>p)throw new W("size","<= 1GiB",j);return j--,j|=j>>>1,j|=j>>>2,j|=j>>>4,j|=j>>>8,j|=j>>>16,j++,j}function k(j,B){return j<=0||B.length===0&&B.ended?0:B.state&Q?1:t(j)?B.flowing&&B.length?B.buffer.first().length:B.length:j<=B.length?j:B.ended?B.length:0}fe.prototype.read=function(j){v("read",j),j===void 0?j=NaN:u(j)||(j=r(j,10));let B=this._readableState,xe=j;if(j>B.highWaterMark&&(B.highWaterMark=m(j)),j!==0&&(B.state&=~H),j===0&&B.needReadable&&((B.highWaterMark!==0?B.length>=B.highWaterMark:B.length>0)||B.ended))return v("read: emitReadable",B.length,B.ended),B.length===0&&B.ended?Ye(this):z(this),null;if(j=k(j,B),j===0&&B.ended)return B.length===0&&Ye(this),null;let Ce=(B.state&ae)!==0;if(v("need readable",Ce),(B.length===0||B.length-j<B.highWaterMark)&&(Ce=!0,v("length less than watermark",Ce)),B.ended||B.reading||B.destroyed||B.errored||!B.constructed)Ce=!1,v("reading, ended or constructing",Ce);else if(Ce){v("do read"),B.state|=Ee|U,B.length===0&&(B.state|=ae);try{this._read(B.highWaterMark)}catch(ft){R(this,ft)}B.state&=~U,B.reading||(j=k(xe,B))}let Be;return j>0?Be=Ue(j,B):Be=null,Be===null?(B.needReadable=B.length<=B.highWaterMark,j=0):(B.length-=j,B.multiAwaitDrain?B.awaitDrainWriters.clear():B.awaitDrainWriters=null),B.length===0&&(B.ended||(B.needReadable=!0),xe!==j&&B.ended&&Ye(this)),Be!==null&&!B.errorEmitted&&!B.closeEmitted&&(B.dataEmitted=!0,this.emit("data",Be)),Be};function M(j,B){if(v("onEofChunk"),!B.ended){if(B.decoder){let xe=B.decoder.end();xe&&xe.length&&(B.buffer.push(xe),B.length+=B.objectMode?1:xe.length)}B.ended=!0,B.sync?z(j):(B.needReadable=!1,B.emittedReadable=!0,ie(j))}}function z(j){let B=j._readableState;v("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(v("emitReadable",B.flowing),B.emittedReadable=!0,s.nextTick(ie,j))}function ie(j){let B=j._readableState;v("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&!B.errored&&(B.length||B.ended)&&(j.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,rt(j)}function $(j,B){!B.readingMore&&B.constructed&&(B.readingMore=!0,s.nextTick(J,j,B))}function J(j,B){for(;!B.reading&&!B.ended&&(B.length<B.highWaterMark||B.flowing&&B.length===0);){let xe=B.length;if(v("maybeReadMore read 0"),j.read(0),xe===B.length)break}B.readingMore=!1}fe.prototype._read=function(j){throw new I("_read()")},fe.prototype.pipe=function(j,B){let xe=this,Ce=this._readableState;Ce.pipes.length===1&&(Ce.multiAwaitDrain||(Ce.multiAwaitDrain=!0,Ce.awaitDrainWriters=new h(Ce.awaitDrainWriters?[Ce.awaitDrainWriters]:[]))),Ce.pipes.push(j),v("pipe count=%d opts=%j",Ce.pipes.length,B);let Be=(!B||B.end!==!1)&&j!==s.stdout&&j!==s.stderr?yt:Ve;Ce.endEmitted?s.nextTick(Be):xe.once("end",Be),j.on("unpipe",ft);function ft(it,et){v("onunpipe"),it===xe&&et&&et.hasUnpiped===!1&&(et.hasUnpiped=!0,Ae())}function yt(){v("onend"),j.end()}let xt,K=!1;function Ae(){v("cleanup"),j.removeListener("close",Ge),j.removeListener("finish",ze),xt&&j.removeListener("drain",xt),j.removeListener("error",He),j.removeListener("unpipe",ft),xe.removeListener("end",yt),xe.removeListener("end",Ve),xe.removeListener("data",We),K=!0,xt&&Ce.awaitDrainWriters&&(!j._writableState||j._writableState.needDrain)&&xt()}function je(){K||(Ce.pipes.length===1&&Ce.pipes[0]===j?(v("false write response, pause",0),Ce.awaitDrainWriters=j,Ce.multiAwaitDrain=!1):Ce.pipes.length>1&&Ce.pipes.includes(j)&&(v("false write response, pause",Ce.awaitDrainWriters.size),Ce.awaitDrainWriters.add(j)),xe.pause()),xt||(xt=Te(xe,j),j.on("drain",xt))}xe.on("data",We);function We(it){v("ondata");let et=j.write(it);v("dest.write",et),et===!1&&je()}function He(it){if(v("onerror",it),Ve(),j.removeListener("error",He),j.listenerCount("error")===0){let et=j._writableState||j._readableState;et&&!et.errorEmitted?R(j,it):j.emit("error",it)}}A(j,"error",He);function Ge(){j.removeListener("finish",ze),Ve()}j.once("close",Ge);function ze(){v("onfinish"),j.removeListener("close",Ge),Ve()}j.once("finish",ze);function Ve(){v("unpipe"),xe.unpipe(j)}return j.emit("pipe",xe),j.writableNeedDrain===!0?je():Ce.flowing||(v("pipe resume"),xe.resume()),j};function Te(j,B){return function(){let xe=j._readableState;xe.awaitDrainWriters===B?(v("pipeOnDrain",1),xe.awaitDrainWriters=null):xe.multiAwaitDrain&&(v("pipeOnDrain",xe.awaitDrainWriters.size),xe.awaitDrainWriters.delete(B)),(!xe.awaitDrainWriters||xe.awaitDrainWriters.size===0)&&j.listenerCount("data")&&j.resume()}}fe.prototype.unpipe=function(j){let B=this._readableState,xe={hasUnpiped:!1};if(B.pipes.length===0)return this;if(!j){let Be=B.pipes;B.pipes=[],this.pause();for(let ft=0;ft<Be.length;ft++)Be[ft].emit("unpipe",this,{hasUnpiped:!1});return this}let Ce=a(B.pipes,j);return Ce===-1?this:(B.pipes.splice(Ce,1),B.pipes.length===0&&this.pause(),j.emit("unpipe",this,xe),this)},fe.prototype.on=function(j,B){let xe=S.prototype.on.call(this,j,B),Ce=this._readableState;return j==="data"?(Ce.readableListening=this.listenerCount("readable")>0,Ce.flowing!==!1&&this.resume()):j==="readable"&&!Ce.endEmitted&&!Ce.readableListening&&(Ce.readableListening=Ce.needReadable=!0,Ce.flowing=!1,Ce.emittedReadable=!1,v("on readable",Ce.length,Ce.reading),Ce.length?z(this):Ce.reading||s.nextTick(Ne,this)),xe},fe.prototype.addListener=fe.prototype.on,fe.prototype.removeListener=function(j,B){let xe=S.prototype.removeListener.call(this,j,B);return j==="readable"&&s.nextTick(Me,this),xe},fe.prototype.off=fe.prototype.removeListener,fe.prototype.removeAllListeners=function(j){let B=S.prototype.removeAllListeners.apply(this,arguments);return(j==="readable"||j===void 0)&&s.nextTick(Me,this),B};function Me(j){let B=j._readableState;B.readableListening=j.listenerCount("readable")>0,B.resumeScheduled&&B[ee]===!1?B.flowing=!0:j.listenerCount("data")>0?j.resume():B.readableListening||(B.flowing=null)}function Ne(j){v("readable nexttick read 0"),j.read(0)}fe.prototype.resume=function(){let j=this._readableState;return j.flowing||(v("resume"),j.flowing=!j.readableListening,Fe(this,j)),j[ee]=!1,this};function Fe(j,B){B.resumeScheduled||(B.resumeScheduled=!0,s.nextTick(nt,j,B))}function nt(j,B){v("resume",B.reading),B.reading||j.read(0),B.resumeScheduled=!1,j.emit("resume"),rt(j),B.flowing&&!B.reading&&j.read(0)}fe.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ee]=!0,this};function rt(j){let B=j._readableState;for(v("flow",B.flowing);B.flowing&&j.read()!==null;);}fe.prototype.wrap=function(j){let B=!1;j.on("data",Ce=>{!this.push(Ce)&&j.pause&&(B=!0,j.pause())}),j.on("end",()=>{this.push(null)}),j.on("error",Ce=>{R(this,Ce)}),j.on("close",()=>{this.destroy()}),j.on("destroy",()=>{this.destroy()}),this._read=()=>{B&&j.resume&&(B=!1,j.resume())};let xe=e(j);for(let Ce=1;Ce<xe.length;Ce++){let Be=xe[Ce];this[Be]===void 0&&typeof j[Be]=="function"&&(this[Be]=j[Be].bind(j))}return this},fe.prototype[y]=function(){return Ke(this)},fe.prototype.iterator=function(j){return j!==void 0&&re(j,"options"),Ke(this,j)};function Ke(j,B){typeof j.read!="function"&&(j=fe.wrap(j,{objectMode:!0}));let xe=Xe(j,B);return xe.stream=j,xe}async function*Xe(j,B){let xe=oe;function Ce(yt){this===j?(xe(),xe=oe):xe=yt}j.on("readable",Ce);let Be,ft=E(j,{writable:!1},yt=>{Be=yt?O(Be,yt):null,xe(),xe=oe});try{for(;;){let yt=j.destroyed?null:j.read();if(yt!==null)yield yt;else{if(Be)throw Be;if(Be===null)return;await new c(Ce)}}}catch(yt){throw Be=O(Be,yt),Be}finally{(Be||(B==null?void 0:B.destroyOnReturn)!==!1)&&(Be===void 0||j._readableState.autoDestroy)?T.destroyer(j,null):(j.off("readable",Ce),ft())}}n(fe.prototype,{readable:{__proto__:null,get(){let j=this._readableState;return!!j&&j.readable!==!1&&!j.destroyed&&!j.errorEmitted&&!j.endEmitted},set(j){this._readableState&&(this._readableState.readable=!!j)}},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(j){this._readableState&&(this._readableState.flowing=j)}},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(j){this._readableState&&(this._readableState.destroyed=j)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),n(ke.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ee]!==!1},set(j){this[ee]=!!j}}}),fe._fromList=Ue;function Ue(j,B){if(B.length===0)return null;let xe;return B.objectMode?xe=B.buffer.shift():!j||j>=B.length?(B.decoder?xe=B.buffer.join(""):B.buffer.length===1?xe=B.buffer.first():xe=B.buffer.concat(B.length),B.buffer.clear()):xe=B.buffer.consume(j,B.decoder),xe}function Ye(j){let B=j._readableState;v("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,s.nextTick(Ze,B,j))}function Ze(j,B){if(v("endReadableNT",j.endEmitted,j.length),!j.errored&&!j.closeEmitted&&!j.endEmitted&&j.length===0){if(j.endEmitted=!0,B.emit("end"),B.writable&&B.allowHalfOpen===!1)s.nextTick(lt,B);else if(j.autoDestroy){let xe=B._writableState;(!xe||xe.autoDestroy&&(xe.finished||xe.writable===!1))&&B.destroy()}}}function lt(j){j.writable&&!j.writableEnded&&!j.destroyed&&j.end()}fe.from=function(j,B){return G(fe,j,B)};var ct;function Et(){return ct===void 0&&(ct={}),ct}fe.fromWeb=function(j,B){return Et().newStreamReadableFromReadableStream(j,B)},fe.toWeb=function(j,B){return Et().newReadableStreamFromStreamReadable(j,B)},fe.wrap=function(j,B){var xe,Ce;return new fe({objectMode:(xe=(Ce=j.readableObjectMode)!==null&&Ce!==void 0?Ce:j.objectMode)!==null&&xe!==void 0?xe:!0,...B,destroy(Be,ft){T.destroyer(j,Be),ft(Be)}}).wrap(j)}}),Oi=we((o,l)=>{de(),ye(),ge();var s=Jt(),{ArrayPrototypeSlice:a,Error:u,FunctionPrototypeSymbolHasInstance:t,ObjectDefineProperty:r,ObjectDefineProperties:n,ObjectSetPrototypeOf:e,StringPrototypeToLowerCase:i,Symbol:c,SymbolHasInstance:h}=ut();l.exports=re,re.WritableState=L;var{EventEmitter:d}=(Qt(),tt(Dt)),y=ki().Stream,{Buffer:b}=(dt(),tt(pt)),w=sr(),{addAbortSignal:S}=Ir(),{getHighWaterMark:A,getDefaultHighWaterMark:g}=kr(),{ERR_INVALID_ARG_TYPE:_,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:v,ERR_STREAM_CANNOT_PIPE:C,ERR_STREAM_DESTROYED:T,ERR_STREAM_ALREADY_FINISHED:x,ERR_STREAM_NULL_VALUES:P,ERR_STREAM_WRITE_AFTER_END:O,ERR_UNKNOWN_ENCODING:F}=wt().codes,{errorOrDestroy:I}=w;e(re.prototype,y.prototype),e(re,y);function W(){}var V=c("kOnFinished");function L(N,Y,se){typeof se!="boolean"&&(se=Y instanceof Rt()),this.objectMode=!!(N&&N.objectMode),se&&(this.objectMode=this.objectMode||!!(N&&N.writableObjectMode)),this.highWaterMark=N?A(this,N,"writableHighWaterMark",se):g(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let me=!!(N&&N.decodeStrings===!1);this.decodeStrings=!me,this.defaultEncoding=N&&N.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=R.bind(void 0,Y),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,le(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!N||N.emitClose!==!1,this.autoDestroy=!N||N.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[V]=[]}function le(N){N.buffered=[],N.bufferedIndex=0,N.allBuffers=!0,N.allNoop=!0}L.prototype.getBuffer=function(){return a(this.buffered,this.bufferedIndex)},r(L.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function re(N){let Y=this instanceof Rt();if(!Y&&!t(re,this))return new re(N);this._writableState=new L(N,this,Y),N&&(typeof N.write=="function"&&(this._write=N.write),typeof N.writev=="function"&&(this._writev=N.writev),typeof N.destroy=="function"&&(this._destroy=N.destroy),typeof N.final=="function"&&(this._final=N.final),typeof N.construct=="function"&&(this._construct=N.construct),N.signal&&S(N.signal,this)),y.call(this,N),w.construct(this,()=>{let se=this._writableState;se.writing||Ee(this,se),H(this,se)})}r(re,h,{__proto__:null,value:function(N){return t(this,N)?!0:this!==re?!1:N&&N._writableState instanceof L}}),re.prototype.pipe=function(){I(this,new C)};function ee(N,Y,se,me){let pe=N._writableState;if(typeof se=="function")me=se,se=pe.defaultEncoding;else{if(!se)se=pe.defaultEncoding;else if(se!=="buffer"&&!b.isEncoding(se))throw new F(se);typeof me!="function"&&(me=W)}if(Y===null)throw new P;if(!pe.objectMode)if(typeof Y=="string")pe.decodeStrings!==!1&&(Y=b.from(Y,se),se="buffer");else if(Y instanceof b)se="buffer";else if(y._isUint8Array(Y))Y=y._uint8ArrayToBuffer(Y),se="buffer";else throw new _("chunk",["string","Buffer","Uint8Array"],Y);let _e;return pe.ending?_e=new O:pe.destroyed&&(_e=new T("write")),_e?(s.nextTick(me,_e),I(N,_e,!0),_e):(pe.pendingcb++,ue(N,pe,Y,se,me))}re.prototype.write=function(N,Y,se){return ee(this,N,Y,se)===!0},re.prototype.cork=function(){this._writableState.corked++},re.prototype.uncork=function(){let N=this._writableState;N.corked&&(N.corked--,N.writing||Ee(this,N))},re.prototype.setDefaultEncoding=function(N){if(typeof N=="string"&&(N=i(N)),!b.isEncoding(N))throw new F(N);return this._writableState.defaultEncoding=N,this};function ue(N,Y,se,me,pe){let _e=Y.objectMode?1:se.length;Y.length+=_e;let Z=Y.length<Y.highWaterMark;return Z||(Y.needDrain=!0),Y.writing||Y.corked||Y.errored||!Y.constructed?(Y.buffered.push({chunk:se,encoding:me,callback:pe}),Y.allBuffers&&me!=="buffer"&&(Y.allBuffers=!1),Y.allNoop&&pe!==W&&(Y.allNoop=!1)):(Y.writelen=_e,Y.writecb=pe,Y.writing=!0,Y.sync=!0,N._write(se,me,Y.onwrite),Y.sync=!1),Z&&!Y.errored&&!Y.destroyed}function G(N,Y,se,me,pe,_e,Z){Y.writelen=me,Y.writecb=Z,Y.writing=!0,Y.sync=!0,Y.destroyed?Y.onwrite(new T("write")):se?N._writev(pe,Y.onwrite):N._write(pe,_e,Y.onwrite),Y.sync=!1}function oe(N,Y,se,me){--Y.pendingcb,me(se),q(Y),I(N,se)}function R(N,Y){let se=N._writableState,me=se.sync,pe=se.writecb;if(typeof pe!="function"){I(N,new v);return}se.writing=!1,se.writecb=null,se.length-=se.writelen,se.writelen=0,Y?(Y.stack,se.errored||(se.errored=Y),N._readableState&&!N._readableState.errored&&(N._readableState.errored=Y),me?s.nextTick(oe,N,se,Y,pe):oe(N,se,Y,pe)):(se.buffered.length>se.bufferedIndex&&Ee(N,se),me?se.afterWriteTickInfo!==null&&se.afterWriteTickInfo.cb===pe?se.afterWriteTickInfo.count++:(se.afterWriteTickInfo={count:1,cb:pe,stream:N,state:se},s.nextTick(Q,se.afterWriteTickInfo)):he(N,se,1,pe))}function Q({stream:N,state:Y,count:se,cb:me}){return Y.afterWriteTickInfo=null,he(N,Y,se,me)}function he(N,Y,se,me){for(!Y.ending&&!N.destroyed&&Y.length===0&&Y.needDrain&&(Y.needDrain=!1,N.emit("drain"));se-- >0;)Y.pendingcb--,me();Y.destroyed&&q(Y),H(N,Y)}function q(N){if(N.writing)return;for(let pe=N.bufferedIndex;pe<N.buffered.length;++pe){var Y;let{chunk:_e,callback:Z}=N.buffered[pe],ve=N.objectMode?1:_e.length;N.length-=ve,Z((Y=N.errored)!==null&&Y!==void 0?Y:new T("write"))}let se=N[V].splice(0);for(let pe=0;pe<se.length;pe++){var me;se[pe]((me=N.errored)!==null&&me!==void 0?me:new T("end"))}le(N)}function Ee(N,Y){if(Y.corked||Y.bufferProcessing||Y.destroyed||!Y.constructed)return;let{buffered:se,bufferedIndex:me,objectMode:pe}=Y,_e=se.length-me;if(!_e)return;let Z=me;if(Y.bufferProcessing=!0,_e>1&&N._writev){Y.pendingcb-=_e-1;let ve=Y.allNoop?W:fe=>{for(let De=Z;De<se.length;++De)se[De].callback(fe)},ke=Y.allNoop&&Z===0?se:a(se,Z);ke.allBuffers=Y.allBuffers,G(N,Y,!0,Y.length,ke,"",ve),le(Y)}else{do{let{chunk:ve,encoding:ke,callback:fe}=se[Z];se[Z++]=null;let De=pe?1:ve.length;G(N,Y,!1,De,ve,ke,fe)}while(Z<se.length&&!Y.writing);Z===se.length?le(Y):Z>256?(se.splice(0,Z),Y.bufferedIndex=0):Y.bufferedIndex=Z}Y.bufferProcessing=!1}re.prototype._write=function(N,Y,se){if(this._writev)this._writev([{chunk:N,encoding:Y}],se);else throw new E("_write()")},re.prototype._writev=null,re.prototype.end=function(N,Y,se){let me=this._writableState;typeof N=="function"?(se=N,N=null,Y=null):typeof Y=="function"&&(se=Y,Y=null);let pe;if(N!=null){let _e=ee(this,N,Y);_e instanceof u&&(pe=_e)}return me.corked&&(me.corked=1,this.uncork()),pe||(!me.errored&&!me.ending?(me.ending=!0,H(this,me,!0),me.ended=!0):me.finished?pe=new x("end"):me.destroyed&&(pe=new T("end"))),typeof se=="function"&&(pe||me.finished?s.nextTick(se,pe):me[V].push(se)),this};function X(N){return N.ending&&!N.destroyed&&N.constructed&&N.length===0&&!N.errored&&N.buffered.length===0&&!N.finished&&!N.writing&&!N.errorEmitted&&!N.closeEmitted}function U(N,Y){let se=!1;function me(pe){if(se){I(N,pe??v());return}if(se=!0,Y.pendingcb--,pe){let _e=Y[V].splice(0);for(let Z=0;Z<_e.length;Z++)_e[Z](pe);I(N,pe,Y.sync)}else X(Y)&&(Y.prefinished=!0,N.emit("prefinish"),Y.pendingcb++,s.nextTick(te,N,Y))}Y.sync=!0,Y.pendingcb++;try{N._final(me)}catch(pe){me(pe)}Y.sync=!1}function ae(N,Y){!Y.prefinished&&!Y.finalCalled&&(typeof N._final=="function"&&!Y.destroyed?(Y.finalCalled=!0,U(N,Y)):(Y.prefinished=!0,N.emit("prefinish")))}function H(N,Y,se){X(Y)&&(ae(N,Y),Y.pendingcb===0&&(se?(Y.pendingcb++,s.nextTick((me,pe)=>{X(pe)?te(me,pe):pe.pendingcb--},N,Y)):X(Y)&&(Y.pendingcb++,te(N,Y))))}function te(N,Y){Y.pendingcb--,Y.finished=!0;let se=Y[V].splice(0);for(let me=0;me<se.length;me++)se[me]();if(N.emit("finish"),Y.autoDestroy){let me=N._readableState;(!me||me.autoDestroy&&(me.endEmitted||me.readable===!1))&&N.destroy()}}n(re.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(N){this._writableState&&(this._writableState.destroyed=N)}},writable:{__proto__:null,get(){let N=this._writableState;return!!N&&N.writable!==!1&&!N.destroyed&&!N.errored&&!N.ending&&!N.ended},set(N){this._writableState&&(this._writableState.writable=!!N)}},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 N=this._writableState;return N?!N.destroyed&&!N.ending&&N.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 ne=w.destroy;re.prototype.destroy=function(N,Y){let se=this._writableState;return!se.destroyed&&(se.bufferedIndex<se.buffered.length||se[V].length)&&s.nextTick(q,se),ne.call(this,N,Y),this},re.prototype._undestroy=w.undestroy,re.prototype._destroy=function(N,Y){Y(N)},re.prototype[d.captureRejectionSymbol]=function(N){this.destroy(N)};var be;function ce(){return be===void 0&&(be={}),be}re.fromWeb=function(N,Y){return ce().newStreamWritableFromWritableStream(N,Y)},re.toWeb=function(N){return ce().newWritableStreamFromStreamWritable(N)}}),Bu=we((o,l)=>{de(),ye(),ge();var s=Jt(),a=(dt(),tt(pt)),{isReadable:u,isWritable:t,isIterable:r,isNodeStream:n,isReadableNodeStream:e,isWritableNodeStream:i,isDuplexNodeStream:c,isReadableStream:h,isWritableStream:d}=jt(),y=Ft(),{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:w,ERR_INVALID_RETURN_VALUE:S}}=wt(),{destroyer:A}=sr(),g=Rt(),_=Or(),E=Oi(),{createDeferredPromise:v}=St(),C=ms(),T=globalThis.Blob||a.Blob,x=typeof T<"u"?function(V){return V instanceof T}:function(V){return!1},P=globalThis.AbortController||yr().AbortController,{FunctionPrototypeCall:O}=ut(),F=class extends g{constructor(V){super(V),(V==null?void 0:V.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(V==null?void 0:V.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};l.exports=function V(L,le){if(c(L))return L;if(e(L))return W({readable:L});if(i(L))return W({writable:L});if(n(L))return W({writable:!1,readable:!1});if(h(L))return W({readable:_.fromWeb(L)});if(d(L))return W({writable:E.fromWeb(L)});if(typeof L=="function"){let{value:ee,write:ue,final:G,destroy:oe}=I(L);if(r(ee))return C(F,ee,{objectMode:!0,write:ue,final:G,destroy:oe});let R=ee==null?void 0:ee.then;if(typeof R=="function"){let Q,he=O(R,ee,q=>{if(q!=null)throw new S("nully","body",q)},q=>{A(Q,q)});return Q=new F({objectMode:!0,readable:!1,write:ue,final(q){G(async()=>{try{await he,s.nextTick(q,null)}catch(Ee){s.nextTick(q,Ee)}})},destroy:oe})}throw new S("Iterable, AsyncIterable or AsyncFunction",le,ee)}if(x(L))return V(L.arrayBuffer());if(r(L))return C(F,L,{objectMode:!0,writable:!1});if(h(L==null?void 0:L.readable)&&d(L==null?void 0:L.writable))return F.fromWeb(L);if(typeof(L==null?void 0:L.writable)=="object"||typeof(L==null?void 0:L.readable)=="object"){let ee=L!=null&&L.readable?e(L==null?void 0:L.readable)?L==null?void 0:L.readable:V(L.readable):void 0,ue=L!=null&&L.writable?i(L==null?void 0:L.writable)?L==null?void 0:L.writable:V(L.writable):void 0;return W({readable:ee,writable:ue})}let re=L==null?void 0:L.then;if(typeof re=="function"){let ee;return O(re,L,ue=>{ue!=null&&ee.push(ue),ee.push(null)},ue=>{A(ee,ue)}),ee=new F({objectMode:!0,writable:!1,read(){}})}throw new w(le,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],L)};function I(V){let{promise:L,resolve:le}=v(),re=new P,ee=re.signal;return{value:V(async function*(){for(;;){let ue=L;L=null;let{chunk:G,done:oe,cb:R}=await ue;if(s.nextTick(R),oe)return;if(ee.aborted)throw new b(void 0,{cause:ee.reason});({promise:L,resolve:le}=v()),yield G}}(),{signal:ee}),write(ue,G,oe){let R=le;le=null,R({chunk:ue,done:!1,cb:oe})},final(ue){let G=le;le=null,G({done:!0,cb:ue})},destroy(ue,G){re.abort(),G(ue)}}}function W(V){let L=V.readable&&typeof V.readable.read!="function"?_.wrap(V.readable):V.readable,le=V.writable,re=!!u(L),ee=!!t(le),ue,G,oe,R,Q;function he(q){let Ee=R;R=null,Ee?Ee(q):q&&Q.destroy(q)}return Q=new F({readableObjectMode:!!(L!=null&&L.readableObjectMode),writableObjectMode:!!(le!=null&&le.writableObjectMode),readable:re,writable:ee}),ee&&(y(le,q=>{ee=!1,q&&A(L,q),he(q)}),Q._write=function(q,Ee,X){le.write(q,Ee)?X():ue=X},Q._final=function(q){le.end(),G=q},le.on("drain",function(){if(ue){let q=ue;ue=null,q()}}),le.on("finish",function(){if(G){let q=G;G=null,q()}})),re&&(y(L,q=>{re=!1,q&&A(L,q),he(q)}),L.on("readable",function(){if(oe){let q=oe;oe=null,q()}}),L.on("end",function(){Q.push(null)}),Q._read=function(){for(;;){let q=L.read();if(q===null){oe=Q._read;return}if(!Q.push(q))return}}),Q._destroy=function(q,Ee){!q&&R!==null&&(q=new b),oe=null,ue=null,G=null,R===null?Ee(q):(R=Ee,A(le,q),A(L,q))},Q}}),Rt=we((o,l)=>{de(),ye(),ge();var{ObjectDefineProperties:s,ObjectGetOwnPropertyDescriptor:a,ObjectKeys:u,ObjectSetPrototypeOf:t}=ut();l.exports=e;var r=Or(),n=Oi();t(e.prototype,r.prototype),t(e,r);{let d=u(n.prototype);for(let y=0;y<d.length;y++){let b=d[y];e.prototype[b]||(e.prototype[b]=n.prototype[b])}}function e(d){if(!(this instanceof e))return new e(d);r.call(this,d),n.call(this,d),d?(this.allowHalfOpen=d.allowHalfOpen!==!1,d.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),d.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(e.prototype,{writable:{__proto__:null,...a(n.prototype,"writable")},writableHighWaterMark:{__proto__:null,...a(n.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...a(n.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...a(n.prototype,"writableBuffer")},writableLength:{__proto__:null,...a(n.prototype,"writableLength")},writableFinished:{__proto__:null,...a(n.prototype,"writableFinished")},writableCorked:{__proto__:null,...a(n.prototype,"writableCorked")},writableEnded:{__proto__:null,...a(n.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...a(n.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(d){this._readableState&&this._writableState&&(this._readableState.destroyed=d,this._writableState.destroyed=d)}}});var i;function c(){return i===void 0&&(i={}),i}e.fromWeb=function(d,y){return c().newStreamDuplexFromReadableWritablePair(d,y)},e.toWeb=function(d){return c().newReadableWritablePairFromDuplex(d)};var h;e.from=function(d){return h||(h=Bu()),h(d,"body")}}),bs=we((o,l)=>{de(),ye(),ge();var{ObjectSetPrototypeOf:s,Symbol:a}=ut();l.exports=e;var{ERR_METHOD_NOT_IMPLEMENTED:u}=wt().codes,t=Rt(),{getHighWaterMark:r}=kr();s(e.prototype,t.prototype),s(e,t);var n=a("kCallback");function e(h){if(!(this instanceof e))return new e(h);let d=h?r(this,h,"readableHighWaterMark",!0):null;d===0&&(h={...h,highWaterMark:null,readableHighWaterMark:d,writableHighWaterMark:h.writableHighWaterMark||0}),t.call(this,h),this._readableState.sync=!1,this[n]=null,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",c)}function i(h){typeof this._flush=="function"&&!this.destroyed?this._flush((d,y)=>{if(d){h?h(d):this.destroy(d);return}y!=null&&this.push(y),this.push(null),h&&h()}):(this.push(null),h&&h())}function c(){this._final!==i&&i.call(this)}e.prototype._final=i,e.prototype._transform=function(h,d,y){throw new u("_transform()")},e.prototype._write=function(h,d,y){let b=this._readableState,w=this._writableState,S=b.length;this._transform(h,d,(A,g)=>{if(A){y(A);return}g!=null&&this.push(g),w.ended||S===b.length||b.length<b.highWaterMark?y():this[n]=y})},e.prototype._read=function(){if(this[n]){let h=this[n];this[n]=null,h()}}}),vs=we((o,l)=>{de(),ye(),ge();var{ObjectSetPrototypeOf:s}=ut();l.exports=u;var a=bs();s(u.prototype,a.prototype),s(u,a);function u(t){if(!(this instanceof u))return new u(t);a.call(this,t)}u.prototype._transform=function(t,r,n){n(null,t)}}),Ti=we((o,l)=>{de(),ye(),ge();var s=Jt(),{ArrayIsArray:a,Promise:u,SymbolAsyncIterator:t,SymbolDispose:r}=ut(),n=Ft(),{once:e}=St(),i=sr(),c=Rt(),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_RETURN_VALUE:y,ERR_MISSING_ARGS:b,ERR_STREAM_DESTROYED:w,ERR_STREAM_PREMATURE_CLOSE:S},AbortError:A}=wt(),{validateFunction:g,validateAbortSignal:_}=br(),{isIterable:E,isReadable:v,isReadableNodeStream:C,isNodeStream:T,isTransformStream:x,isWebStream:P,isReadableStream:O,isReadableFinished:F}=jt(),I=globalThis.AbortController||yr().AbortController,W,V,L;function le(q,Ee,X){let U=!1;q.on("close",()=>{U=!0});let ae=n(q,{readable:Ee,writable:X},H=>{U=!H});return{destroy:H=>{U||(U=!0,i.destroyer(q,H||new w("pipe")))},cleanup:ae}}function re(q){return g(q[q.length-1],"streams[stream.length - 1]"),q.pop()}function ee(q){if(E(q))return q;if(C(q))return ue(q);throw new d("val",["Readable","Iterable","AsyncIterable"],q)}async function*ue(q){V||(V=Or()),yield*V.prototype[t].call(q)}async function G(q,Ee,X,{end:U}){let ae,H=null,te=ce=>{if(ce&&(ae=ce),H){let N=H;H=null,N()}},ne=()=>new u((ce,N)=>{ae?N(ae):H=()=>{ae?N(ae):ce()}});Ee.on("drain",te);let be=n(Ee,{readable:!1},te);try{Ee.writableNeedDrain&&await ne();for await(let ce of q)Ee.write(ce)||await ne();U&&(Ee.end(),await ne()),X()}catch(ce){X(ae!==ce?h(ae,ce):ce)}finally{be(),Ee.off("drain",te)}}async function oe(q,Ee,X,{end:U}){x(Ee)&&(Ee=Ee.writable);let ae=Ee.getWriter();try{for await(let H of q)await ae.ready,ae.write(H).catch(()=>{});await ae.ready,U&&await ae.close(),X()}catch(H){try{await ae.abort(H),X(H)}catch(te){X(te)}}}function R(...q){return Q(q,e(re(q)))}function Q(q,Ee,X){if(q.length===1&&a(q[0])&&(q=q[0]),q.length<2)throw new b("streams");let U=new I,ae=U.signal,H=X==null?void 0:X.signal,te=[];_(H,"options.signal");function ne(){pe(new A)}L=L||St().addAbortListener;let be;H&&(be=L(H,ne));let ce,N,Y=[],se=0;function me(ke){pe(ke,--se===0)}function pe(ke,fe){var De;if(ke&&(!ce||ce.code==="ERR_STREAM_PREMATURE_CLOSE")&&(ce=ke),!(!ce&&!fe)){for(;Y.length;)Y.shift()(ce);(De=be)===null||De===void 0||De[r](),U.abort(),fe&&(ce||te.forEach(f=>f()),s.nextTick(Ee,ce,N))}}let _e;for(let ke=0;ke<q.length;ke++){let fe=q[ke],De=ke<q.length-1,f=ke>0,p=De||(X==null?void 0:X.end)!==!1,m=ke===q.length-1;if(T(fe)){let k=function(M){M&&M.name!=="AbortError"&&M.code!=="ERR_STREAM_PREMATURE_CLOSE"&&me(M)};if(p){let{destroy:M,cleanup:z}=le(fe,De,f);Y.push(M),v(fe)&&m&&te.push(z)}fe.on("error",k),v(fe)&&m&&te.push(()=>{fe.removeListener("error",k)})}if(ke===0)if(typeof fe=="function"){if(_e=fe({signal:ae}),!E(_e))throw new y("Iterable, AsyncIterable or Stream","source",_e)}else E(fe)||C(fe)||x(fe)?_e=fe:_e=c.from(fe);else if(typeof fe=="function"){if(x(_e)){var Z;_e=ee((Z=_e)===null||Z===void 0?void 0:Z.readable)}else _e=ee(_e);if(_e=fe(_e,{signal:ae}),De){if(!E(_e,!0))throw new y("AsyncIterable",`transform[${ke-1}]`,_e)}else{var ve;W||(W=vs());let k=new W({objectMode:!0}),M=(ve=_e)===null||ve===void 0?void 0:ve.then;if(typeof M=="function")se++,M.call(_e,$=>{N=$,$!=null&&k.write($),p&&k.end(),s.nextTick(me)},$=>{k.destroy($),s.nextTick(me,$)});else if(E(_e,!0))se++,G(_e,k,me,{end:p});else if(O(_e)||x(_e)){let $=_e.readable||_e;se++,G($,k,me,{end:p})}else throw new y("AsyncIterable or Promise","destination",_e);_e=k;let{destroy:z,cleanup:ie}=le(_e,!1,!0);Y.push(z),m&&te.push(ie)}}else if(T(fe)){if(C(_e)){se+=2;let k=he(_e,fe,me,{end:p});v(fe)&&m&&te.push(k)}else if(x(_e)||O(_e)){let k=_e.readable||_e;se++,G(k,fe,me,{end:p})}else if(E(_e))se++,G(_e,fe,me,{end:p});else throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_e);_e=fe}else if(P(fe)){if(C(_e))se++,oe(ee(_e),fe,me,{end:p});else if(O(_e)||E(_e))se++,oe(_e,fe,me,{end:p});else if(x(_e))se++,oe(_e.readable,fe,me,{end:p});else throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_e);_e=fe}else _e=c.from(fe)}return(ae!=null&&ae.aborted||H!=null&&H.aborted)&&s.nextTick(ne),_e}function he(q,Ee,X,{end:U}){let ae=!1;if(Ee.on("close",()=>{ae||X(new S)}),q.pipe(Ee,{end:!1}),U){let H=function(){ae=!0,Ee.end()};F(q)?s.nextTick(H):q.once("end",H)}else X();return n(q,{readable:!0,writable:!1},H=>{let te=q._readableState;H&&H.code==="ERR_STREAM_PREMATURE_CLOSE"&&te&&te.ended&&!te.errored&&!te.errorEmitted?q.once("end",X).once("error",X):X(H)}),n(Ee,{readable:!1,writable:!0},X)}l.exports={pipelineImpl:Q,pipeline:R}}),ws=we((o,l)=>{de(),ye(),ge();var{pipeline:s}=Ti(),a=Rt(),{destroyer:u}=sr(),{isNodeStream:t,isReadable:r,isWritable:n,isWebStream:e,isTransformStream:i,isWritableStream:c,isReadableStream:h}=jt(),{AbortError:d,codes:{ERR_INVALID_ARG_VALUE:y,ERR_MISSING_ARGS:b}}=wt(),w=Ft();l.exports=function(...S){if(S.length===0)throw new b("streams");if(S.length===1)return a.from(S[0]);let A=[...S];if(typeof S[0]=="function"&&(S[0]=a.from(S[0])),typeof S[S.length-1]=="function"){let I=S.length-1;S[I]=a.from(S[I])}for(let I=0;I<S.length;++I)if(!(!t(S[I])&&!e(S[I]))){if(I<S.length-1&&!(r(S[I])||h(S[I])||i(S[I])))throw new y(`streams[${I}]`,A[I],"must be readable");if(I>0&&!(n(S[I])||c(S[I])||i(S[I])))throw new y(`streams[${I}]`,A[I],"must be writable")}let g,_,E,v,C;function T(I){let W=v;v=null,W?W(I):I?C.destroy(I):!F&&!O&&C.destroy()}let x=S[0],P=s(S,T),O=!!(n(x)||c(x)||i(x)),F=!!(r(P)||h(P)||i(P));if(C=new a({writableObjectMode:!!(x!=null&&x.writableObjectMode),readableObjectMode:!!(P!=null&&P.readableObjectMode),writable:O,readable:F}),O){if(t(x))C._write=function(W,V,L){x.write(W,V)?L():g=L},C._final=function(W){x.end(),_=W},x.on("drain",function(){if(g){let W=g;g=null,W()}});else if(e(x)){let W=(i(x)?x.writable:x).getWriter();C._write=async function(V,L,le){try{await W.ready,W.write(V).catch(()=>{}),le()}catch(re){le(re)}},C._final=async function(V){try{await W.ready,W.close().catch(()=>{}),_=V}catch(L){V(L)}}}let I=i(P)?P.readable:P;w(I,()=>{if(_){let W=_;_=null,W()}})}if(F){if(t(P))P.on("readable",function(){if(E){let I=E;E=null,I()}}),P.on("end",function(){C.push(null)}),C._read=function(){for(;;){let I=P.read();if(I===null){E=C._read;return}if(!C.push(I))return}};else if(e(P)){let I=(i(P)?P.readable:P).getReader();C._read=async function(){for(;;)try{let{value:W,done:V}=await I.read();if(!C.push(W))return;if(V){C.push(null);return}}catch{return}}}}return C._destroy=function(I,W){!I&&v!==null&&(I=new d),E=null,g=null,_=null,v===null?W(I):(v=W,t(P)&&u(P,I))},C}}),Lu=we((o,l)=>{de(),ye(),ge();var s=globalThis.AbortController||yr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:a,ERR_INVALID_ARG_TYPE:u,ERR_MISSING_ARGS:t,ERR_OUT_OF_RANGE:r},AbortError:n}=wt(),{validateAbortSignal:e,validateInteger:i,validateObject:c}=br(),h=ut().Symbol("kWeak"),d=ut().Symbol("kResistStopPropagation"),{finished:y}=Ft(),b=ws(),{addAbortSignalNoValidate:w}=Ir(),{isWritable:S,isNodeStream:A}=jt(),{deprecate:g}=St(),{ArrayPrototypePush:_,Boolean:E,MathFloor:v,Number:C,NumberIsNaN:T,Promise:x,PromiseReject:P,PromiseResolve:O,PromisePrototypeThen:F,Symbol:I}=ut(),W=I("kEmpty"),V=I("kEof");function L(H,te){if(te!=null&&c(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal"),A(H)&&!S(H))throw new a("stream",H,"must be writable");let ne=b(this,H);return te!=null&&te.signal&&w(te.signal,ne),ne}function le(H,te){if(typeof H!="function")throw new u("fn",["Function","AsyncFunction"],H);te!=null&&c(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal");let ne=1;(te==null?void 0:te.concurrency)!=null&&(ne=v(te.concurrency));let be=ne-1;return(te==null?void 0:te.highWaterMark)!=null&&(be=v(te.highWaterMark)),i(ne,"options.concurrency",1),i(be,"options.highWaterMark",0),be+=ne,(async function*(){let ce=St().AbortSignalAny([te==null?void 0:te.signal].filter(E)),N=this,Y=[],se={signal:ce},me,pe,_e=!1,Z=0;function ve(){_e=!0,ke()}function ke(){Z-=1,fe()}function fe(){pe&&!_e&&Z<ne&&Y.length<be&&(pe(),pe=null)}async function De(){try{for await(let f of N){if(_e)return;if(ce.aborted)throw new n;try{if(f=H(f,se),f===W)continue;f=O(f)}catch(p){f=P(p)}Z+=1,F(f,ke,ve),Y.push(f),me&&(me(),me=null),!_e&&(Y.length>=be||Z>=ne)&&await new x(p=>{pe=p})}Y.push(V)}catch(f){let p=P(f);F(p,ke,ve),Y.push(p)}finally{_e=!0,me&&(me(),me=null)}}De();try{for(;;){for(;Y.length>0;){let f=await Y[0];if(f===V)return;if(ce.aborted)throw new n;f!==W&&(yield f),Y.shift(),fe()}await new x(f=>{me=f})}}finally{_e=!0,pe&&(pe(),pe=null)}}).call(this)}function re(H=void 0){return H!=null&&c(H,"options"),(H==null?void 0:H.signal)!=null&&e(H.signal,"options.signal"),(async function*(){let te=0;for await(let be of this){var ne;if(H!=null&&(ne=H.signal)!==null&&ne!==void 0&&ne.aborted)throw new n({cause:H.signal.reason});yield[te++,be]}}).call(this)}async function ee(H,te=void 0){for await(let ne of R.call(this,H,te))return!0;return!1}async function ue(H,te=void 0){if(typeof H!="function")throw new u("fn",["Function","AsyncFunction"],H);return!await ee.call(this,async(...ne)=>!await H(...ne),te)}async function G(H,te){for await(let ne of R.call(this,H,te))return ne}async function oe(H,te){if(typeof H!="function")throw new u("fn",["Function","AsyncFunction"],H);async function ne(be,ce){return await H(be,ce),W}for await(let be of le.call(this,ne,te));}function R(H,te){if(typeof H!="function")throw new u("fn",["Function","AsyncFunction"],H);async function ne(be,ce){return await H(be,ce)?be:W}return le.call(this,ne,te)}var Q=class extends t{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function he(H,te,ne){var be;if(typeof H!="function")throw new u("reducer",["Function","AsyncFunction"],H);ne!=null&&c(ne,"options"),(ne==null?void 0:ne.signal)!=null&&e(ne.signal,"options.signal");let ce=arguments.length>1;if(ne!=null&&(be=ne.signal)!==null&&be!==void 0&&be.aborted){let pe=new n(void 0,{cause:ne.signal.reason});throw this.once("error",()=>{}),await y(this.destroy(pe)),pe}let N=new s,Y=N.signal;if(ne!=null&&ne.signal){let pe={once:!0,[h]:this,[d]:!0};ne.signal.addEventListener("abort",()=>N.abort(),pe)}let se=!1;try{for await(let pe of this){var me;if(se=!0,ne!=null&&(me=ne.signal)!==null&&me!==void 0&&me.aborted)throw new n;ce?te=await H(te,pe,{signal:Y}):(te=pe,ce=!0)}if(!se&&!ce)throw new Q}finally{N.abort()}return te}async function q(H){H!=null&&c(H,"options"),(H==null?void 0:H.signal)!=null&&e(H.signal,"options.signal");let te=[];for await(let be of this){var ne;if(H!=null&&(ne=H.signal)!==null&&ne!==void 0&&ne.aborted)throw new n(void 0,{cause:H.signal.reason});_(te,be)}return te}function Ee(H,te){let ne=le.call(this,H,te);return(async function*(){for await(let be of ne)yield*be}).call(this)}function X(H){if(H=C(H),T(H))return 0;if(H<0)throw new r("number",">= 0",H);return H}function U(H,te=void 0){return te!=null&&c(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal"),H=X(H),(async function*(){var ne;if(te!=null&&(ne=te.signal)!==null&&ne!==void 0&&ne.aborted)throw new n;for await(let ce of this){var be;if(te!=null&&(be=te.signal)!==null&&be!==void 0&&be.aborted)throw new n;H--<=0&&(yield ce)}}).call(this)}function ae(H,te=void 0){return te!=null&&c(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal"),H=X(H),(async function*(){var ne;if(te!=null&&(ne=te.signal)!==null&&ne!==void 0&&ne.aborted)throw new n;for await(let ce of this){var be;if(te!=null&&(be=te.signal)!==null&&be!==void 0&&be.aborted)throw new n;if(H-- >0&&(yield ce),H<=0)return}}).call(this)}l.exports.streamReturningOperators={asIndexedPairs:g(re,"readable.asIndexedPairs will be removed in a future version."),drop:U,filter:R,flatMap:Ee,map:le,take:ae,compose:L},l.exports.promiseReturningOperators={every:ue,forEach:oe,reduce:he,toArray:q,some:ee,find:G}}),_s=we((o,l)=>{de(),ye(),ge();var{ArrayPrototypePop:s,Promise:a}=ut(),{isIterable:u,isNodeStream:t,isWebStream:r}=jt(),{pipelineImpl:n}=Ti(),{finished:e}=Ft();Ss();function i(...c){return new a((h,d)=>{let y,b,w=c[c.length-1];if(w&&typeof w=="object"&&!t(w)&&!u(w)&&!r(w)){let S=s(c);y=S.signal,b=S.end}n(c,(S,A)=>{S?d(S):h(A)},{signal:y,end:b})})}l.exports={finished:e,pipeline:i}}),Ss=we((o,l)=>{de(),ye(),ge();var{Buffer:s}=(dt(),tt(pt)),{ObjectDefineProperty:a,ObjectKeys:u,ReflectApply:t}=ut(),{promisify:{custom:r}}=St(),{streamReturningOperators:n,promiseReturningOperators:e}=Lu(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:i}}=wt(),c=ws(),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:d}=kr(),{pipeline:y}=Ti(),{destroyer:b}=sr(),w=Ft(),S=_s(),A=jt(),g=l.exports=ki().Stream;g.isDestroyed=A.isDestroyed,g.isDisturbed=A.isDisturbed,g.isErrored=A.isErrored,g.isReadable=A.isReadable,g.isWritable=A.isWritable,g.Readable=Or();for(let E of u(n)){let v=function(...T){if(new.target)throw i();return g.Readable.from(t(C,this,T))},C=n[E];a(v,"name",{__proto__:null,value:C.name}),a(v,"length",{__proto__:null,value:C.length}),a(g.Readable.prototype,E,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}for(let E of u(e)){let v=function(...T){if(new.target)throw i();return t(C,this,T)},C=e[E];a(v,"name",{__proto__:null,value:C.name}),a(v,"length",{__proto__:null,value:C.length}),a(g.Readable.prototype,E,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}g.Writable=Oi(),g.Duplex=Rt(),g.Transform=bs(),g.PassThrough=vs(),g.pipeline=y;var{addAbortSignal:_}=Ir();g.addAbortSignal=_,g.finished=w,g.destroy=b,g.compose=c,g.setDefaultHighWaterMark=h,g.getDefaultHighWaterMark=d,a(g,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return S}}),a(y,r,{__proto__:null,enumerable:!0,get(){return S.pipeline}}),a(w,r,{__proto__:null,enumerable:!0,get(){return S.finished}}),g.Stream=g,g._isUint8Array=function(E){return E instanceof Uint8Array},g._uint8ArrayToBuffer=function(E){return s.from(E.buffer,E.byteOffset,E.byteLength)}}),Xt=we((o,l)=>{de(),ye(),ge();var s=Ss(),a=_s(),u=s.Readable.destroy;l.exports=s.Readable,l.exports._uint8ArrayToBuffer=s._uint8ArrayToBuffer,l.exports._isUint8Array=s._isUint8Array,l.exports.isDisturbed=s.isDisturbed,l.exports.isErrored=s.isErrored,l.exports.isReadable=s.isReadable,l.exports.Readable=s.Readable,l.exports.Writable=s.Writable,l.exports.Duplex=s.Duplex,l.exports.Transform=s.Transform,l.exports.PassThrough=s.PassThrough,l.exports.addAbortSignal=s.addAbortSignal,l.exports.finished=s.finished,l.exports.destroy=s.destroy,l.exports.destroy=u,l.exports.pipeline=s.pipeline,l.exports.compose=s.compose,Object.defineProperty(s,"promises",{configurable:!0,enumerable:!0,get(){return a}}),l.exports.Stream=s.Stream,l.exports.default=l.exports}),Uu=we((o,l)=>{de(),ye(),ge(),typeof Object.create=="function"?l.exports=function(s,a){a&&(s.super_=a,s.prototype=Object.create(a.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}))}:l.exports=function(s,a){if(a){s.super_=a;var u=function(){};u.prototype=a.prototype,s.prototype=new u,s.prototype.constructor=s}}}),Du=we((o,l)=>{de(),ye(),ge();var{Buffer:s}=(dt(),tt(pt)),a=Symbol.for("BufferList");function u(t){if(!(this instanceof u))return new u(t);u._init.call(this,t)}u._init=function(t){Object.defineProperty(this,a,{value:!0}),this._bufs=[],this.length=0,t&&this.append(t)},u.prototype._new=function(t){return new u(t)},u.prototype._offset=function(t){if(t===0)return[0,0];let r=0;for(let n=0;n<this._bufs.length;n++){let e=r+this._bufs[n].length;if(t<e||n===this._bufs.length-1)return[n,t-r];r=e}},u.prototype._reverseOffset=function(t){let r=t[0],n=t[1];for(let e=0;e<r;e++)n+=this._bufs[e].length;return n},u.prototype.getBuffers=function(){return this._bufs},u.prototype.get=function(t){if(t>this.length||t<0)return;let r=this._offset(t);return this._bufs[r[0]][r[1]]},u.prototype.slice=function(t,r){return typeof t=="number"&&t<0&&(t+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,t,r)},u.prototype.copy=function(t,r,n,e){if((typeof n!="number"||n<0)&&(n=0),(typeof e!="number"||e>this.length)&&(e=this.length),n>=this.length||e<=0)return t||s.alloc(0);let i=!!t,c=this._offset(n),h=e-n,d=h,y=i&&r||0,b=c[1];if(n===0&&e===this.length){if(!i)return this._bufs.length===1?this._bufs[0]:s.concat(this._bufs,this.length);for(let w=0;w<this._bufs.length;w++)this._bufs[w].copy(t,y),y+=this._bufs[w].length;return t}if(d<=this._bufs[c[0]].length-b)return i?this._bufs[c[0]].copy(t,r,b,b+d):this._bufs[c[0]].slice(b,b+d);i||(t=s.allocUnsafe(h));for(let w=c[0];w<this._bufs.length;w++){let S=this._bufs[w].length-b;if(d>S)this._bufs[w].copy(t,y,b),y+=S;else{this._bufs[w].copy(t,y,b,b+d),y+=S;break}d-=S,b&&(b=0)}return t.length>y?t.slice(0,y):t},u.prototype.shallowSlice=function(t,r){if(t=t||0,r=typeof r!="number"?this.length:r,t<0&&(t+=this.length),r<0&&(r+=this.length),t===r)return this._new();let n=this._offset(t),e=this._offset(r),i=this._bufs.slice(n[0],e[0]+1);return e[1]===0?i.pop():i[i.length-1]=i[i.length-1].slice(0,e[1]),n[1]!==0&&(i[0]=i[0].slice(n[1])),this._new(i)},u.prototype.toString=function(t,r,n){return this.slice(r,n).toString(t)},u.prototype.consume=function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;)if(t>=this._bufs[0].length)t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}return this},u.prototype.duplicate=function(){let t=this._new();for(let r=0;r<this._bufs.length;r++)t.append(this._bufs[r]);return t},u.prototype.append=function(t){return this._attach(t,u.prototype._appendBuffer)},u.prototype.prepend=function(t){return this._attach(t,u.prototype._prependBuffer,!0)},u.prototype._attach=function(t,r,n){if(t==null)return this;if(t.buffer)r.call(this,s.from(t.buffer,t.byteOffset,t.byteLength));else if(Array.isArray(t)){let[e,i]=n?[t.length-1,-1]:[0,1];for(let c=e;c>=0&&c<t.length;c+=i)this._attach(t[c],r,n)}else if(this._isBufferList(t)){let[e,i]=n?[t._bufs.length-1,-1]:[0,1];for(let c=e;c>=0&&c<t._bufs.length;c+=i)this._attach(t._bufs[c],r,n)}else typeof t=="number"&&(t=t.toString()),r.call(this,s.from(t));return this},u.prototype._appendBuffer=function(t){this._bufs.push(t),this.length+=t.length},u.prototype._prependBuffer=function(t){this._bufs.unshift(t),this.length+=t.length},u.prototype.indexOf=function(t,r,n){if(n===void 0&&typeof r=="string"&&(n=r,r=void 0),typeof t=="function"||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t=="number"?t=s.from([t]):typeof t=="string"?t=s.from(t,n):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=s.from(t.buffer,t.byteOffset,t.byteLength):s.isBuffer(t)||(t=s.from(t)),r=Number(r||0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),t.length===0)return r>this.length?this.length:r;let e=this._offset(r),i=e[0],c=e[1];for(;i<this._bufs.length;i++){let h=this._bufs[i];for(;c<h.length;)if(h.length-c>=t.length){let d=h.indexOf(t,c);if(d!==-1)return this._reverseOffset([i,d]);c=h.length-t.length+1}else{let d=this._reverseOffset([i,c]);if(this._match(d,t))return d;c++}c=0}return-1},u.prototype._match=function(t,r){if(this.length-t<r.length)return!1;for(let n=0;n<r.length;n++)if(this.get(t+n)!==r[n])return!1;return!0},function(){let t={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 r in t)(function(n){t[n]===null?u.prototype[n]=function(e,i){return this.slice(e,e+i)[n](0,i)}:u.prototype[n]=function(e=0){return this.slice(e,e+t[n])[n](0)}})(r)}(),u.prototype._isBufferList=function(t){return t instanceof u||u.isBufferList(t)},u.isBufferList=function(t){return t!=null&&t[a]},l.exports=u}),Fu=we((o,l)=>{de(),ye(),ge();var s=Xt().Duplex,a=Uu(),u=Du();function t(r){if(!(this instanceof t))return new t(r);if(typeof r=="function"){this._callback=r;let n=(function(e){this._callback&&(this._callback(e),this._callback=null)}).bind(this);this.on("pipe",function(e){e.on("error",n)}),this.on("unpipe",function(e){e.removeListener("error",n)}),r=null}u._init.call(this,r),s.call(this)}a(t,s),Object.assign(t.prototype,u.prototype),t.prototype._new=function(r){return new t(r)},t.prototype._write=function(r,n,e){this._appendBuffer(r),typeof e=="function"&&e()},t.prototype._read=function(r){if(!this.length)return this.push(null);r=Math.min(r,this.length),this.push(this.slice(0,r)),this.consume(r)},t.prototype.end=function(r){s.prototype.end.call(this,r),this._callback&&(this._callback(null,this.slice()),this._callback=null)},t.prototype._destroy=function(r,n){this._bufs.length=0,this.length=0,n(r)},t.prototype._isBufferList=function(r){return r instanceof t||r instanceof u||t.isBufferList(r)},t.isBufferList=u.isBufferList,l.exports=t,l.exports.BufferListStream=t,l.exports.BufferList=u}),Wu=we((o,l)=>{de(),ye(),ge();var s=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};l.exports=s}),Es=we((o,l)=>{de(),ye(),ge();var s=l.exports,{Buffer:a}=(dt(),tt(pt));s.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"},s.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},s.requiredHeaderFlagsErrors={};for(let t in s.requiredHeaderFlags){let r=s.requiredHeaderFlags[t];s.requiredHeaderFlagsErrors[t]="Invalid header flag bits, must be 0x"+r.toString(16)+" for "+s.types[t]+" packet"}s.codes={};for(let t in s.types){let r=s.types[t];s.codes[r]=t}s.CMD_SHIFT=4,s.CMD_MASK=240,s.DUP_MASK=8,s.QOS_MASK=3,s.QOS_SHIFT=1,s.RETAIN_MASK=1,s.VARBYTEINT_MASK=127,s.VARBYTEINT_FIN_MASK=128,s.VARBYTEINT_MAX=268435455,s.SESSIONPRESENT_MASK=1,s.SESSIONPRESENT_HEADER=a.from([s.SESSIONPRESENT_MASK]),s.CONNACK_HEADER=a.from([s.codes.connack<<s.CMD_SHIFT]),s.USERNAME_MASK=128,s.PASSWORD_MASK=64,s.WILL_RETAIN_MASK=32,s.WILL_QOS_MASK=24,s.WILL_QOS_SHIFT=3,s.WILL_FLAG_MASK=4,s.CLEAN_SESSION_MASK=2,s.CONNECT_HEADER=a.from([s.codes.connect<<s.CMD_SHIFT]),s.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},s.propertiesCodes={};for(let t in s.properties){let r=s.properties[t];s.propertiesCodes[r]=t}s.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 u(t){return[0,1,2].map(r=>[0,1].map(n=>[0,1].map(e=>{let i=a.alloc(1);return i.writeUInt8(s.codes[t]<<s.CMD_SHIFT|(n?s.DUP_MASK:0)|r<<s.QOS_SHIFT|e,0,!0),i})))}s.PUBLISH_HEADER=u("publish"),s.SUBSCRIBE_HEADER=u("subscribe"),s.SUBSCRIBE_OPTIONS_QOS_MASK=3,s.SUBSCRIBE_OPTIONS_NL_MASK=1,s.SUBSCRIBE_OPTIONS_NL_SHIFT=2,s.SUBSCRIBE_OPTIONS_RAP_MASK=1,s.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,s.SUBSCRIBE_OPTIONS_RH_MASK=3,s.SUBSCRIBE_OPTIONS_RH_SHIFT=4,s.SUBSCRIBE_OPTIONS_RH=[0,16,32],s.SUBSCRIBE_OPTIONS_NL=4,s.SUBSCRIBE_OPTIONS_RAP=8,s.SUBSCRIBE_OPTIONS_QOS=[0,1,2],s.UNSUBSCRIBE_HEADER=u("unsubscribe"),s.ACKS={unsuback:u("unsuback"),puback:u("puback"),pubcomp:u("pubcomp"),pubrel:u("pubrel"),pubrec:u("pubrec")},s.SUBACK_HEADER=a.from([s.codes.suback<<s.CMD_SHIFT]),s.VERSION3=a.from([3]),s.VERSION4=a.from([4]),s.VERSION5=a.from([5]),s.VERSION131=a.from([131]),s.VERSION132=a.from([132]),s.QOS=[0,1,2].map(t=>a.from([t])),s.EMPTY={pingreq:a.from([s.codes.pingreq<<4,0]),pingresp:a.from([s.codes.pingresp<<4,0]),disconnect:a.from([s.codes.disconnect<<4,0])},s.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"},s.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},s.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"},s.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"},s.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"},s.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),$u=we((o,l)=>{de(),ye(),ge();var s=1e3,a=s*60,u=a*60,t=u*24,r=t*7,n=t*365.25;l.exports=function(d,y){y=y||{};var b=typeof d;if(b==="string"&&d.length>0)return e(d);if(b==="number"&&isFinite(d))return y.long?c(d):i(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function e(d){if(d=String(d),!(d.length>100)){var y=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(y){var b=parseFloat(y[1]),w=(y[2]||"ms").toLowerCase();switch(w){case"years":case"year":case"yrs":case"yr":case"y":return b*n;case"weeks":case"week":case"w":return b*r;case"days":case"day":case"d":return b*t;case"hours":case"hour":case"hrs":case"hr":case"h":return b*u;case"minutes":case"minute":case"mins":case"min":case"m":return b*a;case"seconds":case"second":case"secs":case"sec":case"s":return b*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}}function i(d){var y=Math.abs(d);return y>=t?Math.round(d/t)+"d":y>=u?Math.round(d/u)+"h":y>=a?Math.round(d/a)+"m":y>=s?Math.round(d/s)+"s":d+"ms"}function c(d){var y=Math.abs(d);return y>=t?h(d,y,t,"day"):y>=u?h(d,y,u,"hour"):y>=a?h(d,y,a,"minute"):y>=s?h(d,y,s,"second"):d+" ms"}function h(d,y,b,w){var S=y>=b*1.5;return Math.round(d/b)+" "+w+(S?"s":"")}}),qu=we((o,l)=>{de(),ye(),ge();function s(a){t.debug=t,t.default=t,t.coerce=h,t.disable=i,t.enable=n,t.enabled=c,t.humanize=$u(),t.destroy=d,Object.keys(a).forEach(y=>{t[y]=a[y]}),t.names=[],t.skips=[],t.formatters={};function u(y){let b=0;for(let w=0;w<y.length;w++)b=(b<<5)-b+y.charCodeAt(w),b|=0;return t.colors[Math.abs(b)%t.colors.length]}t.selectColor=u;function t(y){let b,w=null,S,A;function g(..._){if(!g.enabled)return;let E=g,v=Number(new Date),C=v-(b||v);E.diff=C,E.prev=b,E.curr=v,b=v,_[0]=t.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let T=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(x,P)=>{if(x==="%%")return"%";T++;let O=t.formatters[P];if(typeof O=="function"){let F=_[T];x=O.call(E,F),_.splice(T,1),T--}return x}),t.formatArgs.call(E,_),(E.log||t.log).apply(E,_)}return g.namespace=y,g.useColors=t.useColors(),g.color=t.selectColor(y),g.extend=r,g.destroy=t.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>w!==null?w:(S!==t.namespaces&&(S=t.namespaces,A=t.enabled(y)),A),set:_=>{w=_}}),typeof t.init=="function"&&t.init(g),g}function r(y,b){let w=t(this.namespace+(typeof b>"u"?":":b)+y);return w.log=this.log,w}function n(y){t.save(y),t.namespaces=y,t.names=[],t.skips=[];let b=(typeof y=="string"?y:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let w of b)w[0]==="-"?t.skips.push(w.slice(1)):t.names.push(w)}function e(y,b){let w=0,S=0,A=-1,g=0;for(;w<y.length;)if(S<b.length&&(b[S]===y[w]||b[S]==="*"))b[S]==="*"?(A=S,g=w,S++):(w++,S++);else if(A!==-1)S=A+1,g++,w=g;else return!1;for(;S<b.length&&b[S]==="*";)S++;return S===b.length}function i(){let y=[...t.names,...t.skips.map(b=>"-"+b)].join(",");return t.enable(""),y}function c(y){for(let b of t.skips)if(e(y,b))return!1;for(let b of t.names)if(e(y,b))return!0;return!1}function h(y){return y instanceof Error?y.stack||y.message:y}function d(){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 t.enable(t.load()),t}l.exports=s}),Mt=we((o,l)=>{de(),ye(),ge(),o.formatArgs=a,o.save=u,o.load=t,o.useColors=s,o.storage=r(),o.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})(),o.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 s(){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 e;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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+l.exports.humanize(this.diff),!this.useColors)return;let i="color: "+this.color;e.splice(1,0,i,"color: inherit");let c=0,h=0;e[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(c++,d==="%c"&&(h=c))}),e.splice(h,0,i)}o.log=console.debug||console.log||(()=>{});function u(e){try{e?o.storage.setItem("debug",e):o.storage.removeItem("debug")}catch{}}function t(){let e;try{e=o.storage.getItem("debug")||o.storage.getItem("DEBUG")}catch{}return!e&&typeof Je<"u"&&"env"in Je&&(e=Je.env.DEBUG),e}function r(){try{return localStorage}catch{}}l.exports=qu()(o);var{formatters:n}=l.exports;n.j=function(e){try{return JSON.stringify(e)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}}),Vu=we((o,l)=>{de(),ye(),ge();var s=Fu(),{EventEmitter:a}=(Qt(),tt(Dt)),u=Wu(),t=Es(),r=Mt()("mqtt-packet:parser"),n=class Vo extends a{constructor(){super(),this.parser=this.constructor.parser}static parser(i){return this instanceof Vo?(this.settings=i||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new Vo().parser(i)}_resetState(){r("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new u,this.error=null,this._list=s(),this._stateCounter=0}parse(i){for(this.error&&this._resetState(),this._list.append(i),r("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++,r("parse: state complete. _stateCounter is now: %d",this._stateCounter),r("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return r("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let i=this._list.readUInt8(0),c=i>>t.CMD_SHIFT;this.packet.cmd=t.types[c];let h=i&15,d=t.requiredHeaderFlags[c];return d!=null&&h!==d?this._emitError(new Error(t.requiredHeaderFlagsErrors[c])):(this.packet.retain=(i&t.RETAIN_MASK)!==0,this.packet.qos=i>>t.QOS_SHIFT&t.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(i&t.DUP_MASK)!==0,r("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let i=this._parseVarByteNum(!0);return i&&(this.packet.length=i.value,this._list.consume(i.bytes)),r("_parseLength %d",i.value),!!i}_parsePayload(){r("_parsePayload: payload %O",this._list);let i=!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"))}i=!0}return r("_parsePayload complete result: %s",i),i}_parseConnect(){r("_parseConnect");let i,c,h,d,y={},b=this.packet,w=this._parseString();if(w===null)return this._emitError(new Error("Cannot parse protocolId"));if(w!=="MQTT"&&w!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(b.protocolId=w,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(b.protocolVersion=this._list.readUInt8(this._pos),b.protocolVersion>=128&&(b.bridgeMode=!0,b.protocolVersion=b.protocolVersion-128),b.protocolVersion!==3&&b.protocolVersion!==4&&b.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"));y.username=this._list.readUInt8(this._pos)&t.USERNAME_MASK,y.password=this._list.readUInt8(this._pos)&t.PASSWORD_MASK,y.will=this._list.readUInt8(this._pos)&t.WILL_FLAG_MASK;let S=!!(this._list.readUInt8(this._pos)&t.WILL_RETAIN_MASK),A=(this._list.readUInt8(this._pos)&t.WILL_QOS_MASK)>>t.WILL_QOS_SHIFT;if(y.will)b.will={},b.will.retain=S,b.will.qos=A;else{if(S)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(A)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(b.clean=(this._list.readUInt8(this._pos)&t.CLEAN_SESSION_MASK)!==0,this._pos++,b.keepalive=this._parseNum(),b.keepalive===-1)return this._emitError(new Error("Packet too short"));if(b.protocolVersion===5){let _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(b.properties=_)}let g=this._parseString();if(g===null)return this._emitError(new Error("Packet too short"));if(b.clientId=g,r("_parseConnect: packet.clientId: %s",b.clientId),y.will){if(b.protocolVersion===5){let _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(b.will.properties=_)}if(i=this._parseString(),i===null)return this._emitError(new Error("Cannot parse will topic"));if(b.will.topic=i,r("_parseConnect: packet.will.topic: %s",b.will.topic),c=this._parseBuffer(),c===null)return this._emitError(new Error("Cannot parse will payload"));b.will.payload=c,r("_parseConnect: packet.will.paylaod: %s",b.will.payload)}if(y.username){if(d=this._parseString(),d===null)return this._emitError(new Error("Cannot parse username"));b.username=d,r("_parseConnect: packet.username: %s",b.username)}if(y.password){if(h=this._parseBuffer(),h===null)return this._emitError(new Error("Cannot parse password"));b.password=h}return this.settings=b,r("_parseConnect: complete"),b}_parseConnack(){r("_parseConnack");let i=this.packet;if(this._list.length<1)return null;let c=this._list.readUInt8(this._pos++);if(c>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(i.sessionPresent=!!(c&t.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?i.reasonCode=this._list.readUInt8(this._pos++):i.reasonCode=0;else{if(this._list.length<2)return null;i.returnCode=this._list.readUInt8(this._pos++)}if(i.returnCode===-1||i.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let h=this._parseProperties();Object.getOwnPropertyNames(h).length&&(i.properties=h)}r("_parseConnack: complete")}_parsePublish(){r("_parsePublish");let i=this.packet;if(i.topic=this._parseString(),i.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(i.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}i.payload=this._list.slice(this._pos,i.length),r("_parsePublish: payload from buffer list: %o",i.payload)}}_parseSubscribe(){r("_parseSubscribe");let i=this.packet,c,h,d,y,b,w,S;if(i.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let A=this._parseProperties();Object.getOwnPropertyNames(A).length&&(i.properties=A)}if(i.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<i.length;){if(c=this._parseString(),c===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=i.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(h=this._parseByte(),this.settings.protocolVersion===5){if(h&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(h&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(d=h&t.SUBSCRIBE_OPTIONS_QOS_MASK,d>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(w=(h>>t.SUBSCRIBE_OPTIONS_NL_SHIFT&t.SUBSCRIBE_OPTIONS_NL_MASK)!==0,b=(h>>t.SUBSCRIBE_OPTIONS_RAP_SHIFT&t.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,y=h>>t.SUBSCRIBE_OPTIONS_RH_SHIFT&t.SUBSCRIBE_OPTIONS_RH_MASK,y>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));S={topic:c,qos:d},this.settings.protocolVersion===5?(S.nl=w,S.rap=b,S.rh=y):this.settings.bridgeMode&&(S.rh=0,S.rap=!0,S.nl=!0),r("_parseSubscribe: push subscription `%s` to subscription",S),i.subscriptions.push(S)}}}_parseSuback(){r("_parseSuback");let i=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}if(i.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let c=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!t.MQTT5_SUBACK_CODES[c])return this._emitError(new Error("Invalid suback code"))}else if(c>2&&c!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(c)}}}_parseUnsubscribe(){r("_parseUnsubscribe");let i=this.packet;if(i.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}if(i.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<i.length;){let c=this._parseString();if(c===null)return this._emitError(new Error("Cannot parse topic"));r("_parseUnsubscribe: push topic `%s` to unsubscriptions",c),i.unsubscriptions.push(c)}}}_parseUnsuback(){r("_parseUnsuback");let i=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&i.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(i.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let c=this._parseProperties();for(Object.getOwnPropertyNames(c).length&&(i.properties=c),i.granted=[];this._pos<this.packet.length;){let h=this._list.readUInt8(this._pos++);if(!t.MQTT5_UNSUBACK_CODES[h])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(h)}}}_parseConfirmation(){r("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let i=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(i.length>2){switch(i.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!t.MQTT5_PUBACK_PUBREC_CODES[i.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!t.MQTT5_PUBREL_PUBCOMP_CODES[i.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}r("_parseConfirmation: packet.reasonCode `%d`",i.reasonCode)}else i.reasonCode=0;if(i.length>3){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}}return!0}_parseDisconnect(){let i=this.packet;if(r("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(i.reasonCode=this._parseByte(),t.MQTT5_DISCONNECT_CODES[i.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):i.reasonCode=0;let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}return r("_parseDisconnect result: true"),!0}_parseAuth(){r("_parseAuth");let i=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(i.reasonCode=this._parseByte(),!t.MQTT5_AUTH_CODES[i.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let c=this._parseProperties();return Object.getOwnPropertyNames(c).length&&(i.properties=c),r("_parseAuth: result: true"),!0}_parseMessageId(){let i=this.packet;return i.messageId=this._parseNum(),i.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(r("_parseMessageId: packet.messageId %d",i.messageId),!0)}_parseString(i){let c=this._parseNum(),h=c+this._pos;if(c===-1||h>this._list.length||h>this.packet.length)return null;let d=this._list.toString("utf8",this._pos,h);return this._pos+=c,r("_parseString: result: %s",d),d}_parseStringPair(){return r("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let i=this._parseNum(),c=i+this._pos;if(i===-1||c>this._list.length||c>this.packet.length)return null;let h=this._list.slice(this._pos,c);return this._pos+=i,r("_parseBuffer: result: %o",h),h}_parseNum(){if(this._list.length-this._pos<2)return-1;let i=this._list.readUInt16BE(this._pos);return this._pos+=2,r("_parseNum: result: %s",i),i}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let i=this._list.readUInt32BE(this._pos);return this._pos+=4,r("_parse4ByteNum: result: %s",i),i}_parseVarByteNum(i){r("_parseVarByteNum");let c=4,h=0,d=1,y=0,b=!1,w,S=this._pos?this._pos:0;for(;h<c&&S+h<this._list.length;){if(w=this._list.readUInt8(S+h++),y+=d*(w&t.VARBYTEINT_MASK),d*=128,(w&t.VARBYTEINT_FIN_MASK)===0){b=!0;break}if(this._list.length<=h)break}return!b&&h===c&&this._list.length>=h&&this._emitError(new Error("Invalid variable byte integer")),S&&(this._pos+=h),b?i?b={bytes:h,value:y}:b=y:b=!1,r("_parseVarByteNum: result: %o",b),b}_parseByte(){let i;return this._pos<this._list.length&&(i=this._list.readUInt8(this._pos),this._pos++),r("_parseByte: result: %o",i),i}_parseByType(i){switch(r("_parseByType: type: %s",i),i){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(){r("_parseProperties");let i=this._parseVarByteNum(),c=this._pos+i,h={};for(;this._pos<c;){let d=this._parseByte();if(!d)return this._emitError(new Error("Cannot parse property code type")),!1;let y=t.propertiesCodes[d];if(!y)return this._emitError(new Error("Unknown property")),!1;if(y==="userProperties"){h[y]||(h[y]=Object.create(null));let b=this._parseByType(t.propertiesTypes[y]);if(h[y][b.name])if(Array.isArray(h[y][b.name]))h[y][b.name].push(b.value);else{let w=h[y][b.name];h[y][b.name]=[w],h[y][b.name].push(b.value)}else h[y][b.name]=b.value;continue}h[y]?Array.isArray(h[y])?h[y].push(this._parseByType(t.propertiesTypes[y])):(h[y]=[h[y]],h[y].push(this._parseByType(t.propertiesTypes[y]))):h[y]=this._parseByType(t.propertiesTypes[y])}return h}_newPacket(){return r("_newPacket"),this.packet&&(this._list.consume(this.packet.length),r("_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)),r("_newPacket: new packet"),this.packet=new u,this._pos=0,!0}_emitError(i){r("_emitError",i),this.error=i,this.emit("error",i)}};l.exports=n}),zu=we((o,l)=>{de(),ye(),ge();var{Buffer:s}=(dt(),tt(pt)),a=65536,u={},t=s.isBuffer(s.from([1,2]).subarray(0,1));function r(c){let h=s.allocUnsafe(2);return h.writeUInt8(c>>8,0),h.writeUInt8(c&255,1),h}function n(){for(let c=0;c<a;c++)u[c]=r(c)}function e(c){let h=0,d=0,y=s.allocUnsafe(4);do h=c%128|0,c=c/128|0,c>0&&(h=h|128),y.writeUInt8(h,d++);while(c>0&&d<4);return c>0&&(d=0),t?y.subarray(0,d):y.slice(0,d)}function i(c){let h=s.allocUnsafe(4);return h.writeUInt32BE(c,0),h}l.exports={cache:u,generateCache:n,generateNumber:r,genBufVariableByteInt:e,generate4ByteBuffer:i}}),Ku=we((o,l)=>{de(),ye(),ge(),typeof Je>"u"||!Je.version||Je.version.indexOf("v0.")===0||Je.version.indexOf("v1.")===0&&Je.version.indexOf("v1.8.")!==0?l.exports={nextTick:s}:l.exports=Je;function s(a,u,t,r){if(typeof a!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,e,i;switch(n){case 0:case 1:return Je.nextTick(a);case 2:return Je.nextTick(function(){a.call(null,u)});case 3:return Je.nextTick(function(){a.call(null,u,t)});case 4:return Je.nextTick(function(){a.call(null,u,t,r)});default:for(e=new Array(n-1),i=0;i<e.length;)e[i++]=arguments[i];return Je.nextTick(function(){a.apply(null,e)})}}}),As=we((o,l)=>{de(),ye(),ge();var s=Es(),{Buffer:a}=(dt(),tt(pt)),u=a.allocUnsafe(0),t=a.from([0]),r=zu(),n=Ku().nextTick,e=Mt()("mqtt-packet:writeToStream"),i=r.cache,c=r.generateNumber,h=r.generateCache,d=r.genBufVariableByteInt,y=r.generate4ByteBuffer,b=re,w=!0;function S(X,U,ae){switch(e("generate called"),U.cork&&(U.cork(),n(A,U)),w&&(w=!1,h()),e("generate: packet.cmd: %s",X.cmd),X.cmd){case"connect":return g(X,U);case"connack":return _(X,U,ae);case"publish":return E(X,U,ae);case"puback":case"pubrec":case"pubrel":case"pubcomp":return v(X,U,ae);case"subscribe":return C(X,U,ae);case"suback":return T(X,U,ae);case"unsubscribe":return x(X,U,ae);case"unsuback":return P(X,U,ae);case"pingreq":case"pingresp":return O(X,U);case"disconnect":return F(X,U,ae);case"auth":return I(X,U,ae);default:return U.destroy(new Error("Unknown command")),!1}}Object.defineProperty(S,"cacheNumbers",{get(){return b===re},set(X){X?((!i||Object.keys(i).length===0)&&(w=!0),b=re):(w=!1,b=ee)}});function A(X){X.uncork()}function g(X,U,ae){let H=X||{},te=H.protocolId||"MQTT",ne=H.protocolVersion||4,be=H.will,ce=H.clean,N=H.keepalive||0,Y=H.clientId||"",se=H.username,me=H.password,pe=H.properties;ce===void 0&&(ce=!0);let _e=0;if(typeof te!="string"&&!a.isBuffer(te))return U.destroy(new Error("Invalid protocolId")),!1;if(_e+=te.length+2,ne!==3&&ne!==4&&ne!==5)return U.destroy(new Error("Invalid protocol version")),!1;if(_e+=1,(typeof Y=="string"||a.isBuffer(Y))&&(Y||ne>=4)&&(Y||ce))_e+=a.byteLength(Y)+2;else{if(ne<4)return U.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(ce*1===0)return U.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof N!="number"||N<0||N>65535||N%1!==0)return U.destroy(new Error("Invalid keepalive")),!1;_e+=2,_e+=1;let Z,ve;if(ne===5){if(Z=oe(U,pe),!Z)return!1;_e+=Z.length}if(be){if(typeof be!="object")return U.destroy(new Error("Invalid will")),!1;if(!be.topic||typeof be.topic!="string")return U.destroy(new Error("Invalid will topic")),!1;if(_e+=a.byteLength(be.topic)+2,_e+=2,be.payload)if(be.payload.length>=0)typeof be.payload=="string"?_e+=a.byteLength(be.payload):_e+=be.payload.length;else return U.destroy(new Error("Invalid will payload")),!1;if(ve={},ne===5){if(ve=oe(U,be.properties),!ve)return!1;_e+=ve.length}}let ke=!1;if(se!=null)if(Ee(se))ke=!0,_e+=a.byteLength(se)+2;else return U.destroy(new Error("Invalid username")),!1;if(me!=null){if(!ke)return U.destroy(new Error("Username is required to use password")),!1;if(Ee(me))_e+=q(me)+2;else return U.destroy(new Error("Invalid password")),!1}U.write(s.CONNECT_HEADER),V(U,_e),G(U,te),H.bridgeMode&&(ne+=128),U.write(ne===131?s.VERSION131:ne===132?s.VERSION132:ne===4?s.VERSION4:ne===5?s.VERSION5:s.VERSION3);let fe=0;return fe|=se!=null?s.USERNAME_MASK:0,fe|=me!=null?s.PASSWORD_MASK:0,fe|=be&&be.retain?s.WILL_RETAIN_MASK:0,fe|=be&&be.qos?be.qos<<s.WILL_QOS_SHIFT:0,fe|=be?s.WILL_FLAG_MASK:0,fe|=ce?s.CLEAN_SESSION_MASK:0,U.write(a.from([fe])),b(U,N),ne===5&&Z.write(),G(U,Y),be&&(ne===5&&ve.write(),L(U,be.topic),G(U,be.payload)),se!=null&&G(U,se),me!=null&&G(U,me),!0}function _(X,U,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=H===5?te.reasonCode:te.returnCode,be=te.properties,ce=2;if(typeof ne!="number")return U.destroy(new Error("Invalid return code")),!1;let N=null;if(H===5){if(N=oe(U,be),!N)return!1;ce+=N.length}return U.write(s.CONNACK_HEADER),V(U,ce),U.write(te.sessionPresent?s.SESSIONPRESENT_HEADER:t),U.write(a.from([ne])),N==null||N.write(),!0}function E(X,U,ae){e("publish: packet: %o",X);let H=ae?ae.protocolVersion:4,te=X||{},ne=te.qos||0,be=te.retain?s.RETAIN_MASK:0,ce=te.topic,N=te.payload||u,Y=te.messageId,se=te.properties,me=0;if(typeof ce=="string")me+=a.byteLength(ce)+2;else if(a.isBuffer(ce))me+=ce.length+2;else return U.destroy(new Error("Invalid topic")),!1;if(a.isBuffer(N)?me+=N.length:me+=a.byteLength(N),ne&&typeof Y!="number")return U.destroy(new Error("Invalid messageId")),!1;ne&&(me+=2);let pe=null;if(H===5){if(pe=oe(U,se),!pe)return!1;me+=pe.length}return U.write(s.PUBLISH_HEADER[ne][te.dup?1:0][be?1:0]),V(U,me),b(U,q(ce)),U.write(ce),ne>0&&b(U,Y),pe==null||pe.write(),e("publish: payload: %o",N),U.write(N)}function v(X,U,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.cmd||"puback",be=te.messageId,ce=te.dup&&ne==="pubrel"?s.DUP_MASK:0,N=0,Y=te.reasonCode,se=te.properties,me=H===5?3:2;if(ne==="pubrel"&&(N=1),typeof be!="number")return U.destroy(new Error("Invalid messageId")),!1;let pe=null;if(H===5&&typeof se=="object"){if(pe=R(U,se,ae,me),!pe)return!1;me+=pe.length}return U.write(s.ACKS[ne][N][ce][0]),me===3&&(me+=Y!==0?1:-1),V(U,me),b(U,be),H===5&&me!==2&&U.write(a.from([Y])),pe!==null?pe.write():me===4&&U.write(a.from([0])),!0}function C(X,U,ae){e("subscribe: packet: ");let H=ae?ae.protocolVersion:4,te=X||{},ne=te.dup?s.DUP_MASK:0,be=te.messageId,ce=te.subscriptions,N=te.properties,Y=0;if(typeof be!="number")return U.destroy(new Error("Invalid messageId")),!1;Y+=2;let se=null;if(H===5){if(se=oe(U,N),!se)return!1;Y+=se.length}if(typeof ce=="object"&&ce.length)for(let pe=0;pe<ce.length;pe+=1){let _e=ce[pe].topic,Z=ce[pe].qos;if(typeof _e!="string")return U.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof Z!="number")return U.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(H===5){if(typeof(ce[pe].nl||!1)!="boolean")return U.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(ce[pe].rap||!1)!="boolean")return U.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let ve=ce[pe].rh||0;if(typeof ve!="number"||ve>2)return U.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}Y+=a.byteLength(_e)+2+1}else return U.destroy(new Error("Invalid subscriptions")),!1;e("subscribe: writing to stream: %o",s.SUBSCRIBE_HEADER),U.write(s.SUBSCRIBE_HEADER[1][ne?1:0][0]),V(U,Y),b(U,be),se!==null&&se.write();let me=!0;for(let pe of ce){let _e=pe.topic,Z=pe.qos,ve=+pe.nl,ke=+pe.rap,fe=pe.rh,De;L(U,_e),De=s.SUBSCRIBE_OPTIONS_QOS[Z],H===5&&(De|=ve?s.SUBSCRIBE_OPTIONS_NL:0,De|=ke?s.SUBSCRIBE_OPTIONS_RAP:0,De|=fe?s.SUBSCRIBE_OPTIONS_RH[fe]:0),me=U.write(a.from([De]))}return me}function T(X,U,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.messageId,be=te.granted,ce=te.properties,N=0;if(typeof ne!="number")return U.destroy(new Error("Invalid messageId")),!1;if(N+=2,typeof be=="object"&&be.length)for(let se=0;se<be.length;se+=1){if(typeof be[se]!="number")return U.destroy(new Error("Invalid qos vector")),!1;N+=1}else return U.destroy(new Error("Invalid qos vector")),!1;let Y=null;if(H===5){if(Y=R(U,ce,ae,N),!Y)return!1;N+=Y.length}return U.write(s.SUBACK_HEADER),V(U,N),b(U,ne),Y!==null&&Y.write(),U.write(a.from(be))}function x(X,U,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.messageId,be=te.dup?s.DUP_MASK:0,ce=te.unsubscriptions,N=te.properties,Y=0;if(typeof ne!="number")return U.destroy(new Error("Invalid messageId")),!1;if(Y+=2,typeof ce=="object"&&ce.length)for(let pe=0;pe<ce.length;pe+=1){if(typeof ce[pe]!="string")return U.destroy(new Error("Invalid unsubscriptions")),!1;Y+=a.byteLength(ce[pe])+2}else return U.destroy(new Error("Invalid unsubscriptions")),!1;let se=null;if(H===5){if(se=oe(U,N),!se)return!1;Y+=se.length}U.write(s.UNSUBSCRIBE_HEADER[1][be?1:0][0]),V(U,Y),b(U,ne),se!==null&&se.write();let me=!0;for(let pe=0;pe<ce.length;pe++)me=L(U,ce[pe]);return me}function P(X,U,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.messageId,be=te.dup?s.DUP_MASK:0,ce=te.granted,N=te.properties,Y=te.cmd,se=0,me=2;if(typeof ne!="number")return U.destroy(new Error("Invalid messageId")),!1;if(H===5)if(typeof ce=="object"&&ce.length)for(let _e=0;_e<ce.length;_e+=1){if(typeof ce[_e]!="number")return U.destroy(new Error("Invalid qos vector")),!1;me+=1}else return U.destroy(new Error("Invalid qos vector")),!1;let pe=null;if(H===5){if(pe=R(U,N,ae,me),!pe)return!1;me+=pe.length}return U.write(s.ACKS[Y][se][be][0]),V(U,me),b(U,ne),pe!==null&&pe.write(),H===5&&U.write(a.from(ce)),!0}function O(X,U,ae){return U.write(s.EMPTY[X.cmd])}function F(X,U,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.reasonCode,be=te.properties,ce=H===5?1:0,N=null;if(H===5){if(N=R(U,be,ae,ce),!N)return!1;ce+=N.length}return U.write(a.from([s.codes.disconnect<<4])),V(U,ce),H===5&&U.write(a.from([ne])),N!==null&&N.write(),!0}function I(X,U,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.reasonCode,be=te.properties,ce=H===5?1:0;H!==5&&U.destroy(new Error("Invalid mqtt version for auth packet"));let N=R(U,be,ae,ce);return N?(ce+=N.length,U.write(a.from([s.codes.auth<<4])),V(U,ce),U.write(a.from([ne])),N!==null&&N.write(),!0):!1}var W={};function V(X,U){if(U>s.VARBYTEINT_MAX)return X.destroy(new Error(`Invalid variable byte integer: ${U}`)),!1;let ae=W[U];return ae||(ae=d(U),U<16384&&(W[U]=ae)),e("writeVarByteInt: writing to stream: %o",ae),X.write(ae)}function L(X,U){let ae=a.byteLength(U);return b(X,ae),e("writeString: %s",U),X.write(U,"utf8")}function le(X,U,ae){L(X,U),L(X,ae)}function re(X,U){return e("writeNumberCached: number: %d",U),e("writeNumberCached: %o",i[U]),X.write(i[U])}function ee(X,U){let ae=c(U);return e("writeNumberGenerated: %o",ae),X.write(ae)}function ue(X,U){let ae=y(U);return e("write4ByteNumber: %o",ae),X.write(ae)}function G(X,U){typeof U=="string"?L(X,U):U?(b(X,U.length),X.write(U)):b(X,0)}function oe(X,U){if(typeof U!="object"||U.length!=null)return{length:1,write(){he(X,{},0)}};let ae=0;function H(te,ne){let be=s.propertiesTypes[te],ce=0;switch(be){case"byte":{if(typeof ne!="boolean")return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=2;break}case"int8":{if(typeof ne!="number"||ne<0||ne>255)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=2;break}case"binary":{if(ne&&ne===null)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=1+a.byteLength(ne)+2;break}case"int16":{if(typeof ne!="number"||ne<0||ne>65535)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=3;break}case"int32":{if(typeof ne!="number"||ne<0||ne>4294967295)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=5;break}case"var":{if(typeof ne!="number"||ne<0||ne>268435455)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=1+a.byteLength(d(ne));break}case"string":{if(typeof ne!="string")return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=3+a.byteLength(ne.toString());break}case"pair":{if(typeof ne!="object")return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=Object.getOwnPropertyNames(ne).reduce((N,Y)=>{let se=ne[Y];return Array.isArray(se)?N+=se.reduce((me,pe)=>(me+=3+a.byteLength(Y.toString())+2+a.byteLength(pe.toString()),me),0):N+=3+a.byteLength(Y.toString())+2+a.byteLength(ne[Y].toString()),N},0);break}default:return X.destroy(new Error(`Invalid property ${te}: ${ne}`)),!1}return ce}if(U)for(let te in U){let ne=0,be=0,ce=U[te];if(ce!==void 0){if(Array.isArray(ce))for(let N=0;N<ce.length;N++){if(be=H(te,ce[N]),!be)return!1;ne+=be}else{if(be=H(te,ce),!be)return!1;ne=be}if(!ne)return!1;ae+=ne}}return{length:a.byteLength(d(ae))+ae,write(){he(X,U,ae)}}}function R(X,U,ae,H){let te=["reasonString","userProperties"],ne=ae&&ae.properties&&ae.properties.maximumPacketSize?ae.properties.maximumPacketSize:0,be=oe(X,U);if(ne)for(;H+be.length>ne;){let ce=te.shift();if(ce&&U[ce])delete U[ce],be=oe(X,U);else return!1}return be}function Q(X,U,ae){switch(s.propertiesTypes[U]){case"byte":{X.write(a.from([s.properties[U]])),X.write(a.from([+ae]));break}case"int8":{X.write(a.from([s.properties[U]])),X.write(a.from([ae]));break}case"binary":{X.write(a.from([s.properties[U]])),G(X,ae);break}case"int16":{X.write(a.from([s.properties[U]])),b(X,ae);break}case"int32":{X.write(a.from([s.properties[U]])),ue(X,ae);break}case"var":{X.write(a.from([s.properties[U]])),V(X,ae);break}case"string":{X.write(a.from([s.properties[U]])),L(X,ae);break}case"pair":{Object.getOwnPropertyNames(ae).forEach(H=>{let te=ae[H];Array.isArray(te)?te.forEach(ne=>{X.write(a.from([s.properties[U]])),le(X,H.toString(),ne.toString())}):(X.write(a.from([s.properties[U]])),le(X,H.toString(),te.toString()))});break}default:return X.destroy(new Error(`Invalid property ${U} value: ${ae}`)),!1}}function he(X,U,ae){V(X,ae);for(let H in U)if(Object.prototype.hasOwnProperty.call(U,H)&&U[H]!=null){let te=U[H];if(Array.isArray(te))for(let ne=0;ne<te.length;ne++)Q(X,H,te[ne]);else Q(X,H,te)}}function q(X){return X?X instanceof a?X.length:a.byteLength(X):0}function Ee(X){return typeof X=="string"||X instanceof a}l.exports=S}),Hu=we((o,l)=>{de(),ye(),ge();var s=As(),{EventEmitter:a}=(Qt(),tt(Dt)),{Buffer:u}=(dt(),tt(pt));function t(n,e){let i=new r;return s(n,i,e),i.concat()}var r=class extends a{constructor(){super(),this._array=new Array(20),this._i=0}write(n){return this._array[this._i++]=n,!0}concat(){let n=0,e=new Array(this._array.length),i=this._array,c=0,h;for(h=0;h<i.length&&i[h]!==void 0;h++)typeof i[h]!="string"?e[h]=i[h].length:e[h]=u.byteLength(i[h]),n+=e[h];let d=u.allocUnsafe(n);for(h=0;h<i.length&&i[h]!==void 0;h++)typeof i[h]!="string"?(i[h].copy(d,c),c+=e[h]):(d.write(i[h],c),c+=e[h]);return d}destroy(n){n&&this.emit("error",n)}};l.exports=t}),Gu=we(o=>{de(),ye(),ge(),o.parser=Vu().parser,o.generate=Hu(),o.writeToStream=As()}),Yu=we((o,l)=>{de(),ye(),ge(),l.exports=a;function s(t){return t instanceof xr?xr.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function a(t){if(t=t||{},t.circles)return u(t);let r=new Map;if(r.set(Date,h=>new Date(h)),r.set(Map,(h,d)=>new Map(e(Array.from(h),d))),r.set(Set,(h,d)=>new Set(e(Array.from(h),d))),t.constructorHandlers)for(let h of t.constructorHandlers)r.set(h[0],h[1]);let n=null;return t.proto?c:i;function e(h,d){let y=Object.keys(h),b=new Array(y.length);for(let w=0;w<y.length;w++){let S=y[w],A=h[S];typeof A!="object"||A===null?b[S]=A:A.constructor!==Object&&(n=r.get(A.constructor))?b[S]=n(A,d):ArrayBuffer.isView(A)?b[S]=s(A):b[S]=d(A)}return b}function i(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return e(h,i);if(h.constructor!==Object&&(n=r.get(h.constructor)))return n(h,i);let d={};for(let y in h){if(Object.hasOwnProperty.call(h,y)===!1)continue;let b=h[y];typeof b!="object"||b===null?d[y]=b:b.constructor!==Object&&(n=r.get(b.constructor))?d[y]=n(b,i):ArrayBuffer.isView(b)?d[y]=s(b):d[y]=i(b)}return d}function c(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return e(h,c);if(h.constructor!==Object&&(n=r.get(h.constructor)))return n(h,c);let d={};for(let y in h){let b=h[y];typeof b!="object"||b===null?d[y]=b:b.constructor!==Object&&(n=r.get(b.constructor))?d[y]=n(b,c):ArrayBuffer.isView(b)?d[y]=s(b):d[y]=c(b)}return d}}function u(t){let r=[],n=[],e=new Map;if(e.set(Date,y=>new Date(y)),e.set(Map,(y,b)=>new Map(c(Array.from(y),b))),e.set(Set,(y,b)=>new Set(c(Array.from(y),b))),t.constructorHandlers)for(let y of t.constructorHandlers)e.set(y[0],y[1]);let i=null;return t.proto?d:h;function c(y,b){let w=Object.keys(y),S=new Array(w.length);for(let A=0;A<w.length;A++){let g=w[A],_=y[g];if(typeof _!="object"||_===null)S[g]=_;else if(_.constructor!==Object&&(i=e.get(_.constructor)))S[g]=i(_,b);else if(ArrayBuffer.isView(_))S[g]=s(_);else{let E=r.indexOf(_);E!==-1?S[g]=n[E]:S[g]=b(_)}}return S}function h(y){if(typeof y!="object"||y===null)return y;if(Array.isArray(y))return c(y,h);if(y.constructor!==Object&&(i=e.get(y.constructor)))return i(y,h);let b={};r.push(y),n.push(b);for(let w in y){if(Object.hasOwnProperty.call(y,w)===!1)continue;let S=y[w];if(typeof S!="object"||S===null)b[w]=S;else if(S.constructor!==Object&&(i=e.get(S.constructor)))b[w]=i(S,h);else if(ArrayBuffer.isView(S))b[w]=s(S);else{let A=r.indexOf(S);A!==-1?b[w]=n[A]:b[w]=h(S)}}return r.pop(),n.pop(),b}function d(y){if(typeof y!="object"||y===null)return y;if(Array.isArray(y))return c(y,d);if(y.constructor!==Object&&(i=e.get(y.constructor)))return i(y,d);let b={};r.push(y),n.push(b);for(let w in y){let S=y[w];if(typeof S!="object"||S===null)b[w]=S;else if(S.constructor!==Object&&(i=e.get(S.constructor)))b[w]=i(S,d);else if(ArrayBuffer.isView(S))b[w]=s(S);else{let A=r.indexOf(S);A!==-1?b[w]=n[A]:b[w]=d(S)}}return r.pop(),n.pop(),b}}}),Qu=we((o,l)=>{de(),ye(),ge(),l.exports=Yu()()}),Ju=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.validateTopic=l,o.validateTopics=s;function l(a){let u=a.split("/");for(let t=0;t<u.length;t++)if(u[t]!=="+"){if(u[t]==="#")return t===u.length-1;if(u[t].indexOf("+")!==-1||u[t].indexOf("#")!==-1)return!1}return!0}function s(a){if(a.length===0)return"empty_topic_list";for(let u=0;u<a.length;u++)if(!l(a[u]))return a[u];return null}}),xs=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=Xt(),s={objectMode:!0},a={clean:!0},u=class{constructor(t){Pe(this,"options");Pe(this,"_inflights");this.options=t||{},this.options={...a,...t},this._inflights=new Map}put(t,r){return this._inflights.set(t.messageId,t),r&&r(),this}createStream(){let t=new l.Readable(s),r=[],n=!1,e=0;return this._inflights.forEach((i,c)=>{r.push(i)}),t._read=()=>{!n&&e<r.length?t.push(r[e++]):t.push(null)},t.destroy=i=>{if(!n)return n=!0,setTimeout(()=>{t.emit("close")},0),t},t}del(t,r){let n=this._inflights.get(t.messageId);return n?(this._inflights.delete(t.messageId),r(null,n)):r&&r(new Error("missing packet")),this}get(t,r){let n=this._inflights.get(t.messageId);return n?r(null,n):r&&r(new Error("missing packet")),this}close(t){this.options.clean&&(this._inflights=null),t&&t()}};o.default=u}),Xu=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=[0,16,128,131,135,144,145,151,153],s=(a,u,t)=>{a.log("handlePublish: packet %o",u),t=typeof t<"u"?t:a.noop;let r=u.topic.toString(),n=u.payload,{qos:e}=u,{messageId:i}=u,{options:c}=a;if(a.options.protocolVersion===5){let h;if(u.properties&&(h=u.properties.topicAlias),typeof h<"u")if(r.length===0)if(h>0&&h<=65535){let d=a.topicAliasRecv.getTopicByAlias(h);if(d)r=d,a.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",r,h);else{a.log("handlePublish :: unregistered topic alias. alias: %d",h),a.emit("error",new Error("Received unregistered Topic Alias"));return}}else{a.log("handlePublish :: topic alias out of range. alias: %d",h),a.emit("error",new Error("Received Topic Alias is out of range"));return}else if(a.topicAliasRecv.put(r,h))a.log("handlePublish :: registered topic: %s - alias: %d",r,h);else{a.log("handlePublish :: topic alias out of range. alias: %d",h),a.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(a.log("handlePublish: qos %d",e),e){case 2:{c.customHandleAcks(r,n,u,(h,d)=>{if(typeof h=="number"&&(d=h,h=null),h)return a.emit("error",h);if(l.indexOf(d)===-1)return a.emit("error",new Error("Wrong reason code for pubrec"));d?a._sendPacket({cmd:"pubrec",messageId:i,reasonCode:d},t):a.incomingStore.put(u,()=>{a._sendPacket({cmd:"pubrec",messageId:i},t)})});break}case 1:{c.customHandleAcks(r,n,u,(h,d)=>{if(typeof h=="number"&&(d=h,h=null),h)return a.emit("error",h);if(l.indexOf(d)===-1)return a.emit("error",new Error("Wrong reason code for puback"));d||a.emit("message",r,n,u),a.handleMessage(u,y=>{if(y)return t&&t(y);a._sendPacket({cmd:"puback",messageId:i,reasonCode:d},t)})});break}case 0:a.emit("message",r,n,u),a.handleMessage(u,t);break;default:a.log("handlePublish: unknown QoS. Doing nothing.");break}};o.default=s}),Zu=we((o,l)=>{l.exports={version:"5.14.1"}}),ar=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.MQTTJS_VERSION=o.nextTick=o.ErrorWithSubackPacket=o.ErrorWithReasonCode=void 0,o.applyMixin=a;var l=class uu extends Error{constructor(r,n){super(r);Pe(this,"code");this.code=n,Object.setPrototypeOf(this,uu.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};o.ErrorWithReasonCode=l;var s=class cu extends Error{constructor(r,n){super(r);Pe(this,"packet");this.packet=n,Object.setPrototypeOf(this,cu.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};o.ErrorWithSubackPacket=s;function a(u,t,r=!1){let n=[t];for(;;){let e=n[0],i=Object.getPrototypeOf(e);if(i!=null&&i.prototype)n.unshift(i);else break}for(let e of n)for(let i of Object.getOwnPropertyNames(e.prototype))(r||i!=="constructor")&&Object.defineProperty(u.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i)??Object.create(null))}o.nextTick=typeof(Je==null?void 0:Je.nextTick)=="function"?Je.nextTick:u=>{setTimeout(u,0)},o.MQTTJS_VERSION=Zu().version}),Tr=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.ReasonCodes=void 0;var l=ar();o.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 s=(a,u)=>{let{messageId:t}=u,r=u.cmd,n=null,e=a.outgoing[t]?a.outgoing[t].cb:null,i=null;if(!e){a.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(a.log("_handleAck :: packet type",r),r){case"pubcomp":case"puback":{let c=u.reasonCode;c&&c>0&&c!==16?(i=new l.ErrorWithReasonCode(`Publish error: ${o.ReasonCodes[c]}`,c),a._removeOutgoingAndStoreMessage(t,()=>{e(i,u)})):a._removeOutgoingAndStoreMessage(t,e);break}case"pubrec":{n={cmd:"pubrel",qos:2,messageId:t};let c=u.reasonCode;c&&c>0&&c!==16?(i=new l.ErrorWithReasonCode(`Publish error: ${o.ReasonCodes[c]}`,c),a._removeOutgoingAndStoreMessage(t,()=>{e(i,u)})):a._sendPacket(n);break}case"suback":{delete a.outgoing[t],a.messageIdProvider.deallocate(t);let c=u.granted;for(let h=0;h<c.length;h++){let d=c[h];if(d&128){i=new Error(`Subscribe error: ${o.ReasonCodes[d]}`),i.code=d;let y=a.messageIdToTopic[t];y&&y.forEach(b=>{delete a._resubscribeTopics[b]})}}delete a.messageIdToTopic[t],a._invokeStoreProcessingQueue(),e(i,u);break}case"unsuback":{delete a.outgoing[t],a.messageIdProvider.deallocate(t),a._invokeStoreProcessingQueue(),e(null,u);break}default:a.emit("error",new Error("unrecognized packet type"))}a.disconnecting&&Object.keys(a.outgoing).length===0&&a.emit("outgoingEmpty")};o.default=s}),ec=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=ar(),s=Tr(),a=(u,t)=>{let{options:r}=u,n=r.protocolVersion,e=n===5?t.reasonCode:t.returnCode;if(n!==5){let i=new l.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${n}`,e);u.emit("error",i);return}u.handleAuth(t,(i,c)=>{if(i){u.emit("error",i);return}if(e===24)u.reconnecting=!1,u._sendPacket(c);else{let h=new l.ErrorWithReasonCode(`Connection refused: ${s.ReasonCodes[e]}`,e);u.emit("error",h)}})};o.default=a}),tc=we(o=>{var y,b,w,S,A,g,_,E,v,C,T,x,P,O,F,I,W,V,L,le,re,ee,ue,G,oe,R,Q,he,q,zo,X,U,ae,H,fu,ne,be,ce,Vt,zt,Ko,un,cn,ot,Ho,Sr,Kt,Go,De;de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.LRUCache=void 0;var l=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,s=new Set,a=typeof Je=="object"&&Je?Je:{},u=(f,p,m,k)=>{typeof a.emitWarning=="function"?a.emitWarning(f,p,m,k):console.error(`[${m}] ${p}: ${f}`)},t=globalThis.AbortController,r=globalThis.AbortSignal;if(typeof t>"u"){r=class{constructor(){Pe(this,"onabort");Pe(this,"_onabort",[]);Pe(this,"reason");Pe(this,"aborted",!1)}addEventListener(m,k){this._onabort.push(k)}},t=class{constructor(){Pe(this,"signal",new r);p()}abort(m){var k,M;if(!this.signal.aborted){this.signal.reason=m,this.signal.aborted=!0;for(let z of this.signal._onabort)z(m);(M=(k=this.signal).onabort)==null||M.call(k,m)}}};let f=((y=a.env)==null?void 0:y.LRU_CACHE_IGNORE_AC_WARNING)!=="1",p=()=>{f&&(f=!1,u("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",p))}}var n=f=>!s.has(f),e=f=>f&&f===Math.floor(f)&&f>0&&isFinite(f),i=f=>e(f)?f<=Math.pow(2,8)?Uint8Array:f<=Math.pow(2,16)?Uint16Array:f<=Math.pow(2,32)?Uint32Array:f<=Number.MAX_SAFE_INTEGER?c:null:null,c=class extends Array{constructor(f){super(f),this.fill(0)}},h=(b=class{constructor(p,m){Pe(this,"heap");Pe(this,"length");if(!D(b,w))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new m(p),this.length=0}static create(p){let m=i(p);if(!m)return[];$e(b,w,!0);let k=new b(p,m);return $e(b,w,!1),k}push(p){this.heap[this.length++]=p}pop(){return this.heap[--this.length]}},w=new WeakMap,Qe(b,w,!1),b),d=(De=class{constructor(p){Qe(this,q);Qe(this,g);Qe(this,_);Qe(this,E);Qe(this,v);Qe(this,C);Qe(this,T);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");Qe(this,x);Qe(this,P);Qe(this,O);Qe(this,F);Qe(this,I);Qe(this,W);Qe(this,V);Qe(this,L);Qe(this,le);Qe(this,re);Qe(this,ee);Qe(this,ue);Qe(this,G);Qe(this,oe);Qe(this,R);Qe(this,Q);Qe(this,he);Qe(this,X,()=>{});Qe(this,U,()=>{});Qe(this,ae,()=>{});Qe(this,H,()=>!1);Qe(this,ne,p=>{});Qe(this,be,(p,m,k)=>{});Qe(this,ce,(p,m,k,M)=>{if(k||M)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Pe(this,S,"LRUCache");let{max:m=0,ttl:k,ttlResolution:M=1,ttlAutopurge:z,updateAgeOnGet:ie,updateAgeOnHas:$,allowStale:J,dispose:Te,disposeAfter:Me,noDisposeOnSet:Ne,noUpdateTTL:Fe,maxSize:nt=0,maxEntrySize:rt=0,sizeCalculation:Ke,fetchMethod:Xe,memoMethod:Ue,noDeleteOnFetchRejection:Ye,noDeleteOnStaleGet:Ze,allowStaleOnFetchRejection:lt,allowStaleOnFetchAbort:ct,ignoreFetchAbort:Et}=p;if(m!==0&&!e(m))throw new TypeError("max option must be a nonnegative integer");let j=m?i(m):Array;if(!j)throw new Error("invalid max value: "+m);if($e(this,g,m),$e(this,_,nt),this.maxEntrySize=rt||D(this,_),this.sizeCalculation=Ke,this.sizeCalculation){if(!D(this,_)&&!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(Ue!==void 0&&typeof Ue!="function")throw new TypeError("memoMethod must be a function if defined");if($e(this,T,Ue),Xe!==void 0&&typeof Xe!="function")throw new TypeError("fetchMethod must be a function if specified");if($e(this,C,Xe),$e(this,Q,!!Xe),$e(this,O,new Map),$e(this,F,new Array(m).fill(void 0)),$e(this,I,new Array(m).fill(void 0)),$e(this,W,new j(m)),$e(this,V,new j(m)),$e(this,L,0),$e(this,le,0),$e(this,re,h.create(m)),$e(this,x,0),$e(this,P,0),typeof Te=="function"&&$e(this,E,Te),typeof Me=="function"?($e(this,v,Me),$e(this,ee,[])):($e(this,v,void 0),$e(this,ee,void 0)),$e(this,R,!!D(this,E)),$e(this,he,!!D(this,v)),this.noDisposeOnSet=!!Ne,this.noUpdateTTL=!!Fe,this.noDeleteOnFetchRejection=!!Ye,this.allowStaleOnFetchRejection=!!lt,this.allowStaleOnFetchAbort=!!ct,this.ignoreFetchAbort=!!Et,this.maxEntrySize!==0){if(D(this,_)!==0&&!e(D(this,_)))throw new TypeError("maxSize must be a positive integer if specified");if(!e(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Le(this,q,fu).call(this)}if(this.allowStale=!!J,this.noDeleteOnStaleGet=!!Ze,this.updateAgeOnGet=!!ie,this.updateAgeOnHas=!!$,this.ttlResolution=e(M)||M===0?M:1,this.ttlAutopurge=!!z,this.ttl=k||0,this.ttl){if(!e(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Le(this,q,zo).call(this)}if(D(this,g)===0&&this.ttl===0&&D(this,_)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!D(this,g)&&!D(this,_)){let B="LRU_CACHE_UNBOUNDED";n(B)&&(s.add(B),u("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",B,De))}}static unsafeExposeInternals(p){return{starts:D(p,G),ttls:D(p,oe),sizes:D(p,ue),keyMap:D(p,O),keyList:D(p,F),valList:D(p,I),next:D(p,W),prev:D(p,V),get head(){return D(p,L)},get tail(){return D(p,le)},free:D(p,re),isBackgroundFetch:m=>{var k;return Le(k=p,q,ot).call(k,m)},backgroundFetch:(m,k,M,z)=>{var ie;return Le(ie=p,q,cn).call(ie,m,k,M,z)},moveToTail:m=>{var k;return Le(k=p,q,Sr).call(k,m)},indexes:m=>{var k;return Le(k=p,q,Vt).call(k,m)},rindexes:m=>{var k;return Le(k=p,q,zt).call(k,m)},isStale:m=>{var k;return D(k=p,H).call(k,m)}}}get max(){return D(this,g)}get maxSize(){return D(this,_)}get calculatedSize(){return D(this,P)}get size(){return D(this,x)}get fetchMethod(){return D(this,C)}get memoMethod(){return D(this,T)}get dispose(){return D(this,E)}get disposeAfter(){return D(this,v)}getRemainingTTL(p){return D(this,O).has(p)?1/0:0}*entries(){for(let p of Le(this,q,Vt).call(this))D(this,I)[p]!==void 0&&D(this,F)[p]!==void 0&&!Le(this,q,ot).call(this,D(this,I)[p])&&(yield[D(this,F)[p],D(this,I)[p]])}*rentries(){for(let p of Le(this,q,zt).call(this))D(this,I)[p]!==void 0&&D(this,F)[p]!==void 0&&!Le(this,q,ot).call(this,D(this,I)[p])&&(yield[D(this,F)[p],D(this,I)[p]])}*keys(){for(let p of Le(this,q,Vt).call(this)){let m=D(this,F)[p];m!==void 0&&!Le(this,q,ot).call(this,D(this,I)[p])&&(yield m)}}*rkeys(){for(let p of Le(this,q,zt).call(this)){let m=D(this,F)[p];m!==void 0&&!Le(this,q,ot).call(this,D(this,I)[p])&&(yield m)}}*values(){for(let p of Le(this,q,Vt).call(this))D(this,I)[p]!==void 0&&!Le(this,q,ot).call(this,D(this,I)[p])&&(yield D(this,I)[p])}*rvalues(){for(let p of Le(this,q,zt).call(this))D(this,I)[p]!==void 0&&!Le(this,q,ot).call(this,D(this,I)[p])&&(yield D(this,I)[p])}[(A=Symbol.iterator,S=Symbol.toStringTag,A)](){return this.entries()}find(p,m={}){for(let k of Le(this,q,Vt).call(this)){let M=D(this,I)[k],z=Le(this,q,ot).call(this,M)?M.__staleWhileFetching:M;if(z!==void 0&&p(z,D(this,F)[k],this))return this.get(D(this,F)[k],m)}}forEach(p,m=this){for(let k of Le(this,q,Vt).call(this)){let M=D(this,I)[k],z=Le(this,q,ot).call(this,M)?M.__staleWhileFetching:M;z!==void 0&&p.call(m,z,D(this,F)[k],this)}}rforEach(p,m=this){for(let k of Le(this,q,zt).call(this)){let M=D(this,I)[k],z=Le(this,q,ot).call(this,M)?M.__staleWhileFetching:M;z!==void 0&&p.call(m,z,D(this,F)[k],this)}}purgeStale(){let p=!1;for(let m of Le(this,q,zt).call(this,{allowStale:!0}))D(this,H).call(this,m)&&(Le(this,q,Kt).call(this,D(this,F)[m],"expire"),p=!0);return p}info(p){let m=D(this,O).get(p);if(m===void 0)return;let k=D(this,I)[m],M=Le(this,q,ot).call(this,k)?k.__staleWhileFetching:k;if(M===void 0)return;let z={value:M};if(D(this,oe)&&D(this,G)){let ie=D(this,oe)[m],$=D(this,G)[m];if(ie&&$){let J=ie-(l.now()-$);z.ttl=J,z.start=Date.now()}}return D(this,ue)&&(z.size=D(this,ue)[m]),z}dump(){let p=[];for(let m of Le(this,q,Vt).call(this,{allowStale:!0})){let k=D(this,F)[m],M=D(this,I)[m],z=Le(this,q,ot).call(this,M)?M.__staleWhileFetching:M;if(z===void 0||k===void 0)continue;let ie={value:z};if(D(this,oe)&&D(this,G)){ie.ttl=D(this,oe)[m];let $=l.now()-D(this,G)[m];ie.start=Math.floor(Date.now()-$)}D(this,ue)&&(ie.size=D(this,ue)[m]),p.unshift([k,ie])}return p}load(p){this.clear();for(let[m,k]of p){if(k.start){let M=Date.now()-k.start;k.start=l.now()-M}this.set(m,k.value,k)}}set(p,m,k={}){var Fe,nt,rt,Ke,Xe;if(m===void 0)return this.delete(p),this;let{ttl:M=this.ttl,start:z,noDisposeOnSet:ie=this.noDisposeOnSet,sizeCalculation:$=this.sizeCalculation,status:J}=k,{noUpdateTTL:Te=this.noUpdateTTL}=k,Me=D(this,ce).call(this,p,m,k.size||0,$);if(this.maxEntrySize&&Me>this.maxEntrySize)return J&&(J.set="miss",J.maxEntrySizeExceeded=!0),Le(this,q,Kt).call(this,p,"set"),this;let Ne=D(this,x)===0?void 0:D(this,O).get(p);if(Ne===void 0)Ne=D(this,x)===0?D(this,le):D(this,re).length!==0?D(this,re).pop():D(this,x)===D(this,g)?Le(this,q,un).call(this,!1):D(this,x),D(this,F)[Ne]=p,D(this,I)[Ne]=m,D(this,O).set(p,Ne),D(this,W)[D(this,le)]=Ne,D(this,V)[Ne]=D(this,le),$e(this,le,Ne),ln(this,x)._++,D(this,be).call(this,Ne,Me,J),J&&(J.set="add"),Te=!1;else{Le(this,q,Sr).call(this,Ne);let Ue=D(this,I)[Ne];if(m!==Ue){if(D(this,Q)&&Le(this,q,ot).call(this,Ue)){Ue.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Ye}=Ue;Ye!==void 0&&!ie&&(D(this,R)&&((Fe=D(this,E))==null||Fe.call(this,Ye,p,"set")),D(this,he)&&((nt=D(this,ee))==null||nt.push([Ye,p,"set"])))}else ie||(D(this,R)&&((rt=D(this,E))==null||rt.call(this,Ue,p,"set")),D(this,he)&&((Ke=D(this,ee))==null||Ke.push([Ue,p,"set"])));if(D(this,ne).call(this,Ne),D(this,be).call(this,Ne,Me,J),D(this,I)[Ne]=m,J){J.set="replace";let Ye=Ue&&Le(this,q,ot).call(this,Ue)?Ue.__staleWhileFetching:Ue;Ye!==void 0&&(J.oldValue=Ye)}}else J&&(J.set="update")}if(M!==0&&!D(this,oe)&&Le(this,q,zo).call(this),D(this,oe)&&(Te||D(this,ae).call(this,Ne,M,z),J&&D(this,U).call(this,J,Ne)),!ie&&D(this,he)&&D(this,ee)){let Ue=D(this,ee),Ye;for(;Ye=Ue==null?void 0:Ue.shift();)(Xe=D(this,v))==null||Xe.call(this,...Ye)}return this}pop(){var p;try{for(;D(this,x);){let m=D(this,I)[D(this,L)];if(Le(this,q,un).call(this,!0),Le(this,q,ot).call(this,m)){if(m.__staleWhileFetching)return m.__staleWhileFetching}else if(m!==void 0)return m}}finally{if(D(this,he)&&D(this,ee)){let m=D(this,ee),k;for(;k=m==null?void 0:m.shift();)(p=D(this,v))==null||p.call(this,...k)}}}has(p,m={}){let{updateAgeOnHas:k=this.updateAgeOnHas,status:M}=m,z=D(this,O).get(p);if(z!==void 0){let ie=D(this,I)[z];if(Le(this,q,ot).call(this,ie)&&ie.__staleWhileFetching===void 0)return!1;if(D(this,H).call(this,z))M&&(M.has="stale",D(this,U).call(this,M,z));else return k&&D(this,X).call(this,z),M&&(M.has="hit",D(this,U).call(this,M,z)),!0}else M&&(M.has="miss");return!1}peek(p,m={}){let{allowStale:k=this.allowStale}=m,M=D(this,O).get(p);if(M===void 0||!k&&D(this,H).call(this,M))return;let z=D(this,I)[M];return Le(this,q,ot).call(this,z)?z.__staleWhileFetching:z}async fetch(p,m={}){let{allowStale:k=this.allowStale,updateAgeOnGet:M=this.updateAgeOnGet,noDeleteOnStaleGet:z=this.noDeleteOnStaleGet,ttl:ie=this.ttl,noDisposeOnSet:$=this.noDisposeOnSet,size:J=0,sizeCalculation:Te=this.sizeCalculation,noUpdateTTL:Me=this.noUpdateTTL,noDeleteOnFetchRejection:Ne=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Fe=this.allowStaleOnFetchRejection,ignoreFetchAbort:nt=this.ignoreFetchAbort,allowStaleOnFetchAbort:rt=this.allowStaleOnFetchAbort,context:Ke,forceRefresh:Xe=!1,status:Ue,signal:Ye}=m;if(!D(this,Q))return Ue&&(Ue.fetch="get"),this.get(p,{allowStale:k,updateAgeOnGet:M,noDeleteOnStaleGet:z,status:Ue});let Ze={allowStale:k,updateAgeOnGet:M,noDeleteOnStaleGet:z,ttl:ie,noDisposeOnSet:$,size:J,sizeCalculation:Te,noUpdateTTL:Me,noDeleteOnFetchRejection:Ne,allowStaleOnFetchRejection:Fe,allowStaleOnFetchAbort:rt,ignoreFetchAbort:nt,status:Ue,signal:Ye},lt=D(this,O).get(p);if(lt===void 0){Ue&&(Ue.fetch="miss");let ct=Le(this,q,cn).call(this,p,lt,Ze,Ke);return ct.__returned=ct}else{let ct=D(this,I)[lt];if(Le(this,q,ot).call(this,ct)){let xe=k&&ct.__staleWhileFetching!==void 0;return Ue&&(Ue.fetch="inflight",xe&&(Ue.returnedStale=!0)),xe?ct.__staleWhileFetching:ct.__returned=ct}let Et=D(this,H).call(this,lt);if(!Xe&&!Et)return Ue&&(Ue.fetch="hit"),Le(this,q,Sr).call(this,lt),M&&D(this,X).call(this,lt),Ue&&D(this,U).call(this,Ue,lt),ct;let j=Le(this,q,cn).call(this,p,lt,Ze,Ke),B=j.__staleWhileFetching!==void 0&&k;return Ue&&(Ue.fetch=Et?"stale":"refresh",B&&Et&&(Ue.returnedStale=!0)),B?j.__staleWhileFetching:j.__returned=j}}async forceFetch(p,m={}){let k=await this.fetch(p,m);if(k===void 0)throw new Error("fetch() returned undefined");return k}memo(p,m={}){let k=D(this,T);if(!k)throw new Error("no memoMethod provided to constructor");let{context:M,forceRefresh:z,...ie}=m,$=this.get(p,ie);if(!z&&$!==void 0)return $;let J=k(p,$,{options:ie,context:M});return this.set(p,J,ie),J}get(p,m={}){let{allowStale:k=this.allowStale,updateAgeOnGet:M=this.updateAgeOnGet,noDeleteOnStaleGet:z=this.noDeleteOnStaleGet,status:ie}=m,$=D(this,O).get(p);if($!==void 0){let J=D(this,I)[$],Te=Le(this,q,ot).call(this,J);return ie&&D(this,U).call(this,ie,$),D(this,H).call(this,$)?(ie&&(ie.get="stale"),Te?(ie&&k&&J.__staleWhileFetching!==void 0&&(ie.returnedStale=!0),k?J.__staleWhileFetching:void 0):(z||Le(this,q,Kt).call(this,p,"expire"),ie&&k&&(ie.returnedStale=!0),k?J:void 0)):(ie&&(ie.get="hit"),Te?J.__staleWhileFetching:(Le(this,q,Sr).call(this,$),M&&D(this,X).call(this,$),J))}else ie&&(ie.get="miss")}delete(p){return Le(this,q,Kt).call(this,p,"delete")}clear(){return Le(this,q,Go).call(this,"delete")}},g=new WeakMap,_=new WeakMap,E=new WeakMap,v=new WeakMap,C=new WeakMap,T=new WeakMap,x=new WeakMap,P=new WeakMap,O=new WeakMap,F=new WeakMap,I=new WeakMap,W=new WeakMap,V=new WeakMap,L=new WeakMap,le=new WeakMap,re=new WeakMap,ee=new WeakMap,ue=new WeakMap,G=new WeakMap,oe=new WeakMap,R=new WeakMap,Q=new WeakMap,he=new WeakMap,q=new WeakSet,zo=function(){let p=new c(D(this,g)),m=new c(D(this,g));$e(this,oe,p),$e(this,G,m),$e(this,ae,(z,ie,$=l.now())=>{if(m[z]=ie!==0?$:0,p[z]=ie,ie!==0&&this.ttlAutopurge){let J=setTimeout(()=>{D(this,H).call(this,z)&&Le(this,q,Kt).call(this,D(this,F)[z],"expire")},ie+1);J.unref&&J.unref()}}),$e(this,X,z=>{m[z]=p[z]!==0?l.now():0}),$e(this,U,(z,ie)=>{if(p[ie]){let $=p[ie],J=m[ie];if(!$||!J)return;z.ttl=$,z.start=J,z.now=k||M();let Te=z.now-J;z.remainingTTL=$-Te}});let k=0,M=()=>{let z=l.now();if(this.ttlResolution>0){k=z;let ie=setTimeout(()=>k=0,this.ttlResolution);ie.unref&&ie.unref()}return z};this.getRemainingTTL=z=>{let ie=D(this,O).get(z);if(ie===void 0)return 0;let $=p[ie],J=m[ie];if(!$||!J)return 1/0;let Te=(k||M())-J;return $-Te},$e(this,H,z=>{let ie=m[z],$=p[z];return!!$&&!!ie&&(k||M())-ie>$})},X=new WeakMap,U=new WeakMap,ae=new WeakMap,H=new WeakMap,fu=function(){let p=new c(D(this,g));$e(this,P,0),$e(this,ue,p),$e(this,ne,m=>{$e(this,P,D(this,P)-p[m]),p[m]=0}),$e(this,ce,(m,k,M,z)=>{if(Le(this,q,ot).call(this,k))return 0;if(!e(M))if(z){if(typeof z!="function")throw new TypeError("sizeCalculation must be a function");if(M=z(k,m),!e(M))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 M}),$e(this,be,(m,k,M)=>{if(p[m]=k,D(this,_)){let z=D(this,_)-p[m];for(;D(this,P)>z;)Le(this,q,un).call(this,!0)}$e(this,P,D(this,P)+p[m]),M&&(M.entrySize=k,M.totalCalculatedSize=D(this,P))})},ne=new WeakMap,be=new WeakMap,ce=new WeakMap,Vt=function*({allowStale:p=this.allowStale}={}){if(D(this,x))for(let m=D(this,le);!(!Le(this,q,Ko).call(this,m)||((p||!D(this,H).call(this,m))&&(yield m),m===D(this,L)));)m=D(this,V)[m]},zt=function*({allowStale:p=this.allowStale}={}){if(D(this,x))for(let m=D(this,L);!(!Le(this,q,Ko).call(this,m)||((p||!D(this,H).call(this,m))&&(yield m),m===D(this,le)));)m=D(this,W)[m]},Ko=function(p){return p!==void 0&&D(this,O).get(D(this,F)[p])===p},un=function(p){var z,ie;let m=D(this,L),k=D(this,F)[m],M=D(this,I)[m];return D(this,Q)&&Le(this,q,ot).call(this,M)?M.__abortController.abort(new Error("evicted")):(D(this,R)||D(this,he))&&(D(this,R)&&((z=D(this,E))==null||z.call(this,M,k,"evict")),D(this,he)&&((ie=D(this,ee))==null||ie.push([M,k,"evict"]))),D(this,ne).call(this,m),p&&(D(this,F)[m]=void 0,D(this,I)[m]=void 0,D(this,re).push(m)),D(this,x)===1?($e(this,L,$e(this,le,0)),D(this,re).length=0):$e(this,L,D(this,W)[m]),D(this,O).delete(k),ln(this,x)._--,m},cn=function(p,m,k,M){let z=m===void 0?void 0:D(this,I)[m];if(Le(this,q,ot).call(this,z))return z;let ie=new t,{signal:$}=k;$==null||$.addEventListener("abort",()=>ie.abort($.reason),{signal:ie.signal});let J={signal:ie.signal,options:k,context:M},Te=(Ke,Xe=!1)=>{let{aborted:Ue}=ie.signal,Ye=k.ignoreFetchAbort&&Ke!==void 0;if(k.status&&(Ue&&!Xe?(k.status.fetchAborted=!0,k.status.fetchError=ie.signal.reason,Ye&&(k.status.fetchAbortIgnored=!0)):k.status.fetchResolved=!0),Ue&&!Ye&&!Xe)return Ne(ie.signal.reason);let Ze=nt;return D(this,I)[m]===nt&&(Ke===void 0?Ze.__staleWhileFetching?D(this,I)[m]=Ze.__staleWhileFetching:Le(this,q,Kt).call(this,p,"fetch"):(k.status&&(k.status.fetchUpdated=!0),this.set(p,Ke,J.options))),Ke},Me=Ke=>(k.status&&(k.status.fetchRejected=!0,k.status.fetchError=Ke),Ne(Ke)),Ne=Ke=>{let{aborted:Xe}=ie.signal,Ue=Xe&&k.allowStaleOnFetchAbort,Ye=Ue||k.allowStaleOnFetchRejection,Ze=Ye||k.noDeleteOnFetchRejection,lt=nt;if(D(this,I)[m]===nt&&(!Ze||lt.__staleWhileFetching===void 0?Le(this,q,Kt).call(this,p,"fetch"):Ue||(D(this,I)[m]=lt.__staleWhileFetching)),Ye)return k.status&&lt.__staleWhileFetching!==void 0&&(k.status.returnedStale=!0),lt.__staleWhileFetching;if(lt.__returned===lt)throw Ke},Fe=(Ke,Xe)=>{var Ye;let Ue=(Ye=D(this,C))==null?void 0:Ye.call(this,p,z,J);Ue&&Ue instanceof Promise&&Ue.then(Ze=>Ke(Ze===void 0?void 0:Ze),Xe),ie.signal.addEventListener("abort",()=>{(!k.ignoreFetchAbort||k.allowStaleOnFetchAbort)&&(Ke(void 0),k.allowStaleOnFetchAbort&&(Ke=Ze=>Te(Ze,!0)))})};k.status&&(k.status.fetchDispatched=!0);let nt=new Promise(Fe).then(Te,Me),rt=Object.assign(nt,{__abortController:ie,__staleWhileFetching:z,__returned:void 0});return m===void 0?(this.set(p,rt,{...J.options,status:void 0}),m=D(this,O).get(p)):D(this,I)[m]=rt,rt},ot=function(p){if(!D(this,Q))return!1;let m=p;return!!m&&m instanceof Promise&&m.hasOwnProperty("__staleWhileFetching")&&m.__abortController instanceof t},Ho=function(p,m){D(this,V)[m]=p,D(this,W)[p]=m},Sr=function(p){p!==D(this,le)&&(p===D(this,L)?$e(this,L,D(this,W)[p]):Le(this,q,Ho).call(this,D(this,V)[p],D(this,W)[p]),Le(this,q,Ho).call(this,D(this,le),p),$e(this,le,p))},Kt=function(p,m){var M,z,ie,$;let k=!1;if(D(this,x)!==0){let J=D(this,O).get(p);if(J!==void 0)if(k=!0,D(this,x)===1)Le(this,q,Go).call(this,m);else{D(this,ne).call(this,J);let Te=D(this,I)[J];if(Le(this,q,ot).call(this,Te)?Te.__abortController.abort(new Error("deleted")):(D(this,R)||D(this,he))&&(D(this,R)&&((M=D(this,E))==null||M.call(this,Te,p,m)),D(this,he)&&((z=D(this,ee))==null||z.push([Te,p,m]))),D(this,O).delete(p),D(this,F)[J]=void 0,D(this,I)[J]=void 0,J===D(this,le))$e(this,le,D(this,V)[J]);else if(J===D(this,L))$e(this,L,D(this,W)[J]);else{let Me=D(this,V)[J];D(this,W)[Me]=D(this,W)[J];let Ne=D(this,W)[J];D(this,V)[Ne]=D(this,V)[J]}ln(this,x)._--,D(this,re).push(J)}}if(D(this,he)&&((ie=D(this,ee))!=null&&ie.length)){let J=D(this,ee),Te;for(;Te=J==null?void 0:J.shift();)($=D(this,v))==null||$.call(this,...Te)}return k},Go=function(p){var m,k,M;for(let z of Le(this,q,zt).call(this,{allowStale:!0})){let ie=D(this,I)[z];if(Le(this,q,ot).call(this,ie))ie.__abortController.abort(new Error("deleted"));else{let $=D(this,F)[z];D(this,R)&&((m=D(this,E))==null||m.call(this,ie,$,p)),D(this,he)&&((k=D(this,ee))==null||k.push([ie,$,p]))}}if(D(this,O).clear(),D(this,I).fill(void 0),D(this,F).fill(void 0),D(this,oe)&&D(this,G)&&(D(this,oe).fill(0),D(this,G).fill(0)),D(this,ue)&&D(this,ue).fill(0),$e(this,L,0),$e(this,le,0),D(this,re).length=0,$e(this,P,0),$e(this,x,0),D(this,he)&&D(this,ee)){let z=D(this,ee),ie;for(;ie=z==null?void 0:z.shift();)(M=D(this,v))==null||M.call(this,...ie)}},De);o.LRUCache=d}),Nt=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.ContainerIterator=o.Container=o.Base=void 0;var l=class{constructor(u=0){this.iteratorType=u}equals(u){return this.o===u.o}};o.ContainerIterator=l;var s=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};o.Base=s;var a=class extends s{};o.Container=a}),rc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=class extends l.Base{constructor(u=[]){super(),this.S=[];let t=this;u.forEach(function(r){t.push(r)})}clear(){this.i=0,this.S=[]}push(u){return this.S.push(u),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},a=s;o.default=a}),nc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=class extends l.Base{constructor(u=[]){super(),this.j=0,this.q=[];let t=this;u.forEach(function(r){t.push(r)})}clear(){this.q=[],this.i=this.j=0}push(u){let t=this.q.length;if(this.j/t>.5&&this.j+this.i>=t&&t>4096){let r=this.i;for(let n=0;n<r;++n)this.q[n]=this.q[this.j+n];this.j=0,this.q[this.i]=u}else this.q[this.j+this.i]=u;return++this.i}pop(){if(this.i===0)return;let u=this.q[this.j++];return this.i-=1,u}front(){if(this.i!==0)return this.q[this.j]}},a=s;o.default=a}),ic=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=class extends l.Base{constructor(u=[],t=function(n,e){return n>e?-1:n<e?1:0},r=!0){if(super(),this.v=t,Array.isArray(u))this.C=r?[...u]:u;else{this.C=[];let e=this;u.forEach(function(i){e.C.push(i)})}this.i=this.C.length;let n=this.i>>1;for(let e=this.i-1>>1;e>=0;--e)this.k(e,n)}m(u){let t=this.C[u];for(;u>0;){let r=u-1>>1,n=this.C[r];if(this.v(n,t)<=0)break;this.C[u]=n,u=r}this.C[u]=t}k(u,t){let r=this.C[u];for(;u<t;){let n=u<<1|1,e=n+1,i=this.C[n];if(e<this.i&&this.v(i,this.C[e])>0&&(n=e,i=this.C[e]),this.v(i,r)>=0)break;this.C[u]=i,u=n}this.C[u]=r}clear(){this.i=0,this.C.length=0}push(u){this.C.push(u),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let u=this.C[0],t=this.C.pop();return this.i-=1,this.i&&(this.C[0]=t,this.k(0,this.i>>1)),u}top(){return this.C[0]}find(u){return this.C.indexOf(u)>=0}remove(u){let t=this.C.indexOf(u);return t<0?!1:(t===0?this.pop():t===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(t,1,this.C.pop()),this.i-=1,this.m(t),this.k(t,this.i>>1)),!0)}updateItem(u){let t=this.C.indexOf(u);return t<0?!1:(this.m(t),this.k(t,this.i>>1),!0)}toArray(){return[...this.C]}},a=s;o.default=a}),Pi=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=class extends l.Container{},a=s;o.default=a}),Bt=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.throwIteratorAccessError=l;function l(){throw new RangeError("Iterator access denied!")}}),Is=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.RandomIterator=void 0;var l=Nt(),s=Bt(),a=class extends l.ContainerIterator{constructor(u,t){super(t),this.o=u,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,s.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,s.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,s.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,s.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(u){this.container.setElementByPos(this.o,u)}};o.RandomIterator=a}),oc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=a(Pi()),s=Is();function a(n){return n&&n.t?n:{default:n}}var u=class hu extends s.RandomIterator{constructor(e,i,c){super(e,c),this.container=i}copy(){return new hu(this.o,this.container,this.iteratorType)}},t=class extends l.default{constructor(n=[],e=!0){if(super(),Array.isArray(n))this.J=e?[...n]:n,this.i=n.length;else{this.J=[];let i=this;n.forEach(function(c){i.pushBack(c)})}}clear(){this.i=0,this.J.length=0}begin(){return new u(0,this)}end(){return new u(this.i,this)}rBegin(){return new u(this.i-1,this,1)}rEnd(){return new u(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;return this.J[n]}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;return this.J.splice(n,1),this.i-=1,this.i}eraseElementByValue(n){let e=0;for(let i=0;i<this.i;++i)this.J[i]!==n&&(this.J[e++]=this.J[i]);return this.i=this.J.length=e,this.i}eraseElementByIterator(n){let e=n.o;return n=n.next(),this.eraseElementByPos(e),n}pushBack(n){return this.J.push(n),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(n,e){if(n<0||n>this.i-1)throw new RangeError;this.J[n]=e}insert(n,e,i=1){if(n<0||n>this.i)throw new RangeError;return this.J.splice(n,0,...new Array(i).fill(e)),this.i+=i,this.i}find(n){for(let e=0;e<this.i;++e)if(this.J[e]===n)return new u(e,this);return this.end()}reverse(){this.J.reverse()}unique(){let n=1;for(let e=1;e<this.i;++e)this.J[e]!==this.J[e-1]&&(this.J[n++]=this.J[e]);return this.i=this.J.length=n,this.i}sort(n){this.J.sort(n)}forEach(n){for(let e=0;e<this.i;++e)n(this.J[e],e,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}},r=t;o.default=r}),sc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=u(Pi()),s=Nt(),a=Bt();function u(e){return e&&e.t?e:{default:e}}var t=class pu extends s.ContainerIterator{constructor(i,c,h,d){super(d),this.o=i,this.h=c,this.container=h,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l}set pointer(i){this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l=i}copy(){return new pu(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.default{constructor(e=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let i=this;e.forEach(function(c){i.pushBack(c)})}V(e){let{L:i,B:c}=e;i.B=c,c.L=i,e===this.p&&(this.p=c),e===this._&&(this._=i),this.i-=1}G(e,i){let c=i.B,h={l:e,L:i,B:c};i.B=h,c.L=h,i===this.h&&(this.p=h),c===this.h&&(this._=h),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new t(this.p,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this._,this.h,this,1)}rEnd(){return new t(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;return i.l}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;return this.V(i),this.i}eraseElementByValue(e){let i=this.p;for(;i!==this.h;)i.l===e&&this.V(i),i=i.B;return this.i}eraseElementByIterator(e){let i=e.o;return i===this.h&&(0,a.throwIteratorAccessError)(),e=e.next(),this.V(i),e}pushBack(e){return this.G(e,this._),this.i}popBack(){if(this.i===0)return;let e=this._.l;return this.V(this._),e}pushFront(e){return this.G(e,this.h),this.i}popFront(){if(this.i===0)return;let e=this.p.l;return this.V(this.p),e}setElementByPos(e,i){if(e<0||e>this.i-1)throw new RangeError;let c=this.p;for(;e--;)c=c.B;c.l=i}insert(e,i,c=1){if(e<0||e>this.i)throw new RangeError;if(c<=0)return this.i;if(e===0)for(;c--;)this.pushFront(i);else if(e===this.i)for(;c--;)this.pushBack(i);else{let h=this.p;for(let y=1;y<e;++y)h=h.B;let d=h.B;for(this.i+=c;c--;)h.B={l:i,L:h},h.B.L=h,h=h.B;h.B=d,d.L=h}return this.i}find(e){let i=this.p;for(;i!==this.h;){if(i.l===e)return new t(i,this.h,this);i=i.B}return this.end()}reverse(){if(this.i<=1)return;let e=this.p,i=this._,c=0;for(;c<<1<this.i;){let h=e.l;e.l=i.l,i.l=h,e=e.B,i=i.L,c+=1}}unique(){if(this.i<=1)return this.i;let e=this.p;for(;e!==this.h;){let i=e;for(;i.B!==this.h&&i.l===i.B.l;)i=i.B,this.i-=1;e.B=i.B,e.B.L=e,e=e.B}return this.i}sort(e){if(this.i<=1)return;let i=[];this.forEach(function(h){i.push(h)}),i.sort(e);let c=this.p;i.forEach(function(h){c.l=h,c=c.B})}merge(e){let i=this;if(this.i===0)e.forEach(function(c){i.pushBack(c)});else{let c=this.p;e.forEach(function(h){for(;c!==i.h&&c.l<=h;)c=c.B;i.G(h,c.L)})}return this.i}forEach(e){let i=this.p,c=0;for(;i!==this.h;)e(i.l,c++,this),i=i.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let e=this.p;for(;e!==this.h;)yield e.l,e=e.B}).bind(this)()}},n=r;o.default=n}),ac=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=a(Pi()),s=Is();function a(n){return n&&n.t?n:{default:n}}var u=class du extends s.RandomIterator{constructor(e,i,c){super(e,c),this.container=i}copy(){return new du(this.o,this.container,this.iteratorType)}},t=class extends l.default{constructor(n=[],e=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let i=(()=>{if(typeof n.length=="number")return n.length;if(typeof n.size=="number")return n.size;if(typeof n.size=="function")return n.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=e,this.P=Math.max(Math.ceil(i/this.F),1);for(let d=0;d<this.P;++d)this.A.push(new Array(this.F));let c=Math.ceil(i/this.F);this.j=this.R=(this.P>>1)-(c>>1),this.D=this.N=this.F-i%this.F>>1;let h=this;n.forEach(function(d){h.pushBack(d)})}T(){let n=[],e=Math.max(this.P>>1,1);for(let i=0;i<e;++i)n[i]=new Array(this.F);for(let i=this.j;i<this.P;++i)n[n.length]=this.A[i];for(let i=0;i<this.R;++i)n[n.length]=this.A[i];n[n.length]=[...this.A[this.R]],this.j=e,this.R=n.length-1;for(let i=0;i<e;++i)n[n.length]=new Array(this.F);this.A=n,this.P=n.length}O(n){let e=this.D+n+1,i=e%this.F,c=i-1,h=this.j+(e-i)/this.F;return i===0&&(h-=1),h%=this.P,c<0&&(c+=this.F),{curNodeBucketIndex:h,curNodePointerIndex:c}}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 u(0,this)}end(){return new u(this.i,this)}rBegin(){return new u(this.i-1,this,1)}rEnd(){return new u(-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(n){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]=n,this.i}popBack(){if(this.i===0)return;let n=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,n}pushFront(n){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]=n,this.i}popFront(){if(this.i===0)return;let n=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,n}getElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;let{curNodeBucketIndex:e,curNodePointerIndex:i}=this.O(n);return this.A[e][i]}setElementByPos(n,e){if(n<0||n>this.i-1)throw new RangeError;let{curNodeBucketIndex:i,curNodePointerIndex:c}=this.O(n);this.A[i][c]=e}insert(n,e,i=1){if(n<0||n>this.i)throw new RangeError;if(n===0)for(;i--;)this.pushFront(e);else if(n===this.i)for(;i--;)this.pushBack(e);else{let c=[];for(let h=n;h<this.i;++h)c.push(this.getElementByPos(h));this.cut(n-1);for(let h=0;h<i;++h)this.pushBack(e);for(let h=0;h<c.length;++h)this.pushBack(c[h])}return this.i}cut(n){if(n<0)return this.clear(),0;let{curNodeBucketIndex:e,curNodePointerIndex:i}=this.O(n);return this.R=e,this.N=i,this.i=n+1,this.i}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;if(n===0)this.popFront();else if(n===this.i-1)this.popBack();else{let e=[];for(let c=n+1;c<this.i;++c)e.push(this.getElementByPos(c));this.cut(n),this.popBack();let i=this;e.forEach(function(c){i.pushBack(c)})}return this.i}eraseElementByValue(n){if(this.i===0)return 0;let e=[];for(let c=0;c<this.i;++c){let h=this.getElementByPos(c);h!==n&&e.push(h)}let i=e.length;for(let c=0;c<i;++c)this.setElementByPos(c,e[c]);return this.cut(i-1)}eraseElementByIterator(n){let e=n.o;return this.eraseElementByPos(e),n=n.next(),n}find(n){for(let e=0;e<this.i;++e)if(this.getElementByPos(e)===n)return new u(e,this);return this.end()}reverse(){let n=0,e=this.i-1;for(;n<e;){let i=this.getElementByPos(n);this.setElementByPos(n,this.getElementByPos(e)),this.setElementByPos(e,i),n+=1,e-=1}}unique(){if(this.i<=1)return this.i;let n=1,e=this.getElementByPos(0);for(let i=1;i<this.i;++i){let c=this.getElementByPos(i);c!==e&&(e=c,this.setElementByPos(n++,c))}for(;this.i>n;)this.popBack();return this.i}sort(n){let e=[];for(let i=0;i<this.i;++i)e.push(this.getElementByPos(i));e.sort(n);for(let i=0;i<this.i;++i)this.setElementByPos(i,e[i])}shrinkToFit(){if(this.i===0)return;let n=[];this.forEach(function(e){n.push(e)}),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 e=0;e<this.P;++e)this.A.push(new Array(this.F));for(let e=0;e<n.length;++e)this.pushBack(n[e])}forEach(n){for(let e=0;e<this.i;++e)n(this.getElementByPos(e),e,this)}[Symbol.iterator](){return(function*(){for(let n=0;n<this.i;++n)yield this.getElementByPos(n)}).bind(this)()}},r=t;o.default=r}),lc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.TreeNodeEnableIndex=o.TreeNode=void 0;var l=class{constructor(a,u){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=a,this.l=u}L(){let a=this;if(a.ee===1&&a.tt.tt===a)a=a.W;else if(a.U)for(a=a.U;a.W;)a=a.W;else{let u=a.tt;for(;u.U===a;)a=u,u=a.tt;a=u}return a}B(){let a=this;if(a.W){for(a=a.W;a.U;)a=a.U;return a}else{let u=a.tt;for(;u.W===a;)a=u,u=a.tt;return a.W!==u?u:a}}te(){let a=this.tt,u=this.W,t=u.U;return a.tt===this?a.tt=u:a.U===this?a.U=u:a.W=u,u.tt=a,u.U=this,this.tt=u,this.W=t,t&&(t.tt=this),u}se(){let a=this.tt,u=this.U,t=u.W;return a.tt===this?a.tt=u:a.U===this?a.U=u:a.W=u,u.tt=a,u.W=this,this.tt=u,this.U=t,t&&(t.tt=this),u}};o.TreeNode=l;var s=class extends l{constructor(){super(...arguments),this.rt=1}te(){let a=super.te();return this.ie(),a.ie(),a}se(){let a=super.se();return this.ie(),a.ie(),a}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};o.TreeNodeEnableIndex=s}),ks=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=lc(),s=Nt(),a=Bt(),u=class extends s.Container{constructor(r=function(e,i){return e<i?-1:e>i?1:0},n=!1){super(),this.Y=void 0,this.v=r,n?(this.re=l.TreeNodeEnableIndex,this.M=function(e,i,c){let h=this.ne(e,i,c);if(h){let d=h.tt;for(;d!==this.h;)d.rt+=1,d=d.tt;let y=this.he(h);if(y){let{parentNode:b,grandParent:w,curNode:S}=y;b.ie(),w.ie(),S.ie()}}return this.i},this.V=function(e){let i=this.fe(e);for(;i!==this.h;)i.rt-=1,i=i.tt}):(this.re=l.TreeNode,this.M=function(e,i,c){let h=this.ne(e,i,c);return h&&this.he(h),this.i},this.V=this.fe),this.h=new this.re}X(r,n){let e=this.h;for(;r;){let i=this.v(r.u,n);if(i<0)r=r.W;else if(i>0)e=r,r=r.U;else return r}return e}Z(r,n){let e=this.h;for(;r;)this.v(r.u,n)<=0?r=r.W:(e=r,r=r.U);return e}$(r,n){let e=this.h;for(;r;){let i=this.v(r.u,n);if(i<0)e=r,r=r.W;else if(i>0)r=r.U;else return r}return e}rr(r,n){let e=this.h;for(;r;)this.v(r.u,n)<0?(e=r,r=r.W):r=r.U;return e}ue(r){for(;;){let n=r.tt;if(n===this.h)return;if(r.ee===1){r.ee=0;return}if(r===n.U){let e=n.W;if(e.ee===1)e.ee=0,n.ee=1,n===this.Y?this.Y=n.te():n.te();else if(e.W&&e.W.ee===1){e.ee=n.ee,n.ee=0,e.W.ee=0,n===this.Y?this.Y=n.te():n.te();return}else e.U&&e.U.ee===1?(e.ee=1,e.U.ee=0,e.se()):(e.ee=1,r=n)}else{let e=n.U;if(e.ee===1)e.ee=0,n.ee=1,n===this.Y?this.Y=n.se():n.se();else if(e.U&&e.U.ee===1){e.ee=n.ee,n.ee=0,e.U.ee=0,n===this.Y?this.Y=n.se():n.se();return}else e.W&&e.W.ee===1?(e.ee=1,e.W.ee=0,e.te()):(e.ee=1,r=n)}}}fe(r){if(this.i===1)return this.clear(),this.h;let n=r;for(;n.U||n.W;){if(n.W)for(n=n.W;n.U;)n=n.U;else n=n.U;[r.u,n.u]=[n.u,r.u],[r.l,n.l]=[n.l,r.l],r=n}this.h.U===n?this.h.U=n.tt:this.h.W===n&&(this.h.W=n.tt),this.ue(n);let e=n.tt;return n===e.U?e.U=void 0:e.W=void 0,this.i-=1,this.Y.ee=0,e}oe(r,n){return r===void 0?!1:this.oe(r.U,n)||n(r)?!0:this.oe(r.W,n)}he(r){for(;;){let n=r.tt;if(n.ee===0)return;let e=n.tt;if(n===e.U){let i=e.W;if(i&&i.ee===1){if(i.ee=n.ee=0,e===this.Y)return;e.ee=1,r=e;continue}else if(r===n.W){if(r.ee=0,r.U&&(r.U.tt=n),r.W&&(r.W.tt=e),n.W=r.U,e.U=r.W,r.U=n,r.W=e,e===this.Y)this.Y=r,this.h.tt=r;else{let c=e.tt;c.U===e?c.U=r:c.W=r}return r.tt=e.tt,n.tt=r,e.tt=r,e.ee=1,{parentNode:n,grandParent:e,curNode:r}}else n.ee=0,e===this.Y?this.Y=e.se():e.se(),e.ee=1}else{let i=e.U;if(i&&i.ee===1){if(i.ee=n.ee=0,e===this.Y)return;e.ee=1,r=e;continue}else if(r===n.U){if(r.ee=0,r.U&&(r.U.tt=e),r.W&&(r.W.tt=n),e.W=r.U,n.U=r.W,r.U=e,r.W=n,e===this.Y)this.Y=r,this.h.tt=r;else{let c=e.tt;c.U===e?c.U=r:c.W=r}return r.tt=e.tt,n.tt=r,e.tt=r,e.ee=1,{parentNode:n,grandParent:e,curNode:r}}else n.ee=0,e===this.Y?this.Y=e.te():e.te(),e.ee=1}return}}ne(r,n,e){if(this.Y===void 0){this.i+=1,this.Y=new this.re(r,n),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 i,c=this.h.U,h=this.v(c.u,r);if(h===0){c.l=n;return}else if(h>0)c.U=new this.re(r,n),c.U.tt=c,i=c.U,this.h.U=i;else{let d=this.h.W,y=this.v(d.u,r);if(y===0){d.l=n;return}else if(y<0)d.W=new this.re(r,n),d.W.tt=d,i=d.W,this.h.W=i;else{if(e!==void 0){let b=e.o;if(b!==this.h){let w=this.v(b.u,r);if(w===0){b.l=n;return}else if(w>0){let S=b.L(),A=this.v(S.u,r);if(A===0){S.l=n;return}else A<0&&(i=new this.re(r,n),S.W===void 0?(S.W=i,i.tt=S):(b.U=i,i.tt=b))}}}if(i===void 0)for(i=this.Y;;){let b=this.v(i.u,r);if(b>0){if(i.U===void 0){i.U=new this.re(r,n),i.U.tt=i,i=i.U;break}i=i.U}else if(b<0){if(i.W===void 0){i.W=new this.re(r,n),i.W.tt=i,i=i.W;break}i=i.W}else{i.l=n;return}}}}return this.i+=1,i}I(r,n){for(;r;){let e=this.v(r.u,n);if(e<0)r=r.W;else if(e>0)r=r.U;else return r}return r||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(r,n){let e=r.o;if(e===this.h&&(0,a.throwIteratorAccessError)(),this.i===1)return e.u=n,!0;if(e===this.h.U)return this.v(e.B().u,n)>0?(e.u=n,!0):!1;if(e===this.h.W)return this.v(e.L().u,n)<0?(e.u=n,!0):!1;let i=e.L().u;if(this.v(i,n)>=0)return!1;let c=e.B().u;return this.v(c,n)<=0?!1:(e.u=n,!0)}eraseElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let n=0,e=this;return this.oe(this.Y,function(i){return r===n?(e.V(i),!0):(n+=1,!1)}),this.i}eraseElementByKey(r){if(this.i===0)return!1;let n=this.I(this.Y,r);return n===this.h?!1:(this.V(n),!0)}eraseElementByIterator(r){let n=r.o;n===this.h&&(0,a.throwIteratorAccessError)();let e=n.W===void 0;return r.iteratorType===0?e&&r.next():(!e||n.U===void 0)&&r.next(),this.V(n),r}forEach(r){let n=0;for(let e of this)r(e,n++,this)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let n,e=0;for(let i of this){if(e===r){n=i;break}e+=1}return n}getHeight(){if(this.i===0)return 0;let r=function(n){return n?Math.max(r(n.U),r(n.W))+1:0};return r(this.Y)}},t=u;o.default=t}),Os=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=Bt(),a=class extends l.ContainerIterator{constructor(t,r,n){super(n),this.o=t,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,s.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,s.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let t=this.o,r=this.h.tt;if(t===this.h)return r?r.rt-1:0;let n=0;for(t.U&&(n+=t.U.rt);t!==r;){let e=t.tt;t===e.W&&(n+=1,e.U&&(n+=e.U.rt)),t=e}return n}},u=a;o.default=u}),uc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=u(ks()),s=u(Os()),a=Bt();function u(e){return e&&e.t?e:{default:e}}var t=class gu extends s.default{constructor(i,c,h,d){super(i,c,d),this.container=h}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.u}copy(){return new gu(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.default{constructor(e=[],i,c){super(i,c);let h=this;e.forEach(function(d){h.insert(d)})}*K(e){e!==void 0&&(yield*this.K(e.U),yield e.u,yield*this.K(e.W))}begin(){return new t(this.h.U||this.h,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this.h.W||this.h,this.h,this,1)}rEnd(){return new t(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(e,i){return this.M(e,void 0,i)}find(e){let i=this.I(this.Y,e);return new t(i,this.h,this)}lowerBound(e){let i=this.X(this.Y,e);return new t(i,this.h,this)}upperBound(e){let i=this.Z(this.Y,e);return new t(i,this.h,this)}reverseLowerBound(e){let i=this.$(this.Y,e);return new t(i,this.h,this)}reverseUpperBound(e){let i=this.rr(this.Y,e);return new t(i,this.h,this)}union(e){let i=this;return e.forEach(function(c){i.insert(c)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},n=r;o.default=n}),cc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=u(ks()),s=u(Os()),a=Bt();function u(e){return e&&e.t?e:{default:e}}var t=class yu extends s.default{constructor(i,c,h,d){super(i,c,d),this.container=h}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let i=this;return new Proxy([],{get(c,h){if(h==="0")return i.o.u;if(h==="1")return i.o.l},set(c,h,d){if(h!=="1")throw new TypeError("props must be 1");return i.o.l=d,!0}})}copy(){return new yu(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.default{constructor(e=[],i,c){super(i,c);let h=this;e.forEach(function(d){h.setElement(d[0],d[1])})}*K(e){e!==void 0&&(yield*this.K(e.U),yield[e.u,e.l],yield*this.K(e.W))}begin(){return new t(this.h.U||this.h,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this.h.W||this.h,this.h,this,1)}rEnd(){return new t(this.h,this.h,this,1)}front(){if(this.i===0)return;let e=this.h.U;return[e.u,e.l]}back(){if(this.i===0)return;let e=this.h.W;return[e.u,e.l]}lowerBound(e){let i=this.X(this.Y,e);return new t(i,this.h,this)}upperBound(e){let i=this.Z(this.Y,e);return new t(i,this.h,this)}reverseLowerBound(e){let i=this.$(this.Y,e);return new t(i,this.h,this)}reverseUpperBound(e){let i=this.rr(this.Y,e);return new t(i,this.h,this)}setElement(e,i,c){return this.M(e,i,c)}find(e){let i=this.I(this.Y,e);return new t(i,this.h,this)}getElementByKey(e){return this.I(this.Y,e).l}union(e){let i=this;return e.forEach(function(c){i.setElement(c[0],c[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},n=r;o.default=n}),Ts=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=l;function l(s){let a=typeof s;return a==="object"&&s!==null||a==="function"}}),Ps=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.HashContainerIterator=o.HashContainer=void 0;var l=Nt(),s=u(Ts()),a=Bt();function u(n){return n&&n.t?n:{default:n}}var t=class extends l.ContainerIterator{constructor(n,e,i){super(i),this.o=n,this.h=e,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this})}};o.HashContainerIterator=t;var r=class extends l.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(n){let{L:e,B:i}=n;e.B=i,i.L=e,n===this.p&&(this.p=i),n===this._&&(this._=e),this.i-=1}M(n,e,i){i===void 0&&(i=(0,s.default)(n));let c;if(i){let h=n[this.HASH_TAG];if(h!==void 0)return this.H[h].l=e,this.i;Object.defineProperty(n,this.HASH_TAG,{value:this.H.length,configurable:!0}),c={u:n,l:e,L:this._,B:this.h},this.H.push(c)}else{let h=this.g[n];if(h)return h.l=e,this.i;c={u:n,l:e,L:this._,B:this.h},this.g[n]=c}return this.i===0?(this.p=c,this.h.B=c):this._.B=c,this._=c,this.h.L=c,++this.i}I(n,e){if(e===void 0&&(e=(0,s.default)(n)),e){let i=n[this.HASH_TAG];return i===void 0?this.h:this.H[i]}else return this.g[n]||this.h}clear(){let n=this.HASH_TAG;this.H.forEach(function(e){delete e.u[n]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(n,e){let i;if(e===void 0&&(e=(0,s.default)(n)),e){let c=n[this.HASH_TAG];if(c===void 0)return!1;delete n[this.HASH_TAG],i=this.H[c],delete this.H[c]}else{if(i=this.g[n],i===void 0)return!1;delete this.g[n]}return this.V(i),!0}eraseElementByIterator(n){let e=n.o;return e===this.h&&(0,a.throwIteratorAccessError)(),this.V(e),n.next()}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;let e=this.p;for(;n--;)e=e.B;return this.V(e),this.i}};o.HashContainer=r}),fc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Ps(),s=Bt(),a=class mu extends l.HashContainerIterator{constructor(n,e,i,c){super(n,e,c),this.container=i}get pointer(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o.u}copy(){return new mu(this.o,this.h,this.container,this.iteratorType)}},u=class extends l.HashContainer{constructor(r=[]){super();let n=this;r.forEach(function(e){n.insert(e)})}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.u}back(){return this._.u}insert(r,n){return this.M(r,void 0,n)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let n=this.p;for(;r--;)n=n.B;return n.u}find(r,n){let e=this.I(r,n);return new a(e,this.h,this)}forEach(r){let n=0,e=this.p;for(;e!==this.h;)r(e.u,n++,this),e=e.B}[Symbol.iterator](){return(function*(){let r=this.p;for(;r!==this.h;)yield r.u,r=r.B}).bind(this)()}},t=u;o.default=t}),hc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Ps(),s=u(Ts()),a=Bt();function u(e){return e&&e.t?e:{default:e}}var t=class bu extends l.HashContainerIterator{constructor(i,c,h,d){super(i,c,d),this.container=h}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let i=this;return new Proxy([],{get(c,h){if(h==="0")return i.o.u;if(h==="1")return i.o.l},set(c,h,d){if(h!=="1")throw new TypeError("props must be 1");return i.o.l=d,!0}})}copy(){return new bu(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.HashContainer{constructor(e=[]){super();let i=this;e.forEach(function(c){i.setElement(c[0],c[1])})}begin(){return new t(this.p,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this._,this.h,this,1)}rEnd(){return new t(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(e,i,c){return this.M(e,i,c)}getElementByKey(e,i){if(i===void 0&&(i=(0,s.default)(e)),i){let h=e[this.HASH_TAG];return h!==void 0?this.H[h].l:void 0}let c=this.g[e];return c?c.l:void 0}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;return[i.u,i.l]}find(e,i){let c=this.I(e,i);return new t(c,this.h,this)}forEach(e){let i=0,c=this.p;for(;c!==this.h;)e([c.u,c.l],i++,this),c=c.B}[Symbol.iterator](){return(function*(){let e=this.p;for(;e!==this.h;)yield[e.u,e.l],e=e.B}).bind(this)()}},n=r;o.default=n}),pc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),Object.defineProperty(o,"Deque",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(o,"HashMap",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(o,"HashSet",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(o,"LinkList",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(o,"OrderedMap",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(o,"OrderedSet",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(o,"PriorityQueue",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(o,"Queue",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(o,"Stack",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(o,"Vector",{enumerable:!0,get:function(){return u.default}});var l=h(rc()),s=h(nc()),a=h(ic()),u=h(oc()),t=h(sc()),r=h(ac()),n=h(uc()),e=h(cc()),i=h(fc()),c=h(hc());function h(d){return d&&d.t?d:{default:d}}}),dc=we((o,l)=>{de(),ye(),ge();var s=pc().OrderedSet,a=Mt()("number-allocator:trace"),u=Mt()("number-allocator:error");function t(n,e){this.low=n,this.high=e}t.prototype.equals=function(n){return this.low===n.low&&this.high===n.high},t.prototype.compare=function(n){return this.low<n.low&&this.high<n.low?-1:n.low<this.low&&n.high<this.low?1:0};function r(n,e){if(!(this instanceof r))return new r(n,e);this.min=n,this.max=e,this.ss=new s([],(i,c)=>i.compare(c)),a("Create"),this.clear()}r.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},r.prototype.alloc=function(){if(this.ss.size()===0)return a("alloc():empty"),null;let n=this.ss.begin(),e=n.pointer.low,i=n.pointer.high,c=e;return c+1<=i?this.ss.updateKeyByIterator(n,new t(e+1,i)):this.ss.eraseElementByPos(0),a("alloc():"+c),c},r.prototype.use=function(n){let e=new t(n,n),i=this.ss.lowerBound(e);if(!i.equals(this.ss.end())){let c=i.pointer.low,h=i.pointer.high;return i.pointer.equals(e)?(this.ss.eraseElementByIterator(i),a("use():"+n),!0):c>n?!1:c===n?(this.ss.updateKeyByIterator(i,new t(c+1,h)),a("use():"+n),!0):h===n?(this.ss.updateKeyByIterator(i,new t(c,h-1)),a("use():"+n),!0):(this.ss.updateKeyByIterator(i,new t(n+1,h)),this.ss.insert(new t(c,n-1)),a("use():"+n),!0)}return a("use():failed"),!1},r.prototype.free=function(n){if(n<this.min||n>this.max){u("free():"+n+" is out of range");return}let e=new t(n,n),i=this.ss.upperBound(e);if(i.equals(this.ss.end())){if(i.equals(this.ss.begin())){this.ss.insert(e);return}i.pre();let c=i.pointer.high;i.pointer.high+1===n?this.ss.updateKeyByIterator(i,new t(c,n)):this.ss.insert(e)}else if(i.equals(this.ss.begin()))if(n+1===i.pointer.low){let c=i.pointer.high;this.ss.updateKeyByIterator(i,new t(n,c))}else this.ss.insert(e);else{let c=i.pointer.low,h=i.pointer.high;i.pre();let d=i.pointer.low;i.pointer.high+1===n?n+1===c?(this.ss.eraseElementByIterator(i),this.ss.updateKeyByIterator(i,new t(d,h))):this.ss.updateKeyByIterator(i,new t(d,n)):n+1===c?(this.ss.eraseElementByIterator(i.next()),this.ss.insert(new t(n,h))):this.ss.insert(e)}a("free():"+n)},r.prototype.clear=function(){a("clear()"),this.ss.clear(),this.ss.insert(new t(this.min,this.max))},r.prototype.intervalCount=function(){return this.ss.size()},r.prototype.dump=function(){console.log("length:"+this.ss.size());for(let n of this.ss)console.log(n)},l.exports=r}),Cs=we((o,l)=>{de(),ye(),ge();var s=dc();l.exports.NumberAllocator=s}),gc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=tc(),s=Cs(),a=class{constructor(u){Pe(this,"aliasToTopic");Pe(this,"topicToAlias");Pe(this,"max");Pe(this,"numberAllocator");Pe(this,"length");u>0&&(this.aliasToTopic=new l.LRUCache({max:u}),this.topicToAlias={},this.numberAllocator=new s.NumberAllocator(1,u),this.max=u,this.length=0)}put(u,t){if(t===0||t>this.max)return!1;let r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,u),this.topicToAlias[u]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.size,!0}getTopicByAlias(u){return this.aliasToTopic.get(u)}getAliasByTopic(u){let t=this.topicToAlias[u];return typeof t<"u"&&this.aliasToTopic.get(t),t}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};o.default=a}),yc=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(o,"__esModule",{value:!0});var s=Tr(),a=l(gc()),u=ar(),t=(r,n)=>{r.log("_handleConnack");let{options:e}=r,i=e.protocolVersion===5?n.reasonCode:n.returnCode;if(clearTimeout(r.connackTimer),delete r.topicAliasSend,n.properties){if(n.properties.topicAliasMaximum){if(n.properties.topicAliasMaximum>65535){r.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}n.properties.topicAliasMaximum>0&&(r.topicAliasSend=new a.default(n.properties.topicAliasMaximum))}n.properties.serverKeepAlive&&e.keepalive&&(e.keepalive=n.properties.serverKeepAlive),n.properties.maximumPacketSize&&(e.properties||(e.properties={}),e.properties.maximumPacketSize=n.properties.maximumPacketSize)}if(i===0)r.reconnecting=!1,r._onConnect(n);else if(i>0){let c=new u.ErrorWithReasonCode(`Connection refused: ${s.ReasonCodes[i]}`,i);r.emit("error",c),r.options.reconnectOnConnackError&&r._cleanUp(!0)}};o.default=t}),mc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=(s,a,u)=>{s.log("handling pubrel packet");let t=typeof u<"u"?u:s.noop,{messageId:r}=a,n={cmd:"pubcomp",messageId:r};s.incomingStore.get(a,(e,i)=>{e?s._sendPacket(n,t):(s.emit("message",i.topic,i.payload,i),s.handleMessage(i,c=>{if(c)return t(c);s.incomingStore.del(i,s.noop),s._sendPacket(n,t)}))})};o.default=l}),bc=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0});var s=l(Xu()),a=l(ec()),u=l(yc()),t=l(Tr()),r=l(mc()),n=(e,i,c)=>{let{options:h}=e;if(h.protocolVersion===5&&h.properties&&h.properties.maximumPacketSize&&h.properties.maximumPacketSize<i.length)return e.emit("error",new Error(`exceeding packets size ${i.cmd}`)),e.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",i),i.cmd){case"publish":(0,s.default)(e,i,c);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing(),(0,t.default)(e,i),c();break;case"pubrel":e.reschedulePing(),(0,r.default)(e,i,c);break;case"connack":(0,u.default)(e,i),c();break;case"auth":e.reschedulePing(),(0,a.default)(e,i),c();break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(!0),c();break;case"disconnect":e.emit("disconnect",i),c();break;default:e.log("_handlePacket :: unknown command"),c();break}};o.default=n}),js=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=class{constructor(){Pe(this,"nextId");this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let s=this.nextId++;return this.nextId===65536&&(this.nextId=1),s}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(s){return!0}deallocate(s){}clear(){}};o.default=l}),vc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=class{constructor(s){Pe(this,"aliasToTopic");Pe(this,"max");Pe(this,"length");this.aliasToTopic={},this.max=s}put(s,a){return a===0||a>this.max?!1:(this.aliasToTopic[a]=s,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(s){return this.aliasToTopic[s]}clear(){this.aliasToTopic={}}};o.default=l}),wc=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(o,"__esModule",{value:!0}),o.TypedEventEmitter=void 0;var s=l((Qt(),tt(Dt))),a=ar(),u=class{};o.TypedEventEmitter=u,(0,a.applyMixin)(u,s.default)}),Pr=we((o,l)=>{de(),ye(),ge();function s(a){"@babel/helpers - typeof";return l.exports=s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},l.exports.__esModule=!0,l.exports.default=l.exports,s(a)}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),_c=we((o,l)=>{de(),ye(),ge();var s=Pr().default;function a(u,t){if(s(u)!="object"||!u)return u;var r=u[Symbol.toPrimitive];if(r!==void 0){var n=r.call(u,t||"default");if(s(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(u)}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Sc=we((o,l)=>{de(),ye(),ge();var s=Pr().default,a=_c();function u(t){var r=a(t,"string");return s(r)=="symbol"?r:r+""}l.exports=u,l.exports.__esModule=!0,l.exports.default=l.exports}),Ec=we((o,l)=>{de(),ye(),ge();var s=Sc();function a(u,t,r){return(t=s(t))in u?Object.defineProperty(u,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):u[t]=r,u}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Ac=we((o,l)=>{de(),ye(),ge();function s(a){if(Array.isArray(a))return a}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),xc=we((o,l)=>{de(),ye(),ge();function s(a,u){var t=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(t!=null){var r,n,e,i,c=[],h=!0,d=!1;try{if(e=(t=t.call(a)).next,u===0){if(Object(t)!==t)return;h=!1}else for(;!(h=(r=e.call(t)).done)&&(c.push(r.value),c.length!==u);h=!0);}catch(y){d=!0,n=y}finally{try{if(!h&&t.return!=null&&(i=t.return(),Object(i)!==i))return}finally{if(d)throw n}}return c}}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Ic=we((o,l)=>{de(),ye(),ge();function s(a,u){(u==null||u>a.length)&&(u=a.length);for(var t=0,r=Array(u);t<u;t++)r[t]=a[t];return r}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),kc=we((o,l)=>{de(),ye(),ge();var s=Ic();function a(u,t){if(u){if(typeof u=="string")return s(u,t);var r={}.toString.call(u).slice(8,-1);return r==="Object"&&u.constructor&&(r=u.constructor.name),r==="Map"||r==="Set"?Array.from(u):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(u,t):void 0}}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Oc=we((o,l)=>{de(),ye(),ge();function s(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
32
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Tc=we((o,l)=>{de(),ye(),ge();var s=Ac(),a=xc(),u=kc(),t=Oc();function r(n,e){return s(n)||a(n,e)||u(n,e)||t()}l.exports=r,l.exports.__esModule=!0,l.exports.default=l.exports}),Rs=we((o,l)=>{de(),ye(),ge(),function(s,a){typeof o=="object"&&typeof l<"u"?a(o):typeof define=="function"&&define.amd?define(["exports"],a):(s=typeof globalThis<"u"?globalThis:s||self,a(s.fastUniqueNumbers={}))}(o,function(s){var a=function(y){return function(b){var w=y(b);return b.add(w),w}},u=function(y){return function(b,w){return y.set(b,w),w}},t=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,r=536870912,n=r*2,e=function(y,b){return function(w){var S=b.get(w),A=S===void 0?w.size:S<n?S+1:0;if(!w.has(A))return y(w,A);if(w.size<r){for(;w.has(A);)A=Math.floor(Math.random()*n);return y(w,A)}if(w.size>t)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;w.has(A);)A=Math.floor(Math.random()*t);return y(w,A)}},i=new WeakMap,c=u(i),h=e(c,i),d=a(h);s.addUniqueNumber=d,s.generateUniqueNumber=h})}),Pc=we((o,l)=>{de(),ye(),ge();function s(u,t,r,n,e,i,c){try{var h=u[i](c),d=h.value}catch(y){return void r(y)}h.done?t(d):Promise.resolve(d).then(n,e)}function a(u){return function(){var t=this,r=arguments;return new Promise(function(n,e){var i=u.apply(t,r);function c(d){s(i,n,e,c,h,"next",d)}function h(d){s(i,n,e,c,h,"throw",d)}c(void 0)})}}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Ms=we((o,l)=>{de(),ye(),ge();function s(a,u){this.v=a,this.k=u}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Ns=we((o,l)=>{de(),ye(),ge();function s(a,u,t,r){var n=Object.defineProperty;try{n({},"",{})}catch{n=0}l.exports=s=function(e,i,c,h){function d(y,b){s(e,y,function(w){return this._invoke(y,b,w)})}i?n?n(e,i,{value:c,enumerable:!h,configurable:!h,writable:!h}):e[i]=c:(d("next",0),d("throw",1),d("return",2))},l.exports.__esModule=!0,l.exports.default=l.exports,s(a,u,t,r)}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Bs=we((o,l)=>{de(),ye(),ge();var s=Ns();function a(){var u,t,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",e=r.toStringTag||"@@toStringTag";function i(A,g,_,E){var v=g&&g.prototype instanceof h?g:h,C=Object.create(v.prototype);return s(C,"_invoke",function(T,x,P){var O,F,I,W=0,V=P||[],L=!1,le={p:0,n:0,v:u,a:re,f:re.bind(u,4),d:function(ee,ue){return O=ee,F=0,I=u,le.n=ue,c}};function re(ee,ue){for(F=ee,I=ue,t=0;!L&&W&&!G&&t<V.length;t++){var G,oe=V[t],R=le.p,Q=oe[2];ee>3?(G=Q===ue)&&(I=oe[(F=oe[4])?5:(F=3,3)],oe[4]=oe[5]=u):oe[0]<=R&&((G=ee<2&&R<oe[1])?(F=0,le.v=ue,le.n=oe[1]):R<Q&&(G=ee<3||oe[0]>ue||ue>Q)&&(oe[4]=ee,oe[5]=ue,le.n=Q,F=0))}if(G||ee>1)return c;throw L=!0,ue}return function(ee,ue,G){if(W>1)throw TypeError("Generator is already running");for(L&&ue===1&&re(ue,G),F=ue,I=G;(t=F<2?u:I)||!L;){O||(F?F<3?(F>1&&(le.n=-1),re(F,I)):le.n=I:le.v=I);try{if(W=2,O){if(F||(ee="next"),t=O[ee]){if(!(t=t.call(O,I)))throw TypeError("iterator result is not an object");if(!t.done)return t;I=t.value,F<2&&(F=0)}else F===1&&(t=O.return)&&t.call(O),F<2&&(I=TypeError("The iterator does not provide a '"+ee+"' method"),F=1);O=u}else if((t=(L=le.n<0)?I:T.call(x,le))!==c)break}catch(oe){O=u,F=1,I=oe}finally{W=1}}return{value:t,done:L}}}(A,_,E),!0),C}var c={};function h(){}function d(){}function y(){}t=Object.getPrototypeOf;var b=[][n]?t(t([][n]())):(s(t={},n,function(){return this}),t),w=y.prototype=h.prototype=Object.create(b);function S(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,y):(A.__proto__=y,s(A,e,"GeneratorFunction")),A.prototype=Object.create(w),A}return d.prototype=y,s(w,"constructor",y),s(y,"constructor",d),d.displayName="GeneratorFunction",s(y,e,"GeneratorFunction"),s(w),s(w,e,"Generator"),s(w,n,function(){return this}),s(w,"toString",function(){return"[object Generator]"}),(l.exports=a=function(){return{w:i,m:S}},l.exports.__esModule=!0,l.exports.default=l.exports)()}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Ls=we((o,l)=>{de(),ye(),ge();var s=Ms(),a=Ns();function u(t,r){function n(i,c,h,d){try{var y=t[i](c),b=y.value;return b instanceof s?r.resolve(b.v).then(function(w){n("next",w,h,d)},function(w){n("throw",w,h,d)}):r.resolve(b).then(function(w){y.value=w,h(y)},function(w){return n("throw",w,h,d)})}catch(w){d(w)}}var e;this.next||(a(u.prototype),a(u.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),a(this,"_invoke",function(i,c,h){function d(){return new r(function(y,b){n(i,h,y,b)})}return e=e?e.then(d,d):d()},!0)}l.exports=u,l.exports.__esModule=!0,l.exports.default=l.exports}),Us=we((o,l)=>{de(),ye(),ge();var s=Bs(),a=Ls();function u(t,r,n,e,i){return new a(s().w(t,r,n,e),i||Promise)}l.exports=u,l.exports.__esModule=!0,l.exports.default=l.exports}),Cc=we((o,l)=>{de(),ye(),ge();var s=Us();function a(u,t,r,n,e){var i=s(u,t,r,n,e);return i.next().then(function(c){return c.done?c.value:i.next()})}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),jc=we((o,l)=>{de(),ye(),ge();function s(a){var u=Object(a),t=[];for(var r in u)t.unshift(r);return function n(){for(;t.length;)if((r=t.pop())in u)return n.value=r,n.done=!1,n;return n.done=!0,n}}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Rc=we((o,l)=>{de(),ye(),ge();var s=Pr().default;function a(u){if(u!=null){var t=u[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(u);if(typeof u.next=="function")return u;if(!isNaN(u.length))return{next:function(){return u&&r>=u.length&&(u=void 0),{value:u&&u[r++],done:!u}}}}throw new TypeError(s(u)+" is not iterable")}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Mc=we((o,l)=>{de(),ye(),ge();var s=Ms(),a=Bs(),u=Cc(),t=Us(),r=Ls(),n=jc(),e=Rc();function i(){var c=a(),h=c.m(i),d=(Object.getPrototypeOf?Object.getPrototypeOf(h):h.__proto__).constructor;function y(S){var A=typeof S=="function"&&S.constructor;return!!A&&(A===d||(A.displayName||A.name)==="GeneratorFunction")}var b={throw:1,return:2,break:3,continue:3};function w(S){var A,g;return function(_){A||(A={stop:function(){return g(_.a,2)},catch:function(){return _.v},abrupt:function(E,v){return g(_.a,b[E],v)},delegateYield:function(E,v,C){return A.resultName=v,g(_.d,e(E),C)},finish:function(E){return g(_.f,E)}},g=function(E,v,C){_.p=A.prev,_.n=A.next;try{return E(v,C)}finally{A.next=_.n}}),A.resultName&&(A[A.resultName]=_.v,A.resultName=void 0),A.sent=_.v,A.next=_.n;try{return S.call(this,A)}finally{_.p=A.prev,_.n=A.next}}}return(l.exports=i=function(){return{wrap:function(S,A,g,_){return c.w(w(S),A,g,_&&_.reverse())},isGeneratorFunction:y,mark:c.m,awrap:function(S,A){return new s(S,A)},AsyncIterator:r,async:function(S,A,g,_,E){return(y(A)?t:u)(w(S),A,g,_,E)},keys:n,values:e}},l.exports.__esModule=!0,l.exports.default=l.exports)()}l.exports=i,l.exports.__esModule=!0,l.exports.default=l.exports}),Nc=we((o,l)=>{de(),ye(),ge();var s=Mc()();l.exports=s;try{regeneratorRuntime=s}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}}),Bc=we((o,l)=>{de(),ye(),ge(),function(s,a){typeof o=="object"&&typeof l<"u"?a(o,Ec(),Tc(),Rs(),Pc(),Nc()):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"],a):(s=typeof globalThis<"u"?globalThis:s||self,a(s.brokerFactory={},s._defineProperty,s._slicedToArray,s.fastUniqueNumbers,s._asyncToGenerator,s._regeneratorRuntime))}(o,function(s,a,u,t,r,n){var e=function(g){return typeof g.start=="function"},i=new WeakMap;function c(g,_){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(g);_&&(v=v.filter(function(C){return Object.getOwnPropertyDescriptor(g,C).enumerable})),E.push.apply(E,v)}return E}function h(g){for(var _=1;_<arguments.length;_++){var E=arguments[_]!=null?arguments[_]:{};_%2?c(Object(E),!0).forEach(function(v){a(g,v,E[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):c(Object(E)).forEach(function(v){Object.defineProperty(g,v,Object.getOwnPropertyDescriptor(E,v))})}return g}var d=function(g){return h(h({},g),{},{connect:function(_){var E=_.call;return r(n.mark(function v(){var C,T,x,P;return n.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return C=new MessageChannel,T=C.port1,x=C.port2,O.next=1,E("connect",{port:T},[T]);case 1:return P=O.sent,i.set(x,P),O.abrupt("return",x);case 2:case"end":return O.stop()}},v)}))},disconnect:function(_){var E=_.call;return function(){var v=r(n.mark(function C(T){var x;return n.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(x=i.get(T),x!==void 0){P.next=1;break}throw new Error("The given port is not connected.");case 1:return P.next=2,E("disconnect",{portId:x});case 2:case"end":return P.stop()}},C)}));return function(C){return v.apply(this,arguments)}}()},isSupported:function(_){var E=_.call;return function(){return E("isSupported")}}})};function y(g,_){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(g);_&&(v=v.filter(function(C){return Object.getOwnPropertyDescriptor(g,C).enumerable})),E.push.apply(E,v)}return E}function b(g){for(var _=1;_<arguments.length;_++){var E=arguments[_]!=null?arguments[_]:{};_%2?y(Object(E),!0).forEach(function(v){a(g,v,E[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):y(Object(E)).forEach(function(v){Object.defineProperty(g,v,Object.getOwnPropertyDescriptor(E,v))})}return g}var w=new WeakMap,S=function(g){if(w.has(g))return w.get(g);var _=new Map;return w.set(g,_),_},A=function(g){var _=d(g);return function(E){var v=S(E);E.addEventListener("message",function(V){var L=V.data,le=L.id;if(le!==null&&v.has(le)){var re=v.get(le),ee=re.reject,ue=re.resolve;v.delete(le),L.error===void 0?ue(L.result):ee(new Error(L.error.message))}}),e(E)&&E.start();for(var C=function(V){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new Promise(function(re,ee){var ue=t.generateUniqueNumber(v);v.set(ue,{reject:ee,resolve:re}),L===null?E.postMessage({id:ue,method:V},le):E.postMessage({id:ue,method:V,params:L},le)})},T=function(V,L){var le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];E.postMessage({id:null,method:V,params:L},le)},x={},P=0,O=Object.entries(_);P<O.length;P++){var F=u(O[P],2),I=F[0],W=F[1];x=b(b({},x),{},a({},I,W({call:C,notify:T})))}return b({},x)}};s.createBroker=A})}),Lc=we((o,l)=>{de(),ye(),ge(),function(s,a){typeof o=="object"&&typeof l<"u"?a(o,Pr(),Bc(),Rs()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/typeof","broker-factory","fast-unique-numbers"],a):(s=typeof globalThis<"u"?globalThis:s||self,a(s.workerTimersBroker={},s._typeof,s.brokerFactory,s.fastUniqueNumbers))}(o,function(s,a,u,t){var r=new Map([[0,null]]),n=new Map([[0,null]]),e=u.createBroker({clearInterval:function(c){var h=c.call;return function(d){a(r.get(d))==="symbol"&&(r.set(d,null),h("clear",{timerId:d,timerType:"interval"}).then(function(){r.delete(d)}))}},clearTimeout:function(c){var h=c.call;return function(d){a(n.get(d))==="symbol"&&(n.set(d,null),h("clear",{timerId:d,timerType:"timeout"}).then(function(){n.delete(d)}))}},setInterval:function(c){var h=c.call;return function(d){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,b=arguments.length,w=new Array(b>2?b-2:0),S=2;S<b;S++)w[S-2]=arguments[S];var A=Symbol(),g=t.generateUniqueNumber(r);r.set(g,A);var _=function(){return h("set",{delay:y,now:performance.timeOrigin+performance.now(),timerId:g,timerType:"interval"}).then(function(){var E=r.get(g);if(E===void 0)throw new Error("The timer is in an undefined state.");E===A&&(d.apply(void 0,w),r.get(g)===A&&_())})};return _(),g}},setTimeout:function(c){var h=c.call;return function(d){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,b=arguments.length,w=new Array(b>2?b-2:0),S=2;S<b;S++)w[S-2]=arguments[S];var A=Symbol(),g=t.generateUniqueNumber(n);return n.set(g,A),h("set",{delay:y,now:performance.timeOrigin+performance.now(),timerId:g,timerType:"timeout"}).then(function(){var _=n.get(g);if(_===void 0)throw new Error("The timer is in an undefined state.");_===A&&(n.delete(g),d.apply(void 0,w))}),g}}}),i=function(c){var h=new Worker(c);return e(h)};s.load=i,s.wrap=e})}),Uc=we((o,l)=>{de(),ye(),ge(),function(s,a){typeof o=="object"&&typeof l<"u"?a(o,Lc()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],a):(s=typeof globalThis<"u"?globalThis:s||self,a(s.workerTimers={},s.workerTimersBroker))}(o,function(s,a){var u=function(h,d){var y=null;return function(){if(y!==null)return y;var b=new Blob([d],{type:"application/javascript; charset=utf-8"}),w=URL.createObjectURL(b);return y=h(w),setTimeout(function(){return URL.revokeObjectURL(w)}),y}},t=`(()=>{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)})()})();`,r=u(a.load,t),n=function(h){return r().clearInterval(h)},e=function(h){return r().clearTimeout(h)},i=function(){var h;return(h=r()).setInterval.apply(h,arguments)},c=function(){var h;return(h=r()).setTimeout.apply(h,arguments)};s.clearInterval=n,s.clearTimeout=e,s.setInterval=i,s.setTimeout=c})}),Cr=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.isReactNativeBrowser=o.isWebWorker=void 0;var l=()=>{var t;return typeof window<"u"?typeof navigator<"u"&&((t=navigator.userAgent)==null?void 0:t.toLowerCase().indexOf(" electron/"))>-1&&(Je!=null&&Je.versions)?!Object.prototype.hasOwnProperty.call(Je.versions,"electron"):typeof window.document<"u":!1},s=()=>{var t,r;return!!(typeof self=="object"&&((r=(t=self==null?void 0:self.constructor)==null?void 0:t.name)!=null&&r.includes("WorkerGlobalScope"))&&typeof Deno>"u")},a=()=>typeof navigator<"u"&&navigator.product==="ReactNative",u=l()||s()||a();o.isWebWorker=s(),o.isReactNativeBrowser=a(),o.default=u}),Dc=we(o=>{de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(i,c,h,d){d===void 0&&(d=h);var y=Object.getOwnPropertyDescriptor(c,h);(!y||("get"in y?!c.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return c[h]}}),Object.defineProperty(i,d,y)}:function(i,c,h,d){d===void 0&&(d=h),i[d]=c[h]}),s=o&&o.__setModuleDefault||(Object.create?function(i,c){Object.defineProperty(i,"default",{enumerable:!0,value:c})}:function(i,c){i.default=c}),a=o&&o.__importStar||function(){var i=function(c){return i=Object.getOwnPropertyNames||function(h){var d=[];for(var y in h)Object.prototype.hasOwnProperty.call(h,y)&&(d[d.length]=y);return d},i(c)};return function(c){if(c&&c.__esModule)return c;var h={};if(c!=null)for(var d=i(c),y=0;y<d.length;y++)d[y]!=="default"&&l(h,c,d[y]);return s(h,c),h}}();Object.defineProperty(o,"__esModule",{value:!0});var u=Uc(),t=a(Cr()),r={set:u.setInterval,clear:u.clearInterval},n={set:(i,c)=>setInterval(i,c),clear:i=>clearInterval(i)},e=i=>{switch(i){case"native":return n;case"worker":return r;case"auto":default:return t.default&&!t.isWebWorker&&!t.isReactNativeBrowser?r:n}};o.default=e}),Ds=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(o,"__esModule",{value:!0});var s=l(Dc()),a=class{constructor(u,t){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=u,this.timer=typeof t=="object"&&"set"in t&&"clear"in t?t:(0,s.default)(t),this.setKeepalive(u.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(u){if(u*=1e3,isNaN(u)||u<=0||u>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${u}`);this._keepalive=u,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${u}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let u=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+u,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)}};o.default=a}),Ci=we(o=>{var v;de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(C,T,x,P){P===void 0&&(P=x);var O=Object.getOwnPropertyDescriptor(T,x);(!O||("get"in O?!T.__esModule:O.writable||O.configurable))&&(O={enumerable:!0,get:function(){return T[x]}}),Object.defineProperty(C,P,O)}:function(C,T,x,P){P===void 0&&(P=x),C[P]=T[x]}),s=o&&o.__setModuleDefault||(Object.create?function(C,T){Object.defineProperty(C,"default",{enumerable:!0,value:T})}:function(C,T){C.default=T}),a=o&&o.__importStar||function(){var C=function(T){return C=Object.getOwnPropertyNames||function(x){var P=[];for(var O in x)Object.prototype.hasOwnProperty.call(x,O)&&(P[P.length]=O);return P},C(T)};return function(T){if(T&&T.__esModule)return T;var x={};if(T!=null)for(var P=C(T),O=0;O<P.length;O++)P[O]!=="default"&&l(x,T,P[O]);return s(x,T),x}}(),u=o&&o.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(o,"__esModule",{value:!0});var t=u(Gu()),r=Xt(),n=u(Qu()),e=u(Mt()),i=a(Ju()),c=u(xs()),h=u(bc()),d=u(js()),y=u(vc()),b=ar(),w=wc(),S=u(Ds()),A=a(Cr()),g=globalThis.setImmediate||((...C)=>{let T=C.shift();(0,b.nextTick)(()=>{T(...C)})}),_={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},E=(v=class extends w.TypedEventEmitter{constructor(x,P){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=P||{};for(let O in _)typeof this.options[O]>"u"?this.options[O]=_[O]:this.options[O]=P[O];this.log=this.options.log||(0,e.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",v.VERSION),A.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",A.default?"browser":"node"),this.log("MqttClient :: options.protocol",P.protocol),this.log("MqttClient :: options.protocolVersion",P.protocolVersion),this.log("MqttClient :: options.username",P.username),this.log("MqttClient :: options.keepalive",P.keepalive),this.log("MqttClient :: options.reconnectPeriod",P.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",P.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",P.properties?P.properties.topicAliasMaximum:void 0),this.options.clientId=typeof P.clientId=="string"?P.clientId:v.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=P.protocolVersion===5&&P.customHandleAcks?P.customHandleAcks:(...O)=>{O[3](null,0)},this.options.writeCache||(t.default.writeToStream.cacheNumbers=!1),this.streamBuilder=x,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new d.default:this.options.messageIdProvider,this.outgoingStore=P.outgoingStore||new c.default,this.incomingStore=P.incomingStore||new c.default,this.queueQoSZero=P.queueQoSZero===void 0?!0:P.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,P.properties&&P.properties.topicAliasMaximum>0&&(P.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new y.default(P.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:O}=this,F=()=>{let I=O.shift();this.log("deliver :: entry %o",I);let W=null;if(!I){this._resubscribe();return}W=I.packet,this.log("deliver :: call _sendPacket for %o",W);let V=!0;W.messageId&&W.messageId!==0&&(this.messageIdProvider.register(W.messageId)||(V=!1)),V?this._sendPacket(W,L=>{I.cb&&I.cb(L),F()}):(this.log("messageId: %d has already used. The message is skipped and removed.",W.messageId),F())};this.log("connect :: sending queued packets"),F()}),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(x,P){P()}handleMessage(x,P){P()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var le;let x=new r.Writable,P=t.default.parser(this.options),O=null,F=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new c.default,this.outgoingStore=this.options.outgoingStore||new c.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),P.on("packet",re=>{this.log("parser :: on packet push to packets array."),F.push(re)});let I=()=>{this.log("work :: getting next packet in queue");let re=F.shift();if(re)this.log("work :: packet pulled from queue"),(0,h.default)(this,re,W);else{this.log("work :: no packets in queue");let ee=O;O=null,this.log("work :: done flag is %s",!!ee),ee&&ee()}},W=()=>{if(F.length)(0,b.nextTick)(I);else{let re=O;O=null,re()}};x._write=(re,ee,ue)=>{O=ue,this.log("writable stream :: parsing buffer"),P.parse(re),I()};let V=re=>{this.log("streamErrorHandler :: error",re.message),re.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",re)):this.noop(re)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(x),this.stream.on("error",V),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 L={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&&(L.will={...this.options.will,payload:(le=this.options.will)==null?void 0:le.payload}),this.topicAliasRecv&&(L.properties||(L.properties={}),this.topicAliasRecv&&(L.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(L),P.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 re={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(re)}}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(x,P,O,F){this.log("publish :: message `%s` to topic `%s`",P,x);let{options:I}=this;typeof O=="function"&&(F=O,O=null),O=O||{},O={qos:0,retain:!1,dup:!1,...O};let{qos:W,retain:V,dup:L,properties:le,cbStorePut:re}=O;if(this._checkDisconnecting(F))return this;let ee=()=>{let ue=0;if((W===1||W===2)&&(ue=this._nextId(),ue===null))return this.log("No messageId left"),!1;let G={cmd:"publish",topic:x,payload:P,qos:W,retain:V,messageId:ue,dup:L};switch(I.protocolVersion===5&&(G.properties=le),this.log("publish :: qos",W),W){case 1:case 2:this.outgoing[G.messageId]={volatile:!1,cb:F||this.noop},this.log("MqttClient:publish: packet cmd: %s",G.cmd),this._sendPacket(G,void 0,re);break;default:this.log("MqttClient:publish: packet cmd: %s",G.cmd),this._sendPacket(G,F,re);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ee())&&this._storeProcessingQueue.push({invoke:ee,cbStorePut:O.cbStorePut,callback:F}),this}publishAsync(x,P,O){return new Promise((F,I)=>{this.publish(x,P,O,(W,V)=>{W?I(W):F(V)})})}subscribe(x,P,O){let F=this.options.protocolVersion;typeof P=="function"&&(O=P),O=O||this.noop;let I=!1,W=[];typeof x=="string"?(x=[x],W=x):Array.isArray(x)?W=x:typeof x=="object"&&(I=x.resubscribe,delete x.resubscribe,W=Object.keys(x));let V=i.validateTopics(W);if(V!==null)return g(O,new Error(`Invalid topic ${V}`)),this;if(this._checkDisconnecting(O))return this.log("subscribe: discconecting true"),this;let L={qos:0};F===5&&(L.nl=!1,L.rap=!1,L.rh=0),P={...L,...P};let{properties:le}=P,re=[],ee=(oe,R)=>{if(R=R||P,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,oe)||this._resubscribeTopics[oe].qos<R.qos||I){let Q={topic:oe,qos:R.qos};F===5&&(Q.nl=R.nl,Q.rap=R.rap,Q.rh=R.rh,Q.properties=le),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",Q.topic,Q.qos),re.push(Q)}};if(Array.isArray(x)?x.forEach(oe=>{this.log("subscribe: array topic %s",oe),ee(oe)}):Object.keys(x).forEach(oe=>{this.log("subscribe: object topic %s, %o",oe,x[oe]),ee(oe,x[oe])}),!re.length)return O(null,[]),this;let ue=(oe,R)=>{let Q={cmd:"subscribe",subscriptions:oe,messageId:R};if(le&&(Q.properties=le),this.options.resubscribe){this.log("subscribe :: resubscribe true");let q=[];oe.forEach(Ee=>{if(this.options.reconnectPeriod>0){let X={qos:Ee.qos};F===5&&(X.nl=Ee.nl||!1,X.rap=Ee.rap||!1,X.rh=Ee.rh||0,X.properties=Ee.properties),this._resubscribeTopics[Ee.topic]=X,q.push(Ee.topic)}}),this.messageIdToTopic[Q.messageId]=q}let he=new Promise((q,Ee)=>{this.outgoing[Q.messageId]={volatile:!0,cb(X,U){if(!X){let{granted:ae}=U;for(let H=0;H<ae.length;H+=1)oe[H].qos=ae[H]}X?Ee(new b.ErrorWithSubackPacket(X.message,U)):q(U)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(Q),he},G=()=>{let oe=this.options.subscribeBatchSize??re.length,R=[];for(let Q=0;Q<re.length;Q+=oe){let he=re.slice(Q,Q+oe),q=this._nextId();if(q===null)return this.log("No messageId left"),!1;R.push(ue(he,q))}return Promise.all(R).then(Q=>{O(null,re,Q.at(-1))}).catch(Q=>{O(Q,re,Q.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!G())&&this._storeProcessingQueue.push({invoke:G,callback:O}),this}subscribeAsync(x,P){return new Promise((O,F)=>{this.subscribe(x,P,(I,W)=>{I?F(I):O(W)})})}unsubscribe(x,P,O){typeof x=="string"&&(x=[x]),typeof P=="function"&&(O=P),O=O||this.noop;let F=i.validateTopics(x);if(F!==null)return g(O,new Error(`Invalid topic ${F}`)),this;if(this._checkDisconnecting(O))return this;let I=()=>{let W=this._nextId();if(W===null)return this.log("No messageId left"),!1;let V={cmd:"unsubscribe",messageId:W,unsubscriptions:[]};return typeof x=="string"?V.unsubscriptions=[x]:Array.isArray(x)&&(V.unsubscriptions=x),this.options.resubscribe&&V.unsubscriptions.forEach(L=>{delete this._resubscribeTopics[L]}),typeof P=="object"&&P.properties&&(V.properties=P.properties),this.outgoing[V.messageId]={volatile:!0,cb:O},this.log("unsubscribe: call _sendPacket"),this._sendPacket(V),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!I())&&this._storeProcessingQueue.push({invoke:I,callback:O}),this}unsubscribeAsync(x,P){return new Promise((O,F)=>{this.unsubscribe(x,P,(I,W)=>{I?F(I):O(W)})})}end(x,P,O){this.log("end :: (%s)",this.options.clientId),(x==null||typeof x!="boolean")&&(O=O||P,P=x,x=!1),typeof P!="object"&&(O=O||P,P=null),this.log("end :: cb? %s",!!O),(!O||typeof O!="function")&&(O=this.noop);let F=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(W=>{this.outgoingStore.close(V=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),O){let L=W||V;this.log("end :: closeStores: invoking callback with args"),O(L)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},I=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,x),this._cleanUp(x,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,b.nextTick)(F)},P)};return this.disconnecting?(O(),this):(this._clearReconnect(),this.disconnecting=!0,!x&&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,I,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),I()),this)}endAsync(x,P){return new Promise((O,F)=>{this.end(x,P,I=>{I?F(I):O()})})}removeOutgoingMessage(x){if(this.outgoing[x]){let{cb:P}=this.outgoing[x];this._removeOutgoingAndStoreMessage(x,()=>{P(new Error("Message removed"))})}return this}reconnect(x){this.log("client reconnect");let P=()=>{x?(this.options.incomingStore=x.incomingStore,this.options.outgoingStore=x.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new c.default,this.outgoingStore=this.options.outgoingStore||new c.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=P:P(),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(x=>{this.outgoing[x].volatile&&typeof this.outgoing[x].cb=="function"&&(this.outgoing[x].cb(new Error("Connection closed")),delete this.outgoing[x])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(x=>{typeof this.outgoing[x].cb=="function"&&(this.outgoing[x].cb(new Error("Connection closed")),delete this.outgoing[x])}))}_removeTopicAliasAndRecoverTopicName(x){let P;x.properties&&(P=x.properties.topicAlias);let O=x.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",P,O),O.length===0){if(typeof P>"u")return new Error("Unregistered Topic Alias");if(O=this.topicAliasSend.getTopicByAlias(P),typeof O>"u")return new Error("Unregistered Topic Alias");x.topic=O}P&&delete x.properties.topicAlias}_checkDisconnecting(x){return this.disconnecting&&(x&&x!==this.noop?x(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(x,P,O={}){if(P&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",P)),this.log("_cleanUp :: forced? %s",x),x)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let F={cmd:"disconnect",...O};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(F,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),g(()=>{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(),P&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",P),P())}_storeAndSend(x,P,O){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",x.cmd);let F=x,I;if(F.cmd==="publish"&&(F=(0,n.default)(x),I=this._removeTopicAliasAndRecoverTopicName(F),I))return P&&P(I);this.outgoingStore.put(F,W=>{if(W)return P&&P(W);O(),this._writePacket(x,P)})}_applyTopicAlias(x){if(this.options.protocolVersion===5&&x.cmd==="publish"){let P;x.properties&&(P=x.properties.topicAlias);let O=x.topic.toString();if(this.topicAliasSend)if(P){if(O.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",O,P),!this.topicAliasSend.put(O,P)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",O,P),new Error("Sending Topic Alias out of range")}else O.length!==0&&(this.options.autoAssignTopicAlias?(P=this.topicAliasSend.getAliasByTopic(O),P?(x.topic="",x.properties={...x.properties,topicAlias:P},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",O,P)):(P=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(O,P),x.properties={...x.properties,topicAlias:P},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",O,P))):this.options.autoUseTopicAlias&&(P=this.topicAliasSend.getAliasByTopic(O),P&&(x.topic="",x.properties={...x.properties,topicAlias:P},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",O,P))));else if(P)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",O,P),new Error("Sending Topic Alias out of range")}}_noop(x){this.log("noop ::",x)}_writePacket(x,P){this.log("_writePacket :: packet: %O",x),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",x),this.log("_writePacket :: writing to stream");let O=t.default.writeToStream(x,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",O),!O&&P&&P!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",P)):P&&(this.log("_writePacket :: invoking cb"),P())}_sendPacket(x,P,O,F){this.log("_sendPacket :: (%s) :: start",this.options.clientId),O=O||this.noop,P=P||this.noop;let I=this._applyTopicAlias(x);if(I){P(I);return}if(!this.connected){if(x.cmd==="auth"){this._writePacket(x,P);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(x,P,O);return}if(F){this._writePacket(x,P);return}switch(x.cmd){case"publish":break;case"pubrel":this._storeAndSend(x,P,O);return;default:this._writePacket(x,P);return}switch(x.qos){case 2:case 1:this._storeAndSend(x,P,O);break;case 0:default:this._writePacket(x,P);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(x,P,O){this.log("_storePacket :: packet: %o",x),this.log("_storePacket :: cb? %s",!!P),O=O||this.noop;let F=x;if(F.cmd==="publish"){F=(0,n.default)(x);let W=this._removeTopicAliasAndRecoverTopicName(F);if(W)return P&&P(W)}let I=F.qos||0;I===0&&this.queueQoSZero||F.cmd!=="publish"?this.queue.push({packet:F,cb:P}):I>0?(P=this.outgoing[F.messageId]?this.outgoing[F.messageId].cb:null,this.outgoingStore.put(F,W=>{if(W)return P&&P(W);O()})):P&&P(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new S.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(x=!1){this.keepaliveManager&&this.options.keepalive&&(x||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 x=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&x.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let P=0;P<x.length;P++){let O={};O[x[P]]=this._resubscribeTopics[x[P]],O.resubscribe=!0,this.subscribe(O,{properties:O[x[P]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(x){if(this.disconnected){this.emit("connect",x);return}this.connackPacket=x,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let P=()=>{let O=this.outgoingStore.createStream(),F=()=>{O.destroy(),O=null,this._flushStoreProcessingQueue(),I()},I=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",F),O.on("error",V=>{I(),this._flushStoreProcessingQueue(),this.removeListener("close",F),this.emit("error",V)});let W=()=>{if(!O)return;let V=O.read(1),L;if(!V){O.once("readable",W);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[V.messageId]){W();return}!this.disconnecting&&!this.reconnectTimer?(L=this.outgoing[V.messageId]?this.outgoing[V.messageId].cb:null,this.outgoing[V.messageId]={volatile:!1,cb(le,re){L&&L(le,re),W()}},this._packetIdsDuringStoreProcessing[V.messageId]=!0,this.messageIdProvider.register(V.messageId)?this._sendPacket(V,void 0,void 0,!0):this.log("messageId: %d has already used.",V.messageId)):O.destroy&&O.destroy()};O.on("end",()=>{let V=!0;for(let L in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[L]){V=!1;break}this.removeListener("close",F),V?(I(),this._invokeAllStoreProcessingQueue(),this.emit("connect",x)):P()}),W()};P()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let x=this._storeProcessingQueue[0];if(x&&x.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let x of this._storeProcessingQueue)x.cbStorePut&&x.cbStorePut(new Error("Connection closed")),x.callback&&x.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(x,P){delete this.outgoing[x],this.outgoingStore.del({messageId:x},(O,F)=>{P(O,F),this.messageIdProvider.deallocate(x),this._invokeStoreProcessingQueue()})}},Pe(v,"VERSION",b.MQTTJS_VERSION),v);o.default=E}),Fc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=Cs(),s=class{constructor(){Pe(this,"numberAllocator");Pe(this,"lastId");this.numberAllocator=new l.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(a){return this.numberAllocator.use(a)}deallocate(a){this.numberAllocator.free(a)}clear(){this.numberAllocator.clear()}};o.default=s});function Wc(){if(ji)return jr;ji=!0;let o=2147483647,l=36,s=1,a=26,u=38,t=700,r=72,n=128,e="-",i=/^xn--/,c=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=l-s,b=Math.floor,w=String.fromCharCode;function S(O){throw new RangeError(d[O])}function A(O,F){let I=[],W=O.length;for(;W--;)I[W]=F(O[W]);return I}function g(O,F){let I=O.split("@"),W="";I.length>1&&(W=I[0]+"@",O=I[1]),O=O.replace(h,".");let V=O.split("."),L=A(V,F).join(".");return W+L}function _(O){let F=[],I=0,W=O.length;for(;I<W;){let V=O.charCodeAt(I++);if(V>=55296&&V<=56319&&I<W){let L=O.charCodeAt(I++);(L&64512)==56320?F.push(((V&1023)<<10)+(L&1023)+65536):(F.push(V),I--)}else F.push(V)}return F}let E=O=>String.fromCodePoint(...O),v=function(O){return O>=48&&O<58?26+(O-48):O>=65&&O<91?O-65:O>=97&&O<123?O-97:l},C=function(O,F){return O+22+75*(O<26)-((F!=0)<<5)},T=function(O,F,I){let W=0;for(O=I?b(O/t):O>>1,O+=b(O/F);O>y*a>>1;W+=l)O=b(O/y);return b(W+(y+1)*O/(O+u))},x=function(O){let F=[],I=O.length,W=0,V=n,L=r,le=O.lastIndexOf(e);le<0&&(le=0);for(let re=0;re<le;++re)O.charCodeAt(re)>=128&&S("not-basic"),F.push(O.charCodeAt(re));for(let re=le>0?le+1:0;re<I;){let ee=W;for(let G=1,oe=l;;oe+=l){re>=I&&S("invalid-input");let R=v(O.charCodeAt(re++));R>=l&&S("invalid-input"),R>b((o-W)/G)&&S("overflow"),W+=R*G;let Q=oe<=L?s:oe>=L+a?a:oe-L;if(R<Q)break;let he=l-Q;G>b(o/he)&&S("overflow"),G*=he}let ue=F.length+1;L=T(W-ee,ue,ee==0),b(W/ue)>o-V&&S("overflow"),V+=b(W/ue),W%=ue,F.splice(W++,0,V)}return String.fromCodePoint(...F)},P=function(O){let F=[];O=_(O);let I=O.length,W=n,V=0,L=r;for(let ee of O)ee<128&&F.push(w(ee));let le=F.length,re=le;for(le&&F.push(e);re<I;){let ee=o;for(let G of O)G>=W&&G<ee&&(ee=G);let ue=re+1;ee-W>b((o-V)/ue)&&S("overflow"),V+=(ee-W)*ue,W=ee;for(let G of O)if(G<W&&++V>o&&S("overflow"),G===W){let oe=V;for(let R=l;;R+=l){let Q=R<=L?s:R>=L+a?a:R-L;if(oe<Q)break;let he=oe-Q,q=l-Q;F.push(w(C(Q+he%q,0))),oe=b(he/q)}F.push(w(C(oe,0))),L=T(V,ue,re===le),V=0,++re}++V,++W}return F.join("")};return jr={version:"2.3.1",ucs2:{decode:_,encode:E},decode:x,encode:P,toASCII:function(O){return g(O,function(F){return c.test(F)?"xn--"+P(F):F})},toUnicode:function(O){return g(O,function(F){return i.test(F)?x(F.slice(4).toLowerCase()):F})}},jr}var jr,ji,Wt,$c=_t(()=>{de(),ye(),ge(),jr={},ji=!1,Wt=Wc(),Wt.decode,Wt.encode,Wt.toASCII,Wt.toUnicode,Wt.ucs2,Wt.version});function qc(){return Bi||(Bi=!0,Ni=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var o={},l=Symbol("test"),s=Object(l);if(typeof l=="string"||Object.prototype.toString.call(l)!=="[object Symbol]"||Object.prototype.toString.call(s)!=="[object Symbol]")return!1;var a=42;o[l]=a;for(l in o)return!1;if(typeof Object.keys=="function"&&Object.keys(o).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(o).length!==0)return!1;var u=Object.getOwnPropertySymbols(o);if(u.length!==1||u[0]!==l||!Object.prototype.propertyIsEnumerable.call(o,l))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var t=Object.getOwnPropertyDescriptor(o,l);if(t.value!==a||t.enumerable!==!0)return!1}return!0}),Ni}function Vc(){return Ui||(Ui=!0,Li=Error),Li}function zc(){return Fi||(Fi=!0,Di=EvalError),Di}function Kc(){return $i||($i=!0,Wi=RangeError),Wi}function Hc(){return Vi||(Vi=!0,qi=ReferenceError),qi}function Fs(){return Ki||(Ki=!0,zi=SyntaxError),zi}function vr(){return Gi||(Gi=!0,Hi=TypeError),Hi}function Gc(){return Qi||(Qi=!0,Yi=URIError),Yi}function Yc(){if(Ji)return Rr;Ji=!0;var o=typeof Symbol<"u"&&Symbol,l=qc();return Rr=function(){return typeof o!="function"||typeof Symbol!="function"||typeof o("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:l()},Rr}function Qc(){if(Xi)return Mr;Xi=!0;var o={__proto__:null,foo:{}},l=Object;return Mr=function(){return{__proto__:o}.foo===o.foo&&!(o instanceof l)},Mr}function Jc(){if(Zi)return Nr;Zi=!0;var o="Function.prototype.bind called on incompatible ",l=Object.prototype.toString,s=Math.max,a="[object Function]",u=function(n,e){for(var i=[],c=0;c<n.length;c+=1)i[c]=n[c];for(var h=0;h<e.length;h+=1)i[h+n.length]=e[h];return i},t=function(n,e){for(var i=[],c=e,h=0;c<n.length;c+=1,h+=1)i[h]=n[c];return i},r=function(n,e){for(var i="",c=0;c<n.length;c+=1)i+=n[c],c+1<n.length&&(i+=e);return i};return Nr=function(n){var e=this;if(typeof e!="function"||l.apply(e)!==a)throw new TypeError(o+e);for(var i=t(arguments,1),c,h=function(){if(this instanceof c){var S=e.apply(this,u(i,arguments));return Object(S)===S?S:this}return e.apply(n,u(i,arguments))},d=s(0,e.length-i.length),y=[],b=0;b<d;b++)y[b]="$"+b;if(c=Function("binder","return function ("+r(y,",")+"){ return binder.apply(this,arguments); }")(h),e.prototype){var w=function(){};w.prototype=e.prototype,c.prototype=new w,w.prototype=null}return c},Nr}function Ri(){if(eo)return Br;eo=!0;var o=Jc();return Br=Function.prototype.bind||o,Br}function Xc(){if(to)return Lr;to=!0;var o=Function.prototype.call,l=Object.prototype.hasOwnProperty,s=Ri();return Lr=s.call(o,l),Lr}function lr(){if(ro)return Ur;ro=!0;var o,l=Vc(),s=zc(),a=Kc(),u=Hc(),t=Fs(),r=vr(),n=Gc(),e=Function,i=function(re){try{return e('"use strict"; return ('+re+").constructor;")()}catch{}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch{c=null}var h=function(){throw new r},d=c?function(){try{return arguments.callee,h}catch{try{return c(arguments,"callee").get}catch{return h}}}():h,y=Yc()(),b=Qc()(),w=Object.getPrototypeOf||(b?function(re){return re.__proto__}:null),S={},A=typeof Uint8Array>"u"||!w?o:w(Uint8Array),g={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?o:ArrayBuffer,"%ArrayIteratorPrototype%":y&&w?w([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":S,"%AsyncGenerator%":S,"%AsyncGeneratorFunction%":S,"%AsyncIteratorPrototype%":S,"%Atomics%":typeof Atomics>"u"?o:Atomics,"%BigInt%":typeof BigInt>"u"?o:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?o:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?o:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":l,"%eval%":eval,"%EvalError%":s,"%Float32Array%":typeof Float32Array>"u"?o:Float32Array,"%Float64Array%":typeof Float64Array>"u"?o:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?o:FinalizationRegistry,"%Function%":e,"%GeneratorFunction%":S,"%Int8Array%":typeof Int8Array>"u"?o:Int8Array,"%Int16Array%":typeof Int16Array>"u"?o:Int16Array,"%Int32Array%":typeof Int32Array>"u"?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":y&&w?w(w([][Symbol.iterator]())):o,"%JSON%":typeof JSON=="object"?JSON:o,"%Map%":typeof Map>"u"?o:Map,"%MapIteratorPrototype%":typeof Map>"u"||!y||!w?o:w(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?o:Promise,"%Proxy%":typeof Proxy>"u"?o:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":typeof Reflect>"u"?o:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?o:Set,"%SetIteratorPrototype%":typeof Set>"u"||!y||!w?o:w(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&w?w(""[Symbol.iterator]()):o,"%Symbol%":y?Symbol:o,"%SyntaxError%":t,"%ThrowTypeError%":d,"%TypedArray%":A,"%TypeError%":r,"%Uint8Array%":typeof Uint8Array>"u"?o:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?o:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?o:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?o:Uint32Array,"%URIError%":n,"%WeakMap%":typeof WeakMap>"u"?o:WeakMap,"%WeakRef%":typeof WeakRef>"u"?o:WeakRef,"%WeakSet%":typeof WeakSet>"u"?o:WeakSet};if(w)try{null.error}catch(re){var _=w(w(re));g["%Error.prototype%"]=_}var E=function re(ee){var ue;if(ee==="%AsyncFunction%")ue=i("async function () {}");else if(ee==="%GeneratorFunction%")ue=i("function* () {}");else if(ee==="%AsyncGeneratorFunction%")ue=i("async function* () {}");else if(ee==="%AsyncGenerator%"){var G=re("%AsyncGeneratorFunction%");G&&(ue=G.prototype)}else if(ee==="%AsyncIteratorPrototype%"){var oe=re("%AsyncGenerator%");oe&&w&&(ue=w(oe.prototype))}return g[ee]=ue,ue},v={__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"]},C=Ri(),T=Xc(),x=C.call(Function.call,Array.prototype.concat),P=C.call(Function.apply,Array.prototype.splice),O=C.call(Function.call,String.prototype.replace),F=C.call(Function.call,String.prototype.slice),I=C.call(Function.call,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V=/\\(\\)?/g,L=function(re){var ee=F(re,0,1),ue=F(re,-1);if(ee==="%"&&ue!=="%")throw new t("invalid intrinsic syntax, expected closing `%`");if(ue==="%"&&ee!=="%")throw new t("invalid intrinsic syntax, expected opening `%`");var G=[];return O(re,W,function(oe,R,Q,he){G[G.length]=Q?O(he,V,"$1"):R||oe}),G},le=function(re,ee){var ue=re,G;if(T(v,ue)&&(G=v[ue],ue="%"+G[0]+"%"),T(g,ue)){var oe=g[ue];if(oe===S&&(oe=E(ue)),typeof oe>"u"&&!ee)throw new r("intrinsic "+re+" exists, but is not available. Please file an issue!");return{alias:G,name:ue,value:oe}}throw new t("intrinsic "+re+" does not exist!")};return Ur=function(re,ee){if(typeof re!="string"||re.length===0)throw new r("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ee!="boolean")throw new r('"allowMissing" argument must be a boolean');if(I(/^%?[^%]*%?$/,re)===null)throw new t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ue=L(re),G=ue.length>0?ue[0]:"",oe=le("%"+G+"%",ee),R=oe.name,Q=oe.value,he=!1,q=oe.alias;q&&(G=q[0],P(ue,x([0,1],q)));for(var Ee=1,X=!0;Ee<ue.length;Ee+=1){var U=ue[Ee],ae=F(U,0,1),H=F(U,-1);if((ae==='"'||ae==="'"||ae==="`"||H==='"'||H==="'"||H==="`")&&ae!==H)throw new t("property names with quotes must have matching quotes");if((U==="constructor"||!X)&&(he=!0),G+="."+U,R="%"+G+"%",T(g,R))Q=g[R];else if(Q!=null){if(!(U in Q)){if(!ee)throw new r("base intrinsic for "+re+" exists, but the property is not available.");return}if(c&&Ee+1>=ue.length){var te=c(Q,U);X=!!te,X&&"get"in te&&!("originalValue"in te.get)?Q=te.get:Q=Q[U]}else X=T(Q,U),Q=Q[U];X&&!he&&(g[R]=Q)}}return Q},Ur}function Mi(){if(no)return Dr;no=!0;var o=lr(),l=o("%Object.defineProperty%",!0)||!1;if(l)try{l({},"a",{value:1})}catch{l=!1}return Dr=l,Dr}function Ws(){if(io)return Fr;io=!0;var o=lr(),l=o("%Object.getOwnPropertyDescriptor%",!0);if(l)try{l([],"length")}catch{l=null}return Fr=l,Fr}function Zc(){if(oo)return Wr;oo=!0;var o=Mi(),l=Fs(),s=vr(),a=Ws();return Wr=function(u,t,r){if(!u||typeof u!="object"&&typeof u!="function")throw new s("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,e=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,h=!!a&&a(u,t);if(o)o(u,t,{configurable:i===null&&h?h.configurable:!i,enumerable:n===null&&h?h.enumerable:!n,value:r,writable:e===null&&h?h.writable:!e});else if(c||!n&&!e&&!i)u[t]=r;else throw new l("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Wr}function ef(){if(so)return $r;so=!0;var o=Mi(),l=function(){return!!o};return l.hasArrayLengthDefineBug=function(){if(!o)return null;try{return o([],"length",{value:1}).length!==1}catch{return!0}},$r=l,$r}function tf(){if(ao)return qr;ao=!0;var o=lr(),l=Zc(),s=ef()(),a=Ws(),u=vr(),t=o("%Math.floor%");return qr=function(r,n){if(typeof r!="function")throw new u("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||t(n)!==n)throw new u("`length` must be a positive 32-bit integer");var e=arguments.length>2&&!!arguments[2],i=!0,c=!0;if("length"in r&&a){var h=a(r,"length");h&&!h.configurable&&(i=!1),h&&!h.writable&&(c=!1)}return(i||c||!e)&&(s?l(r,"length",n,!0,!0):l(r,"length",n)),r},qr}function rf(){if(lo)return ur;lo=!0;var o=Ri(),l=lr(),s=tf(),a=vr(),u=l("%Function.prototype.apply%"),t=l("%Function.prototype.call%"),r=l("%Reflect.apply%",!0)||o.call(t,u),n=Mi(),e=l("%Math.max%");ur=function(c){if(typeof c!="function")throw new a("a function is required");var h=r(o,t,arguments);return s(h,1+e(0,c.length-(arguments.length-1)),!0)};var i=function(){return r(o,u,arguments)};return n?n(ur,"apply",{value:i}):ur.apply=i,ur}function nf(){if(uo)return Vr;uo=!0;var o=lr(),l=rf(),s=l(o("String.prototype.indexOf"));return Vr=function(a,u){var t=o(a,!!u);return typeof t=="function"&&s(a,".prototype.")>-1?l(t):t},Vr}var Ni,Bi,Li,Ui,Di,Fi,Wi,$i,qi,Vi,zi,Ki,Hi,Gi,Yi,Qi,Rr,Ji,Mr,Xi,Nr,Zi,Br,eo,Lr,to,Ur,ro,Dr,no,Fr,io,Wr,oo,$r,so,qr,ao,ur,lo,Vr,uo,of=_t(()=>{de(),ye(),ge(),Ni={},Bi=!1,Li={},Ui=!1,Di={},Fi=!1,Wi={},$i=!1,qi={},Vi=!1,zi={},Ki=!1,Hi={},Gi=!1,Yi={},Qi=!1,Rr={},Ji=!1,Mr={},Xi=!1,Nr={},Zi=!1,Br={},eo=!1,Lr={},to=!1,Ur={},ro=!1,Dr={},no=!1,Fr={},io=!1,Wr={},oo=!1,$r={},so=!1,qr={},ao=!1,ur={},lo=!1,Vr={},uo=!1});function co(o){throw new Error("Node.js process "+o+" is not supported by JSPM core outside of Node.js")}function sf(){!Zt||!er||(Zt=!1,er.length?Ot=er.concat(Ot):wr=-1,Ot.length&&$s())}function $s(){if(!Zt){var o=setTimeout(sf,0);Zt=!0;for(var l=Ot.length;l;){for(er=Ot,Ot=[];++wr<l;)er&&er[wr].run();wr=-1,l=Ot.length}er=null,Zt=!1,clearTimeout(o)}}function af(o){var l=new Array(arguments.length-1);if(arguments.length>1)for(var s=1;s<arguments.length;s++)l[s-1]=arguments[s];Ot.push(new qs(o,l)),Ot.length===1&&!Zt&&setTimeout($s,0)}function qs(o,l){this.fun=o,this.array=l}function bt(){}function lf(o){co("_linkedBinding")}function uf(o){co("dlopen")}function cf(){return[]}function ff(){return[]}function hf(o,l){if(!o)throw new Error(l||"assertion error")}function pf(){return!1}function df(){return Lt.now()/1e3}function fo(o){var l=Math.floor((Date.now()-Lt.now())*.001),s=Lt.now()*.001,a=Math.floor(s)+l,u=Math.floor(s%1*1e9);return o&&(a=a-o[0],u=u-o[1],u<0&&(a--,u+=Kr)),[a,u]}function $t(){return po}function gf(o){return[]}var Ot,Zt,er,wr,Vs,zs,Ks,Hs,Gs,Ys,Qs,Js,Xs,Zs,ea,ta,ra,na,ia,oa,sa,aa,la,ua,ca,zr,fa,ha,pa,da,ga,ya,ma,ba,va,wa,_a,Sa,Ea,Aa,xa,Ia,ka,Oa,Ta,Pa,Ca,ja,Ra,Ma,Na,Lt,ho,Kr,Ba,La,Ua,Da,Fa,Wa,$a,qa,Va,za,Ka,po,Ha=_t(()=>{de(),ye(),ge(),Ot=[],Zt=!1,wr=-1,qs.prototype.run=function(){this.fun.apply(null,this.array)},Vs="browser",zs="x64",Ks="browser",Hs={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Gs=["/usr/bin/node"],Ys=[],Qs="v16.8.0",Js={},Xs=function(o,l){console.warn((l?l+": ":"")+o)},Zs=function(o){co("binding")},ea=function(o){return 0},ta=function(){return"/"},ra=function(o){},na={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},ia=bt,oa=[],sa={},aa=!1,la={},ua=bt,ca=bt,zr=function(){return{}},fa=zr,ha=zr,pa=bt,da=bt,ga=bt,ya={},ma={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ba=bt,va=bt,wa=bt,_a=bt,Sa=bt,Ea=bt,Aa=bt,xa=void 0,Ia=void 0,ka=void 0,Oa=bt,Ta=2,Pa=1,Ca="/bin/usr/node",ja=9229,Ra="node",Ma=[],Na=bt,Lt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},Lt.now===void 0&&(ho=Date.now(),Lt.timing&&Lt.timing.navigationStart&&(ho=Lt.timing.navigationStart),Lt.now=()=>Date.now()-ho),Kr=1e9,fo.bigint=function(o){var l=fo(o);return typeof BigInt>"u"?l[0]*Kr+l[1]:BigInt(l[0]*Kr)+BigInt(l[1])},Ba=10,La={},Ua=0,Da=$t,Fa=$t,Wa=$t,$a=$t,qa=$t,Va=bt,za=$t,Ka=$t,po={version:Qs,versions:Js,arch:zs,platform:Ks,release:na,_rawDebug:ia,moduleLoadList:oa,binding:Zs,_linkedBinding:lf,_events:La,_eventsCount:Ua,_maxListeners:Ba,on:$t,addListener:Da,once:Fa,off:Wa,removeListener:$a,removeAllListeners:qa,emit:Va,prependListener:za,prependOnceListener:Ka,listeners:gf,domain:sa,_exiting:aa,config:la,dlopen:uf,uptime:df,_getActiveRequests:cf,_getActiveHandles:ff,reallyExit:ua,_kill:ca,cpuUsage:zr,resourceUsage:fa,memoryUsage:ha,kill:pa,exit:da,openStdin:ga,allowedNodeEnvironmentFlags:ya,assert:hf,features:ma,_fatalExceptions:ba,setUncaughtExceptionCaptureCallback:va,hasUncaughtExceptionCaptureCallback:pf,emitWarning:Xs,nextTick:af,_tickCallback:wa,_debugProcess:_a,_debugEnd:Sa,_startProfilerIdleNotifier:Ea,_stopProfilerIdleNotifier:Aa,stdout:xa,stdin:ka,stderr:Ia,abort:Oa,umask:ea,chdir:ra,cwd:ta,env:Hs,title:Vs,argv:Gs,execArgv:Ys,pid:Ta,ppid:Pa,execPath:Ca,debugPort:ja,hrtime:fo,argv0:Ra,_preload_modules:Ma,setSourceMapsEnabled:Na}});function yf(){if(go)return Hr;go=!0;var o=po;function l(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function s(t,r){for(var n="",e=0,i=-1,c=0,h,d=0;d<=t.length;++d){if(d<t.length)h=t.charCodeAt(d);else{if(h===47)break;h=47}if(h===47){if(!(i===d-1||c===1))if(i!==d-1&&c===2){if(n.length<2||e!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var y=n.lastIndexOf("/");if(y!==n.length-1){y===-1?(n="",e=0):(n=n.slice(0,y),e=n.length-1-n.lastIndexOf("/")),i=d,c=0;continue}}else if(n.length===2||n.length===1){n="",e=0,i=d,c=0;continue}}r&&(n.length>0?n+="/..":n="..",e=2)}else n.length>0?n+="/"+t.slice(i+1,d):n=t.slice(i+1,d),e=d-i-1;i=d,c=0}else h===46&&c!==-1?++c:c=-1}return n}function a(t,r){var n=r.dir||r.root,e=r.base||(r.name||"")+(r.ext||"");return n?n===r.root?n+e:n+t+e:e}var u={resolve:function(){for(var t="",r=!1,n,e=arguments.length-1;e>=-1&&!r;e--){var i;e>=0?i=arguments[e]:(n===void 0&&(n=o.cwd()),i=n),l(i),i.length!==0&&(t=i+"/"+t,r=i.charCodeAt(0)===47)}return t=s(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(l(t),t.length===0)return".";var r=t.charCodeAt(0)===47,n=t.charCodeAt(t.length-1)===47;return t=s(t,!r),t.length===0&&!r&&(t="."),t.length>0&&n&&(t+="/"),r?"/"+t:t},isAbsolute:function(t){return l(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,r=0;r<arguments.length;++r){var n=arguments[r];l(n),n.length>0&&(t===void 0?t=n:t+="/"+n)}return t===void 0?".":u.normalize(t)},relative:function(t,r){if(l(t),l(r),t===r||(t=u.resolve(t),r=u.resolve(r),t===r))return"";for(var n=1;n<t.length&&t.charCodeAt(n)===47;++n);for(var e=t.length,i=e-n,c=1;c<r.length&&r.charCodeAt(c)===47;++c);for(var h=r.length,d=h-c,y=i<d?i:d,b=-1,w=0;w<=y;++w){if(w===y){if(d>y){if(r.charCodeAt(c+w)===47)return r.slice(c+w+1);if(w===0)return r.slice(c+w)}else i>y&&(t.charCodeAt(n+w)===47?b=w:w===0&&(b=0));break}var S=t.charCodeAt(n+w),A=r.charCodeAt(c+w);if(S!==A)break;S===47&&(b=w)}var g="";for(w=n+b+1;w<=e;++w)(w===e||t.charCodeAt(w)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+r.slice(c+b):(c+=b,r.charCodeAt(c)===47&&++c,r.slice(c))},_makeLong:function(t){return t},dirname:function(t){if(l(t),t.length===0)return".";for(var r=t.charCodeAt(0),n=r===47,e=-1,i=!0,c=t.length-1;c>=1;--c)if(r=t.charCodeAt(c),r===47){if(!i){e=c;break}}else i=!1;return e===-1?n?"/":".":n&&e===1?"//":t.slice(0,e)},basename:function(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');l(t);var n=0,e=-1,i=!0,c;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var h=r.length-1,d=-1;for(c=t.length-1;c>=0;--c){var y=t.charCodeAt(c);if(y===47){if(!i){n=c+1;break}}else d===-1&&(i=!1,d=c+1),h>=0&&(y===r.charCodeAt(h)?--h===-1&&(e=c):(h=-1,e=d))}return n===e?e=d:e===-1&&(e=t.length),t.slice(n,e)}else{for(c=t.length-1;c>=0;--c)if(t.charCodeAt(c)===47){if(!i){n=c+1;break}}else e===-1&&(i=!1,e=c+1);return e===-1?"":t.slice(n,e)}},extname:function(t){l(t);for(var r=-1,n=0,e=-1,i=!0,c=0,h=t.length-1;h>=0;--h){var d=t.charCodeAt(h);if(d===47){if(!i){n=h+1;break}continue}e===-1&&(i=!1,e=h+1),d===46?r===-1?r=h:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||e===-1||c===0||c===1&&r===e-1&&r===n+1?"":t.slice(r,e)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return a("/",t)},parse:function(t){l(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var n=t.charCodeAt(0),e=n===47,i;e?(r.root="/",i=1):i=0;for(var c=-1,h=0,d=-1,y=!0,b=t.length-1,w=0;b>=i;--b){if(n=t.charCodeAt(b),n===47){if(!y){h=b+1;break}continue}d===-1&&(y=!1,d=b+1),n===46?c===-1?c=b:w!==1&&(w=1):c!==-1&&(w=-1)}return c===-1||d===-1||w===0||w===1&&c===d-1&&c===h+1?d!==-1&&(h===0&&e?r.base=r.name=t.slice(1,d):r.base=r.name=t.slice(h,d)):(h===0&&e?(r.name=t.slice(1,c),r.base=t.slice(1,d)):(r.name=t.slice(h,c),r.base=t.slice(h,d)),r.ext=t.slice(c,d)),h>0?r.dir=t.slice(0,h-1):e&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return u.posix=u,Hr=u,Hr}var Hr,go,yo,mf=_t(()=>{de(),ye(),ge(),Ha(),Hr={},go=!1,yo=yf()}),Ga={};nr(Ga,{URL:()=>ol,Url:()=>el,default:()=>vt,fileURLToPath:()=>Qa,format:()=>tl,parse:()=>il,pathToFileURL:()=>Ja,resolve:()=>rl,resolveObject:()=>nl});function bf(){if(bo)return Gr;bo=!0;var o=typeof Map=="function"&&Map.prototype,l=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,s=o&&l&&typeof l.get=="function"?l.get:null,a=o&&Map.prototype.forEach,u=typeof Set=="function"&&Set.prototype,t=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,r=u&&t&&typeof t.get=="function"?t.get:null,n=u&&Set.prototype.forEach,e=typeof WeakMap=="function"&&WeakMap.prototype,i=e?WeakMap.prototype.has:null,c=typeof WeakSet=="function"&&WeakSet.prototype,h=c?WeakSet.prototype.has:null,d=typeof WeakRef=="function"&&WeakRef.prototype,y=d?WeakRef.prototype.deref:null,b=Boolean.prototype.valueOf,w=Object.prototype.toString,S=Function.prototype.toString,A=String.prototype.match,g=String.prototype.slice,_=String.prototype.replace,E=String.prototype.toUpperCase,v=String.prototype.toLowerCase,C=RegExp.prototype.test,T=Array.prototype.concat,x=Array.prototype.join,P=Array.prototype.slice,O=Math.floor,F=typeof BigInt=="function"?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,V=typeof Symbol=="function"&&typeof Symbol.iterator=="object",L=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===V||!0)?Symbol.toStringTag:null,le=Object.prototype.propertyIsEnumerable,re=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function($){return $.__proto__}:null);function ee($,J){if($===1/0||$===-1/0||$!==$||$&&$>-1e3&&$<1e3||C.call(/e/,J))return J;var Te=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof $=="number"){var Me=$<0?-O(-$):O($);if(Me!==$){var Ne=String(Me),Fe=g.call(J,Ne.length+1);return _.call(Ne,Te,"$&_")+"."+_.call(_.call(Fe,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(J,Te,"$&_")}var ue=Xa,G=ue.custom,oe=te(G)?G:null;Gr=function $(J,Te,Me,Ne){var Fe=Te||{};if(ce(Fe,"quoteStyle")&&Fe.quoteStyle!=="single"&&Fe.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ce(Fe,"maxStringLength")&&(typeof Fe.maxStringLength=="number"?Fe.maxStringLength<0&&Fe.maxStringLength!==1/0:Fe.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var nt=ce(Fe,"customInspect")?Fe.customInspect:!0;if(typeof nt!="boolean"&&nt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ce(Fe,"indent")&&Fe.indent!==null&&Fe.indent!==" "&&!(parseInt(Fe.indent,10)===Fe.indent&&Fe.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ce(Fe,"numericSeparator")&&typeof Fe.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var rt=Fe.numericSeparator;if(typeof J>"u")return"undefined";if(J===null)return"null";if(typeof J=="boolean")return J?"true":"false";if(typeof J=="string")return fe(J,Fe);if(typeof J=="number"){if(J===0)return 1/0/J>0?"0":"-0";var Ke=String(J);return rt?ee(J,Ke):Ke}if(typeof J=="bigint"){var Xe=String(J)+"n";return rt?ee(J,Xe):Xe}var Ue=typeof Fe.depth>"u"?5:Fe.depth;if(typeof Me>"u"&&(Me=0),Me>=Ue&&Ue>0&&typeof J=="object")return he(J)?"[Array]":"[Object]";var Ye=M(Fe,Me);if(typeof Ne>"u")Ne=[];else if(se(Ne,J)>=0)return"[Circular]";function Ze(Ge,ze,Ve){if(ze&&(Ne=P.call(Ne),Ne.push(ze)),Ve){var it={depth:Fe.depth};return ce(Fe,"quoteStyle")&&(it.quoteStyle=Fe.quoteStyle),$(Ge,it,Me+1,Ne)}return $(Ge,Fe,Me+1,Ne)}if(typeof J=="function"&&!Ee(J)){var lt=Y(J),ct=ie(J,Ze);return"[Function"+(lt?": "+lt:" (anonymous)")+"]"+(ct.length>0?" { "+x.call(ct,", ")+" }":"")}if(te(J)){var Et=V?_.call(String(J),/^(Symbol\(.*\))_[^)]*$/,"$1"):W.call(J);return typeof J=="object"&&!V?f(Et):Et}if(ke(J)){for(var j="<"+v.call(String(J.nodeName)),B=J.attributes||[],xe=0;xe<B.length;xe++)j+=" "+B[xe].name+"="+R(Q(B[xe].value),"double",Fe);return j+=">",J.childNodes&&J.childNodes.length&&(j+="..."),j+="</"+v.call(String(J.nodeName))+">",j}if(he(J)){if(J.length===0)return"[]";var Ce=ie(J,Ze);return Ye&&!k(Ce)?"["+z(Ce,Ye)+"]":"[ "+x.call(Ce,", ")+" ]"}if(X(J)){var Be=ie(J,Ze);return!("cause"in Error.prototype)&&"cause"in J&&!le.call(J,"cause")?"{ ["+String(J)+"] "+x.call(T.call("[cause]: "+Ze(J.cause),Be),", ")+" }":Be.length===0?"["+String(J)+"]":"{ ["+String(J)+"] "+x.call(Be,", ")+" }"}if(typeof J=="object"&&nt){if(oe&&typeof J[oe]=="function"&&ue)return ue(J,{depth:Ue-Me});if(nt!=="symbol"&&typeof J.inspect=="function")return J.inspect()}if(me(J)){var ft=[];return a&&a.call(J,function(Ge,ze){ft.push(Ze(ze,J,!0)+" => "+Ze(Ge,J))}),m("Map",s.call(J),ft,Ye)}if(Z(J)){var yt=[];return n&&n.call(J,function(Ge){yt.push(Ze(Ge,J))}),m("Set",r.call(J),yt,Ye)}if(pe(J))return p("WeakMap");if(ve(J))return p("WeakSet");if(_e(J))return p("WeakRef");if(ae(J))return f(Ze(Number(J)));if(ne(J))return f(Ze(F.call(J)));if(H(J))return f(b.call(J));if(U(J))return f(Ze(String(J)));if(typeof window<"u"&&J===window)return"{ [object Window] }";if(typeof globalThis<"u"&&J===globalThis||typeof Yr<"u"&&J===Yr)return"{ [object globalThis] }";if(!q(J)&&!Ee(J)){var xt=ie(J,Ze),K=re?re(J)===Object.prototype:J instanceof Object||J.constructor===Object,Ae=J instanceof Object?"":"null prototype",je=!K&&L&&Object(J)===J&&L in J?g.call(N(J),8,-1):Ae?"Object":"",We=K||typeof J.constructor!="function"?"":J.constructor.name?J.constructor.name+" ":"",He=We+(je||Ae?"["+x.call(T.call([],je||[],Ae||[]),": ")+"] ":"");return xt.length===0?He+"{}":Ye?He+"{"+z(xt,Ye)+"}":He+"{ "+x.call(xt,", ")+" }"}return String(J)};function R($,J,Te){var Me=(Te.quoteStyle||J)==="double"?'"':"'";return Me+$+Me}function Q($){return _.call(String($),/"/g,"&quot;")}function he($){return N($)==="[object Array]"&&(!L||!(typeof $=="object"&&L in $))}function q($){return N($)==="[object Date]"&&(!L||!(typeof $=="object"&&L in $))}function Ee($){return N($)==="[object RegExp]"&&(!L||!(typeof $=="object"&&L in $))}function X($){return N($)==="[object Error]"&&(!L||!(typeof $=="object"&&L in $))}function U($){return N($)==="[object String]"&&(!L||!(typeof $=="object"&&L in $))}function ae($){return N($)==="[object Number]"&&(!L||!(typeof $=="object"&&L in $))}function H($){return N($)==="[object Boolean]"&&(!L||!(typeof $=="object"&&L in $))}function te($){if(V)return $&&typeof $=="object"&&$ instanceof Symbol;if(typeof $=="symbol")return!0;if(!$||typeof $!="object"||!W)return!1;try{return W.call($),!0}catch{}return!1}function ne($){if(!$||typeof $!="object"||!F)return!1;try{return F.call($),!0}catch{}return!1}var be=Object.prototype.hasOwnProperty||function($){return $ in(this||Yr)};function ce($,J){return be.call($,J)}function N($){return w.call($)}function Y($){if($.name)return $.name;var J=A.call(S.call($),/^function\s*([\w$]+)/);return J?J[1]:null}function se($,J){if($.indexOf)return $.indexOf(J);for(var Te=0,Me=$.length;Te<Me;Te++)if($[Te]===J)return Te;return-1}function me($){if(!s||!$||typeof $!="object")return!1;try{s.call($);try{r.call($)}catch{return!0}return $ instanceof Map}catch{}return!1}function pe($){if(!i||!$||typeof $!="object")return!1;try{i.call($,i);try{h.call($,h)}catch{return!0}return $ instanceof WeakMap}catch{}return!1}function _e($){if(!y||!$||typeof $!="object")return!1;try{return y.call($),!0}catch{}return!1}function Z($){if(!r||!$||typeof $!="object")return!1;try{r.call($);try{s.call($)}catch{return!0}return $ instanceof Set}catch{}return!1}function ve($){if(!h||!$||typeof $!="object")return!1;try{h.call($,h);try{i.call($,i)}catch{return!0}return $ instanceof WeakSet}catch{}return!1}function ke($){return!$||typeof $!="object"?!1:typeof HTMLElement<"u"&&$ instanceof HTMLElement?!0:typeof $.nodeName=="string"&&typeof $.getAttribute=="function"}function fe($,J){if($.length>J.maxStringLength){var Te=$.length-J.maxStringLength,Me="... "+Te+" more character"+(Te>1?"s":"");return fe(g.call($,0,J.maxStringLength),J)+Me}var Ne=_.call(_.call($,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,De);return R(Ne,"single",J)}function De($){var J=$.charCodeAt(0),Te={8:"b",9:"t",10:"n",12:"f",13:"r"}[J];return Te?"\\"+Te:"\\x"+(J<16?"0":"")+E.call(J.toString(16))}function f($){return"Object("+$+")"}function p($){return $+" { ? }"}function m($,J,Te,Me){var Ne=Me?z(Te,Me):x.call(Te,", ");return $+" ("+J+") {"+Ne+"}"}function k($){for(var J=0;J<$.length;J++)if(se($[J],`
33
33
  `)>=0)return!1;return!0}function M($,J){var Te;if($.indent===" ")Te=" ";else if(typeof $.indent=="number"&&$.indent>0)Te=x.call(Array($.indent+1)," ");else return null;return{base:Te,prev:x.call(Array(J+1),Te)}}function z($,J){if($.length===0)return"";var Te=`
34
34
  `+J.prev+J.base;return Te+x.call($,","+Te)+`
35
- `+J.prev}function ie($,J){var Te=he($),Me=[];if(Te){Me.length=$.length;for(var Ne=0;Ne<$.length;Ne++)Me[Ne]=ce($,Ne)?J($[Ne],$):""}var Fe=typeof I=="function"?I($):[],nt;if(V){nt={};for(var rt=0;rt<Fe.length;rt++)nt["$"+Fe[rt]]=Fe[rt]}for(var Ke in $)ce($,Ke)&&(Te&&String(Number(Ke))===Ke&&Ke<$.length||V&&nt["$"+Ke]instanceof Symbol||(C.call(/[^\w$]/,Ke)?Me.push(J(Ke,$)+": "+J($[Ke],$)):Me.push(Ke+": "+J($[Ke],$))));if(typeof I=="function")for(var Xe=0;Xe<Fe.length;Xe++)le.call($,Fe[Xe])&&Me.push("["+J(Fe[Xe])+"]: "+J($[Fe[Xe]],$));return Me}return Gr}function bf(){if(vo)return Qr;vo=!0;var o=lr(),l=rf(),s=mf(),a=vr(),c=o("%WeakMap%",!0),t=o("%Map%",!0),r=l("WeakMap.prototype.get",!0),n=l("WeakMap.prototype.set",!0),e=l("WeakMap.prototype.has",!0),i=l("Map.prototype.get",!0),u=l("Map.prototype.set",!0),h=l("Map.prototype.has",!0),d=function(S,A){for(var g=S,_;(_=g.next)!==null;g=_)if(_.key===A)return g.next=_.next,_.next=S.next,S.next=_,_},y=function(S,A){var g=d(S,A);return g&&g.value},b=function(S,A,g){var _=d(S,A);_?_.value=g:S.next={key:A,next:S.next,value:g}},w=function(S,A){return!!d(S,A)};return Qr=function(){var S,A,g,_={assert:function(E){if(!_.has(E))throw new a("Side channel does not contain "+s(E))},get:function(E){if(c&&E&&(typeof E=="object"||typeof E=="function")){if(S)return r(S,E)}else if(t){if(A)return i(A,E)}else if(g)return y(g,E)},has:function(E){if(c&&E&&(typeof E=="object"||typeof E=="function")){if(S)return e(S,E)}else if(t){if(A)return h(A,E)}else if(g)return w(g,E);return!1},set:function(E,v){c&&E&&(typeof E=="object"||typeof E=="function")?(S||(S=new c),n(S,E,v)):t?(A||(A=new t),u(A,E,v)):(g||(g={key:{},next:null}),b(g,E,v))}};return _},Qr}function mo(){if(wo)return Jr;wo=!0;var o=String.prototype.replace,l=/%20/g,s={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Jr={default:s.RFC3986,formatters:{RFC1738:function(a){return o.call(a,l,"+")},RFC3986:function(a){return String(a)}},RFC1738:s.RFC1738,RFC3986:s.RFC3986},Jr}function Ha(){if(_o)return Xr;_o=!0;var o=mo(),l=Object.prototype.hasOwnProperty,s=Array.isArray,a=function(){for(var S=[],A=0;A<256;++A)S.push("%"+((A<16?"0":"")+A.toString(16)).toUpperCase());return S}(),c=function(S){for(;S.length>1;){var A=S.pop(),g=A.obj[A.prop];if(s(g)){for(var _=[],E=0;E<g.length;++E)typeof g[E]<"u"&&_.push(g[E]);A.obj[A.prop]=_}}},t=function(S,A){for(var g=A&&A.plainObjects?Object.create(null):{},_=0;_<S.length;++_)typeof S[_]<"u"&&(g[_]=S[_]);return g},r=function S(A,g,_){if(!g)return A;if(typeof g!="object"){if(s(A))A.push(g);else if(A&&typeof A=="object")(_&&(_.plainObjects||_.allowPrototypes)||!l.call(Object.prototype,g))&&(A[g]=!0);else return[A,g];return A}if(!A||typeof A!="object")return[A].concat(g);var E=A;return s(A)&&!s(g)&&(E=t(A,_)),s(A)&&s(g)?(g.forEach(function(v,C){if(l.call(A,C)){var T=A[C];T&&typeof T=="object"&&v&&typeof v=="object"?A[C]=S(T,v,_):A.push(v)}else A[C]=v}),A):Object.keys(g).reduce(function(v,C){var T=g[C];return l.call(v,C)?v[C]=S(v[C],T,_):v[C]=T,v},E)},n=function(S,A){return Object.keys(A).reduce(function(g,_){return g[_]=A[_],g},S)},e=function(S,A,g){var _=S.replace(/\+/g," ");if(g==="iso-8859-1")return _.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(_)}catch{return _}},i=1024,u=function(S,A,g,_,E){if(S.length===0)return S;var v=S;if(typeof S=="symbol"?v=Symbol.prototype.toString.call(S):typeof S!="string"&&(v=String(S)),g==="iso-8859-1")return escape(v).replace(/%u[0-9a-f]{4}/gi,function(I){return"%26%23"+parseInt(I.slice(2),16)+"%3B"});for(var C="",T=0;T<v.length;T+=i){for(var x=v.length>=i?v.slice(T,T+i):v,P=[],O=0;O<x.length;++O){var F=x.charCodeAt(O);if(F===45||F===46||F===95||F===126||F>=48&&F<=57||F>=65&&F<=90||F>=97&&F<=122||E===o.RFC1738&&(F===40||F===41)){P[P.length]=x.charAt(O);continue}if(F<128){P[P.length]=a[F];continue}if(F<2048){P[P.length]=a[192|F>>6]+a[128|F&63];continue}if(F<55296||F>=57344){P[P.length]=a[224|F>>12]+a[128|F>>6&63]+a[128|F&63];continue}O+=1,F=65536+((F&1023)<<10|x.charCodeAt(O)&1023),P[P.length]=a[240|F>>18]+a[128|F>>12&63]+a[128|F>>6&63]+a[128|F&63]}C+=P.join("")}return C},h=function(S){for(var A=[{obj:{o:S},prop:"o"}],g=[],_=0;_<A.length;++_)for(var E=A[_],v=E.obj[E.prop],C=Object.keys(v),T=0;T<C.length;++T){var x=C[T],P=v[x];typeof P=="object"&&P!==null&&g.indexOf(P)===-1&&(A.push({obj:v,prop:x}),g.push(P))}return c(A),S},d=function(S){return Object.prototype.toString.call(S)==="[object RegExp]"},y=function(S){return!S||typeof S!="object"?!1:!!(S.constructor&&S.constructor.isBuffer&&S.constructor.isBuffer(S))},b=function(S,A){return[].concat(S,A)},w=function(S,A){if(s(S)){for(var g=[],_=0;_<S.length;_+=1)g.push(A(S[_]));return g}return A(S)};return Xr={arrayToObject:t,assign:n,combine:b,compact:h,decode:e,encode:u,isBuffer:y,isRegExp:d,maybeMap:w,merge:r},Xr}function vf(){if(So)return Zr;So=!0;var o=bf(),l=Ha(),s=mo(),a=Object.prototype.hasOwnProperty,c={brackets:function(w){return w+"[]"},comma:"comma",indices:function(w,S){return w+"["+S+"]"},repeat:function(w){return w}},t=Array.isArray,r=Array.prototype.push,n=function(w,S){r.apply(w,t(S)?S:[S])},e=Date.prototype.toISOString,i=s.default,u={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:l.encode,encodeValuesOnly:!1,format:i,formatter:s.formatters[i],indices:!1,serializeDate:function(w){return e.call(w)},skipNulls:!1,strictNullHandling:!1},h=function(w){return typeof w=="string"||typeof w=="number"||typeof w=="boolean"||typeof w=="symbol"||typeof w=="bigint"},d={},y=function w(S,A,g,_,E,v,C,T,x,P,O,F,I,W,V,L,le,re){for(var ee=S,ue=re,G=0,oe=!1;(ue=ue.get(d))!==void 0&&!oe;){var R=ue.get(S);if(G+=1,typeof R<"u"){if(R===G)throw new RangeError("Cyclic object value");oe=!0}typeof ue.get(d)>"u"&&(G=0)}if(typeof P=="function"?ee=P(A,ee):ee instanceof Date?ee=I(ee):g==="comma"&&t(ee)&&(ee=l.maybeMap(ee,function(N){return N instanceof Date?I(N):N})),ee===null){if(v)return x&&!L?x(A,u.encoder,le,"key",W):A;ee=""}if(h(ee)||l.isBuffer(ee)){if(x){var Q=L?A:x(A,u.encoder,le,"key",W);return[V(Q)+"="+V(x(ee,u.encoder,le,"value",W))]}return[V(A)+"="+V(String(ee))]}var he=[];if(typeof ee>"u")return he;var q;if(g==="comma"&&t(ee))L&&x&&(ee=l.maybeMap(ee,x)),q=[{value:ee.length>0?ee.join(",")||null:void 0}];else if(t(P))q=P;else{var Ee=Object.keys(ee);q=O?Ee.sort(O):Ee}var X=T?A.replace(/\./g,"%2E"):A,U=_&&t(ee)&&ee.length===1?X+"[]":X;if(E&&t(ee)&&ee.length===0)return U+"[]";for(var ae=0;ae<q.length;++ae){var H=q[ae],te=typeof H=="object"&&typeof H.value<"u"?H.value:ee[H];if(!(C&&te===null)){var ne=F&&T?H.replace(/\./g,"%2E"):H,be=t(ee)?typeof g=="function"?g(U,ne):U:U+(F?"."+ne:"["+ne+"]");re.set(S,G);var ce=o();ce.set(d,re),n(he,w(te,be,g,_,E,v,C,T,g==="comma"&&L&&t(ee)?null:x,P,O,F,I,W,V,L,le,ce))}}return he},b=function(w){if(!w)return u;if(typeof w.allowEmptyArrays<"u"&&typeof w.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof w.encodeDotInKeys<"u"&&typeof w.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(w.encoder!==null&&typeof w.encoder<"u"&&typeof w.encoder!="function")throw new TypeError("Encoder has to be a function.");var S=w.charset||u.charset;if(typeof w.charset<"u"&&w.charset!=="utf-8"&&w.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var A=s.default;if(typeof w.format<"u"){if(!a.call(s.formatters,w.format))throw new TypeError("Unknown format option provided.");A=w.format}var g=s.formatters[A],_=u.filter;(typeof w.filter=="function"||t(w.filter))&&(_=w.filter);var E;if(w.arrayFormat in c?E=w.arrayFormat:"indices"in w?E=w.indices?"indices":"repeat":E=u.arrayFormat,"commaRoundTrip"in w&&typeof w.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var v=typeof w.allowDots>"u"?w.encodeDotInKeys===!0?!0:u.allowDots:!!w.allowDots;return{addQueryPrefix:typeof w.addQueryPrefix=="boolean"?w.addQueryPrefix:u.addQueryPrefix,allowDots:v,allowEmptyArrays:typeof w.allowEmptyArrays=="boolean"?!!w.allowEmptyArrays:u.allowEmptyArrays,arrayFormat:E,charset:S,charsetSentinel:typeof w.charsetSentinel=="boolean"?w.charsetSentinel:u.charsetSentinel,commaRoundTrip:w.commaRoundTrip,delimiter:typeof w.delimiter>"u"?u.delimiter:w.delimiter,encode:typeof w.encode=="boolean"?w.encode:u.encode,encodeDotInKeys:typeof w.encodeDotInKeys=="boolean"?w.encodeDotInKeys:u.encodeDotInKeys,encoder:typeof w.encoder=="function"?w.encoder:u.encoder,encodeValuesOnly:typeof w.encodeValuesOnly=="boolean"?w.encodeValuesOnly:u.encodeValuesOnly,filter:_,format:A,formatter:g,serializeDate:typeof w.serializeDate=="function"?w.serializeDate:u.serializeDate,skipNulls:typeof w.skipNulls=="boolean"?w.skipNulls:u.skipNulls,sort:typeof w.sort=="function"?w.sort:null,strictNullHandling:typeof w.strictNullHandling=="boolean"?w.strictNullHandling:u.strictNullHandling}};return Zr=function(w,S){var A=w,g=b(S),_,E;typeof g.filter=="function"?(E=g.filter,A=E("",A)):t(g.filter)&&(E=g.filter,_=E);var v=[];if(typeof A!="object"||A===null)return"";var C=c[g.arrayFormat],T=C==="comma"&&g.commaRoundTrip;_||(_=Object.keys(A)),g.sort&&_.sort(g.sort);for(var x=o(),P=0;P<_.length;++P){var O=_[P];g.skipNulls&&A[O]===null||n(v,y(A[O],O,C,T,g.allowEmptyArrays,g.strictNullHandling,g.skipNulls,g.encodeDotInKeys,g.encode?g.encoder:null,g.filter,g.sort,g.allowDots,g.serializeDate,g.format,g.formatter,g.encodeValuesOnly,g.charset,x))}var F=v.join(g.delimiter),I=g.addQueryPrefix===!0?"?":"";return g.charsetSentinel&&(g.charset==="iso-8859-1"?I+="utf8=%26%2310003%3B&":I+="utf8=%E2%9C%93&"),F.length>0?I+F:""},Zr}function wf(){if(Eo)return en;Eo=!0;var o=Ha(),l=Object.prototype.hasOwnProperty,s=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:o.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},c=function(d){return d.replace(/&#(\d+);/g,function(y,b){return String.fromCharCode(parseInt(b,10))})},t=function(d,y){return d&&typeof d=="string"&&y.comma&&d.indexOf(",")>-1?d.split(","):d},r="utf8=%26%2310003%3B",n="utf8=%E2%9C%93",e=function(d,y){var b={__proto__:null},w=y.ignoreQueryPrefix?d.replace(/^\?/,""):d;w=w.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var S=y.parameterLimit===1/0?void 0:y.parameterLimit,A=w.split(y.delimiter,S),g=-1,_,E=y.charset;if(y.charsetSentinel)for(_=0;_<A.length;++_)A[_].indexOf("utf8=")===0&&(A[_]===n?E="utf-8":A[_]===r&&(E="iso-8859-1"),g=_,_=A.length);for(_=0;_<A.length;++_)if(_!==g){var v=A[_],C=v.indexOf("]="),T=C===-1?v.indexOf("="):C+1,x,P;T===-1?(x=y.decoder(v,a.decoder,E,"key"),P=y.strictNullHandling?null:""):(x=y.decoder(v.slice(0,T),a.decoder,E,"key"),P=o.maybeMap(t(v.slice(T+1),y),function(F){return y.decoder(F,a.decoder,E,"value")})),P&&y.interpretNumericEntities&&E==="iso-8859-1"&&(P=c(P)),v.indexOf("[]=")>-1&&(P=s(P)?[P]:P);var O=l.call(b,x);O&&y.duplicates==="combine"?b[x]=o.combine(b[x],P):(!O||y.duplicates==="last")&&(b[x]=P)}return b},i=function(d,y,b,w){for(var S=w?y:t(y,b),A=d.length-1;A>=0;--A){var g,_=d[A];if(_==="[]"&&b.parseArrays)g=b.allowEmptyArrays&&(S===""||b.strictNullHandling&&S===null)?[]:[].concat(S);else{g=b.plainObjects?Object.create(null):{};var E=_.charAt(0)==="["&&_.charAt(_.length-1)==="]"?_.slice(1,-1):_,v=b.decodeDotInKeys?E.replace(/%2E/g,"."):E,C=parseInt(v,10);!b.parseArrays&&v===""?g={0:S}:!isNaN(C)&&_!==v&&String(C)===v&&C>=0&&b.parseArrays&&C<=b.arrayLimit?(g=[],g[C]=S):v!=="__proto__"&&(g[v]=S)}S=g}return S},u=function(d,y,b,w){if(d){var S=b.allowDots?d.replace(/\.([^.[]+)/g,"[$1]"):d,A=/(\[[^[\]]*])/,g=/(\[[^[\]]*])/g,_=b.depth>0&&A.exec(S),E=_?S.slice(0,_.index):S,v=[];if(E){if(!b.plainObjects&&l.call(Object.prototype,E)&&!b.allowPrototypes)return;v.push(E)}for(var C=0;b.depth>0&&(_=g.exec(S))!==null&&C<b.depth;){if(C+=1,!b.plainObjects&&l.call(Object.prototype,_[1].slice(1,-1))&&!b.allowPrototypes)return;v.push(_[1])}if(_){if(b.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+b.depth+" and strictDepth is true");v.push("["+S.slice(_.index)+"]")}return i(v,y,b,w)}},h=function(d){if(!d)return a;if(typeof d.allowEmptyArrays<"u"&&typeof d.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof d.decodeDotInKeys<"u"&&typeof d.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(d.decoder!==null&&typeof d.decoder<"u"&&typeof d.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof d.charset<"u"&&d.charset!=="utf-8"&&d.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=typeof d.charset>"u"?a.charset:d.charset,b=typeof d.duplicates>"u"?a.duplicates:d.duplicates;if(b!=="combine"&&b!=="first"&&b!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var w=typeof d.allowDots>"u"?d.decodeDotInKeys===!0?!0:a.allowDots:!!d.allowDots;return{allowDots:w,allowEmptyArrays:typeof d.allowEmptyArrays=="boolean"?!!d.allowEmptyArrays:a.allowEmptyArrays,allowPrototypes:typeof d.allowPrototypes=="boolean"?d.allowPrototypes:a.allowPrototypes,allowSparse:typeof d.allowSparse=="boolean"?d.allowSparse:a.allowSparse,arrayLimit:typeof d.arrayLimit=="number"?d.arrayLimit:a.arrayLimit,charset:y,charsetSentinel:typeof d.charsetSentinel=="boolean"?d.charsetSentinel:a.charsetSentinel,comma:typeof d.comma=="boolean"?d.comma:a.comma,decodeDotInKeys:typeof d.decodeDotInKeys=="boolean"?d.decodeDotInKeys:a.decodeDotInKeys,decoder:typeof d.decoder=="function"?d.decoder:a.decoder,delimiter:typeof d.delimiter=="string"||o.isRegExp(d.delimiter)?d.delimiter:a.delimiter,depth:typeof d.depth=="number"||d.depth===!1?+d.depth:a.depth,duplicates:b,ignoreQueryPrefix:d.ignoreQueryPrefix===!0,interpretNumericEntities:typeof d.interpretNumericEntities=="boolean"?d.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:typeof d.parameterLimit=="number"?d.parameterLimit:a.parameterLimit,parseArrays:d.parseArrays!==!1,plainObjects:typeof d.plainObjects=="boolean"?d.plainObjects:a.plainObjects,strictDepth:typeof d.strictDepth=="boolean"?!!d.strictDepth:a.strictDepth,strictNullHandling:typeof d.strictNullHandling=="boolean"?d.strictNullHandling:a.strictNullHandling}};return en=function(d,y){var b=h(y);if(d===""||d===null||typeof d>"u")return b.plainObjects?Object.create(null):{};for(var w=typeof d=="string"?e(d,b):d,S=b.plainObjects?Object.create(null):{},A=Object.keys(w),g=0;g<A.length;++g){var _=A[g],E=u(_,w[_],b,typeof d=="string");S=o.merge(S,E,b)}return b.allowSparse===!0?S:o.compact(S)},en}function _f(){if(Ao)return tn;Ao=!0;var o=vf(),l=wf(),s=mo();return tn={formats:s,parse:l,stringify:o},tn}function Sf(){if(xo)return qt;xo=!0;var o=Wt;function l(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,t=["<",">",'"',"`"," ","\r",`
36
- `," "],r=["{","}","|","\\","^","`"].concat(t),n=["'"].concat(r),e=["%","/","?",";","#"].concat(n),i=["/","?","#"],u=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},S=_f();function A(v,C,T){if(v&&typeof v=="object"&&v instanceof l)return v;var x=new l;return x.parse(v,C,T),x}l.prototype.parse=function(v,C,T){if(typeof v!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof v);var x=v.indexOf("?"),P=x!==-1&&x<v.indexOf("#")?"?":"#",O=v.split(P),F=/\\/g;O[0]=O[0].replace(F,"/"),v=O.join(P);var I=v;if(I=I.trim(),!T&&v.split("#").length===1){var W=c.exec(I);if(W)return this.path=I,this.href=I,this.pathname=W[1],W[2]?(this.search=W[2],C?this.query=S.parse(this.search.substr(1)):this.query=this.search.substr(1)):C&&(this.search="",this.query={}),this}var V=s.exec(I);if(V){V=V[0];var L=V.toLowerCase();this.protocol=L,I=I.substr(V.length)}if(T||V||I.match(/^\/\/[^@/]+@[^@/]+/)){var le=I.substr(0,2)==="//";le&&!(V&&b[V])&&(I=I.substr(2),this.slashes=!0)}if(!b[V]&&(le||V&&!w[V])){for(var re=-1,ee=0;ee<i.length;ee++){var ue=I.indexOf(i[ee]);ue!==-1&&(re===-1||ue<re)&&(re=ue)}var G,oe;re===-1?oe=I.lastIndexOf("@"):oe=I.lastIndexOf("@",re),oe!==-1&&(G=I.slice(0,oe),I=I.slice(oe+1),this.auth=decodeURIComponent(G)),re=-1;for(var ee=0;ee<e.length;ee++){var ue=I.indexOf(e[ee]);ue!==-1&&(re===-1||ue<re)&&(re=ue)}re===-1&&(re=I.length),this.host=I.slice(0,re),I=I.slice(re),this.parseHost(),this.hostname=this.hostname||"";var R=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!R)for(var Q=this.hostname.split(/\./),ee=0,he=Q.length;ee<he;ee++){var q=Q[ee];if(q&&!q.match(h)){for(var Ee="",X=0,U=q.length;X<U;X++)q.charCodeAt(X)>127?Ee+="x":Ee+=q[X];if(!Ee.match(h)){var ae=Q.slice(0,ee),H=Q.slice(ee+1),te=q.match(d);te&&(ae.push(te[1]),H.unshift(te[2])),H.length&&(I="/"+H.join(".")+I),this.hostname=ae.join(".");break}}}this.hostname.length>u?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=o.toASCII(this.hostname));var ne=this.port?":"+this.port:"",be=this.hostname||"";this.host=be+ne,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),I[0]!=="/"&&(I="/"+I))}if(!y[L])for(var ee=0,he=n.length;ee<he;ee++){var ce=n[ee];if(I.indexOf(ce)!==-1){var N=encodeURIComponent(ce);N===ce&&(N=escape(ce)),I=I.split(ce).join(N)}}var Y=I.indexOf("#");Y!==-1&&(this.hash=I.substr(Y),I=I.slice(0,Y));var se=I.indexOf("?");if(se!==-1?(this.search=I.substr(se),this.query=I.substr(se+1),C&&(this.query=S.parse(this.query)),I=I.slice(0,se)):C&&(this.search="",this.query={}),I&&(this.pathname=I),w[L]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ne=this.pathname||"",me=this.search||"";this.path=ne+me}return this.href=this.format(),this};function g(v){return typeof v=="string"&&(v=A(v)),v instanceof l?v.format():l.prototype.format.call(v)}l.prototype.format=function(){var v=this.auth||"";v&&(v=encodeURIComponent(v),v=v.replace(/%3A/i,":"),v+="@");var C=this.protocol||"",T=this.pathname||"",x=this.hash||"",P=!1,O="";this.host?P=v+this.host:this.hostname&&(P=v+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(P+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(O=S.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var F=this.search||O&&"?"+O||"";return C&&C.substr(-1)!==":"&&(C+=":"),this.slashes||(!C||w[C])&&P!==!1?(P="//"+(P||""),T&&T.charAt(0)!=="/"&&(T="/"+T)):P||(P=""),x&&x.charAt(0)!=="#"&&(x="#"+x),F&&F.charAt(0)!=="?"&&(F="?"+F),T=T.replace(/[?#]/g,function(I){return encodeURIComponent(I)}),F=F.replace("#","%23"),C+P+T+F+x};function _(v,C){return A(v,!1,!0).resolve(C)}l.prototype.resolve=function(v){return this.resolveObject(A(v,!1,!0)).format()};function E(v,C){return v?A(v,!1,!0).resolveObject(C):C}return l.prototype.resolveObject=function(v){if(typeof v=="string"){var C=new l;C.parse(v,!1,!0),v=C}for(var T=new l,x=Object.keys(this),P=0;P<x.length;P++){var O=x[P];T[O]=this[O]}if(T.hash=v.hash,v.href==="")return T.href=T.format(),T;if(v.slashes&&!v.protocol){for(var F=Object.keys(v),I=0;I<F.length;I++){var W=F[I];W!=="protocol"&&(T[W]=v[W])}return w[T.protocol]&&T.hostname&&!T.pathname&&(T.pathname="/",T.path=T.pathname),T.href=T.format(),T}if(v.protocol&&v.protocol!==T.protocol){if(!w[v.protocol]){for(var V=Object.keys(v),L=0;L<V.length;L++){var le=V[L];T[le]=v[le]}return T.href=T.format(),T}if(T.protocol=v.protocol,!v.host&&!b[v.protocol]){for(var he=(v.pathname||"").split("/");he.length&&!(v.host=he.shift()););v.host||(v.host=""),v.hostname||(v.hostname=""),he[0]!==""&&he.unshift(""),he.length<2&&he.unshift(""),T.pathname=he.join("/")}else T.pathname=v.pathname;if(T.search=v.search,T.query=v.query,T.host=v.host||"",T.auth=v.auth,T.hostname=v.hostname||v.host,T.port=v.port,T.pathname||T.search){var re=T.pathname||"",ee=T.search||"";T.path=re+ee}return T.slashes=T.slashes||v.slashes,T.href=T.format(),T}var ue=T.pathname&&T.pathname.charAt(0)==="/",G=v.host||v.pathname&&v.pathname.charAt(0)==="/",oe=G||ue||T.host&&v.pathname,R=oe,Q=T.pathname&&T.pathname.split("/")||[],he=v.pathname&&v.pathname.split("/")||[],q=T.protocol&&!w[T.protocol];if(q&&(T.hostname="",T.port=null,T.host&&(Q[0]===""?Q[0]=T.host:Q.unshift(T.host)),T.host="",v.protocol&&(v.hostname=null,v.port=null,v.host&&(he[0]===""?he[0]=v.host:he.unshift(v.host)),v.host=null),oe=oe&&(he[0]===""||Q[0]==="")),G)T.host=v.host||v.host===""?v.host:T.host,T.hostname=v.hostname||v.hostname===""?v.hostname:T.hostname,T.search=v.search,T.query=v.query,Q=he;else if(he.length)Q||(Q=[]),Q.pop(),Q=Q.concat(he),T.search=v.search,T.query=v.query;else if(v.search!=null){if(q){T.host=Q.shift(),T.hostname=T.host;var Ee=T.host&&T.host.indexOf("@")>0?T.host.split("@"):!1;Ee&&(T.auth=Ee.shift(),T.hostname=Ee.shift(),T.host=T.hostname)}return T.search=v.search,T.query=v.query,(T.pathname!==null||T.search!==null)&&(T.path=(T.pathname?T.pathname:"")+(T.search?T.search:"")),T.href=T.format(),T}if(!Q.length)return T.pathname=null,T.search?T.path="/"+T.search:T.path=null,T.href=T.format(),T;for(var X=Q.slice(-1)[0],U=(T.host||v.host||Q.length>1)&&(X==="."||X==="..")||X==="",ae=0,H=Q.length;H>=0;H--)X=Q[H],X==="."?Q.splice(H,1):X===".."?(Q.splice(H,1),ae++):ae&&(Q.splice(H,1),ae--);if(!oe&&!R)for(;ae--;ae)Q.unshift("..");oe&&Q[0]!==""&&(!Q[0]||Q[0].charAt(0)!=="/")&&Q.unshift(""),U&&Q.join("/").substr(-1)!=="/"&&Q.push("");var te=Q[0]===""||Q[0]&&Q[0].charAt(0)==="/";if(q){T.hostname=te?"":Q.length?Q.shift():"",T.host=T.hostname;var Ee=T.host&&T.host.indexOf("@")>0?T.host.split("@"):!1;Ee&&(T.auth=Ee.shift(),T.hostname=Ee.shift(),T.host=T.hostname)}return oe=oe||T.host&&Q.length,oe&&!te&&Q.unshift(""),Q.length>0?T.pathname=Q.join("/"):(T.pathname=null,T.path=null),(T.pathname!==null||T.search!==null)&&(T.path=(T.pathname?T.pathname:"")+(T.search?T.search:"")),T.auth=v.auth||T.auth,T.slashes=T.slashes||v.slashes,T.href=T.format(),T},l.prototype.parseHost=function(){var v=this.host,C=a.exec(v);C&&(C=C[0],C!==":"&&(this.port=C.substr(1)),v=v.substr(0,v.length-C.length)),v&&(this.hostname=v)},qt.parse=A,qt.resolve=_,qt.resolveObject=E,qt.format=g,qt.Url=l,qt}function Ga(o){if(typeof o=="string")o=new URL(o);else if(!(o instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(o.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return rn?Ef(o):Af(o)}function Ef(o){let l=o.hostname,s=o.pathname;for(let a=0;a<s.length;a++)if(s[a]==="%"){let c=s.codePointAt(a+2)||32;if(s[a+1]==="2"&&c===102||s[a+1]==="5"&&c===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(s=s.replace(ll,"\\"),s=decodeURIComponent(s),l!=="")return`\\\\${l}${s}`;{let a=s.codePointAt(1)|32,c=s[2];if(a<sl||a>al||c!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return s.slice(1)}}function Af(o){if(o.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let l=o.pathname;for(let s=0;s<l.length;s++)if(l[s]==="%"){let a=l.codePointAt(s+2)||32;if(l[s+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(l)}function Ya(o){let l=yo.resolve(o),s=o.charCodeAt(o.length-1);(s===ol||rn&&s===il)&&l[l.length-1]!==yo.sep&&(l+="/");let a=new URL("file://");return l.includes("%")&&(l=l.replace(ul,"%25")),!rn&&l.includes("\\")&&(l=l.replace(cl,"%5C")),l.includes(`
37
- `)&&(l=l.replace(fl,"%0A")),l.includes("\r")&&(l=l.replace(hl,"%0D")),l.includes(" ")&&(l=l.replace(pl,"%09")),a.pathname=l,a}var Qa,Gr,bo,Yr,Qr,vo,Jr,wo,Xr,_o,Zr,So,en,Eo,tn,Ao,qt,xo,vt,Ja,Xa,Za,el,tl,rl,nl,il,ol,sl,al,rn,ll,ul,cl,fl,hl,pl,xf=_t(()=>{de(),ye(),ge(),Wc(),nf(),yf(),za(),Qa=Object.freeze(Object.create(null)),Gr={},bo=!1,Yr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Qr={},vo=!1,Jr={},wo=!1,Xr={},_o=!1,Zr={},So=!1,en={},Eo=!1,tn={},Ao=!1,qt={},xo=!1,vt=Sf(),vt.parse,vt.resolve,vt.resolveObject,vt.format,vt.Url,Ja=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,vt.URL=typeof URL<"u"?URL:null,vt.pathToFileURL=Ya,vt.fileURLToPath=Ga,Xa=vt.Url,Za=vt.format,el=vt.resolve,tl=vt.resolveObject,rl=vt.parse,nl=vt.URL,il=92,ol=47,sl=97,al=122,rn=Ja==="win32",ll=/\//g,ul=/%/g,cl=/\\/g,fl=/\n/g,hl=/\r/g,pl=/\t/g}),If=we((o,l)=>{de(),ye(),ge(),l.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),Io=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.BufferedDuplex=void 0,o.writev=a;var l=Xt(),s=(dt(),tt(pt));function a(t,r){let n=new Array(t.length);for(let e=0;e<t.length;e++)typeof t[e].chunk=="string"?n[e]=s.Buffer.from(t[e].chunk,"utf8"):n[e]=t[e].chunk;this._write(s.Buffer.concat(n),"binary",r)}var c=class extends l.Duplex{constructor(r,n,e){super({objectMode:!0});Pe(this,"socket");Pe(this,"proxy");Pe(this,"isSocketOpen");Pe(this,"writeQueue");this.proxy=n,this.socket=e,this.writeQueue=[],r.objectMode||(this._writev=a.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",i=>{!this.destroyed&&this.readable&&this.push(i)})}_read(r){this.proxy.read(r)}_write(r,n,e){this.isSocketOpen?this.writeToProxy(r,n,e):this.writeQueue.push({chunk:r,encoding:n,cb:e})}_final(r){this.writeQueue=[],this.proxy.end(r)}_destroy(r,n){this.writeQueue=[],this.proxy.destroy(),n(r)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(r,n,e){this.proxy.write(r,n)===!1?this.proxy.once("drain",e):e()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:r,encoding:n,cb:e}=this.writeQueue.shift();this.writeToProxy(r,n,e)}}};o.BufferedDuplex=c}),nn=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(o,"__esModule",{value:!0}),o.streamBuilder=o.browserStreamBuilder=void 0;var s=(dt(),tt(pt)),a=l(If()),c=l(Mt()),t=Xt(),r=l(Cr()),n=Io(),e=(0,c.default)("mqttjs:ws"),i=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function u(A,g){let _=`${A.protocol}://${A.hostname}:${A.port}${A.path}`;return typeof A.transformWsUrl=="function"&&(_=A.transformWsUrl(_,A,g)),_}function h(A){let g=A;return A.port||(A.protocol==="wss"?g.port=443:g.port=80),A.path||(g.path="/"),A.wsOptions||(g.wsOptions={}),!r.default&&!A.forceNativeWebSocket&&A.protocol==="wss"&&i.forEach(_=>{Object.prototype.hasOwnProperty.call(A,_)&&!Object.prototype.hasOwnProperty.call(A.wsOptions,_)&&(g.wsOptions[_]=A[_])}),g}function d(A){let g=h(A);if(g.hostname||(g.hostname=g.host),!g.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let _=new URL(document.URL);g.hostname=_.hostname,g.port||(g.port=Number(_.port))}return g.objectMode===void 0&&(g.objectMode=!(g.binary===!0||g.binary===void 0)),g}function y(A,g,_){e("createWebSocket"),e(`protocol: ${_.protocolId} ${_.protocolVersion}`);let E=_.protocolId==="MQIsdp"&&_.protocolVersion===3?"mqttv3.1":"mqtt";e(`creating new Websocket for url: ${g} and protocol: ${E}`);let v;return _.createWebsocket?v=_.createWebsocket(g,[E],_):v=new a.default(g,[E],_.wsOptions),v}function b(A,g){let _=g.protocolId==="MQIsdp"&&g.protocolVersion===3?"mqttv3.1":"mqtt",E=u(g,A),v;return g.createWebsocket?v=g.createWebsocket(E,[_],g):v=new WebSocket(E,[_]),v.binaryType="arraybuffer",v}var w=(A,g)=>{e("streamBuilder");let _=h(g);_.hostname=_.hostname||_.host||"localhost";let E=u(_,A),v=y(A,E,_),C=a.default.createWebSocketStream(v,_.wsOptions);return C.url=E,v.on("close",()=>{C.destroy()}),C};o.streamBuilder=w;var S=(A,g)=>{e("browserStreamBuilder");let _,E=d(g).browserBufferSize||1024*512,v=g.browserBufferTimeout||1e3,C=!g.objectMode,T=b(A,g),x=O(g,L,le);g.objectMode||(x._writev=n.writev.bind(x)),x.on("close",()=>{T.close()});let P=typeof T.addEventListener<"u";T.readyState===T.OPEN?(_=x,_.socket=T):(_=new n.BufferedDuplex(g,x,T),P?T.addEventListener("open",F):T.onopen=F),P?(T.addEventListener("close",I),T.addEventListener("error",W),T.addEventListener("message",V)):(T.onclose=I,T.onerror=W,T.onmessage=V);function O(re,ee,ue){let G=new t.Transform({objectMode:re.objectMode});return G._write=ee,G._flush=ue,G}function F(){e("WebSocket onOpen"),_ instanceof n.BufferedDuplex&&_.socketReady()}function I(re){e("WebSocket onClose",re),_.end(),_.destroy()}function W(re){e("WebSocket onError",re);let ee=new Error("WebSocket error");ee.event=re,_.destroy(ee)}async function V(re){if(!x||!x.readable||!x.writable)return;let{data:ee}=re;ee instanceof ArrayBuffer?ee=s.Buffer.from(ee):ee instanceof Blob?ee=s.Buffer.from(await new Response(ee).arrayBuffer()):ee=s.Buffer.from(ee,"utf8"),x.push(ee)}function L(re,ee,ue){if(T.bufferedAmount>E){setTimeout(L,v,re,ee,ue);return}C&&typeof re=="string"&&(re=s.Buffer.from(re,"utf8"));try{T.send(re)}catch(G){return ue(G)}ue()}function le(re){T.close(),re()}return _};o.browserStreamBuilder=S}),ko={};nr(ko,{Server:()=>at,Socket:()=>at,Stream:()=>at,_createServerHandle:()=>at,_normalizeArgs:()=>at,_setSimultaneousAccepts:()=>at,connect:()=>at,createConnection:()=>at,createServer:()=>at,default:()=>dl,isIP:()=>at,isIPv4:()=>at,isIPv6:()=>at});function at(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var dl,gl=_t(()=>{de(),ye(),ge(),dl={_createServerHandle:at,_normalizeArgs:at,_setSimultaneousAccepts:at,connect:at,createConnection:at,createServer:at,isIP:at,isIPv4:at,isIPv6:at,Server:at,Socket:at,Stream:at}}),yl=we((o,l)=>{de(),ye(),ge(),l.exports={}}),ml=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(o,"__esModule",{value:!0});var s=l((gl(),tt(ko))),a=l(Mt()),c=l(yl()),t=(0,a.default)("mqttjs:tcp"),r=(n,e)=>{if(e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost",e.socksProxy)return(0,c.default)(e.hostname,e.port,e.socksProxy,{timeout:e.socksTimeout});let{port:i,path:u}=e,h=e.hostname;return t("port %d and host %s",i,h),s.default.createConnection({port:i,host:h,path:u})};o.default=r}),bl={};nr(bl,{default:()=>vl});var vl,kf=_t(()=>{de(),ye(),ge(),vl={}}),wl=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(o,"__esModule",{value:!0});var s=(kf(),tt(bl)),a=l((gl(),tt(ko))),c=l(Mt()),t=l(yl()),r=(0,c.default)("mqttjs:tls");function n(i){let{host:u,port:h,socksProxy:d,...y}=i;if(d!==void 0){let b=(0,t.default)(u,h,d,{timeout:i.socksTimeout});return(0,s.connect)({...y,socket:b})}return(0,s.connect)(i)}var e=(i,u)=>{u.port=u.port||8883,u.host=u.hostname||u.host||"localhost",a.default.isIP(u.host)===0&&(u.servername=u.host),u.rejectUnauthorized=u.rejectUnauthorized!==!1,delete u.path,r("port %d host %s rejectUnauthorized %b",u.port,u.host,u.rejectUnauthorized);let h=n(u);h.on("secureConnect",()=>{u.rejectUnauthorized&&!h.authorized?h.emit("error",new Error("TLS not authorized")):h.removeListener("error",d)});function d(y){u.rejectUnauthorized&&i.emit("error",y),h.end()}return h.on("error",d),h};o.default=e}),_l=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=(dt(),tt(pt)),s=Xt(),a=Io(),c,t,r;function n(){let d=new s.Transform;return d._write=(y,b,w)=>{c.send({data:y.buffer,success(){w()},fail(S){w(new Error(S))}})},d._flush=y=>{c.close({success(){y()}})},d}function e(d){d.hostname||(d.hostname="localhost"),d.path||(d.path="/"),d.wsOptions||(d.wsOptions={})}function i(d,y){let b=d.protocol==="wxs"?"wss":"ws",w=`${b}://${d.hostname}${d.path}`;return d.port&&d.port!==80&&d.port!==443&&(w=`${b}://${d.hostname}:${d.port}${d.path}`),typeof d.transformWsUrl=="function"&&(w=d.transformWsUrl(w,d,y)),w}function u(){c.onOpen(()=>{r.socketReady()}),c.onMessage(d=>{let{data:y}=d;y instanceof ArrayBuffer?y=l.Buffer.from(y):y=l.Buffer.from(y,"utf8"),t.push(y)}),c.onClose(()=>{r.emit("close"),r.end(),r.destroy()}),c.onError(d=>{let y=new Error(d.errMsg);r.destroy(y)})}var h=(d,y)=>{if(y.hostname=y.hostname||y.host,!y.hostname)throw new Error("Could not determine host. Specify host manually.");let b=y.protocolId==="MQIsdp"&&y.protocolVersion===3?"mqttv3.1":"mqtt";e(y);let w=i(y,d);c=wx.connectSocket({url:w,protocols:[b]}),t=n(),r=new a.BufferedDuplex(y,t,c),r._destroy=(A,g)=>{c.close({success(){g&&g(A)}})};let S=r.destroy;return r.destroy=(A,g)=>(r.destroy=S,setTimeout(()=>{c.close({fail(){r._destroy(A,g)}})},0),r),u(),r};o.default=h}),Sl=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=(dt(),tt(pt)),s=Xt(),a=Io(),c,t,r,n=!1;function e(){let y=new s.Transform;return y._write=(b,w,S)=>{c.sendSocketMessage({data:b.buffer,success(){S()},fail(){S(new Error)}})},y._flush=b=>{c.closeSocket({success(){b()}})},y}function i(y){y.hostname||(y.hostname="localhost"),y.path||(y.path="/"),y.wsOptions||(y.wsOptions={})}function u(y,b){let w=y.protocol==="alis"?"wss":"ws",S=`${w}://${y.hostname}${y.path}`;return y.port&&y.port!==80&&y.port!==443&&(S=`${w}://${y.hostname}:${y.port}${y.path}`),typeof y.transformWsUrl=="function"&&(S=y.transformWsUrl(S,y,b)),S}function h(){n||(n=!0,c.onSocketOpen(()=>{r.socketReady()}),c.onSocketMessage(y=>{if(typeof y.data=="string"){let b=l.Buffer.from(y.data,"base64");t.push(b)}else{let b=new FileReader;b.addEventListener("load",()=>{if(b.result instanceof ArrayBuffer){t.push(l.Buffer.from(b.result));return}t.push(l.Buffer.from(b.result,"utf-8"))}),b.readAsArrayBuffer(y.data)}}),c.onSocketClose(()=>{r.end(),r.destroy()}),c.onSocketError(y=>{r.destroy(y)}))}var d=(y,b)=>{if(b.hostname=b.hostname||b.host,!b.hostname)throw new Error("Could not determine host. Specify host manually.");let w=b.protocolId==="MQIsdp"&&b.protocolVersion===3?"mqttv3.1":"mqtt";i(b);let S=u(b,y);return c=b.my,c.connectSocket({url:S,protocols:w}),t=e(),r=new a.BufferedDuplex(b,t,c),h(),r};o.default=d}),Of=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(o,"__esModule",{value:!0}),o.connectAsync=u;var s=l(Mt()),a=l((xf(),tt(Ka))),c=l(Ci()),t=l(Cr());typeof(Je==null?void 0:Je.nextTick)!="function"&&(Je.nextTick=setImmediate);var r=(0,s.default)("mqttjs"),n=null;function e(h){let d;if(h.auth)if(d=h.auth.match(/^(.+):(.+)$/),d){let[,y,b]=d;h.username=y,h.password=b}else h.username=h.auth}function i(h,d){var w,S,A;if(r("connecting to an MQTT broker..."),typeof h=="object"&&!d&&(d=h,h=""),d=d||{},h&&typeof h=="string"){let g=a.default.parse(h,!0),_={};if(g.port!=null&&(_.port=Number(g.port)),_.host=g.hostname,_.query=g.query,_.auth=g.auth,_.protocol=g.protocol,_.path=g.path,d={..._,...d},!d.protocol)throw new Error("Missing protocol");d.protocol=d.protocol.replace(/:$/,"")}if(d.unixSocket=d.unixSocket||((w=d.protocol)==null?void 0:w.includes("+unix")),d.unixSocket?d.protocol=d.protocol.replace("+unix",""):!((S=d.protocol)!=null&&S.startsWith("ws"))&&!((A=d.protocol)!=null&&A.startsWith("wx"))&&delete d.path,e(d),d.query&&typeof d.query.clientId=="string"&&(d.clientId=d.query.clientId),t.default||d.unixSocket?d.socksProxy=void 0:d.socksProxy===void 0&&typeof Je<"u"&&(d.socksProxy=Je.env.MQTTJS_SOCKS_PROXY),d.cert&&d.key)if(d.protocol){if(["mqtts","wss","wxs","alis"].indexOf(d.protocol)===-1)switch(d.protocol){case"mqtt":d.protocol="mqtts";break;case"ws":d.protocol="wss";break;case"wx":d.protocol="wxs";break;case"ali":d.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${d.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(n||(n={},!t.default&&!d.forceNativeWebSocket?(n.ws=nn().streamBuilder,n.wss=nn().streamBuilder,n.mqtt=ml().default,n.tcp=ml().default,n.ssl=wl().default,n.tls=n.ssl,n.mqtts=wl().default):(n.ws=nn().browserStreamBuilder,n.wss=nn().browserStreamBuilder,n.wx=_l().default,n.wxs=_l().default,n.ali=Sl().default,n.alis=Sl().default)),!n[d.protocol]){let g=["mqtts","wss"].indexOf(d.protocol)!==-1;d.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((_,E)=>g&&E%2===0?!1:typeof n[_]=="function")[0]}if(d.clean===!1&&!d.clientId)throw new Error("Missing clientId for unclean clients");d.protocol&&(d.defaultProtocol=d.protocol);function y(g){return d.servers&&((!g._reconnectCount||g._reconnectCount===d.servers.length)&&(g._reconnectCount=0),d.host=d.servers[g._reconnectCount].host,d.port=d.servers[g._reconnectCount].port,d.protocol=d.servers[g._reconnectCount].protocol?d.servers[g._reconnectCount].protocol:d.defaultProtocol,d.hostname=d.host,g._reconnectCount++),r("calling streambuilder for",d.protocol),n[d.protocol](g,d)}let b=new c.default(y,d);return b.on("error",()=>{}),b}function u(h,d,y=!0){return new Promise((b,w)=>{let S=i(h,d),A={connect:_=>{g(),b(S)},end:()=>{g(),b(S)},error:_=>{g(),S.end(),w(_)}};y===!1&&(A.close=()=>{A.error(new Error("Couldn't connect to server"))});function g(){Object.keys(A).forEach(_=>{S.off(_,A[_])})}Object.keys(A).forEach(_=>{S.on(_,A[_])})})}o.default=i}),El=we(o=>{de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(y,b,w,S){S===void 0&&(S=w);var A=Object.getOwnPropertyDescriptor(b,w);(!A||("get"in A?!b.__esModule:A.writable||A.configurable))&&(A={enumerable:!0,get:function(){return b[w]}}),Object.defineProperty(y,S,A)}:function(y,b,w,S){S===void 0&&(S=w),y[S]=b[w]}),s=o&&o.__setModuleDefault||(Object.create?function(y,b){Object.defineProperty(y,"default",{enumerable:!0,value:b})}:function(y,b){y.default=b}),a=o&&o.__importStar||function(){var y=function(b){return y=Object.getOwnPropertyNames||function(w){var S=[];for(var A in w)Object.prototype.hasOwnProperty.call(w,A)&&(S[S.length]=A);return S},y(b)};return function(b){if(b&&b.__esModule)return b;var w={};if(b!=null)for(var S=y(b),A=0;A<S.length;A++)S[A]!=="default"&&l(w,b,S[A]);return s(w,b),w}}(),c=o&&o.__exportStar||function(y,b){for(var w in y)w!=="default"&&!Object.prototype.hasOwnProperty.call(b,w)&&l(b,y,w)},t=o&&o.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(o,"__esModule",{value:!0}),o.ReasonCodes=o.KeepaliveManager=o.UniqueMessageIdProvider=o.DefaultMessageIdProvider=o.Store=o.MqttClient=o.connectAsync=o.connect=o.Client=void 0;var r=t(Ci());o.MqttClient=r.default;var n=t(Ps());o.DefaultMessageIdProvider=n.default;var e=t(Dc());o.UniqueMessageIdProvider=e.default;var i=t(Es());o.Store=i.default;var u=a(Of());o.connect=u.default,Object.defineProperty(o,"connectAsync",{enumerable:!0,get:function(){return u.connectAsync}});var h=t(Ls());o.KeepaliveManager=h.default,o.Client=r.default,c(Ci(),o),c(ar(),o);var d=Tr();Object.defineProperty(o,"ReasonCodes",{enumerable:!0,get:function(){return d.ReasonCodes}})}),Tf=we(o=>{de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(r,n,e,i){i===void 0&&(i=e);var u=Object.getOwnPropertyDescriptor(n,e);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return n[e]}}),Object.defineProperty(r,i,u)}:function(r,n,e,i){i===void 0&&(i=e),r[i]=n[e]}),s=o&&o.__setModuleDefault||(Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n}),a=o&&o.__importStar||function(){var r=function(n){return r=Object.getOwnPropertyNames||function(e){var i=[];for(var u in e)Object.prototype.hasOwnProperty.call(e,u)&&(i[i.length]=u);return i},r(n)};return function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var i=r(n),u=0;u<i.length;u++)i[u]!=="default"&&l(e,n,i[u]);return s(e,n),e}}(),c=o&&o.__exportStar||function(r,n){for(var e in r)e!=="default"&&!Object.prototype.hasOwnProperty.call(n,e)&&l(n,r,e)};Object.defineProperty(o,"__esModule",{value:!0});var t=a(El());o.default=t,c(El(),o)});const Pf=Tf();/*! Bundled license information:
35
+ `+J.prev}function ie($,J){var Te=he($),Me=[];if(Te){Me.length=$.length;for(var Ne=0;Ne<$.length;Ne++)Me[Ne]=ce($,Ne)?J($[Ne],$):""}var Fe=typeof I=="function"?I($):[],nt;if(V){nt={};for(var rt=0;rt<Fe.length;rt++)nt["$"+Fe[rt]]=Fe[rt]}for(var Ke in $)ce($,Ke)&&(Te&&String(Number(Ke))===Ke&&Ke<$.length||V&&nt["$"+Ke]instanceof Symbol||(C.call(/[^\w$]/,Ke)?Me.push(J(Ke,$)+": "+J($[Ke],$)):Me.push(Ke+": "+J($[Ke],$))));if(typeof I=="function")for(var Xe=0;Xe<Fe.length;Xe++)le.call($,Fe[Xe])&&Me.push("["+J(Fe[Xe])+"]: "+J($[Fe[Xe]],$));return Me}return Gr}function vf(){if(vo)return Qr;vo=!0;var o=lr(),l=nf(),s=bf(),a=vr(),u=o("%WeakMap%",!0),t=o("%Map%",!0),r=l("WeakMap.prototype.get",!0),n=l("WeakMap.prototype.set",!0),e=l("WeakMap.prototype.has",!0),i=l("Map.prototype.get",!0),c=l("Map.prototype.set",!0),h=l("Map.prototype.has",!0),d=function(S,A){for(var g=S,_;(_=g.next)!==null;g=_)if(_.key===A)return g.next=_.next,_.next=S.next,S.next=_,_},y=function(S,A){var g=d(S,A);return g&&g.value},b=function(S,A,g){var _=d(S,A);_?_.value=g:S.next={key:A,next:S.next,value:g}},w=function(S,A){return!!d(S,A)};return Qr=function(){var S,A,g,_={assert:function(E){if(!_.has(E))throw new a("Side channel does not contain "+s(E))},get:function(E){if(u&&E&&(typeof E=="object"||typeof E=="function")){if(S)return r(S,E)}else if(t){if(A)return i(A,E)}else if(g)return y(g,E)},has:function(E){if(u&&E&&(typeof E=="object"||typeof E=="function")){if(S)return e(S,E)}else if(t){if(A)return h(A,E)}else if(g)return w(g,E);return!1},set:function(E,v){u&&E&&(typeof E=="object"||typeof E=="function")?(S||(S=new u),n(S,E,v)):t?(A||(A=new t),c(A,E,v)):(g||(g={key:{},next:null}),b(g,E,v))}};return _},Qr}function mo(){if(wo)return Jr;wo=!0;var o=String.prototype.replace,l=/%20/g,s={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Jr={default:s.RFC3986,formatters:{RFC1738:function(a){return o.call(a,l,"+")},RFC3986:function(a){return String(a)}},RFC1738:s.RFC1738,RFC3986:s.RFC3986},Jr}function Ya(){if(_o)return Xr;_o=!0;var o=mo(),l=Object.prototype.hasOwnProperty,s=Array.isArray,a=function(){for(var S=[],A=0;A<256;++A)S.push("%"+((A<16?"0":"")+A.toString(16)).toUpperCase());return S}(),u=function(S){for(;S.length>1;){var A=S.pop(),g=A.obj[A.prop];if(s(g)){for(var _=[],E=0;E<g.length;++E)typeof g[E]<"u"&&_.push(g[E]);A.obj[A.prop]=_}}},t=function(S,A){for(var g=A&&A.plainObjects?Object.create(null):{},_=0;_<S.length;++_)typeof S[_]<"u"&&(g[_]=S[_]);return g},r=function S(A,g,_){if(!g)return A;if(typeof g!="object"){if(s(A))A.push(g);else if(A&&typeof A=="object")(_&&(_.plainObjects||_.allowPrototypes)||!l.call(Object.prototype,g))&&(A[g]=!0);else return[A,g];return A}if(!A||typeof A!="object")return[A].concat(g);var E=A;return s(A)&&!s(g)&&(E=t(A,_)),s(A)&&s(g)?(g.forEach(function(v,C){if(l.call(A,C)){var T=A[C];T&&typeof T=="object"&&v&&typeof v=="object"?A[C]=S(T,v,_):A.push(v)}else A[C]=v}),A):Object.keys(g).reduce(function(v,C){var T=g[C];return l.call(v,C)?v[C]=S(v[C],T,_):v[C]=T,v},E)},n=function(S,A){return Object.keys(A).reduce(function(g,_){return g[_]=A[_],g},S)},e=function(S,A,g){var _=S.replace(/\+/g," ");if(g==="iso-8859-1")return _.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(_)}catch{return _}},i=1024,c=function(S,A,g,_,E){if(S.length===0)return S;var v=S;if(typeof S=="symbol"?v=Symbol.prototype.toString.call(S):typeof S!="string"&&(v=String(S)),g==="iso-8859-1")return escape(v).replace(/%u[0-9a-f]{4}/gi,function(I){return"%26%23"+parseInt(I.slice(2),16)+"%3B"});for(var C="",T=0;T<v.length;T+=i){for(var x=v.length>=i?v.slice(T,T+i):v,P=[],O=0;O<x.length;++O){var F=x.charCodeAt(O);if(F===45||F===46||F===95||F===126||F>=48&&F<=57||F>=65&&F<=90||F>=97&&F<=122||E===o.RFC1738&&(F===40||F===41)){P[P.length]=x.charAt(O);continue}if(F<128){P[P.length]=a[F];continue}if(F<2048){P[P.length]=a[192|F>>6]+a[128|F&63];continue}if(F<55296||F>=57344){P[P.length]=a[224|F>>12]+a[128|F>>6&63]+a[128|F&63];continue}O+=1,F=65536+((F&1023)<<10|x.charCodeAt(O)&1023),P[P.length]=a[240|F>>18]+a[128|F>>12&63]+a[128|F>>6&63]+a[128|F&63]}C+=P.join("")}return C},h=function(S){for(var A=[{obj:{o:S},prop:"o"}],g=[],_=0;_<A.length;++_)for(var E=A[_],v=E.obj[E.prop],C=Object.keys(v),T=0;T<C.length;++T){var x=C[T],P=v[x];typeof P=="object"&&P!==null&&g.indexOf(P)===-1&&(A.push({obj:v,prop:x}),g.push(P))}return u(A),S},d=function(S){return Object.prototype.toString.call(S)==="[object RegExp]"},y=function(S){return!S||typeof S!="object"?!1:!!(S.constructor&&S.constructor.isBuffer&&S.constructor.isBuffer(S))},b=function(S,A){return[].concat(S,A)},w=function(S,A){if(s(S)){for(var g=[],_=0;_<S.length;_+=1)g.push(A(S[_]));return g}return A(S)};return Xr={arrayToObject:t,assign:n,combine:b,compact:h,decode:e,encode:c,isBuffer:y,isRegExp:d,maybeMap:w,merge:r},Xr}function wf(){if(So)return Zr;So=!0;var o=vf(),l=Ya(),s=mo(),a=Object.prototype.hasOwnProperty,u={brackets:function(w){return w+"[]"},comma:"comma",indices:function(w,S){return w+"["+S+"]"},repeat:function(w){return w}},t=Array.isArray,r=Array.prototype.push,n=function(w,S){r.apply(w,t(S)?S:[S])},e=Date.prototype.toISOString,i=s.default,c={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:l.encode,encodeValuesOnly:!1,format:i,formatter:s.formatters[i],indices:!1,serializeDate:function(w){return e.call(w)},skipNulls:!1,strictNullHandling:!1},h=function(w){return typeof w=="string"||typeof w=="number"||typeof w=="boolean"||typeof w=="symbol"||typeof w=="bigint"},d={},y=function w(S,A,g,_,E,v,C,T,x,P,O,F,I,W,V,L,le,re){for(var ee=S,ue=re,G=0,oe=!1;(ue=ue.get(d))!==void 0&&!oe;){var R=ue.get(S);if(G+=1,typeof R<"u"){if(R===G)throw new RangeError("Cyclic object value");oe=!0}typeof ue.get(d)>"u"&&(G=0)}if(typeof P=="function"?ee=P(A,ee):ee instanceof Date?ee=I(ee):g==="comma"&&t(ee)&&(ee=l.maybeMap(ee,function(N){return N instanceof Date?I(N):N})),ee===null){if(v)return x&&!L?x(A,c.encoder,le,"key",W):A;ee=""}if(h(ee)||l.isBuffer(ee)){if(x){var Q=L?A:x(A,c.encoder,le,"key",W);return[V(Q)+"="+V(x(ee,c.encoder,le,"value",W))]}return[V(A)+"="+V(String(ee))]}var he=[];if(typeof ee>"u")return he;var q;if(g==="comma"&&t(ee))L&&x&&(ee=l.maybeMap(ee,x)),q=[{value:ee.length>0?ee.join(",")||null:void 0}];else if(t(P))q=P;else{var Ee=Object.keys(ee);q=O?Ee.sort(O):Ee}var X=T?A.replace(/\./g,"%2E"):A,U=_&&t(ee)&&ee.length===1?X+"[]":X;if(E&&t(ee)&&ee.length===0)return U+"[]";for(var ae=0;ae<q.length;++ae){var H=q[ae],te=typeof H=="object"&&typeof H.value<"u"?H.value:ee[H];if(!(C&&te===null)){var ne=F&&T?H.replace(/\./g,"%2E"):H,be=t(ee)?typeof g=="function"?g(U,ne):U:U+(F?"."+ne:"["+ne+"]");re.set(S,G);var ce=o();ce.set(d,re),n(he,w(te,be,g,_,E,v,C,T,g==="comma"&&L&&t(ee)?null:x,P,O,F,I,W,V,L,le,ce))}}return he},b=function(w){if(!w)return c;if(typeof w.allowEmptyArrays<"u"&&typeof w.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof w.encodeDotInKeys<"u"&&typeof w.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(w.encoder!==null&&typeof w.encoder<"u"&&typeof w.encoder!="function")throw new TypeError("Encoder has to be a function.");var S=w.charset||c.charset;if(typeof w.charset<"u"&&w.charset!=="utf-8"&&w.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var A=s.default;if(typeof w.format<"u"){if(!a.call(s.formatters,w.format))throw new TypeError("Unknown format option provided.");A=w.format}var g=s.formatters[A],_=c.filter;(typeof w.filter=="function"||t(w.filter))&&(_=w.filter);var E;if(w.arrayFormat in u?E=w.arrayFormat:"indices"in w?E=w.indices?"indices":"repeat":E=c.arrayFormat,"commaRoundTrip"in w&&typeof w.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var v=typeof w.allowDots>"u"?w.encodeDotInKeys===!0?!0:c.allowDots:!!w.allowDots;return{addQueryPrefix:typeof w.addQueryPrefix=="boolean"?w.addQueryPrefix:c.addQueryPrefix,allowDots:v,allowEmptyArrays:typeof w.allowEmptyArrays=="boolean"?!!w.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:E,charset:S,charsetSentinel:typeof w.charsetSentinel=="boolean"?w.charsetSentinel:c.charsetSentinel,commaRoundTrip:w.commaRoundTrip,delimiter:typeof w.delimiter>"u"?c.delimiter:w.delimiter,encode:typeof w.encode=="boolean"?w.encode:c.encode,encodeDotInKeys:typeof w.encodeDotInKeys=="boolean"?w.encodeDotInKeys:c.encodeDotInKeys,encoder:typeof w.encoder=="function"?w.encoder:c.encoder,encodeValuesOnly:typeof w.encodeValuesOnly=="boolean"?w.encodeValuesOnly:c.encodeValuesOnly,filter:_,format:A,formatter:g,serializeDate:typeof w.serializeDate=="function"?w.serializeDate:c.serializeDate,skipNulls:typeof w.skipNulls=="boolean"?w.skipNulls:c.skipNulls,sort:typeof w.sort=="function"?w.sort:null,strictNullHandling:typeof w.strictNullHandling=="boolean"?w.strictNullHandling:c.strictNullHandling}};return Zr=function(w,S){var A=w,g=b(S),_,E;typeof g.filter=="function"?(E=g.filter,A=E("",A)):t(g.filter)&&(E=g.filter,_=E);var v=[];if(typeof A!="object"||A===null)return"";var C=u[g.arrayFormat],T=C==="comma"&&g.commaRoundTrip;_||(_=Object.keys(A)),g.sort&&_.sort(g.sort);for(var x=o(),P=0;P<_.length;++P){var O=_[P];g.skipNulls&&A[O]===null||n(v,y(A[O],O,C,T,g.allowEmptyArrays,g.strictNullHandling,g.skipNulls,g.encodeDotInKeys,g.encode?g.encoder:null,g.filter,g.sort,g.allowDots,g.serializeDate,g.format,g.formatter,g.encodeValuesOnly,g.charset,x))}var F=v.join(g.delimiter),I=g.addQueryPrefix===!0?"?":"";return g.charsetSentinel&&(g.charset==="iso-8859-1"?I+="utf8=%26%2310003%3B&":I+="utf8=%E2%9C%93&"),F.length>0?I+F:""},Zr}function _f(){if(Eo)return en;Eo=!0;var o=Ya(),l=Object.prototype.hasOwnProperty,s=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:o.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},u=function(d){return d.replace(/&#(\d+);/g,function(y,b){return String.fromCharCode(parseInt(b,10))})},t=function(d,y){return d&&typeof d=="string"&&y.comma&&d.indexOf(",")>-1?d.split(","):d},r="utf8=%26%2310003%3B",n="utf8=%E2%9C%93",e=function(d,y){var b={__proto__:null},w=y.ignoreQueryPrefix?d.replace(/^\?/,""):d;w=w.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var S=y.parameterLimit===1/0?void 0:y.parameterLimit,A=w.split(y.delimiter,S),g=-1,_,E=y.charset;if(y.charsetSentinel)for(_=0;_<A.length;++_)A[_].indexOf("utf8=")===0&&(A[_]===n?E="utf-8":A[_]===r&&(E="iso-8859-1"),g=_,_=A.length);for(_=0;_<A.length;++_)if(_!==g){var v=A[_],C=v.indexOf("]="),T=C===-1?v.indexOf("="):C+1,x,P;T===-1?(x=y.decoder(v,a.decoder,E,"key"),P=y.strictNullHandling?null:""):(x=y.decoder(v.slice(0,T),a.decoder,E,"key"),P=o.maybeMap(t(v.slice(T+1),y),function(F){return y.decoder(F,a.decoder,E,"value")})),P&&y.interpretNumericEntities&&E==="iso-8859-1"&&(P=u(P)),v.indexOf("[]=")>-1&&(P=s(P)?[P]:P);var O=l.call(b,x);O&&y.duplicates==="combine"?b[x]=o.combine(b[x],P):(!O||y.duplicates==="last")&&(b[x]=P)}return b},i=function(d,y,b,w){for(var S=w?y:t(y,b),A=d.length-1;A>=0;--A){var g,_=d[A];if(_==="[]"&&b.parseArrays)g=b.allowEmptyArrays&&(S===""||b.strictNullHandling&&S===null)?[]:[].concat(S);else{g=b.plainObjects?Object.create(null):{};var E=_.charAt(0)==="["&&_.charAt(_.length-1)==="]"?_.slice(1,-1):_,v=b.decodeDotInKeys?E.replace(/%2E/g,"."):E,C=parseInt(v,10);!b.parseArrays&&v===""?g={0:S}:!isNaN(C)&&_!==v&&String(C)===v&&C>=0&&b.parseArrays&&C<=b.arrayLimit?(g=[],g[C]=S):v!=="__proto__"&&(g[v]=S)}S=g}return S},c=function(d,y,b,w){if(d){var S=b.allowDots?d.replace(/\.([^.[]+)/g,"[$1]"):d,A=/(\[[^[\]]*])/,g=/(\[[^[\]]*])/g,_=b.depth>0&&A.exec(S),E=_?S.slice(0,_.index):S,v=[];if(E){if(!b.plainObjects&&l.call(Object.prototype,E)&&!b.allowPrototypes)return;v.push(E)}for(var C=0;b.depth>0&&(_=g.exec(S))!==null&&C<b.depth;){if(C+=1,!b.plainObjects&&l.call(Object.prototype,_[1].slice(1,-1))&&!b.allowPrototypes)return;v.push(_[1])}if(_){if(b.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+b.depth+" and strictDepth is true");v.push("["+S.slice(_.index)+"]")}return i(v,y,b,w)}},h=function(d){if(!d)return a;if(typeof d.allowEmptyArrays<"u"&&typeof d.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof d.decodeDotInKeys<"u"&&typeof d.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(d.decoder!==null&&typeof d.decoder<"u"&&typeof d.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof d.charset<"u"&&d.charset!=="utf-8"&&d.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=typeof d.charset>"u"?a.charset:d.charset,b=typeof d.duplicates>"u"?a.duplicates:d.duplicates;if(b!=="combine"&&b!=="first"&&b!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var w=typeof d.allowDots>"u"?d.decodeDotInKeys===!0?!0:a.allowDots:!!d.allowDots;return{allowDots:w,allowEmptyArrays:typeof d.allowEmptyArrays=="boolean"?!!d.allowEmptyArrays:a.allowEmptyArrays,allowPrototypes:typeof d.allowPrototypes=="boolean"?d.allowPrototypes:a.allowPrototypes,allowSparse:typeof d.allowSparse=="boolean"?d.allowSparse:a.allowSparse,arrayLimit:typeof d.arrayLimit=="number"?d.arrayLimit:a.arrayLimit,charset:y,charsetSentinel:typeof d.charsetSentinel=="boolean"?d.charsetSentinel:a.charsetSentinel,comma:typeof d.comma=="boolean"?d.comma:a.comma,decodeDotInKeys:typeof d.decodeDotInKeys=="boolean"?d.decodeDotInKeys:a.decodeDotInKeys,decoder:typeof d.decoder=="function"?d.decoder:a.decoder,delimiter:typeof d.delimiter=="string"||o.isRegExp(d.delimiter)?d.delimiter:a.delimiter,depth:typeof d.depth=="number"||d.depth===!1?+d.depth:a.depth,duplicates:b,ignoreQueryPrefix:d.ignoreQueryPrefix===!0,interpretNumericEntities:typeof d.interpretNumericEntities=="boolean"?d.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:typeof d.parameterLimit=="number"?d.parameterLimit:a.parameterLimit,parseArrays:d.parseArrays!==!1,plainObjects:typeof d.plainObjects=="boolean"?d.plainObjects:a.plainObjects,strictDepth:typeof d.strictDepth=="boolean"?!!d.strictDepth:a.strictDepth,strictNullHandling:typeof d.strictNullHandling=="boolean"?d.strictNullHandling:a.strictNullHandling}};return en=function(d,y){var b=h(y);if(d===""||d===null||typeof d>"u")return b.plainObjects?Object.create(null):{};for(var w=typeof d=="string"?e(d,b):d,S=b.plainObjects?Object.create(null):{},A=Object.keys(w),g=0;g<A.length;++g){var _=A[g],E=c(_,w[_],b,typeof d=="string");S=o.merge(S,E,b)}return b.allowSparse===!0?S:o.compact(S)},en}function Sf(){if(Ao)return tn;Ao=!0;var o=wf(),l=_f(),s=mo();return tn={formats:s,parse:l,stringify:o},tn}function Ef(){if(xo)return qt;xo=!0;var o=Wt;function l(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,t=["<",">",'"',"`"," ","\r",`
36
+ `," "],r=["{","}","|","\\","^","`"].concat(t),n=["'"].concat(r),e=["%","/","?",";","#"].concat(n),i=["/","?","#"],c=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},S=Sf();function A(v,C,T){if(v&&typeof v=="object"&&v instanceof l)return v;var x=new l;return x.parse(v,C,T),x}l.prototype.parse=function(v,C,T){if(typeof v!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof v);var x=v.indexOf("?"),P=x!==-1&&x<v.indexOf("#")?"?":"#",O=v.split(P),F=/\\/g;O[0]=O[0].replace(F,"/"),v=O.join(P);var I=v;if(I=I.trim(),!T&&v.split("#").length===1){var W=u.exec(I);if(W)return this.path=I,this.href=I,this.pathname=W[1],W[2]?(this.search=W[2],C?this.query=S.parse(this.search.substr(1)):this.query=this.search.substr(1)):C&&(this.search="",this.query={}),this}var V=s.exec(I);if(V){V=V[0];var L=V.toLowerCase();this.protocol=L,I=I.substr(V.length)}if(T||V||I.match(/^\/\/[^@/]+@[^@/]+/)){var le=I.substr(0,2)==="//";le&&!(V&&b[V])&&(I=I.substr(2),this.slashes=!0)}if(!b[V]&&(le||V&&!w[V])){for(var re=-1,ee=0;ee<i.length;ee++){var ue=I.indexOf(i[ee]);ue!==-1&&(re===-1||ue<re)&&(re=ue)}var G,oe;re===-1?oe=I.lastIndexOf("@"):oe=I.lastIndexOf("@",re),oe!==-1&&(G=I.slice(0,oe),I=I.slice(oe+1),this.auth=decodeURIComponent(G)),re=-1;for(var ee=0;ee<e.length;ee++){var ue=I.indexOf(e[ee]);ue!==-1&&(re===-1||ue<re)&&(re=ue)}re===-1&&(re=I.length),this.host=I.slice(0,re),I=I.slice(re),this.parseHost(),this.hostname=this.hostname||"";var R=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!R)for(var Q=this.hostname.split(/\./),ee=0,he=Q.length;ee<he;ee++){var q=Q[ee];if(q&&!q.match(h)){for(var Ee="",X=0,U=q.length;X<U;X++)q.charCodeAt(X)>127?Ee+="x":Ee+=q[X];if(!Ee.match(h)){var ae=Q.slice(0,ee),H=Q.slice(ee+1),te=q.match(d);te&&(ae.push(te[1]),H.unshift(te[2])),H.length&&(I="/"+H.join(".")+I),this.hostname=ae.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=o.toASCII(this.hostname));var ne=this.port?":"+this.port:"",be=this.hostname||"";this.host=be+ne,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),I[0]!=="/"&&(I="/"+I))}if(!y[L])for(var ee=0,he=n.length;ee<he;ee++){var ce=n[ee];if(I.indexOf(ce)!==-1){var N=encodeURIComponent(ce);N===ce&&(N=escape(ce)),I=I.split(ce).join(N)}}var Y=I.indexOf("#");Y!==-1&&(this.hash=I.substr(Y),I=I.slice(0,Y));var se=I.indexOf("?");if(se!==-1?(this.search=I.substr(se),this.query=I.substr(se+1),C&&(this.query=S.parse(this.query)),I=I.slice(0,se)):C&&(this.search="",this.query={}),I&&(this.pathname=I),w[L]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ne=this.pathname||"",me=this.search||"";this.path=ne+me}return this.href=this.format(),this};function g(v){return typeof v=="string"&&(v=A(v)),v instanceof l?v.format():l.prototype.format.call(v)}l.prototype.format=function(){var v=this.auth||"";v&&(v=encodeURIComponent(v),v=v.replace(/%3A/i,":"),v+="@");var C=this.protocol||"",T=this.pathname||"",x=this.hash||"",P=!1,O="";this.host?P=v+this.host:this.hostname&&(P=v+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(P+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(O=S.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var F=this.search||O&&"?"+O||"";return C&&C.substr(-1)!==":"&&(C+=":"),this.slashes||(!C||w[C])&&P!==!1?(P="//"+(P||""),T&&T.charAt(0)!=="/"&&(T="/"+T)):P||(P=""),x&&x.charAt(0)!=="#"&&(x="#"+x),F&&F.charAt(0)!=="?"&&(F="?"+F),T=T.replace(/[?#]/g,function(I){return encodeURIComponent(I)}),F=F.replace("#","%23"),C+P+T+F+x};function _(v,C){return A(v,!1,!0).resolve(C)}l.prototype.resolve=function(v){return this.resolveObject(A(v,!1,!0)).format()};function E(v,C){return v?A(v,!1,!0).resolveObject(C):C}return l.prototype.resolveObject=function(v){if(typeof v=="string"){var C=new l;C.parse(v,!1,!0),v=C}for(var T=new l,x=Object.keys(this),P=0;P<x.length;P++){var O=x[P];T[O]=this[O]}if(T.hash=v.hash,v.href==="")return T.href=T.format(),T;if(v.slashes&&!v.protocol){for(var F=Object.keys(v),I=0;I<F.length;I++){var W=F[I];W!=="protocol"&&(T[W]=v[W])}return w[T.protocol]&&T.hostname&&!T.pathname&&(T.pathname="/",T.path=T.pathname),T.href=T.format(),T}if(v.protocol&&v.protocol!==T.protocol){if(!w[v.protocol]){for(var V=Object.keys(v),L=0;L<V.length;L++){var le=V[L];T[le]=v[le]}return T.href=T.format(),T}if(T.protocol=v.protocol,!v.host&&!b[v.protocol]){for(var he=(v.pathname||"").split("/");he.length&&!(v.host=he.shift()););v.host||(v.host=""),v.hostname||(v.hostname=""),he[0]!==""&&he.unshift(""),he.length<2&&he.unshift(""),T.pathname=he.join("/")}else T.pathname=v.pathname;if(T.search=v.search,T.query=v.query,T.host=v.host||"",T.auth=v.auth,T.hostname=v.hostname||v.host,T.port=v.port,T.pathname||T.search){var re=T.pathname||"",ee=T.search||"";T.path=re+ee}return T.slashes=T.slashes||v.slashes,T.href=T.format(),T}var ue=T.pathname&&T.pathname.charAt(0)==="/",G=v.host||v.pathname&&v.pathname.charAt(0)==="/",oe=G||ue||T.host&&v.pathname,R=oe,Q=T.pathname&&T.pathname.split("/")||[],he=v.pathname&&v.pathname.split("/")||[],q=T.protocol&&!w[T.protocol];if(q&&(T.hostname="",T.port=null,T.host&&(Q[0]===""?Q[0]=T.host:Q.unshift(T.host)),T.host="",v.protocol&&(v.hostname=null,v.port=null,v.host&&(he[0]===""?he[0]=v.host:he.unshift(v.host)),v.host=null),oe=oe&&(he[0]===""||Q[0]==="")),G)T.host=v.host||v.host===""?v.host:T.host,T.hostname=v.hostname||v.hostname===""?v.hostname:T.hostname,T.search=v.search,T.query=v.query,Q=he;else if(he.length)Q||(Q=[]),Q.pop(),Q=Q.concat(he),T.search=v.search,T.query=v.query;else if(v.search!=null){if(q){T.host=Q.shift(),T.hostname=T.host;var Ee=T.host&&T.host.indexOf("@")>0?T.host.split("@"):!1;Ee&&(T.auth=Ee.shift(),T.hostname=Ee.shift(),T.host=T.hostname)}return T.search=v.search,T.query=v.query,(T.pathname!==null||T.search!==null)&&(T.path=(T.pathname?T.pathname:"")+(T.search?T.search:"")),T.href=T.format(),T}if(!Q.length)return T.pathname=null,T.search?T.path="/"+T.search:T.path=null,T.href=T.format(),T;for(var X=Q.slice(-1)[0],U=(T.host||v.host||Q.length>1)&&(X==="."||X==="..")||X==="",ae=0,H=Q.length;H>=0;H--)X=Q[H],X==="."?Q.splice(H,1):X===".."?(Q.splice(H,1),ae++):ae&&(Q.splice(H,1),ae--);if(!oe&&!R)for(;ae--;ae)Q.unshift("..");oe&&Q[0]!==""&&(!Q[0]||Q[0].charAt(0)!=="/")&&Q.unshift(""),U&&Q.join("/").substr(-1)!=="/"&&Q.push("");var te=Q[0]===""||Q[0]&&Q[0].charAt(0)==="/";if(q){T.hostname=te?"":Q.length?Q.shift():"",T.host=T.hostname;var Ee=T.host&&T.host.indexOf("@")>0?T.host.split("@"):!1;Ee&&(T.auth=Ee.shift(),T.hostname=Ee.shift(),T.host=T.hostname)}return oe=oe||T.host&&Q.length,oe&&!te&&Q.unshift(""),Q.length>0?T.pathname=Q.join("/"):(T.pathname=null,T.path=null),(T.pathname!==null||T.search!==null)&&(T.path=(T.pathname?T.pathname:"")+(T.search?T.search:"")),T.auth=v.auth||T.auth,T.slashes=T.slashes||v.slashes,T.href=T.format(),T},l.prototype.parseHost=function(){var v=this.host,C=a.exec(v);C&&(C=C[0],C!==":"&&(this.port=C.substr(1)),v=v.substr(0,v.length-C.length)),v&&(this.hostname=v)},qt.parse=A,qt.resolve=_,qt.resolveObject=E,qt.format=g,qt.Url=l,qt}function Qa(o){if(typeof o=="string")o=new URL(o);else if(!(o instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(o.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return rn?Af(o):xf(o)}function Af(o){let l=o.hostname,s=o.pathname;for(let a=0;a<s.length;a++)if(s[a]==="%"){let u=s.codePointAt(a+2)||32;if(s[a+1]==="2"&&u===102||s[a+1]==="5"&&u===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(s=s.replace(cl,"\\"),s=decodeURIComponent(s),l!=="")return`\\\\${l}${s}`;{let a=s.codePointAt(1)|32,u=s[2];if(a<ll||a>ul||u!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return s.slice(1)}}function xf(o){if(o.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let l=o.pathname;for(let s=0;s<l.length;s++)if(l[s]==="%"){let a=l.codePointAt(s+2)||32;if(l[s+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(l)}function Ja(o){let l=yo.resolve(o),s=o.charCodeAt(o.length-1);(s===al||rn&&s===sl)&&l[l.length-1]!==yo.sep&&(l+="/");let a=new URL("file://");return l.includes("%")&&(l=l.replace(fl,"%25")),!rn&&l.includes("\\")&&(l=l.replace(hl,"%5C")),l.includes(`
37
+ `)&&(l=l.replace(pl,"%0A")),l.includes("\r")&&(l=l.replace(dl,"%0D")),l.includes(" ")&&(l=l.replace(gl,"%09")),a.pathname=l,a}var Xa,Gr,bo,Yr,Qr,vo,Jr,wo,Xr,_o,Zr,So,en,Eo,tn,Ao,qt,xo,vt,Za,el,tl,rl,nl,il,ol,sl,al,ll,ul,rn,cl,fl,hl,pl,dl,gl,If=_t(()=>{de(),ye(),ge(),$c(),of(),mf(),Ha(),Xa=Object.freeze(Object.create(null)),Gr={},bo=!1,Yr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Qr={},vo=!1,Jr={},wo=!1,Xr={},_o=!1,Zr={},So=!1,en={},Eo=!1,tn={},Ao=!1,qt={},xo=!1,vt=Ef(),vt.parse,vt.resolve,vt.resolveObject,vt.format,vt.Url,Za=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,vt.URL=typeof URL<"u"?URL:null,vt.pathToFileURL=Ja,vt.fileURLToPath=Qa,el=vt.Url,tl=vt.format,rl=vt.resolve,nl=vt.resolveObject,il=vt.parse,ol=vt.URL,sl=92,al=47,ll=97,ul=122,rn=Za==="win32",cl=/\//g,fl=/%/g,hl=/\\/g,pl=/\n/g,dl=/\r/g,gl=/\t/g}),kf=we((o,l)=>{de(),ye(),ge(),l.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),Io=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.BufferedDuplex=void 0,o.writev=a;var l=Xt(),s=(dt(),tt(pt));function a(t,r){let n=new Array(t.length);for(let e=0;e<t.length;e++)typeof t[e].chunk=="string"?n[e]=s.Buffer.from(t[e].chunk,"utf8"):n[e]=t[e].chunk;this._write(s.Buffer.concat(n),"binary",r)}var u=class extends l.Duplex{constructor(r,n,e){super({objectMode:!0});Pe(this,"socket");Pe(this,"proxy");Pe(this,"isSocketOpen");Pe(this,"writeQueue");this.proxy=n,this.socket=e,this.writeQueue=[],r.objectMode||(this._writev=a.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",i=>{!this.destroyed&&this.readable&&this.push(i)})}_read(r){this.proxy.read(r)}_write(r,n,e){this.isSocketOpen?this.writeToProxy(r,n,e):this.writeQueue.push({chunk:r,encoding:n,cb:e})}_final(r){this.writeQueue=[],this.proxy.end(r)}_destroy(r,n){this.writeQueue=[],this.proxy.destroy(),n(r)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(r,n,e){this.proxy.write(r,n)===!1?this.proxy.once("drain",e):e()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:r,encoding:n,cb:e}=this.writeQueue.shift();this.writeToProxy(r,n,e)}}};o.BufferedDuplex=u}),nn=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(o,"__esModule",{value:!0}),o.streamBuilder=o.browserStreamBuilder=void 0;var s=(dt(),tt(pt)),a=l(kf()),u=l(Mt()),t=Xt(),r=l(Cr()),n=Io(),e=(0,u.default)("mqttjs:ws"),i=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function c(A,g){let _=`${A.protocol}://${A.hostname}:${A.port}${A.path}`;return typeof A.transformWsUrl=="function"&&(_=A.transformWsUrl(_,A,g)),_}function h(A){let g=A;return A.port||(A.protocol==="wss"?g.port=443:g.port=80),A.path||(g.path="/"),A.wsOptions||(g.wsOptions={}),!r.default&&!A.forceNativeWebSocket&&A.protocol==="wss"&&i.forEach(_=>{Object.prototype.hasOwnProperty.call(A,_)&&!Object.prototype.hasOwnProperty.call(A.wsOptions,_)&&(g.wsOptions[_]=A[_])}),g}function d(A){let g=h(A);if(g.hostname||(g.hostname=g.host),!g.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let _=new URL(document.URL);g.hostname=_.hostname,g.port||(g.port=Number(_.port))}return g.objectMode===void 0&&(g.objectMode=!(g.binary===!0||g.binary===void 0)),g}function y(A,g,_){e("createWebSocket"),e(`protocol: ${_.protocolId} ${_.protocolVersion}`);let E=_.protocolId==="MQIsdp"&&_.protocolVersion===3?"mqttv3.1":"mqtt";e(`creating new Websocket for url: ${g} and protocol: ${E}`);let v;return _.createWebsocket?v=_.createWebsocket(g,[E],_):v=new a.default(g,[E],_.wsOptions),v}function b(A,g){let _=g.protocolId==="MQIsdp"&&g.protocolVersion===3?"mqttv3.1":"mqtt",E=c(g,A),v;return g.createWebsocket?v=g.createWebsocket(E,[_],g):v=new WebSocket(E,[_]),v.binaryType="arraybuffer",v}var w=(A,g)=>{e("streamBuilder");let _=h(g);_.hostname=_.hostname||_.host||"localhost";let E=c(_,A),v=y(A,E,_),C=a.default.createWebSocketStream(v,_.wsOptions);return C.url=E,v.on("close",()=>{C.destroy()}),C};o.streamBuilder=w;var S=(A,g)=>{e("browserStreamBuilder");let _,E=d(g).browserBufferSize||1024*512,v=g.browserBufferTimeout||1e3,C=!g.objectMode,T=b(A,g),x=O(g,L,le);g.objectMode||(x._writev=n.writev.bind(x)),x.on("close",()=>{T.close()});let P=typeof T.addEventListener<"u";T.readyState===T.OPEN?(_=x,_.socket=T):(_=new n.BufferedDuplex(g,x,T),P?T.addEventListener("open",F):T.onopen=F),P?(T.addEventListener("close",I),T.addEventListener("error",W),T.addEventListener("message",V)):(T.onclose=I,T.onerror=W,T.onmessage=V);function O(re,ee,ue){let G=new t.Transform({objectMode:re.objectMode});return G._write=ee,G._flush=ue,G}function F(){e("WebSocket onOpen"),_ instanceof n.BufferedDuplex&&_.socketReady()}function I(re){e("WebSocket onClose",re),_.end(),_.destroy()}function W(re){e("WebSocket onError",re);let ee=new Error("WebSocket error");ee.event=re,_.destroy(ee)}async function V(re){if(!x||!x.readable||!x.writable)return;let{data:ee}=re;ee instanceof ArrayBuffer?ee=s.Buffer.from(ee):ee instanceof Blob?ee=s.Buffer.from(await new Response(ee).arrayBuffer()):ee=s.Buffer.from(ee,"utf8"),x.push(ee)}function L(re,ee,ue){if(T.bufferedAmount>E){setTimeout(L,v,re,ee,ue);return}C&&typeof re=="string"&&(re=s.Buffer.from(re,"utf8"));try{T.send(re)}catch(G){return ue(G)}ue()}function le(re){T.close(),re()}return _};o.browserStreamBuilder=S}),ko={};nr(ko,{Server:()=>at,Socket:()=>at,Stream:()=>at,_createServerHandle:()=>at,_normalizeArgs:()=>at,_setSimultaneousAccepts:()=>at,connect:()=>at,createConnection:()=>at,createServer:()=>at,default:()=>yl,isIP:()=>at,isIPv4:()=>at,isIPv6:()=>at});function at(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var yl,ml=_t(()=>{de(),ye(),ge(),yl={_createServerHandle:at,_normalizeArgs:at,_setSimultaneousAccepts:at,connect:at,createConnection:at,createServer:at,isIP:at,isIPv4:at,isIPv6:at,Server:at,Socket:at,Stream:at}}),bl=we((o,l)=>{de(),ye(),ge(),l.exports={}}),vl=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(o,"__esModule",{value:!0});var s=l((ml(),tt(ko))),a=l(Mt()),u=l(bl()),t=(0,a.default)("mqttjs:tcp"),r=(n,e)=>{if(e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost",e.socksProxy)return(0,u.default)(e.hostname,e.port,e.socksProxy,{timeout:e.socksTimeout});let{port:i,path:c}=e,h=e.hostname;return t("port %d and host %s",i,h),s.default.createConnection({port:i,host:h,path:c})};o.default=r}),wl={};nr(wl,{default:()=>_l});var _l,Of=_t(()=>{de(),ye(),ge(),_l={}}),Sl=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(o,"__esModule",{value:!0});var s=(Of(),tt(wl)),a=l((ml(),tt(ko))),u=l(Mt()),t=l(bl()),r=(0,u.default)("mqttjs:tls");function n(i){let{host:c,port:h,socksProxy:d,...y}=i;if(d!==void 0){let b=(0,t.default)(c,h,d,{timeout:i.socksTimeout});return(0,s.connect)({...y,socket:b})}return(0,s.connect)(i)}var e=(i,c)=>{c.port=c.port||8883,c.host=c.hostname||c.host||"localhost",a.default.isIP(c.host)===0&&(c.servername=c.host),c.rejectUnauthorized=c.rejectUnauthorized!==!1,delete c.path,r("port %d host %s rejectUnauthorized %b",c.port,c.host,c.rejectUnauthorized);let h=n(c);h.on("secureConnect",()=>{c.rejectUnauthorized&&!h.authorized?h.emit("error",new Error("TLS not authorized")):h.removeListener("error",d)});function d(y){c.rejectUnauthorized&&i.emit("error",y),h.end()}return h.on("error",d),h};o.default=e}),El=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=(dt(),tt(pt)),s=Xt(),a=Io(),u,t,r;function n(){let d=new s.Transform;return d._write=(y,b,w)=>{u.send({data:y.buffer,success(){w()},fail(S){w(new Error(S))}})},d._flush=y=>{u.close({success(){y()}})},d}function e(d){d.hostname||(d.hostname="localhost"),d.path||(d.path="/"),d.wsOptions||(d.wsOptions={})}function i(d,y){let b=d.protocol==="wxs"?"wss":"ws",w=`${b}://${d.hostname}${d.path}`;return d.port&&d.port!==80&&d.port!==443&&(w=`${b}://${d.hostname}:${d.port}${d.path}`),typeof d.transformWsUrl=="function"&&(w=d.transformWsUrl(w,d,y)),w}function c(){u.onOpen(()=>{r.socketReady()}),u.onMessage(d=>{let{data:y}=d;y instanceof ArrayBuffer?y=l.Buffer.from(y):y=l.Buffer.from(y,"utf8"),t.push(y)}),u.onClose(()=>{r.emit("close"),r.end(),r.destroy()}),u.onError(d=>{let y=new Error(d.errMsg);r.destroy(y)})}var h=(d,y)=>{if(y.hostname=y.hostname||y.host,!y.hostname)throw new Error("Could not determine host. Specify host manually.");let b=y.protocolId==="MQIsdp"&&y.protocolVersion===3?"mqttv3.1":"mqtt";e(y);let w=i(y,d);u=wx.connectSocket({url:w,protocols:[b]}),t=n(),r=new a.BufferedDuplex(y,t,u),r._destroy=(A,g)=>{u.close({success(){g&&g(A)}})};let S=r.destroy;return r.destroy=(A,g)=>(r.destroy=S,setTimeout(()=>{u.close({fail(){r._destroy(A,g)}})},0),r),c(),r};o.default=h}),Al=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=(dt(),tt(pt)),s=Xt(),a=Io(),u,t,r,n=!1;function e(){let y=new s.Transform;return y._write=(b,w,S)=>{u.sendSocketMessage({data:b.buffer,success(){S()},fail(){S(new Error)}})},y._flush=b=>{u.closeSocket({success(){b()}})},y}function i(y){y.hostname||(y.hostname="localhost"),y.path||(y.path="/"),y.wsOptions||(y.wsOptions={})}function c(y,b){let w=y.protocol==="alis"?"wss":"ws",S=`${w}://${y.hostname}${y.path}`;return y.port&&y.port!==80&&y.port!==443&&(S=`${w}://${y.hostname}:${y.port}${y.path}`),typeof y.transformWsUrl=="function"&&(S=y.transformWsUrl(S,y,b)),S}function h(){n||(n=!0,u.onSocketOpen(()=>{r.socketReady()}),u.onSocketMessage(y=>{if(typeof y.data=="string"){let b=l.Buffer.from(y.data,"base64");t.push(b)}else{let b=new FileReader;b.addEventListener("load",()=>{if(b.result instanceof ArrayBuffer){t.push(l.Buffer.from(b.result));return}t.push(l.Buffer.from(b.result,"utf-8"))}),b.readAsArrayBuffer(y.data)}}),u.onSocketClose(()=>{r.end(),r.destroy()}),u.onSocketError(y=>{r.destroy(y)}))}var d=(y,b)=>{if(b.hostname=b.hostname||b.host,!b.hostname)throw new Error("Could not determine host. Specify host manually.");let w=b.protocolId==="MQIsdp"&&b.protocolVersion===3?"mqttv3.1":"mqtt";i(b);let S=c(b,y);return u=b.my,u.connectSocket({url:S,protocols:w}),t=e(),r=new a.BufferedDuplex(b,t,u),h(),r};o.default=d}),Tf=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(o,"__esModule",{value:!0}),o.connectAsync=c;var s=l(Mt()),a=l((If(),tt(Ga))),u=l(Ci()),t=l(Cr());typeof(Je==null?void 0:Je.nextTick)!="function"&&(Je.nextTick=setImmediate);var r=(0,s.default)("mqttjs"),n=null;function e(h){let d;if(h.auth)if(d=h.auth.match(/^(.+):(.+)$/),d){let[,y,b]=d;h.username=y,h.password=b}else h.username=h.auth}function i(h,d){var w,S,A;if(r("connecting to an MQTT broker..."),typeof h=="object"&&!d&&(d=h,h=""),d=d||{},h&&typeof h=="string"){let g=a.default.parse(h,!0),_={};if(g.port!=null&&(_.port=Number(g.port)),_.host=g.hostname,_.query=g.query,_.auth=g.auth,_.protocol=g.protocol,_.path=g.path,d={..._,...d},!d.protocol)throw new Error("Missing protocol");d.protocol=d.protocol.replace(/:$/,"")}if(d.unixSocket=d.unixSocket||((w=d.protocol)==null?void 0:w.includes("+unix")),d.unixSocket?d.protocol=d.protocol.replace("+unix",""):!((S=d.protocol)!=null&&S.startsWith("ws"))&&!((A=d.protocol)!=null&&A.startsWith("wx"))&&delete d.path,e(d),d.query&&typeof d.query.clientId=="string"&&(d.clientId=d.query.clientId),t.default||d.unixSocket?d.socksProxy=void 0:d.socksProxy===void 0&&typeof Je<"u"&&(d.socksProxy=Je.env.MQTTJS_SOCKS_PROXY),d.cert&&d.key)if(d.protocol){if(["mqtts","wss","wxs","alis"].indexOf(d.protocol)===-1)switch(d.protocol){case"mqtt":d.protocol="mqtts";break;case"ws":d.protocol="wss";break;case"wx":d.protocol="wxs";break;case"ali":d.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${d.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(n||(n={},!t.default&&!d.forceNativeWebSocket?(n.ws=nn().streamBuilder,n.wss=nn().streamBuilder,n.mqtt=vl().default,n.tcp=vl().default,n.ssl=Sl().default,n.tls=n.ssl,n.mqtts=Sl().default):(n.ws=nn().browserStreamBuilder,n.wss=nn().browserStreamBuilder,n.wx=El().default,n.wxs=El().default,n.ali=Al().default,n.alis=Al().default)),!n[d.protocol]){let g=["mqtts","wss"].indexOf(d.protocol)!==-1;d.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((_,E)=>g&&E%2===0?!1:typeof n[_]=="function")[0]}if(d.clean===!1&&!d.clientId)throw new Error("Missing clientId for unclean clients");d.protocol&&(d.defaultProtocol=d.protocol);function y(g){return d.servers&&((!g._reconnectCount||g._reconnectCount===d.servers.length)&&(g._reconnectCount=0),d.host=d.servers[g._reconnectCount].host,d.port=d.servers[g._reconnectCount].port,d.protocol=d.servers[g._reconnectCount].protocol?d.servers[g._reconnectCount].protocol:d.defaultProtocol,d.hostname=d.host,g._reconnectCount++),r("calling streambuilder for",d.protocol),n[d.protocol](g,d)}let b=new u.default(y,d);return b.on("error",()=>{}),b}function c(h,d,y=!0){return new Promise((b,w)=>{let S=i(h,d),A={connect:_=>{g(),b(S)},end:()=>{g(),b(S)},error:_=>{g(),S.end(),w(_)}};y===!1&&(A.close=()=>{A.error(new Error("Couldn't connect to server"))});function g(){Object.keys(A).forEach(_=>{S.off(_,A[_])})}Object.keys(A).forEach(_=>{S.on(_,A[_])})})}o.default=i}),xl=we(o=>{de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(y,b,w,S){S===void 0&&(S=w);var A=Object.getOwnPropertyDescriptor(b,w);(!A||("get"in A?!b.__esModule:A.writable||A.configurable))&&(A={enumerable:!0,get:function(){return b[w]}}),Object.defineProperty(y,S,A)}:function(y,b,w,S){S===void 0&&(S=w),y[S]=b[w]}),s=o&&o.__setModuleDefault||(Object.create?function(y,b){Object.defineProperty(y,"default",{enumerable:!0,value:b})}:function(y,b){y.default=b}),a=o&&o.__importStar||function(){var y=function(b){return y=Object.getOwnPropertyNames||function(w){var S=[];for(var A in w)Object.prototype.hasOwnProperty.call(w,A)&&(S[S.length]=A);return S},y(b)};return function(b){if(b&&b.__esModule)return b;var w={};if(b!=null)for(var S=y(b),A=0;A<S.length;A++)S[A]!=="default"&&l(w,b,S[A]);return s(w,b),w}}(),u=o&&o.__exportStar||function(y,b){for(var w in y)w!=="default"&&!Object.prototype.hasOwnProperty.call(b,w)&&l(b,y,w)},t=o&&o.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(o,"__esModule",{value:!0}),o.ReasonCodes=o.KeepaliveManager=o.UniqueMessageIdProvider=o.DefaultMessageIdProvider=o.Store=o.MqttClient=o.connectAsync=o.connect=o.Client=void 0;var r=t(Ci());o.MqttClient=r.default;var n=t(js());o.DefaultMessageIdProvider=n.default;var e=t(Fc());o.UniqueMessageIdProvider=e.default;var i=t(xs());o.Store=i.default;var c=a(Tf());o.connect=c.default,Object.defineProperty(o,"connectAsync",{enumerable:!0,get:function(){return c.connectAsync}});var h=t(Ds());o.KeepaliveManager=h.default,o.Client=r.default,u(Ci(),o),u(ar(),o);var d=Tr();Object.defineProperty(o,"ReasonCodes",{enumerable:!0,get:function(){return d.ReasonCodes}})}),Pf=we(o=>{de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(r,n,e,i){i===void 0&&(i=e);var c=Object.getOwnPropertyDescriptor(n,e);(!c||("get"in c?!n.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return n[e]}}),Object.defineProperty(r,i,c)}:function(r,n,e,i){i===void 0&&(i=e),r[i]=n[e]}),s=o&&o.__setModuleDefault||(Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n}),a=o&&o.__importStar||function(){var r=function(n){return r=Object.getOwnPropertyNames||function(e){var i=[];for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&(i[i.length]=c);return i},r(n)};return function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var i=r(n),c=0;c<i.length;c++)i[c]!=="default"&&l(e,n,i[c]);return s(e,n),e}}(),u=o&&o.__exportStar||function(r,n){for(var e in r)e!=="default"&&!Object.prototype.hasOwnProperty.call(n,e)&&l(n,r,e)};Object.defineProperty(o,"__esModule",{value:!0});var t=a(xl());o.default=t,u(xl(),o)});const Cf=Pf();/*! Bundled license information:
38
38
 
39
39
  @jspm/core/nodelibs/browser/chunk-DtuTasat.js:
40
40
  (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
@@ -44,62 +44,62 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
44
44
 
45
45
  @babel/runtime/helpers/regenerator.js:
46
46
  (*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
47
- */const Al=Oe.createContext(null),Cf=({children:o})=>{const[l,s]=Oe.useState(!1),[a,c]=Oe.useState({}),t=Oe.useRef(null),r=Oe.useRef(new Set),n=Ht();Oe.useEffect(()=>{const h=n.config.brokerUrl||"wss://test.mosquitto.org:8081";console.log(`[MQTT] Connecting to ${h}...`),t.current&&t.current.end();const d=Pf.connect(h);return t.current=d,d.on("connect",()=>{console.log("[MQTT] Connected ✅"),s(!0),r.current.forEach(y=>d.subscribe(y))}),d.on("message",(y,b)=>{const w=b.toString();c(S=>({...S,[y]:w}))}),d.on("error",y=>{console.error("[MQTT] Connection error: ",y),d.end()}),()=>{console.log("[MQTT] Disconnecting..."),d.end()}},[n.config.brokerUrl]);const e=h=>{t.current&&!r.current.has(h)&&(t.current.subscribe(h),r.current.add(h))},i=h=>{t.current&&r.current.has(h)&&(t.current.unsubscribe(h),r.current.delete(h))},u=(h,d)=>{t.current&&t.current.publish(h,d)};return Ie.jsx(Al.Provider,{value:{isConnected:l,lastMessage:a,subscribe:e,unsubscribe:i,publish:u},children:o})},Oo=()=>{const o=Oe.useContext(Al);if(!o)throw new Error("useMqtt must be used within an MqttProvider");return o},xl=Oe.createContext([]),jf=()=>{const o=Oe.useContext(xl);if(o===void 0)throw new Error("useSitemap must be used within a SitemapProvider");return o},Rf=xl.Provider,Mf=()=>{const{publish:o,isConnected:l}=Oo(),s=Ht(),{config:a,domain:c}=s;return{sendAction:Oe.useCallback(async(r,n)=>{const e=c.entities.find(h=>h.id===r);if(!e){console.warn(`[Action] Entity ID '${r}' not found in manifest.`);return}const i=e.signals[0],u=c.signals.find(h=>h.id===i);if(!u){console.warn(`[Action] No signal linked to entity: ${r}`);return}if(a.mockMode){console.log(`%c[Mock Action] Setting ${e.name} to:`,"color: #10b981; font-weight: bold;",n);return}if(u.source==="mqtt"&&u.topic){if(!l){console.warn("[Action] Cannot send: MQTT disconnected");return}const h=typeof n=="object"?JSON.stringify(n):String(n);console.log(`[MQTT] Publishing to '${u.topic}': ${h}`),o(u.topic,h)}if(u.source==="http"&&u.endpoint)try{await fetch(u.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:u.id,value:n})})}catch{console.log("[HTTP] (Simulation) Request sent.")}},[a.mockMode,l,o,c])}},Il=(o,l)=>{const[s,a]=Oe.useState(()=>{if(typeof window>"u")return l;try{const n=window.localStorage.getItem(o);return n?JSON.parse(n):(window.localStorage.setItem(o,JSON.stringify(l)),l)}catch(n){return console.error(`[Data Lake] Error reading key "${o}":`,n),l}}),c=Oe.useCallback(n=>{a(e=>{let i;e.length>0&&typeof e[0].id=="number"?i=e.reduce((b,w)=>typeof w.id=="number"&&w.id>b?w.id:b,0)+1:i=`id_${Date.now()}`;const h={...n,id:i},d=[...e,h];return window.localStorage.setItem(o,JSON.stringify(d)),d})},[o]),t=Oe.useCallback(n=>{a(e=>{const i=e.map(u=>u.id===n.id?n:u);return window.localStorage.setItem(o,JSON.stringify(i)),i})},[o]),r=Oe.useCallback(n=>{a(e=>{const i=e.filter(u=>u.id!==n);return window.localStorage.setItem(o,JSON.stringify(i)),i})},[o]);return{data:s,createItem:c,updateItem:t,deleteItem:r}};function Nf(o,l={}){const{filters:s,sort:a,page:c=1,pageSize:t=10}=l,r=Oe.useMemo(()=>!s||s.length===0?o:o.filter(i=>s.every(u=>{const h=i[u.field];switch(u.operator){case"equals":return h==u.value;case"neq":return h!=u.value;case"contains":return String(h).toLowerCase().includes(String(u.value).toLowerCase());case"gt":return h>u.value;case"lt":return h<u.value;default:return!0}})),[o,s]),n=Oe.useMemo(()=>a?[...r].sort((i,u)=>{const h=i[a.field],d=u[a.field];return h<d?a.direction==="asc"?-1:1:h>d?a.direction==="asc"?1:-1:0}):r,[r,a]);return{data:Oe.useMemo(()=>{const i=(c-1)*t;return n.slice(i,i+t)},[n,c,t]),total:r.length,pageCount:Math.ceil(r.length/t)}}const Bf="ramme_db_",Lf=(o,l)=>{const s=l+1,a=o.label||"Item";switch(o.type){case"text":return`${a} ${s}`;case"number":return Math.floor(Math.random()*100)+1;case"currency":return(Math.random()*1e3).toFixed(2);case"boolean":return Math.random()>.5;case"date":const c=new Date;return c.setDate(c.getDate()-s*2),c.toISOString().split("T")[0];case"status":return["Active","Pending","Inactive","Archived"][l%4];case"email":return`user${s}@example.com`;case"image":return`https://i.pravatar.cc/150?u=${s}`;case"textarea":return`This is a sample description for ${a} ${s}. It contains enough text to test multi-line rendering.`;default:return`${a}-${s}`}},To=(o,l)=>Oe.useMemo(()=>{if(!o)return[];if(typeof window<"u"){const s=`${Bf}${o}`,a=localStorage.getItem(s);if(a)try{const c=JSON.parse(a);if(Array.isArray(c)&&c.length>0)return c}catch{console.warn(`[JIT Seeder] Corrupt data in ${s}, falling back to generation.`)}}return l?(console.log(`🌱 [JIT Seeder] Generating 5 mock records for: ${o}`),Array.from({length:5}).map((a,c)=>{const t={id:`jit_${o}_${c+1}`};return l.fields.forEach(r=>{r.key!=="id"&&(t[r.key]=Lf(r,c))}),t})):[]},[o,l]),kl=({isOpen:o,onClose:l,onSubmit:s,title:a,fields:c,initialData:t})=>{const r=t||{},n=!!r.id,e=Oe.useMemo(()=>c.filter(i=>!(i.key==="id"&&!n)).map(i=>{const u=i.key==="id",h={name:i.key,label:i.label,required:i.required,placeholder:i.description||`Enter ${i.label.toLowerCase()}`,value:r[i.key]!==void 0?r[i.key]:i.defaultValue||"",colSpan:1,disabled:u};switch(i.type){case"number":case"integer":case"currency":return{...h,type:"number",value:Number(h.value)||0};case"boolean":return{...h,type:"toggle",checked:!!h.value};case"date":return{...h,type:"datepicker",value:h.value?new Date(h.value):null};case"status":return{...h,type:"select",options:[{value:"Active",label:"Active"},{value:"Pending",label:"Pending"},{value:"Inactive",label:"Inactive"},{value:"Archived",label:"Archived"}]};case"textarea":return{...h,type:"textarea",colSpan:2};case"email":return{...h,type:"email"};default:return{...h,type:"text"}}}),[c,r,n]);return Ie.jsx(qe.Drawer,{isOpen:o,onClose:l,title:`${n?"Edit":"New"} ${a}`,size:"500px",children:Ie.jsx("div",{className:"p-6",children:Ie.jsx(qe.FormTemplate,{fields:e,onSubmit:i=>{s({...r,...i})},children:Ie.jsxs("div",{className:"flex justify-end gap-2 mt-8 pt-4 border-t border-border",children:[Ie.jsx(qe.Button,{variant:"outline",onClick:l,type:"button",children:"Cancel"}),Ie.jsx(qe.Button,{type:"submit",variant:"primary",children:n?"Save Changes":"Create Record"})]})})})})},Po=({dataId:o,title:l,getResourceMeta:s})=>{const{addToast:a}=qe.useToast(),c=Ht(),t=Oe.useMemo(()=>{var C;const E=(C=c.resources)==null?void 0:C.find(T=>T.id===o);if(E)return E;const v=s==null?void 0:s(o);return v?{...v,id:o}:null},[c,o]),r=To(o,t),{data:n,createItem:e,updateItem:i,deleteItem:u}=Il(`ramme_db_${o}`,r),[h,d]=Oe.useState(!1),[y,b]=Oe.useState(null),[w,S]=Oe.useState(null),A=Oe.useMemo(()=>t!=null&&t.fields?t.fields.map(E=>({key:E.key,label:E.label,type:E.type,hide:E.key==="id"})):[],[t]),g=Oe.useMemo(()=>[{id:"edit",icon:"edit-2",variant:"ghost",onClick:E=>{b(E),d(!0)}},{id:"delete",icon:"trash-2",variant:"danger",onClick:E=>{confirm("Delete?")&&u(E.id)}}],[u]),_=E=>{E.id&&(y!=null&&y.id)?(i(E),a("Item updated","success")):(e({...E,id:void 0}),a("Item created","success")),d(!1)};return Ie.jsxs(qe.Card,{className:"flex flex-col h-[600px] border border-border shadow-sm overflow-hidden bg-card",children:[Ie.jsxs("div",{className:"p-4 border-b border-border flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 bg-muted/5",children:[Ie.jsxs("div",{className:"flex items-center gap-2",children:[Ie.jsx("h3",{className:"text-base font-bold",children:l||(t==null?void 0:t.name)||o}),Ie.jsx("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded",children:n.length})]}),Ie.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[Ie.jsx("div",{className:"w-full sm:w-64",children:Ie.jsx(qe.SearchInput,{placeholder:"Search...",onChange:E=>w==null?void 0:w.updateGridOptions({quickFilterText:E.target.value})})}),Ie.jsx(qe.Button,{size:"sm",iconLeft:"plus",onClick:()=>{b({}),d(!0)},children:"New"})]})]}),Ie.jsxs("div",{className:"flex-1 w-full bg-card relative overflow-hidden",children:[Ie.jsx("div",{className:"hidden md:block h-full",children:Ie.jsx(qe.DataTable,{rowData:n,schema:A,actions:g,onGridReady:E=>S(E.api),emptyState:Ie.jsx("div",{className:"text-muted-foreground",children:"No records found."})})}),Ie.jsxs("div",{className:"block md:hidden h-full overflow-y-auto p-4 space-y-3 bg-muted/5",children:[n.map((E,v)=>{var C;return Ie.jsxs("div",{className:"bg-background border border-border rounded-lg p-4 shadow-sm relative group",children:[Ie.jsxs("div",{className:"flex justify-between items-start mb-3 pb-2 border-b border-dashed",children:[Ie.jsx("span",{className:"font-semibold text-foreground",children:E[((C=A.find(T=>T.type==="text"&&T.key!=="id"))==null?void 0:C.key)||"id"]}),(()=>{const T=A.find(x=>x.type==="status");return T?qe.formatValue(E[T.key],"status"):null})()]}),Ie.jsx("div",{className:"space-y-2 text-sm",children:A.filter(T=>!T.hide&&T.type!=="status").slice(0,5).map(T=>Ie.jsxs("div",{className:"flex justify-between",children:[Ie.jsxs("span",{className:"text-muted-foreground",children:[T.label,":"]}),Ie.jsx("span",{className:"font-medium text-right",children:qe.formatValue(E[T.key],T.type)})]},T.key))}),Ie.jsxs("div",{className:"flex gap-2 pt-3 mt-3 border-t border-border/50",children:[Ie.jsx(qe.Button,{size:"sm",variant:"outline",className:"flex-1 h-8 text-xs",onClick:()=>{b(E),d(!0)},children:"Edit"}),Ie.jsx(qe.Button,{size:"sm",variant:"ghost",className:"h-8 w-8 text-destructive",onClick:()=>{confirm("Delete?")&&u(E.id)},children:Ie.jsx(qe.Icon,{name:"trash-2",size:14})})]})]},E.id||v)}),n.length===0&&Ie.jsx("div",{className:"text-center p-8 text-muted-foreground",children:"No records."})]})]}),Ie.jsx(kl,{isOpen:h,onClose:()=>d(!1),onSubmit:_,title:(t==null?void 0:t.name)||"Item",fields:(t==null?void 0:t.fields)||[],initialData:y})]})};/**
47
+ */const Il=Oe.createContext(null),jf=({children:o})=>{const[l,s]=Oe.useState(!1),[a,u]=Oe.useState({}),t=Oe.useRef(null),r=Oe.useRef(new Set),n=Ht();Oe.useEffect(()=>{const h=n.config.brokerUrl||"wss://test.mosquitto.org:8081";console.log(`[MQTT] Connecting to ${h}...`),t.current&&t.current.end();const d=Cf.connect(h);return t.current=d,d.on("connect",()=>{console.log("[MQTT] Connected ✅"),s(!0),r.current.forEach(y=>d.subscribe(y))}),d.on("message",(y,b)=>{const w=b.toString();u(S=>({...S,[y]:w}))}),d.on("error",y=>{console.error("[MQTT] Connection error: ",y),d.end()}),()=>{console.log("[MQTT] Disconnecting..."),d.end()}},[n.config.brokerUrl]);const e=h=>{t.current&&!r.current.has(h)&&(t.current.subscribe(h),r.current.add(h))},i=h=>{t.current&&r.current.has(h)&&(t.current.unsubscribe(h),r.current.delete(h))},c=(h,d)=>{t.current&&t.current.publish(h,d)};return Ie.jsx(Il.Provider,{value:{isConnected:l,lastMessage:a,subscribe:e,unsubscribe:i,publish:c},children:o})},Oo=()=>{const o=Oe.useContext(Il);if(!o)throw new Error("useMqtt must be used within an MqttProvider");return o},kl=Oe.createContext([]),Rf=()=>{const o=Oe.useContext(kl);if(o===void 0)throw new Error("useSitemap must be used within a SitemapProvider");return o},Mf=kl.Provider,Nf=()=>{const{publish:o,isConnected:l}=Oo(),s=Ht(),{config:a,domain:u}=s;return{sendAction:Oe.useCallback(async(r,n)=>{const e=u.entities.find(h=>h.id===r);if(!e){console.warn(`[Action] Entity ID '${r}' not found in manifest.`);return}const i=e.signals[0],c=u.signals.find(h=>h.id===i);if(!c){console.warn(`[Action] No signal linked to entity: ${r}`);return}if(a.mockMode){console.log(`%c[Mock Action] Setting ${e.name} to:`,"color: #10b981; font-weight: bold;",n);return}if(c.source==="mqtt"&&c.topic){if(!l){console.warn("[Action] Cannot send: MQTT disconnected");return}const h=typeof n=="object"?JSON.stringify(n):String(n);console.log(`[MQTT] Publishing to '${c.topic}': ${h}`),o(c.topic,h)}if(c.source==="http"&&c.endpoint)try{await fetch(c.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:c.id,value:n})})}catch{console.log("[HTTP] (Simulation) Request sent.")}},[a.mockMode,l,o,u])}},Ol=(o,l)=>{const[s,a]=Oe.useState(()=>{if(typeof window>"u")return l;try{const n=window.localStorage.getItem(o);return n?JSON.parse(n):(window.localStorage.setItem(o,JSON.stringify(l)),l)}catch(n){return console.error(`[Data Lake] Error reading key "${o}":`,n),l}}),u=Oe.useCallback(n=>{a(e=>{let i;e.length>0&&typeof e[0].id=="number"?i=e.reduce((b,w)=>typeof w.id=="number"&&w.id>b?w.id:b,0)+1:i=`id_${Date.now()}`;const h={...n,id:i},d=[...e,h];return window.localStorage.setItem(o,JSON.stringify(d)),d})},[o]),t=Oe.useCallback(n=>{a(e=>{const i=e.map(c=>c.id===n.id?n:c);return window.localStorage.setItem(o,JSON.stringify(i)),i})},[o]),r=Oe.useCallback(n=>{a(e=>{const i=e.filter(c=>c.id!==n);return window.localStorage.setItem(o,JSON.stringify(i)),i})},[o]);return{data:s,createItem:u,updateItem:t,deleteItem:r}};function Bf(o,l={}){const{filters:s,sort:a,page:u=1,pageSize:t=10}=l,r=Oe.useMemo(()=>!s||s.length===0?o:o.filter(i=>s.every(c=>{const h=i[c.field];switch(c.operator){case"equals":return h==c.value;case"neq":return h!=c.value;case"contains":return String(h).toLowerCase().includes(String(c.value).toLowerCase());case"gt":return h>c.value;case"lt":return h<c.value;default:return!0}})),[o,s]),n=Oe.useMemo(()=>a?[...r].sort((i,c)=>{const h=i[a.field],d=c[a.field];return h<d?a.direction==="asc"?-1:1:h>d?a.direction==="asc"?1:-1:0}):r,[r,a]);return{data:Oe.useMemo(()=>{const i=(u-1)*t;return n.slice(i,i+t)},[n,u,t]),total:r.length,pageCount:Math.ceil(r.length/t)}}const Lf="ramme_db_",Uf=(o,l)=>{const s=l+1,a=o.label||"Item";switch(o.type){case"text":return`${a} ${s}`;case"number":return Math.floor(Math.random()*100)+1;case"currency":return(Math.random()*1e3).toFixed(2);case"boolean":return Math.random()>.5;case"date":const u=new Date;return u.setDate(u.getDate()-s*2),u.toISOString().split("T")[0];case"status":return["Active","Pending","Inactive","Archived"][l%4];case"email":return`user${s}@example.com`;case"image":return`https://i.pravatar.cc/150?u=${s}`;case"textarea":return`This is a sample description for ${a} ${s}. It contains enough text to test multi-line rendering.`;default:return`${a}-${s}`}},To=(o,l)=>Oe.useMemo(()=>{if(!o)return[];if(typeof window<"u"){const s=`${Lf}${o}`,a=localStorage.getItem(s);if(a)try{const u=JSON.parse(a);if(Array.isArray(u)&&u.length>0)return u}catch{console.warn(`[JIT Seeder] Corrupt data in ${s}, falling back to generation.`)}}return l?(console.log(`🌱 [JIT Seeder] Generating 5 mock records for: ${o}`),Array.from({length:5}).map((a,u)=>{const t={id:`jit_${o}_${u+1}`};return l.fields.forEach(r=>{r.key!=="id"&&(t[r.key]=Uf(r,u))}),t})):[]},[o,l]),Tl=({isOpen:o,onClose:l,onSubmit:s,title:a,fields:u,initialData:t})=>{const r=t||{},n=!!r.id,e=Oe.useMemo(()=>u.filter(i=>!(i.key==="id"&&!n)).map(i=>{const c=i.key==="id",h={name:i.key,label:i.label,required:i.required,placeholder:i.description||`Enter ${i.label.toLowerCase()}`,value:r[i.key]!==void 0?r[i.key]:i.defaultValue||"",colSpan:1,disabled:c};switch(i.type){case"number":case"integer":case"currency":return{...h,type:"number",value:Number(h.value)||0};case"boolean":return{...h,type:"toggle",checked:!!h.value};case"date":return{...h,type:"datepicker",value:h.value?new Date(h.value):null};case"status":return{...h,type:"select",options:[{value:"Active",label:"Active"},{value:"Pending",label:"Pending"},{value:"Inactive",label:"Inactive"},{value:"Archived",label:"Archived"}]};case"textarea":return{...h,type:"textarea",colSpan:2};case"email":return{...h,type:"email"};default:return{...h,type:"text"}}}),[u,r,n]);return Ie.jsx(qe.Drawer,{isOpen:o,onClose:l,title:`${n?"Edit":"New"} ${a}`,size:"500px",children:Ie.jsx("div",{className:"p-6",children:Ie.jsx(qe.FormTemplate,{fields:e,onSubmit:i=>{s({...r,...i})},children:Ie.jsxs("div",{className:"flex justify-end gap-2 mt-8 pt-4 border-t border-border",children:[Ie.jsx(qe.Button,{variant:"outline",onClick:l,type:"button",children:"Cancel"}),Ie.jsx(qe.Button,{type:"submit",variant:"primary",children:n?"Save Changes":"Create Record"})]})})})})},Po=({dataId:o,title:l,getResourceMeta:s})=>{const{addToast:a}=qe.useToast(),u=Ht(),t=Oe.useMemo(()=>{var C;const E=(C=u.resources)==null?void 0:C.find(T=>T.id===o);if(E)return E;const v=s==null?void 0:s(o);return v?{...v,id:o}:null},[u,o]),r=To(o,t),{data:n,createItem:e,updateItem:i,deleteItem:c}=Ol(`ramme_db_${o}`,r),[h,d]=Oe.useState(!1),[y,b]=Oe.useState(null),[w,S]=Oe.useState(null),A=Oe.useMemo(()=>t!=null&&t.fields?t.fields.map(E=>({key:E.key,label:E.label,type:E.type,hide:E.key==="id"})):[],[t]),g=Oe.useMemo(()=>[{id:"edit",icon:"edit-2",variant:"ghost",onClick:E=>{b(E),d(!0)}},{id:"delete",icon:"trash-2",variant:"danger",onClick:E=>{confirm("Delete?")&&c(E.id)}}],[c]),_=E=>{E.id&&(y!=null&&y.id)?(i(E),a("Item updated","success")):(e({...E,id:void 0}),a("Item created","success")),d(!1)};return Ie.jsxs(qe.Card,{className:"flex flex-col h-[600px] border border-border shadow-sm overflow-hidden bg-card",children:[Ie.jsxs("div",{className:"p-4 border-b border-border flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 bg-muted/5",children:[Ie.jsxs("div",{className:"flex items-center gap-2",children:[Ie.jsx("h3",{className:"text-base font-bold",children:l||(t==null?void 0:t.name)||o}),Ie.jsx("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded",children:n.length})]}),Ie.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[Ie.jsx("div",{className:"w-full sm:w-64",children:Ie.jsx(qe.SearchInput,{placeholder:"Search...",onChange:E=>w==null?void 0:w.updateGridOptions({quickFilterText:E.target.value})})}),Ie.jsx(qe.Button,{size:"sm",iconLeft:"plus",onClick:()=>{b({}),d(!0)},children:"New"})]})]}),Ie.jsxs("div",{className:"flex-1 w-full bg-card relative overflow-hidden",children:[Ie.jsx("div",{className:"hidden md:block h-full",children:Ie.jsx(qe.DataTable,{rowData:n,schema:A,actions:g,onGridReady:E=>S(E.api),emptyState:Ie.jsx("div",{className:"text-muted-foreground",children:"No records found."})})}),Ie.jsxs("div",{className:"block md:hidden h-full overflow-y-auto p-4 space-y-3 bg-muted/5",children:[n.map((E,v)=>{var C;return Ie.jsxs("div",{className:"bg-background border border-border rounded-lg p-4 shadow-sm relative group",children:[Ie.jsxs("div",{className:"flex justify-between items-start mb-3 pb-2 border-b border-dashed",children:[Ie.jsx("span",{className:"font-semibold text-foreground",children:E[((C=A.find(T=>T.type==="text"&&T.key!=="id"))==null?void 0:C.key)||"id"]}),(()=>{const T=A.find(x=>x.type==="status");return T?qe.formatValue(E[T.key],"status"):null})()]}),Ie.jsx("div",{className:"space-y-2 text-sm",children:A.filter(T=>!T.hide&&T.type!=="status").slice(0,5).map(T=>Ie.jsxs("div",{className:"flex justify-between",children:[Ie.jsxs("span",{className:"text-muted-foreground",children:[T.label,":"]}),Ie.jsx("span",{className:"font-medium text-right",children:qe.formatValue(E[T.key],T.type)})]},T.key))}),Ie.jsxs("div",{className:"flex gap-2 pt-3 mt-3 border-t border-border/50",children:[Ie.jsx(qe.Button,{size:"sm",variant:"outline",className:"flex-1 h-8 text-xs",onClick:()=>{b(E),d(!0)},children:"Edit"}),Ie.jsx(qe.Button,{size:"sm",variant:"ghost",className:"h-8 w-8 text-destructive",onClick:()=>{confirm("Delete?")&&c(E.id)},children:Ie.jsx(qe.Icon,{name:"trash-2",size:14})})]})]},E.id||v)}),n.length===0&&Ie.jsx("div",{className:"text-center p-8 text-muted-foreground",children:"No records."})]})]}),Ie.jsx(Tl,{isOpen:h,onClose:()=>d(!1),onSubmit:_,title:(t==null?void 0:t.name)||"Item",fields:(t==null?void 0:t.fields)||[],initialData:y})]})};/**
48
48
  * @license lucide-react v0.454.0 - ISC
49
49
  *
50
50
  * This source code is licensed under the ISC license.
51
51
  * See the LICENSE file in the root directory of this source tree.
52
- */const Uf=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ol=(...o)=>o.filter((l,s,a)=>!!l&&l.trim()!==""&&a.indexOf(l)===s).join(" ").trim();/**
52
+ */const Df=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pl=(...o)=>o.filter((l,s,a)=>!!l&&l.trim()!==""&&a.indexOf(l)===s).join(" ").trim();/**
53
53
  * @license lucide-react v0.454.0 - ISC
54
54
  *
55
55
  * This source code is licensed under the ISC license.
56
56
  * See the LICENSE file in the root directory of this source tree.
57
- */var Df={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
57
+ */var Ff={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
58
58
  * @license lucide-react v0.454.0 - ISC
59
59
  *
60
60
  * This source code is licensed under the ISC license.
61
61
  * See the LICENSE file in the root directory of this source tree.
62
- */const Ff=Oe.forwardRef(({color:o="currentColor",size:l=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:c="",children:t,iconNode:r,...n},e)=>Oe.createElement("svg",{ref:e,...Df,width:l,height:l,stroke:o,strokeWidth:a?Number(s)*24/Number(l):s,className:Ol("lucide",c),...n},[...r.map(([i,u])=>Oe.createElement(i,u)),...Array.isArray(t)?t:[t]]));/**
62
+ */const Wf=Oe.forwardRef(({color:o="currentColor",size:l=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:u="",children:t,iconNode:r,...n},e)=>Oe.createElement("svg",{ref:e,...Ff,width:l,height:l,stroke:o,strokeWidth:a?Number(s)*24/Number(l):s,className:Pl("lucide",u),...n},[...r.map(([i,c])=>Oe.createElement(i,c)),...Array.isArray(t)?t:[t]]));/**
63
63
  * @license lucide-react v0.454.0 - ISC
64
64
  *
65
65
  * This source code is licensed under the ISC license.
66
66
  * See the LICENSE file in the root directory of this source tree.
67
- */const tr=(o,l)=>{const s=Oe.forwardRef(({className:a,...c},t)=>Oe.createElement(Ff,{ref:t,iconNode:l,className:Ol(`lucide-${Uf(o)}`,a),...c}));return s.displayName=`${o}`,s};/**
67
+ */const tr=(o,l)=>{const s=Oe.forwardRef(({className:a,...u},t)=>Oe.createElement(Wf,{ref:t,iconNode:l,className:Pl(`lucide-${Df(o)}`,a),...u}));return s.displayName=`${o}`,s};/**
68
68
  * @license lucide-react v0.454.0 - ISC
69
69
  *
70
70
  * This source code is licensed under the ISC license.
71
71
  * See the LICENSE file in the root directory of this source tree.
72
- */const Wf=tr("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
72
+ */const $f=tr("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
73
73
  * @license lucide-react v0.454.0 - ISC
74
74
  *
75
75
  * This source code is licensed under the ISC license.
76
76
  * See the LICENSE file in the root directory of this source tree.
77
- */const $f=tr("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/**
77
+ */const qf=tr("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/**
78
78
  * @license lucide-react v0.454.0 - ISC
79
79
  *
80
80
  * This source code is licensed under the ISC license.
81
81
  * See the LICENSE file in the root directory of this source tree.
82
- */const qf=tr("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
82
+ */const Vf=tr("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
83
83
  * @license lucide-react v0.454.0 - ISC
84
84
  *
85
85
  * This source code is licensed under the ISC license.
86
86
  * See the LICENSE file in the root directory of this source tree.
87
- */const Vf=tr("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
87
+ */const zf=tr("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
88
88
  * @license lucide-react v0.454.0 - ISC
89
89
  *
90
90
  * This source code is licensed under the ISC license.
91
91
  * See the LICENSE file in the root directory of this source tree.
92
- */const zf=tr("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
92
+ */const Kf=tr("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
93
93
  * @license lucide-react v0.454.0 - ISC
94
94
  *
95
95
  * This source code is licensed under the ISC license.
96
96
  * See the LICENSE file in the root directory of this source tree.
97
- */const Kf=tr("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
97
+ */const Hf=tr("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
98
98
  * @license lucide-react v0.454.0 - ISC
99
99
  *
100
100
  * This source code is licensed under the ISC license.
101
101
  * See the LICENSE file in the root directory of this source tree.
102
- */const Hf=tr("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]),Tl={SmartTable:Po,DataTable:Po,StatCard:qe.StatCard,DeviceCard:qe.DeviceCard,BarChart:qe.BarChart,LineChart:qe.LineChart,Button:qe.Button,Unknown:({type:o})=>Ie.jsxs("div",{className:"h-24 w-full border-2 border-dashed border-amber-300 bg-amber-50 rounded-lg flex flex-col items-center justify-center text-amber-700 text-sm",children:[Ie.jsx($f,{className:"mb-2 opacity-50",size:20}),Ie.jsxs("span",{children:["Unknown Component: ",Ie.jsx("strong",{children:o})]})]})},Gf=o=>Tl[o]||Tl.Unknown;class Yf extends Oe.Component{constructor(l){super(l),this.state={hasError:!1,error:""}}static getDerivedStateFromError(l){return{hasError:!0,error:l.message}}render(){return this.state.hasError?Ie.jsxs("div",{className:"h-full min-h-[100px] p-4 border-2 border-dashed border-red-300 bg-red-50/50 rounded-lg flex flex-col items-center justify-center text-red-600 text-xs",children:[Ie.jsx(Vf,{size:16,className:"mb-2 opacity-80"}),Ie.jsx("span",{className:"font-bold",children:"Render Error"}),Ie.jsx("span",{className:"opacity-75 text-center truncate max-w-[200px]",children:this.state.error})]}):this.props.children}}const Qf=({block:o,manifest:l})=>{var e,i,u,h,d;const s=Gf(o.type),a=(e=o.props.dataId)==null?void 0:e.toLowerCase(),c=Oe.useMemo(()=>{var y;return(y=l.resources)==null?void 0:y.find(b=>b.id.toLowerCase()===a)},[l,a]),t=To(a,c),r=(u=(i=t==null?void 0:t[0])==null?void 0:i.id)==null?void 0:u.toString().startsWith("jit_"),n=Oe.useMemo(()=>{if(a&&o.type==="SmartTable"&&!o.props.columnDefs&&c)return c.fields.map(y=>({field:y.key,headerName:y.label,filter:!0,flex:1,cellRenderer:y.type==="status"?b=>Ie.jsx(qe.Badge,{variant:"secondary",children:b.value}):void 0}))},[a,o.type,c,o.props.columnDefs]);return Ie.jsx("div",{style:{gridColumn:`span ${((h=o.layout)==null?void 0:h.colSpan)||1}`,gridRow:`span ${((d=o.layout)==null?void 0:d.rowSpan)||1}`},className:"relative group",children:Ie.jsxs(Yf,{children:[Ie.jsx("div",{className:"absolute -top-3 right-0 opacity-0 group-hover:opacity-100 transition-opacity z-20 pointer-events-none translate-y-2 group-hover:translate-y-0 duration-200",children:Ie.jsxs("div",{className:`text-[10px] px-2 py-1 rounded-md shadow-lg border border-white/10 flex items-center gap-1.5 font-mono ${r?"bg-amber-600 text-white":"bg-slate-800 text-slate-200"}`,children:[Ie.jsx("span",{className:"font-bold",children:o.type}),a&&Ie.jsxs(Ie.Fragment,{children:[" ",Ie.jsx("span",{className:"opacity-40",children:"|"})," ",r?Ie.jsx(zf,{size:10,className:"animate-pulse"}):Ie.jsx(Wf,{size:10})," ",a]})]})}),Ie.jsx(s,{...o.props,rowData:o.type==="SmartTable"?void 0:t,columnDefs:o.props.columnDefs||n,className:"w-full h-full"})]})})},Pl=({pageId:o})=>{var r;const l=Ht(),a=dn()==="live",c=Oe.useMemo(()=>{var n;return(n=l.pages)==null?void 0:n.find(e=>e.id===o)},[l,o]);if(!c)return Ie.jsxs("div",{className:"p-8 space-y-4 flex flex-col items-center justify-center h-[50vh]",children:[Ie.jsx(qf,{className:"animate-spin text-primary mb-4",size:32}),Ie.jsx("p",{className:"text-muted-foreground",children:"Loading Blueprint..."})]});const t=Ie.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-bold border transition-colors duration-300 ${a?"bg-green-100 text-green-700 border-green-200":"bg-slate-100 text-slate-500 border-slate-200"}`,children:[a?Ie.jsx(Hf,{size:14,className:"text-green-600 animate-pulse"}):Ie.jsx(Kf,{size:14}),a?"LIVE BRIDGE":"STATIC MODE"]});return Ie.jsxs("div",{className:"p-6 md:p-8 max-w-7xl mx-auto w-full space-y-8",children:[Ie.jsxs("header",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 border-b border-border/40 pb-6",children:[Ie.jsxs("div",{className:"space-y-1",children:[Ie.jsx("h1",{className:"text-3xl font-bold tracking-tight text-foreground",children:c.title}),c.description&&Ie.jsx("p",{className:"text-muted-foreground",children:c.description})]}),Ie.jsx("div",{className:"flex items-center gap-2",children:t})]}),Ie.jsx("div",{className:"grid gap-8 pb-20",children:(r=c.sections)==null?void 0:r.map(n=>{var e;return Ie.jsxs("section",{className:"space-y-6",children:[n.title&&Ie.jsx("div",{className:"flex items-center gap-2 pb-2 border-b border-border/60",children:Ie.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-muted-foreground/80",children:n.title})}),Ie.jsx("div",{className:"grid gap-6",style:{gridTemplateColumns:`repeat(${((e=n.layout)==null?void 0:e.columns)||1}, minmax(0, 1fr))`},children:n.blocks.map(i=>Ie.jsx(Qf,{block:i,manifest:l},i.id))})]},n.id)})})]})},Jf=o=>{const l=Ht(),a=dn()==="live";return Oe.useMemo(()=>{const c=(l.pages||[]).map(n=>({id:n.id,path:n.slug,title:n.title,icon:n.icon||"layout",component:()=>Ie.jsx(Pl,{pageId:n.id})}));if(a&&c.length>0)return c;const t=new Set(o.map(n=>n.id)),r=c.filter(n=>!t.has(n.id));return[...o,...r]},[l,o,a])},Xf={name:"loading",version:"0.0.0",capabilities:[],navigation:[]};function Zf(){const[o,l]=Oe.useState(Xf),{lastMessage:s,isConnected:a}=Oo();return Oe.useEffect(()=>{if(s&&s.topic==="ramme/manifest/update")try{const c=JSON.parse(s.payload.toString());l(c)}catch(c){console.error("Failed to parse manifest update",c)}},[s]),{manifest:o,isLive:a}}const Cl=o=>{let l;const s=new Set,a=(i,u)=>{const h=typeof i=="function"?i(l):i;if(!Object.is(h,l)){const d=l;l=u??(typeof h!="object"||h===null)?h:Object.assign({},l,h),s.forEach(y=>y(l,d))}},c=()=>l,n={setState:a,getState:c,getInitialState:()=>e,subscribe:i=>(s.add(i),()=>s.delete(i))},e=l=o(a,c,n);return n},eh=o=>o?Cl(o):Cl,th=o=>o;function rh(o,l=th){const s=Oe.useSyncExternalStore(o.subscribe,Oe.useCallback(()=>l(o.getState()),[o,l]),Oe.useCallback(()=>l(o.getInitialState()),[o,l]));return Oe.useDebugValue(s),s}const jl=o=>{const l=eh(o),s=a=>rh(l,a);return Object.assign(s,l),s},Rl=o=>o?jl(o):jl,nh={living_room_ac:{value:72,timestamp:Date.now()},living_room_hum:{value:45,timestamp:Date.now()},server_01:{value:42,timestamp:Date.now()},front_door_lock:{value:"LOCKED",timestamp:Date.now()}},on=Rl(o=>({signals:nh,updateSignal:(l,s)=>o(a=>({signals:{...a.signals,[l]:{value:s,timestamp:Date.now()}}})),updateSignals:l=>o(s=>{const a={...s.signals};return Object.entries(l).forEach(([c,t])=>{a[c]={value:t,timestamp:Date.now()}}),{signals:a}})})),Ml=()=>on(o=>o.signals),ih=(o=!0)=>{const{updateSignals:l}=on();Oe.useEffect(()=>{if(!o)return;console.log("[System] Simulation Mode: ON 🎲");const s=setInterval(()=>{const a={};a.living_room_ac=Number((72+(Math.random()*4-2)).toFixed(1)),a.living_room_hum=Number((45+(Math.random()*6-3)).toFixed(1)),a.server_01=Math.floor(Math.random()*100),Math.random()>.99&&(a.front_door_lock=Math.random()>.5?"LOCKED":"UNLOCKED"),l(a)},2e3);return()=>clearInterval(s)},[o,l])},oh=o=>{const l=on(r=>r.signals[o]),s=Ht(),a=Oe.useMemo(()=>s.domain.signals.find(r=>r.id===o),[o,s]),c=(l==null?void 0:l.value)??(a==null?void 0:a.defaultValue)??0,t=l?Date.now()-l.timestamp>1e4:!0;return{id:o,value:c,unit:a==null?void 0:a.unit,min:a==null?void 0:a.min,max:a==null?void 0:a.max,timestamp:l==null?void 0:l.timestamp,status:t?"stale":"fresh"}},sh="ramme_db_",ah=o=>{if(!(typeof window>"u")){if(!o){console.warn("⚠️ [Data Lake] No registry provided to seeder. Skipping initialization.");return}console.groupCollapsed("🌊 [Data Lake] Initialization"),Object.entries(o).forEach(([l,s])=>{const a=`${sh}${l}`;localStorage.getItem(a)||(console.log(`✨ Seeding collection: ${l}`),localStorage.setItem(a,JSON.stringify(s)))}),console.groupEnd()}};function Nl(o,l){let s;try{s=o()}catch{return}return{getItem:c=>{var t;const r=e=>e===null?null:JSON.parse(e,void 0),n=(t=s.getItem(c))!=null?t:null;return n instanceof Promise?n.then(r):r(n)},setItem:(c,t)=>s.setItem(c,JSON.stringify(t,void 0)),removeItem:c=>s.removeItem(c)}}const Co=o=>l=>{try{const s=o(l);return s instanceof Promise?s:{then(a){return Co(a)(s)},catch(a){return this}}}catch(s){return{then(a){return this},catch(a){return Co(a)(s)}}}},lh=(o,l)=>(s,a,c)=>{let t={storage:Nl(()=>localStorage),partialize:w=>w,version:0,merge:(w,S)=>({...S,...w}),...l},r=!1;const n=new Set,e=new Set;let i=t.storage;if(!i)return o((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${t.name}', the given storage is currently unavailable.`),s(...w)},a,c);const u=()=>{const w=t.partialize({...a()});return i.setItem(t.name,{state:w,version:t.version})},h=c.setState;c.setState=(w,S)=>(h(w,S),u());const d=o((...w)=>(s(...w),u()),a,c);c.getInitialState=()=>d;let y;const b=()=>{var w,S;if(!i)return;r=!1,n.forEach(g=>{var _;return g((_=a())!=null?_:d)});const A=((S=t.onRehydrateStorage)==null?void 0:S.call(t,(w=a())!=null?w:d))||void 0;return Co(i.getItem.bind(i))(t.name).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==t.version){if(t.migrate){const _=t.migrate(g.state,g.version);return _ instanceof Promise?_.then(E=>[!0,E]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,g.state];return[!1,void 0]}).then(g=>{var _;const[E,v]=g;if(y=t.merge(v,(_=a())!=null?_:d),s(y,!0),E)return u()}).then(()=>{A==null||A(y,void 0),y=a(),r=!0,e.forEach(g=>g(y))}).catch(g=>{A==null||A(void 0,g)})};return c.persist={setOptions:w=>{t={...t,...w},w.storage&&(i=w.storage)},clearStorage:()=>{i==null||i.removeItem(t.name)},getOptions:()=>t,rehydrate:()=>b(),hasHydrated:()=>r,onHydrate:w=>(n.add(w),()=>{n.delete(w)}),onFinishHydration:w=>(e.add(w),()=>{e.delete(w)})},t.skipHydration||b(),y||d},jo=Rl()(lh((o,l)=>({geminiApiKey:null,isSettingsOpen:!1,setGeminiApiKey:s=>{s&&o({geminiApiKey:s.trim()})},clearKeys:()=>o({geminiApiKey:null}),hasKey:()=>!!l().geminiApiKey,toggleSettings:s=>o(a=>({isSettingsOpen:s??!a.isSettingsOpen}))}),{name:"ramme-vault-storage",storage:Nl(()=>localStorage),partialize:o=>({geminiApiKey:o.geminiApiKey})})),uh=()=>{const{geminiApiKey:o}=jo();return Oe.useEffect(()=>{console.log(o?"🧠 [Kernel] Workflow Engine: Online":"🧠 [Kernel] Workflow Engine: Standby (No Key)")},[o]),{isReady:!!o,status:o?"active":"idle"}},Bl=o=>{switch(o){case"fresh":return"online";case"stale":return"warning";case"disconnected":return"offline";case"error":return"error";default:return"offline"}},ch=({block:o,getComponent:l,getMockData:s})=>{const a=l(o.type),c=Ml(),{signalId:t,dataId:r,...n}=o.props,e={...n,dataId:r,signalId:t};if(r){const i=s(r);e.data=i||[],e.rowData=i||[]}if(t&&c&&t in c){const i=c[t];if(i){const u=typeof i=="object"&&i!==null,h=u&&"value"in i?i.value:i,d=u&&"status"in i?i.status:"fresh";e.value=typeof h=="number"?h:String(h),e.status=Bl(String(d))}else e.status=Bl("disconnected")}return Ie.jsx(a,{...e},o.id)};/**
102
+ */const Gf=tr("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]),Cl={SmartTable:Po,DataTable:Po,StatCard:qe.StatCard,DeviceCard:qe.DeviceCard,BarChart:qe.BarChart,LineChart:qe.LineChart,Button:qe.Button,Unknown:({type:o})=>Ie.jsxs("div",{className:"h-24 w-full border-2 border-dashed border-amber-300 bg-amber-50 rounded-lg flex flex-col items-center justify-center text-amber-700 text-sm",children:[Ie.jsx(qf,{className:"mb-2 opacity-50",size:20}),Ie.jsxs("span",{children:["Unknown Component: ",Ie.jsx("strong",{children:o})]})]})},Yf=o=>Cl[o]||Cl.Unknown;class Qf extends Oe.Component{constructor(l){super(l),this.state={hasError:!1,error:""}}static getDerivedStateFromError(l){return{hasError:!0,error:l.message}}render(){return this.state.hasError?Ie.jsxs("div",{className:"h-full min-h-[100px] p-4 border-2 border-dashed border-red-300 bg-red-50/50 rounded-lg flex flex-col items-center justify-center text-red-600 text-xs",children:[Ie.jsx(zf,{size:16,className:"mb-2 opacity-80"}),Ie.jsx("span",{className:"font-bold",children:"Render Error"}),Ie.jsx("span",{className:"opacity-75 text-center truncate max-w-[200px]",children:this.state.error})]}):this.props.children}}const Jf=({block:o,manifest:l})=>{var e,i,c,h,d;const s=Yf(o.type),a=(e=o.props.dataId)==null?void 0:e.toLowerCase(),u=Oe.useMemo(()=>{var y;return(y=l.resources)==null?void 0:y.find(b=>b.id.toLowerCase()===a)},[l,a]),t=To(a,u),r=(c=(i=t==null?void 0:t[0])==null?void 0:i.id)==null?void 0:c.toString().startsWith("jit_"),n=Oe.useMemo(()=>{if(a&&o.type==="SmartTable"&&!o.props.columnDefs&&u)return u.fields.map(y=>({field:y.key,headerName:y.label,filter:!0,flex:1,cellRenderer:y.type==="status"?b=>Ie.jsx(qe.Badge,{variant:"secondary",children:b.value}):void 0}))},[a,o.type,u,o.props.columnDefs]);return Ie.jsx("div",{style:{gridColumn:`span ${((h=o.layout)==null?void 0:h.colSpan)||1}`,gridRow:`span ${((d=o.layout)==null?void 0:d.rowSpan)||1}`},className:"relative group",children:Ie.jsxs(Qf,{children:[Ie.jsx("div",{className:"absolute -top-3 right-0 opacity-0 group-hover:opacity-100 transition-opacity z-20 pointer-events-none translate-y-2 group-hover:translate-y-0 duration-200",children:Ie.jsxs("div",{className:`text-[10px] px-2 py-1 rounded-md shadow-lg border border-white/10 flex items-center gap-1.5 font-mono ${r?"bg-amber-600 text-white":"bg-slate-800 text-slate-200"}`,children:[Ie.jsx("span",{className:"font-bold",children:o.type}),a&&Ie.jsxs(Ie.Fragment,{children:[" ",Ie.jsx("span",{className:"opacity-40",children:"|"})," ",r?Ie.jsx(Kf,{size:10,className:"animate-pulse"}):Ie.jsx($f,{size:10})," ",a]})]})}),Ie.jsx(s,{...o.props,rowData:o.type==="SmartTable"?void 0:t,columnDefs:o.props.columnDefs||n,className:"w-full h-full"})]})})},jl=({pageId:o})=>{var r;const l=Ht(),a=dn()==="live",u=Oe.useMemo(()=>{var n;return(n=l.pages)==null?void 0:n.find(e=>e.id===o)},[l,o]);if(!u)return Ie.jsxs("div",{className:"p-8 space-y-4 flex flex-col items-center justify-center h-[50vh]",children:[Ie.jsx(Vf,{className:"animate-spin text-primary mb-4",size:32}),Ie.jsx("p",{className:"text-muted-foreground",children:"Loading Blueprint..."})]});const t=Ie.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-bold border transition-colors duration-300 ${a?"bg-green-100 text-green-700 border-green-200":"bg-slate-100 text-slate-500 border-slate-200"}`,children:[a?Ie.jsx(Gf,{size:14,className:"text-green-600 animate-pulse"}):Ie.jsx(Hf,{size:14}),a?"LIVE BRIDGE":"STATIC MODE"]});return Ie.jsxs("div",{className:"p-6 md:p-8 max-w-7xl mx-auto w-full space-y-8",children:[Ie.jsxs("header",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 border-b border-border/40 pb-6",children:[Ie.jsxs("div",{className:"space-y-1",children:[Ie.jsx("h1",{className:"text-3xl font-bold tracking-tight text-foreground",children:u.title}),u.description&&Ie.jsx("p",{className:"text-muted-foreground",children:u.description})]}),Ie.jsx("div",{className:"flex items-center gap-2",children:t})]}),Ie.jsx("div",{className:"grid gap-8 pb-20",children:(r=u.sections)==null?void 0:r.map(n=>{var e;return Ie.jsxs("section",{className:"space-y-6",children:[n.title&&Ie.jsx("div",{className:"flex items-center gap-2 pb-2 border-b border-border/60",children:Ie.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-muted-foreground/80",children:n.title})}),Ie.jsx("div",{className:"grid gap-6",style:{gridTemplateColumns:`repeat(${((e=n.layout)==null?void 0:e.columns)||1}, minmax(0, 1fr))`},children:n.blocks.map(i=>Ie.jsx(Jf,{block:i,manifest:l},i.id))})]},n.id)})})]})},Xf=o=>{const l=Ht(),a=dn()==="live";return Oe.useMemo(()=>{const u=(l.pages||[]).map(n=>({id:n.id,path:n.slug,title:n.title,icon:n.icon||"layout",component:()=>Ie.jsx(jl,{pageId:n.id})}));if(a&&u.length>0)return u;const t=new Set(o.map(n=>n.id)),r=u.filter(n=>!t.has(n.id));return[...o,...r]},[l,o,a])},Zf={name:"loading",version:"0.0.0",capabilities:[],navigation:[]};function eh(){const[o,l]=Oe.useState(Zf),{lastMessage:s,isConnected:a}=Oo();return Oe.useEffect(()=>{if(s&&s.topic==="ramme/manifest/update")try{const u=JSON.parse(s.payload.toString());l(u)}catch(u){console.error("Failed to parse manifest update",u)}},[s]),{manifest:o,isLive:a}}const Rl=o=>{let l;const s=new Set,a=(i,c)=>{const h=typeof i=="function"?i(l):i;if(!Object.is(h,l)){const d=l;l=c??(typeof h!="object"||h===null)?h:Object.assign({},l,h),s.forEach(y=>y(l,d))}},u=()=>l,n={setState:a,getState:u,getInitialState:()=>e,subscribe:i=>(s.add(i),()=>s.delete(i))},e=l=o(a,u,n);return n},th=o=>o?Rl(o):Rl,rh=o=>o;function nh(o,l=rh){const s=Oe.useSyncExternalStore(o.subscribe,Oe.useCallback(()=>l(o.getState()),[o,l]),Oe.useCallback(()=>l(o.getInitialState()),[o,l]));return Oe.useDebugValue(s),s}const Ml=o=>{const l=th(o),s=a=>nh(l,a);return Object.assign(s,l),s},Co=o=>o?Ml(o):Ml,ih={living_room_ac:{value:72,timestamp:Date.now()},living_room_hum:{value:45,timestamp:Date.now()},server_01:{value:42,timestamp:Date.now()},front_door_lock:{value:"LOCKED",timestamp:Date.now()}},on=Co(o=>({signals:ih,updateSignal:(l,s)=>o(a=>({signals:{...a.signals,[l]:{value:s,timestamp:Date.now()}}})),updateSignals:l=>o(s=>{const a={...s.signals};return Object.entries(l).forEach(([u,t])=>{a[u]={value:t,timestamp:Date.now()}}),{signals:a}})})),Nl=()=>on(o=>o.signals),oh=(o=!0)=>{const{updateSignals:l}=on();Oe.useEffect(()=>{if(!o)return;console.log("[System] Simulation Mode: ON 🎲");const s=setInterval(()=>{const a={};a.living_room_ac=Number((72+(Math.random()*4-2)).toFixed(1)),a.living_room_hum=Number((45+(Math.random()*6-3)).toFixed(1)),a.server_01=Math.floor(Math.random()*100),Math.random()>.99&&(a.front_door_lock=Math.random()>.5?"LOCKED":"UNLOCKED"),l(a)},2e3);return()=>clearInterval(s)},[o,l])},sh=o=>{const l=on(r=>r.signals[o]),s=Ht(),a=Oe.useMemo(()=>s.domain.signals.find(r=>r.id===o),[o,s]),u=(l==null?void 0:l.value)??(a==null?void 0:a.defaultValue)??0,t=l?Date.now()-l.timestamp>1e4:!0;return{id:o,value:u,unit:a==null?void 0:a.unit,min:a==null?void 0:a.min,max:a==null?void 0:a.max,timestamp:l==null?void 0:l.timestamp,status:t?"stale":"fresh"}},ah="ramme_db_",lh=o=>{if(!(typeof window>"u")){if(!o){console.warn("⚠️ [Data Lake] No registry provided to seeder. Skipping initialization.");return}console.groupCollapsed("🌊 [Data Lake] Initialization"),Object.entries(o).forEach(([l,s])=>{const a=`${ah}${l}`;localStorage.getItem(a)||(console.log(`✨ Seeding collection: ${l}`),localStorage.setItem(a,JSON.stringify(s)))}),console.groupEnd()}};function Bl(o,l){let s;try{s=o()}catch{return}return{getItem:u=>{var t;const r=e=>e===null?null:JSON.parse(e,void 0),n=(t=s.getItem(u))!=null?t:null;return n instanceof Promise?n.then(r):r(n)},setItem:(u,t)=>s.setItem(u,JSON.stringify(t,void 0)),removeItem:u=>s.removeItem(u)}}const jo=o=>l=>{try{const s=o(l);return s instanceof Promise?s:{then(a){return jo(a)(s)},catch(a){return this}}}catch(s){return{then(a){return this},catch(a){return jo(a)(s)}}}},uh=(o,l)=>(s,a,u)=>{let t={storage:Bl(()=>localStorage),partialize:w=>w,version:0,merge:(w,S)=>({...S,...w}),...l},r=!1;const n=new Set,e=new Set;let i=t.storage;if(!i)return o((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${t.name}', the given storage is currently unavailable.`),s(...w)},a,u);const c=()=>{const w=t.partialize({...a()});return i.setItem(t.name,{state:w,version:t.version})},h=u.setState;u.setState=(w,S)=>(h(w,S),c());const d=o((...w)=>(s(...w),c()),a,u);u.getInitialState=()=>d;let y;const b=()=>{var w,S;if(!i)return;r=!1,n.forEach(g=>{var _;return g((_=a())!=null?_:d)});const A=((S=t.onRehydrateStorage)==null?void 0:S.call(t,(w=a())!=null?w:d))||void 0;return jo(i.getItem.bind(i))(t.name).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==t.version){if(t.migrate){const _=t.migrate(g.state,g.version);return _ instanceof Promise?_.then(E=>[!0,E]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,g.state];return[!1,void 0]}).then(g=>{var _;const[E,v]=g;if(y=t.merge(v,(_=a())!=null?_:d),s(y,!0),E)return c()}).then(()=>{A==null||A(y,void 0),y=a(),r=!0,e.forEach(g=>g(y))}).catch(g=>{A==null||A(void 0,g)})};return u.persist={setOptions:w=>{t={...t,...w},w.storage&&(i=w.storage)},clearStorage:()=>{i==null||i.removeItem(t.name)},getOptions:()=>t,rehydrate:()=>b(),hasHydrated:()=>r,onHydrate:w=>(n.add(w),()=>{n.delete(w)}),onFinishHydration:w=>(e.add(w),()=>{e.delete(w)})},t.skipHydration||b(),y||d},Ro=Co()(uh((o,l)=>({geminiApiKey:null,isSettingsOpen:!1,setGeminiApiKey:s=>{s&&o({geminiApiKey:s.trim()})},clearKeys:()=>o({geminiApiKey:null}),hasKey:()=>!!l().geminiApiKey,toggleSettings:s=>o(a=>({isSettingsOpen:s??!a.isSettingsOpen}))}),{name:"ramme-vault-storage",storage:Bl(()=>localStorage),partialize:o=>({geminiApiKey:o.geminiApiKey})})),ch=()=>{const{geminiApiKey:o}=Ro();return Oe.useEffect(()=>{console.log(o?"🧠 [Kernel] Workflow Engine: Online":"🧠 [Kernel] Workflow Engine: Standby (No Key)")},[o]),{isReady:!!o,status:o?"active":"idle"}},Mo=o=>`${o}_${Date.now()}`,fh={meta:{name:"My Ramme App",version:"0.0.1"},config:{theme:"system",mockMode:!0},domain:{signals:[],entities:[],workflows:[]},modules:[],resources:[],pages:[{id:"home",title:"Home",slug:"/",sections:[{id:"main_section",title:"Main Content",layout:{columns:1},blocks:[]}]}]},hh=Co(o=>({manifest:fh,activePageId:"home",selectedBlockId:null,setManifest:l=>o({manifest:l}),setActivePage:l=>o({activePageId:l}),selectBlock:l=>o({selectedBlockId:l}),addPage:l=>o(s=>{const a={id:Mo("page"),title:l,slug:l.toLowerCase().replace(/\s+/g,"-"),sections:[{id:Mo("sect"),title:"Main",layout:{columns:1},blocks:[]}]};return{manifest:{...s.manifest,pages:[...s.manifest.pages||[],a]}}}),updatePage:(l,s)=>o(a=>{var u;return{manifest:{...a.manifest,pages:(u=a.manifest.pages)==null?void 0:u.map(t=>t.id===l?{...t,...s}:t)}}}),deletePage:l=>o(s=>{var t,r;const a=((t=s.manifest.pages)==null?void 0:t.filter(n=>n.id!==l))||[],u=s.activePageId===l?((r=a[0])==null?void 0:r.id)||null:s.activePageId;return{manifest:{...s.manifest,pages:a},activePageId:u}}),addBlock:(l,s,a,u={})=>o(t=>{var n;const r={id:Mo("blk"),type:a,props:u};return{manifest:{...t.manifest,pages:(n=t.manifest.pages)==null?void 0:n.map(e=>e.id!==l?e:{...e,sections:e.sections.map(i=>i.id!==s?i:{...i,blocks:[...i.blocks,r]})})}}}),updateBlock:(l,s,a)=>o(u=>{var t;return{manifest:{...u.manifest,pages:(t=u.manifest.pages)==null?void 0:t.map(r=>r.id!==l?r:{...r,sections:r.sections.map(n=>n.blocks.some(e=>e.id===s)?{...n,blocks:n.blocks.map(e=>e.id===s?{...e,props:{...e.props,...a}}:e)}:n)})}}}),deleteBlock:(l,s)=>o(a=>{var u;return{manifest:{...a.manifest,pages:(u=a.manifest.pages)==null?void 0:u.map(t=>t.id!==l?t:{...t,sections:t.sections.map(r=>({...r,blocks:r.blocks.filter(n=>n.id!==s)}))})}}})})),Ll=Se.z.object({key:Se.z.string(),label:Se.z.string(),type:Se.z.enum(["text","number","currency","date","boolean","status","email","image","textarea"]),required:Se.z.boolean().optional(),description:Se.z.string().optional(),defaultValue:Se.z.any().optional()}),Ul=Se.z.object({id:Se.z.string(),name:Se.z.string(),fields:Se.z.array(Ll),defaultView:Se.z.enum(["table","grid","list"]).optional(),features:Se.z.object({searchable:Se.z.boolean().optional(),creatable:Se.z.boolean().optional(),editable:Se.z.boolean().optional(),deletable:Se.z.boolean().optional(),exportable:Se.z.boolean().optional()}).optional()}),Dl=Se.z.object({id:Se.z.string().min(1,"Signal ID is required"),label:Se.z.string(),description:Se.z.string().optional(),kind:Se.z.enum(["sensor","actuator","setpoint","metric","status","kpi"]),source:Se.z.enum(["mock","mqtt","http","derived","local"]),topic:Se.z.string().optional(),endpoint:Se.z.string().optional(),jsonPath:Se.z.string().optional(),refreshRate:Se.z.number().optional().default(1e3),defaultValue:Se.z.any().optional(),unit:Se.z.string().optional(),min:Se.z.number().optional(),max:Se.z.number().optional()}),Fl=Se.z.object({id:Se.z.string(),name:Se.z.string(),description:Se.z.string().optional(),type:Se.z.string(),category:Se.z.string().default("logical"),signals:Se.z.array(Se.z.string()),ui:Se.z.object({icon:Se.z.string().optional(),color:Se.z.string().optional(),dashboardComponent:Se.z.string().optional()}).optional()}),Wl=Se.z.object({id:Se.z.string(),type:Se.z.enum(["signal_change","manual_action","schedule","webhook"]),config:Se.z.record(Se.z.string(),Se.z.any())}),$l=Se.z.object({id:Se.z.string(),type:Se.z.enum(["update_resource","send_notification","mqtt_publish","api_call","navigate","agent_task"]),config:Se.z.record(Se.z.string(),Se.z.any())}),ql=Se.z.object({id:Se.z.string(),name:Se.z.string(),active:Se.z.boolean().default(!0),trigger:Wl,actions:Se.z.array($l)}),Vl=Se.z.object({id:Se.z.string(),type:Se.z.string(),props:Se.z.record(Se.z.string(),Se.z.any()),layout:Se.z.object({colSpan:Se.z.number().optional(),rowSpan:Se.z.number().optional()}).optional()}),zl=Se.z.object({id:Se.z.string(),title:Se.z.string().optional(),description:Se.z.string().optional(),layout:Se.z.object({columns:Se.z.number().optional(),variant:Se.z.enum(["grid","stack","split"]).optional()}).optional(),blocks:Se.z.array(Vl)}),Kl=Se.z.object({id:Se.z.string(),slug:Se.z.string(),title:Se.z.string(),description:Se.z.string().optional(),icon:Se.z.string().optional(),sections:Se.z.array(zl)}),ph=Se.z.object({meta:Se.z.object({name:Se.z.string(),version:Se.z.string(),description:Se.z.string().optional(),author:Se.z.string().optional(),createdAt:Se.z.string().optional()}),config:Se.z.object({theme:Se.z.enum(["light","dark","system","corporate","midnight","blueprint"]).default("system"),mockMode:Se.z.boolean().default(!0),brokerUrl:Se.z.string().optional()}),modules:Se.z.array(Se.z.string()).optional(),resources:Se.z.array(Ul).optional(),domain:Se.z.object({signals:Se.z.array(Dl),entities:Se.z.array(Fl),workflows:Se.z.array(ql).optional()}),pages:Se.z.array(Kl).optional()}),Hl=o=>{switch(o){case"fresh":return"online";case"stale":return"warning";case"disconnected":return"offline";case"error":return"error";default:return"offline"}},dh=({block:o,getComponent:l,getMockData:s})=>{const a=l(o.type),u=Nl(),{signalId:t,dataId:r,...n}=o.props,e={...n,dataId:r,signalId:t};if(r){const i=s(r);e.data=i||[],e.rowData=i||[]}if(t&&u&&t in u){const i=u[t];if(i){const c=typeof i=="object"&&i!==null,h=c&&"value"in i?i.value:i,d=c&&"status"in i?i.status:"fresh";e.value=typeof h=="number"?h:String(h),e.status=Hl(String(d))}else e.status=Hl("disconnected")}return Ie.jsx(a,{...e},o.id)};/**
103
103
  * @remix-run/router v1.23.2
104
104
  *
105
105
  * Copyright (c) Remix Software Inc.
@@ -108,7 +108,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
108
108
  * LICENSE.md file in the root directory of this source tree.
109
109
  *
110
110
  * @license MIT
111
- */function Ro(){return Ro=Object.assign?Object.assign.bind():function(o){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=s[a])}return o},Ro.apply(this,arguments)}var Ll;(function(o){o.Pop="POP",o.Push="PUSH",o.Replace="REPLACE"})(Ll||(Ll={}));function gt(o,l){if(o===!1||o===null||typeof o>"u")throw new Error(l)}function sn(o,l){if(!o){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Ul(o){let l={};if(o){let s=o.indexOf("#");s>=0&&(l.hash=o.substr(s),o=o.substr(0,s));let a=o.indexOf("?");a>=0&&(l.search=o.substr(a),o=o.substr(0,a)),o&&(l.pathname=o)}return l}var Dl;(function(o){o.data="data",o.deferred="deferred",o.redirect="redirect",o.error="error"})(Dl||(Dl={}));const fh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hh=o=>fh.test(o);function ph(o,l){l===void 0&&(l="/");let{pathname:s,search:a="",hash:c=""}=typeof o=="string"?Ul(o):o,t;if(s)if(hh(s))t=s;else{if(s.includes("//")){let r=s;s=s.replace(/\/\/+/g,"/"),sn(!1,"Pathnames cannot have embedded double slashes - normalizing "+(r+" -> "+s))}s.startsWith("/")?t=Fl(s.substring(1),"/"):t=Fl(s,l)}else t=l;return{pathname:t,search:yh(a),hash:mh(c)}}function Fl(o,l){let s=l.replace(/\/+$/,"").split("/");return o.split("/").forEach(c=>{c===".."?s.length>1&&s.pop():c!=="."&&s.push(c)}),s.length>1?s.join("/"):"/"}function Mo(o,l,s,a){return"Cannot include a '"+o+"' character in a manually specified "+("`to."+l+"` field ["+JSON.stringify(a)+"]. Please separate it out to the ")+("`to."+s+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function dh(o){return o.filter((l,s)=>s===0||l.route.path&&l.route.path.length>0)}function Wl(o,l){let s=dh(o);return l?s.map((a,c)=>c===s.length-1?a.pathname:a.pathnameBase):s.map(a=>a.pathnameBase)}function $l(o,l,s,a){a===void 0&&(a=!1);let c;typeof o=="string"?c=Ul(o):(c=Ro({},o),gt(!c.pathname||!c.pathname.includes("?"),Mo("?","pathname","search",c)),gt(!c.pathname||!c.pathname.includes("#"),Mo("#","pathname","hash",c)),gt(!c.search||!c.search.includes("#"),Mo("#","search","hash",c)));let t=o===""||c.pathname==="",r=t?"/":c.pathname,n;if(r==null)n=s;else{let h=l.length-1;if(!a&&r.startsWith("..")){let d=r.split("/");for(;d[0]==="..";)d.shift(),h-=1;c.pathname=d.join("/")}n=h>=0?l[h]:"/"}let e=ph(c,n),i=r&&r!=="/"&&r.endsWith("/"),u=(t||r===".")&&s.endsWith("/");return!e.pathname.endsWith("/")&&(i||u)&&(e.pathname+="/"),e}const gh=o=>o.join("/").replace(/\/\/+/g,"/"),yh=o=>!o||o==="?"?"":o.startsWith("?")?o:"?"+o,mh=o=>!o||o==="#"?"":o.startsWith("#")?o:"#"+o,ql=["post","put","patch","delete"];new Set(ql);const bh=["get",...ql];new Set(bh);/**
111
+ */function No(){return No=Object.assign?Object.assign.bind():function(o){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=s[a])}return o},No.apply(this,arguments)}var Gl;(function(o){o.Pop="POP",o.Push="PUSH",o.Replace="REPLACE"})(Gl||(Gl={}));function gt(o,l){if(o===!1||o===null||typeof o>"u")throw new Error(l)}function sn(o,l){if(!o){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Yl(o){let l={};if(o){let s=o.indexOf("#");s>=0&&(l.hash=o.substr(s),o=o.substr(0,s));let a=o.indexOf("?");a>=0&&(l.search=o.substr(a),o=o.substr(0,a)),o&&(l.pathname=o)}return l}var Ql;(function(o){o.data="data",o.deferred="deferred",o.redirect="redirect",o.error="error"})(Ql||(Ql={}));const gh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yh=o=>gh.test(o);function mh(o,l){l===void 0&&(l="/");let{pathname:s,search:a="",hash:u=""}=typeof o=="string"?Yl(o):o,t;if(s)if(yh(s))t=s;else{if(s.includes("//")){let r=s;s=s.replace(/\/\/+/g,"/"),sn(!1,"Pathnames cannot have embedded double slashes - normalizing "+(r+" -> "+s))}s.startsWith("/")?t=Jl(s.substring(1),"/"):t=Jl(s,l)}else t=l;return{pathname:t,search:wh(a),hash:_h(u)}}function Jl(o,l){let s=l.replace(/\/+$/,"").split("/");return o.split("/").forEach(u=>{u===".."?s.length>1&&s.pop():u!=="."&&s.push(u)}),s.length>1?s.join("/"):"/"}function Bo(o,l,s,a){return"Cannot include a '"+o+"' character in a manually specified "+("`to."+l+"` field ["+JSON.stringify(a)+"]. Please separate it out to the ")+("`to."+s+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function bh(o){return o.filter((l,s)=>s===0||l.route.path&&l.route.path.length>0)}function Xl(o,l){let s=bh(o);return l?s.map((a,u)=>u===s.length-1?a.pathname:a.pathnameBase):s.map(a=>a.pathnameBase)}function Zl(o,l,s,a){a===void 0&&(a=!1);let u;typeof o=="string"?u=Yl(o):(u=No({},o),gt(!u.pathname||!u.pathname.includes("?"),Bo("?","pathname","search",u)),gt(!u.pathname||!u.pathname.includes("#"),Bo("#","pathname","hash",u)),gt(!u.search||!u.search.includes("#"),Bo("#","search","hash",u)));let t=o===""||u.pathname==="",r=t?"/":u.pathname,n;if(r==null)n=s;else{let h=l.length-1;if(!a&&r.startsWith("..")){let d=r.split("/");for(;d[0]==="..";)d.shift(),h-=1;u.pathname=d.join("/")}n=h>=0?l[h]:"/"}let e=mh(u,n),i=r&&r!=="/"&&r.endsWith("/"),c=(t||r===".")&&s.endsWith("/");return!e.pathname.endsWith("/")&&(i||c)&&(e.pathname+="/"),e}const vh=o=>o.join("/").replace(/\/\/+/g,"/"),wh=o=>!o||o==="?"?"":o.startsWith("?")?o:"?"+o,_h=o=>!o||o==="#"?"":o.startsWith("#")?o:"#"+o,eu=["post","put","patch","delete"];new Set(eu);const Sh=["get",...eu];new Set(Sh);/**
112
112
  * React Router v6.30.3
113
113
  *
114
114
  * Copyright (c) Remix Software Inc.
@@ -117,4 +117,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
117
117
  * LICENSE.md file in the root directory of this source tree.
118
118
  *
119
119
  * @license MIT
120
- */function No(){return No=Object.assign?Object.assign.bind():function(o){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=s[a])}return o},No.apply(this,arguments)}const Bo=st.createContext(null);process.env.NODE_ENV!=="production"&&(Bo.displayName="DataRouter");const vh=st.createContext(null);process.env.NODE_ENV!=="production"&&(vh.displayName="DataRouterState");const wh=st.createContext(null);process.env.NODE_ENV!=="production"&&(wh.displayName="Await");const an=st.createContext(null);process.env.NODE_ENV!=="production"&&(an.displayName="Navigation");const Lo=st.createContext(null);process.env.NODE_ENV!=="production"&&(Lo.displayName="Location");const _r=st.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(_r.displayName="Route");const _h=st.createContext(null);process.env.NODE_ENV!=="production"&&(_h.displayName="RouteError");function Uo(){return st.useContext(Lo)!=null}function Vl(){return Uo()||(process.env.NODE_ENV!=="production"?gt(!1,"useLocation() may be used only in the context of a <Router> component."):gt(!1)),st.useContext(Lo).location}const zl="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Kl(o){st.useContext(an).static||st.useLayoutEffect(o)}function Sh(){let{isDataRoute:o}=st.useContext(_r);return o?kh():Eh()}function Eh(){Uo()||(process.env.NODE_ENV!=="production"?gt(!1,"useNavigate() may be used only in the context of a <Router> component."):gt(!1));let o=st.useContext(Bo),{basename:l,future:s,navigator:a}=st.useContext(an),{matches:c}=st.useContext(_r),{pathname:t}=Vl(),r=JSON.stringify(Wl(c,s.v7_relativeSplatPath)),n=st.useRef(!1);return Kl(()=>{n.current=!0}),st.useCallback(function(i,u){if(u===void 0&&(u={}),process.env.NODE_ENV!=="production"&&sn(n.current,zl),!n.current)return;if(typeof i=="number"){a.go(i);return}let h=$l(i,JSON.parse(r),t,u.relative==="path");o==null&&l!=="/"&&(h.pathname=h.pathname==="/"?l:gh([l,h.pathname])),(u.replace?a.replace:a.push)(h,u.state,u)},[l,a,r,t,o])}var Hl=function(o){return o.UseBlocker="useBlocker",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o}(Hl||{}),Gl=function(o){return o.UseBlocker="useBlocker",o.UseLoaderData="useLoaderData",o.UseActionData="useActionData",o.UseRouteError="useRouteError",o.UseNavigation="useNavigation",o.UseRouteLoaderData="useRouteLoaderData",o.UseMatches="useMatches",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o.UseRouteId="useRouteId",o}(Gl||{});function Yl(o){return o+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Ah(o){let l=st.useContext(Bo);return l||(process.env.NODE_ENV!=="production"?gt(!1,Yl(o)):gt(!1)),l}function xh(o){let l=st.useContext(_r);return l||(process.env.NODE_ENV!=="production"?gt(!1,Yl(o)):gt(!1)),l}function Ih(o){let l=xh(o),s=l.matches[l.matches.length-1];return s.route.id||(process.env.NODE_ENV!=="production"?gt(!1,o+' can only be used on routes that contain a unique "id"'):gt(!1)),s.route.id}function kh(){let{router:o}=Ah(Hl.UseNavigateStable),l=Ih(Gl.UseNavigateStable),s=st.useRef(!1);return Kl(()=>{s.current=!0}),st.useCallback(function(c,t){t===void 0&&(t={}),process.env.NODE_ENV!=="production"&&sn(s.current,zl),s.current&&(typeof c=="number"?o.navigate(c):o.navigate(c,No({fromRouteId:l},t)))},[o,l])}function Oh(o){let{to:l,replace:s,state:a,relative:c}=o;Uo()||(process.env.NODE_ENV!=="production"?gt(!1,"<Navigate> may be used only in the context of a <Router> component."):gt(!1));let{future:t,static:r}=st.useContext(an);process.env.NODE_ENV!=="production"&&sn(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:n}=st.useContext(_r),{pathname:e}=Vl(),i=Sh(),u=$l(l,Wl(n,t.v7_relativeSplatPath),e,c==="path"),h=JSON.stringify(u);return st.useEffect(()=>i(JSON.parse(h),{replace:s,state:a,relative:c}),[i,h,c,s,a]),null}function Do(o){process.env.NODE_ENV!=="production"?gt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>."):gt(!1)}new Promise(()=>{});const Ql=o=>o.map(l=>{if(l.children&&l.children.length>0){const s=l.children[0].path;return Ie.jsxs(Do,{path:l.path,element:Ie.jsx(l.component,{}),children:[Ie.jsx(Do,{index:!0,element:Ie.jsx(Oh,{to:s,replace:!0})}),Ql(l.children)]},l.id)}return Ie.jsx(Do,{path:l.path,element:Ie.jsx(l.component,{})},l.id)}),Jl=Se.z.object({key:Se.z.string(),label:Se.z.string(),type:Se.z.enum(["text","number","currency","date","boolean","status","email","image","textarea"]),required:Se.z.boolean().optional(),description:Se.z.string().optional(),defaultValue:Se.z.any().optional()}),Xl=Se.z.object({id:Se.z.string(),name:Se.z.string(),fields:Se.z.array(Jl),defaultView:Se.z.enum(["table","grid","list"]).optional(),features:Se.z.object({searchable:Se.z.boolean().optional(),creatable:Se.z.boolean().optional(),editable:Se.z.boolean().optional(),deletable:Se.z.boolean().optional(),exportable:Se.z.boolean().optional()}).optional()}),Zl=Se.z.object({id:Se.z.string().min(1,"Signal ID is required"),label:Se.z.string(),description:Se.z.string().optional(),kind:Se.z.enum(["sensor","actuator","setpoint","metric","status","kpi"]),source:Se.z.enum(["mock","mqtt","http","derived","local"]),topic:Se.z.string().optional(),endpoint:Se.z.string().optional(),jsonPath:Se.z.string().optional(),refreshRate:Se.z.number().optional().default(1e3),defaultValue:Se.z.any().optional(),unit:Se.z.string().optional(),min:Se.z.number().optional(),max:Se.z.number().optional()}),eu=Se.z.object({id:Se.z.string(),name:Se.z.string(),description:Se.z.string().optional(),type:Se.z.string(),category:Se.z.string().default("logical"),signals:Se.z.array(Se.z.string()),ui:Se.z.object({icon:Se.z.string().optional(),color:Se.z.string().optional(),dashboardComponent:Se.z.string().optional()}).optional()}),tu=Se.z.object({id:Se.z.string(),type:Se.z.enum(["signal_change","manual_action","schedule","webhook"]),config:Se.z.record(Se.z.string(),Se.z.any())}),ru=Se.z.object({id:Se.z.string(),type:Se.z.enum(["update_resource","send_notification","mqtt_publish","api_call","navigate","agent_task"]),config:Se.z.record(Se.z.string(),Se.z.any())}),nu=Se.z.object({id:Se.z.string(),name:Se.z.string(),active:Se.z.boolean().default(!0),trigger:tu,actions:Se.z.array(ru)}),iu=Se.z.object({id:Se.z.string(),type:Se.z.string(),props:Se.z.record(Se.z.string(),Se.z.any()),layout:Se.z.object({colSpan:Se.z.number().optional(),rowSpan:Se.z.number().optional()}).optional()}),ou=Se.z.object({id:Se.z.string(),title:Se.z.string().optional(),description:Se.z.string().optional(),layout:Se.z.object({columns:Se.z.number().optional(),variant:Se.z.enum(["grid","stack","split"]).optional()}).optional(),blocks:Se.z.array(iu)}),su=Se.z.object({id:Se.z.string(),slug:Se.z.string(),title:Se.z.string(),description:Se.z.string().optional(),icon:Se.z.string().optional(),sections:Se.z.array(ou)}),Th=Se.z.object({meta:Se.z.object({name:Se.z.string(),version:Se.z.string(),description:Se.z.string().optional(),author:Se.z.string().optional(),createdAt:Se.z.string().optional()}),config:Se.z.object({theme:Se.z.enum(["light","dark","system","corporate","midnight","blueprint"]).default("system"),mockMode:Se.z.boolean().default(!0),brokerUrl:Se.z.string().optional()}),modules:Se.z.array(Se.z.string()).optional(),resources:Se.z.array(Xl).optional(),domain:Se.z.object({signals:Se.z.array(Zl),entities:Se.z.array(eu),workflows:Se.z.array(nu).optional()}),pages:Se.z.array(su).optional()}),Ph=({isOpen:o,onClose:l})=>{const{geminiApiKey:s,setGeminiApiKey:a,clearKeys:c}=jo(),[t,r]=Oe.useState(""),[n,e]=Oe.useState(!1),{addToast:i}=qe.useToast();Oe.useEffect(()=>{o&&r(s||"")},[o,s]);const u=()=>{a(t),i("Vault saved","success"),l()},h=()=>{confirm("Clear API Key?")&&(c(),r(""),i("Vault cleared","info"))};return Ie.jsx(qe.Modal,{title:"Ramme Settings",isOpen:o,onClose:l,children:Ie.jsxs("div",{className:"space-y-6 py-4",children:[Ie.jsxs("div",{className:"space-y-3",children:[Ie.jsxs("div",{className:"flex items-center justify-between",children:[Ie.jsx("label",{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Gemini API Key"}),Ie.jsxs("a",{href:"https://aistudio.google.com/app/apikey",target:"_blank",rel:"noreferrer",className:"text-xs text-primary flex gap-1 items-center hover:underline",children:["Get Key ",Ie.jsx(qe.Icon,{name:"external-link",className:"w-3 h-3"})]})]}),Ie.jsxs("div",{className:"relative",children:[Ie.jsx(qe.Input,{type:n?"text":"password",value:t,onChange:d=>r(d.target.value),placeholder:"AIzaSy...",className:"pr-10 font-mono text-sm"}),Ie.jsx("button",{type:"button",onClick:()=>e(!n),className:"absolute right-3 top-2.5 text-muted-foreground hover:text-foreground",children:Ie.jsx(qe.Icon,{name:n?"eye-off":"eye",className:"w-4 h-4"})})]}),Ie.jsx("p",{className:"text-[0.8rem] text-muted-foreground",children:"Stored securely in your browser's LocalStorage."})]}),Ie.jsxs("div",{className:"flex justify-between pt-4 border-t mt-6",children:[Ie.jsx(qe.Button,{variant:"ghost",className:"text-destructive",onClick:h,disabled:!s,children:"Clear Key"}),Ie.jsxs("div",{className:"flex gap-2",children:[Ie.jsx(qe.Button,{variant:"outline",onClick:l,children:"Cancel"}),Ie.jsx(qe.Button,{onClick:u,children:"Save"})]})]})]})})};Re.ActionSchema=ru,Re.AppSpecificationSchema=Th,Re.AutoForm=kl,Re.BlockSchema=iu,Re.DynamicBlock=ch,Re.DynamicPage=Pl,Re.EntitySchema=eu,Re.FieldSchema=Jl,Re.ManifestProvider=wu,Re.MqttProvider=Cf,Re.PageSchema=su,Re.PageSectionSchema=ou,Re.ResourceSchema=Xl,Re.SettingsModal=Ph,Re.SignalSchema=Zl,Re.SitemapProvider=Rf,Re.SmartTable=Po,Re.TriggerSchema=tu,Re.WorkflowSchema=nu,Re.generateRoutes=Ql,Re.initializeDataLake=ah,Re.useAction=Mf,Re.useBridgeStatus=dn,Re.useCrudLocalStorage=Il,Re.useDataQuery=Nf,Re.useDynamicSitemap=Jf,Re.useGeneratedSignals=Ml,Re.useJustInTimeSeeder=To,Re.useLiveBridge=Zf,Re.useManifest=Ht,Re.useMqtt=Oo,Re.useSettingsStore=jo,Re.useSignal=oh,Re.useSignalStore=on,Re.useSimulation=ih,Re.useSitemap=jf,Re.useWorkflowEngine=uh,Object.defineProperty(Re,Symbol.toStringTag,{value:"Module"})});
120
+ */function Lo(){return Lo=Object.assign?Object.assign.bind():function(o){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=s[a])}return o},Lo.apply(this,arguments)}const Uo=st.createContext(null);process.env.NODE_ENV!=="production"&&(Uo.displayName="DataRouter");const Eh=st.createContext(null);process.env.NODE_ENV!=="production"&&(Eh.displayName="DataRouterState");const Ah=st.createContext(null);process.env.NODE_ENV!=="production"&&(Ah.displayName="Await");const an=st.createContext(null);process.env.NODE_ENV!=="production"&&(an.displayName="Navigation");const Do=st.createContext(null);process.env.NODE_ENV!=="production"&&(Do.displayName="Location");const _r=st.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(_r.displayName="Route");const xh=st.createContext(null);process.env.NODE_ENV!=="production"&&(xh.displayName="RouteError");function Fo(){return st.useContext(Do)!=null}function tu(){return Fo()||(process.env.NODE_ENV!=="production"?gt(!1,"useLocation() may be used only in the context of a <Router> component."):gt(!1)),st.useContext(Do).location}const ru="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nu(o){st.useContext(an).static||st.useLayoutEffect(o)}function Ih(){let{isDataRoute:o}=st.useContext(_r);return o?Ch():kh()}function kh(){Fo()||(process.env.NODE_ENV!=="production"?gt(!1,"useNavigate() may be used only in the context of a <Router> component."):gt(!1));let o=st.useContext(Uo),{basename:l,future:s,navigator:a}=st.useContext(an),{matches:u}=st.useContext(_r),{pathname:t}=tu(),r=JSON.stringify(Xl(u,s.v7_relativeSplatPath)),n=st.useRef(!1);return nu(()=>{n.current=!0}),st.useCallback(function(i,c){if(c===void 0&&(c={}),process.env.NODE_ENV!=="production"&&sn(n.current,ru),!n.current)return;if(typeof i=="number"){a.go(i);return}let h=Zl(i,JSON.parse(r),t,c.relative==="path");o==null&&l!=="/"&&(h.pathname=h.pathname==="/"?l:vh([l,h.pathname])),(c.replace?a.replace:a.push)(h,c.state,c)},[l,a,r,t,o])}var iu=function(o){return o.UseBlocker="useBlocker",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o}(iu||{}),ou=function(o){return o.UseBlocker="useBlocker",o.UseLoaderData="useLoaderData",o.UseActionData="useActionData",o.UseRouteError="useRouteError",o.UseNavigation="useNavigation",o.UseRouteLoaderData="useRouteLoaderData",o.UseMatches="useMatches",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o.UseRouteId="useRouteId",o}(ou||{});function su(o){return o+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Oh(o){let l=st.useContext(Uo);return l||(process.env.NODE_ENV!=="production"?gt(!1,su(o)):gt(!1)),l}function Th(o){let l=st.useContext(_r);return l||(process.env.NODE_ENV!=="production"?gt(!1,su(o)):gt(!1)),l}function Ph(o){let l=Th(o),s=l.matches[l.matches.length-1];return s.route.id||(process.env.NODE_ENV!=="production"?gt(!1,o+' can only be used on routes that contain a unique "id"'):gt(!1)),s.route.id}function Ch(){let{router:o}=Oh(iu.UseNavigateStable),l=Ph(ou.UseNavigateStable),s=st.useRef(!1);return nu(()=>{s.current=!0}),st.useCallback(function(u,t){t===void 0&&(t={}),process.env.NODE_ENV!=="production"&&sn(s.current,ru),s.current&&(typeof u=="number"?o.navigate(u):o.navigate(u,Lo({fromRouteId:l},t)))},[o,l])}function jh(o){let{to:l,replace:s,state:a,relative:u}=o;Fo()||(process.env.NODE_ENV!=="production"?gt(!1,"<Navigate> may be used only in the context of a <Router> component."):gt(!1));let{future:t,static:r}=st.useContext(an);process.env.NODE_ENV!=="production"&&sn(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:n}=st.useContext(_r),{pathname:e}=tu(),i=Ih(),c=Zl(l,Xl(n,t.v7_relativeSplatPath),e,u==="path"),h=JSON.stringify(c);return st.useEffect(()=>i(JSON.parse(h),{replace:s,state:a,relative:u}),[i,h,u,s,a]),null}function Wo(o){process.env.NODE_ENV!=="production"?gt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>."):gt(!1)}new Promise(()=>{});const au=o=>o.map(l=>{if(l.children&&l.children.length>0){const s=l.children[0].path;return Ie.jsxs(Wo,{path:l.path,element:Ie.jsx(l.component,{}),children:[Ie.jsx(Wo,{index:!0,element:Ie.jsx(jh,{to:s,replace:!0})}),au(l.children)]},l.id)}return Ie.jsx(Wo,{path:l.path,element:Ie.jsx(l.component,{})},l.id)}),Rh=({isOpen:o,onClose:l})=>{const{geminiApiKey:s,setGeminiApiKey:a,clearKeys:u}=Ro(),[t,r]=Oe.useState(""),[n,e]=Oe.useState(!1),{addToast:i}=qe.useToast();Oe.useEffect(()=>{o&&r(s||"")},[o,s]);const c=()=>{a(t),i("Vault saved","success"),l()},h=()=>{confirm("Clear API Key?")&&(u(),r(""),i("Vault cleared","info"))};return Ie.jsx(qe.Modal,{title:"Ramme Settings",isOpen:o,onClose:l,children:Ie.jsxs("div",{className:"space-y-6 py-4",children:[Ie.jsxs("div",{className:"space-y-3",children:[Ie.jsxs("div",{className:"flex items-center justify-between",children:[Ie.jsx("label",{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Gemini API Key"}),Ie.jsxs("a",{href:"https://aistudio.google.com/app/apikey",target:"_blank",rel:"noreferrer",className:"text-xs text-primary flex gap-1 items-center hover:underline",children:["Get Key ",Ie.jsx(qe.Icon,{name:"external-link",className:"w-3 h-3"})]})]}),Ie.jsxs("div",{className:"relative",children:[Ie.jsx(qe.Input,{type:n?"text":"password",value:t,onChange:d=>r(d.target.value),placeholder:"AIzaSy...",className:"pr-10 font-mono text-sm"}),Ie.jsx("button",{type:"button",onClick:()=>e(!n),className:"absolute right-3 top-2.5 text-muted-foreground hover:text-foreground",children:Ie.jsx(qe.Icon,{name:n?"eye-off":"eye",className:"w-4 h-4"})})]}),Ie.jsx("p",{className:"text-[0.8rem] text-muted-foreground",children:"Stored securely in your browser's LocalStorage."})]}),Ie.jsxs("div",{className:"flex justify-between pt-4 border-t mt-6",children:[Ie.jsx(qe.Button,{variant:"ghost",className:"text-destructive",onClick:h,disabled:!s,children:"Clear Key"}),Ie.jsxs("div",{className:"flex gap-2",children:[Ie.jsx(qe.Button,{variant:"outline",onClick:l,children:"Cancel"}),Ie.jsx(qe.Button,{onClick:c,children:"Save"})]})]})]})})};Re.ActionSchema=$l,Re.AppSpecificationSchema=ph,Re.AutoForm=Tl,Re.BlockSchema=Vl,Re.DynamicBlock=dh,Re.DynamicPage=jl,Re.EntitySchema=Fl,Re.FieldSchema=Ll,Re.ManifestProvider=_u,Re.MqttProvider=jf,Re.PageSchema=Kl,Re.PageSectionSchema=zl,Re.ResourceSchema=Ul,Re.SettingsModal=Rh,Re.SignalSchema=Dl,Re.SitemapProvider=Mf,Re.SmartTable=Po,Re.TriggerSchema=Wl,Re.WorkflowSchema=ql,Re.generateRoutes=au,Re.initializeDataLake=lh,Re.useAction=Nf,Re.useAppStore=hh,Re.useBridgeStatus=dn,Re.useCrudLocalStorage=Ol,Re.useDataQuery=Bf,Re.useDynamicSitemap=Xf,Re.useGeneratedSignals=Nl,Re.useJustInTimeSeeder=To,Re.useLiveBridge=eh,Re.useManifest=Ht,Re.useMqtt=Oo,Re.useSettingsStore=Ro,Re.useSignal=sh,Re.useSignalStore=on,Re.useSimulation=oh,Re.useSitemap=Rf,Re.useWorkflowEngine=ch,Object.defineProperty(Re,Symbol.toStringTag,{value:"Module"})});