@botpress/webchat 1.3.1 → 1.3.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.
@@ -1,4 +1,4 @@
1
- (function(Ye,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],_):(Ye=typeof globalThis<"u"?globalThis:Ye||self,_(Ye.Webchat={},Ye.React,Ye.ReactDOM))})(this,function(Ye,_,Gn){"use strict";var QU=Object.defineProperty;var XU=(Ye,_,Gn)=>_ in Ye?QU(Ye,_,{enumerable:!0,configurable:!0,writable:!0,value:Gn}):Ye[_]=Gn;var E=(Ye,_,Gn)=>(XU(Ye,typeof _!="symbol"?_+"":_,Gn),Gn);function zd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const R=zd(_),jw=zd(Gn);var Me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ai(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ll(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Dl={exports:{}},bs={};/**
1
+ (function(Ye,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],_):(Ye=typeof globalThis<"u"?globalThis:Ye||self,_(Ye.Webchat={},Ye.React,Ye.ReactDOM))})(this,function(Ye,_,Gn){"use strict";var WU=Object.defineProperty;var HU=(Ye,_,Gn)=>_ in Ye?WU(Ye,_,{enumerable:!0,configurable:!0,writable:!0,value:Gn}):Ye[_]=Gn;var E=(Ye,_,Gn)=>(HU(Ye,typeof _!="symbol"?_+"":_,Gn),Gn);function Bd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const R=Bd(_),Dw=Bd(Gn);var Me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ai(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $l(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Ml={exports:{}},bs={};/**
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 Zd;function Uw(){if(Zd)return bs;Zd=1;var e=_,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,l,c){var u,d={},h=null,f=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(f=l.ref);for(u in l)r.call(l,u)&&!s.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:a,key:h,ref:f,props:d,_owner:i.current}}return bs.Fragment=n,bs.jsx=o,bs.jsxs=o,bs}var ws={};/**
9
+ */var Vd;function Nw(){if(Vd)return bs;Vd=1;var e=_,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,l,c){var u,d={},h=null,f=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(f=l.ref);for(u in l)r.call(l,u)&&!s.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:a,key:h,ref:f,props:d,_owner:i.current}}return bs.Fragment=n,bs.jsx=o,bs.jsxs=o,bs}var ws={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,44 +14,44 @@
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 Wd;function Fw(){return Wd||(Wd=1,process.env.NODE_ENV!=="production"&&function(){var e=_,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p=Symbol.iterator,m="@@iterator";function y(M){if(M===null||typeof M!="object")return null;var ge=p&&M[p]||M[m];return typeof ge=="function"?ge:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(M){{for(var ge=arguments.length,Se=new Array(ge>1?ge-1:0),Ke=1;Ke<ge;Ke++)Se[Ke-1]=arguments[Ke];x("error",M,Se)}}function x(M,ge,Se){{var Ke=v.ReactDebugCurrentFrame,ft=Ke.getStackAddendum();ft!==""&&(ge+="%s",Se=Se.concat([ft]));var yt=Se.map(function(at){return String(at)});yt.unshift("Warning: "+ge),Function.prototype.apply.call(console[M],console,yt)}}var I=!1,P=!1,T=!1,j=!1,U=!1,F;F=Symbol.for("react.module.reference");function O(M){return!!(typeof M=="string"||typeof M=="function"||M===r||M===s||U||M===i||M===c||M===u||j||M===f||I||P||T||typeof M=="object"&&M!==null&&(M.$$typeof===h||M.$$typeof===d||M.$$typeof===o||M.$$typeof===a||M.$$typeof===l||M.$$typeof===F||M.getModuleId!==void 0))}function N(M,ge,Se){var Ke=M.displayName;if(Ke)return Ke;var ft=ge.displayName||ge.name||"";return ft!==""?Se+"("+ft+")":Se}function J(M){return M.displayName||"Context"}function q(M){if(M==null)return null;if(typeof M.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case a:var ge=M;return J(ge)+".Consumer";case o:var Se=M;return J(Se._context)+".Provider";case l:return N(M,M.render,"ForwardRef");case d:var Ke=M.displayName||null;return Ke!==null?Ke:q(M.type)||"Memo";case h:{var ft=M,yt=ft._payload,at=ft._init;try{return q(at(yt))}catch{return null}}}return null}var W=Object.assign,B=0,V,Y,K,pe,k,ee,xe;function S(){}S.__reactDisabledLog=!0;function Te(){{if(B===0){V=console.log,Y=console.info,K=console.warn,pe=console.error,k=console.group,ee=console.groupCollapsed,xe=console.groupEnd;var M={configurable:!0,enumerable:!0,value:S,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}B++}}function Ne(){{if(B--,B===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},M,{value:V}),info:W({},M,{value:Y}),warn:W({},M,{value:K}),error:W({},M,{value:pe}),group:W({},M,{value:k}),groupCollapsed:W({},M,{value:ee}),groupEnd:W({},M,{value:xe})})}B<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ie=v.ReactCurrentDispatcher,je;function De(M,ge,Se){{if(je===void 0)try{throw Error()}catch(ft){var Ke=ft.stack.trim().match(/\n( *(at )?)/);je=Ke&&Ke[1]||""}return`
18
- `+je+M}}var Ue=!1,_e;{var ve=typeof WeakMap=="function"?WeakMap:Map;_e=new ve}function ke(M,ge){if(!M||Ue)return"";{var Se=_e.get(M);if(Se!==void 0)return Se}var Ke;Ue=!0;var ft=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var yt;yt=Ie.current,Ie.current=null,Te();try{if(ge){var at=function(){throw Error()};if(Object.defineProperty(at.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(at,[])}catch($){Ke=$}Reflect.construct(M,[],at)}else{try{at.call()}catch($){Ke=$}M.call(at.prototype)}}else{try{throw Error()}catch($){Ke=$}M()}}catch($){if($&&Ke&&typeof $.stack=="string"){for(var it=$.stack.split(`
17
+ */var zd;function jw(){return zd||(zd=1,process.env.NODE_ENV!=="production"&&function(){var e=_,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p=Symbol.iterator,m="@@iterator";function v(M){if(M===null||typeof M!="object")return null;var ge=p&&M[p]||M[m];return typeof ge=="function"?ge:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(M){{for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),Ke=1;Ke<ge;Ke++)Ee[Ke-1]=arguments[Ke];x("error",M,Ee)}}function x(M,ge,Ee){{var Ke=y.ReactDebugCurrentFrame,ft=Ke.getStackAddendum();ft!==""&&(ge+="%s",Ee=Ee.concat([ft]));var gt=Ee.map(function(at){return String(at)});gt.unshift("Warning: "+ge),Function.prototype.apply.call(console[M],console,gt)}}var I=!1,A=!1,O=!1,j=!1,U=!1,H;H=Symbol.for("react.module.reference");function T(M){return!!(typeof M=="string"||typeof M=="function"||M===r||M===s||U||M===i||M===c||M===u||j||M===f||I||A||O||typeof M=="object"&&M!==null&&(M.$$typeof===h||M.$$typeof===d||M.$$typeof===o||M.$$typeof===a||M.$$typeof===l||M.$$typeof===H||M.getModuleId!==void 0))}function N(M,ge,Ee){var Ke=M.displayName;if(Ke)return Ke;var ft=ge.displayName||ge.name||"";return ft!==""?Ee+"("+ft+")":Ee}function G(M){return M.displayName||"Context"}function W(M){if(M==null)return null;if(typeof M.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case a:var ge=M;return G(ge)+".Consumer";case o:var Ee=M;return G(Ee._context)+".Provider";case l:return N(M,M.render,"ForwardRef");case d:var Ke=M.displayName||null;return Ke!==null?Ke:W(M.type)||"Memo";case h:{var ft=M,gt=ft._payload,at=ft._init;try{return W(at(gt))}catch{return null}}}return null}var q=Object.assign,B=0,z,Y,K,pe,k,ee,_e;function S(){}S.__reactDisabledLog=!0;function Se(){{if(B===0){z=console.log,Y=console.info,K=console.warn,pe=console.error,k=console.group,ee=console.groupCollapsed,_e=console.groupEnd;var M={configurable:!0,enumerable:!0,value:S,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}B++}}function Ne(){{if(B--,B===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:q({},M,{value:z}),info:q({},M,{value:Y}),warn:q({},M,{value:K}),error:q({},M,{value:pe}),group:q({},M,{value:k}),groupCollapsed:q({},M,{value:ee}),groupEnd:q({},M,{value:_e})})}B<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ie=y.ReactCurrentDispatcher,je;function He(M,ge,Ee){{if(je===void 0)try{throw Error()}catch(ft){var Ke=ft.stack.trim().match(/\n( *(at )?)/);je=Ke&&Ke[1]||""}return`
18
+ `+je+M}}var De=!1,we;{var ye=typeof WeakMap=="function"?WeakMap:Map;we=new ye}function Te(M,ge){if(!M||De)return"";{var Ee=we.get(M);if(Ee!==void 0)return Ee}var Ke;De=!0;var ft=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var gt;gt=Ie.current,Ie.current=null,Se();try{if(ge){var at=function(){throw Error()};if(Object.defineProperty(at.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(at,[])}catch($){Ke=$}Reflect.construct(M,[],at)}else{try{at.call()}catch($){Ke=$}M.call(at.prototype)}}else{try{throw Error()}catch($){Ke=$}M()}}catch($){if($&&Ke&&typeof $.stack=="string"){for(var it=$.stack.split(`
19
19
  `),sn=Ke.stack.split(`
20
- `),A=it.length-1,g=sn.length-1;A>=1&&g>=0&&it[A]!==sn[g];)g--;for(;A>=1&&g>=0;A--,g--)if(it[A]!==sn[g]){if(A!==1||g!==1)do if(A--,g--,g<0||it[A]!==sn[g]){var w=`
21
- `+it[A].replace(" at new "," at ");return M.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",M.displayName)),typeof M=="function"&&_e.set(M,w),w}while(A>=1&&g>=0);break}}}finally{Ue=!1,Ie.current=yt,Ne(),Error.prepareStackTrace=ft}var C=M?M.displayName||M.name:"",L=C?De(C):"";return typeof M=="function"&&_e.set(M,L),L}function Ce(M,ge,Se){return ke(M,!1)}function Re(M){var ge=M.prototype;return!!(ge&&ge.isReactComponent)}function qe(M,ge,Se){if(M==null)return"";if(typeof M=="function")return ke(M,Re(M));if(typeof M=="string")return De(M);switch(M){case c:return De("Suspense");case u:return De("SuspenseList")}if(typeof M=="object")switch(M.$$typeof){case l:return Ce(M.render);case d:return qe(M.type,ge,Se);case h:{var Ke=M,ft=Ke._payload,yt=Ke._init;try{return qe(yt(ft),ge,Se)}catch{}}}return""}var D=Object.prototype.hasOwnProperty,ne={},me=v.ReactDebugCurrentFrame;function he(M){if(M){var ge=M._owner,Se=qe(M.type,M._source,ge?ge.type:null);me.setExtraStackFrame(Se)}else me.setExtraStackFrame(null)}function Le(M,ge,Se,Ke,ft){{var yt=Function.call.bind(D);for(var at in M)if(yt(M,at)){var it=void 0;try{if(typeof M[at]!="function"){var sn=Error((Ke||"React class")+": "+Se+" type `"+at+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof M[at]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw sn.name="Invariant Violation",sn}it=M[at](ge,at,Ke,Se,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(A){it=A}it&&!(it instanceof Error)&&(he(ft),b("%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).",Ke||"React class",Se,at,typeof it),he(null)),it instanceof Error&&!(it.message in ne)&&(ne[it.message]=!0,he(ft),b("Failed %s type: %s",Se,it.message),he(null))}}}var Pe=Array.isArray;function Be(M){return Pe(M)}function ot(M){{var ge=typeof Symbol=="function"&&Symbol.toStringTag,Se=ge&&M[Symbol.toStringTag]||M.constructor.name||"Object";return Se}}function Ze(M){try{return Z(M),!1}catch{return!0}}function Z(M){return""+M}function Q(M){if(Ze(M))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ot(M)),Z(M)}var G=v.ReactCurrentOwner,$e={key:!0,ref:!0,__self:!0,__source:!0},Ge,St,bt;bt={};function gt(M){if(D.call(M,"ref")){var ge=Object.getOwnPropertyDescriptor(M,"ref").get;if(ge&&ge.isReactWarning)return!1}return M.ref!==void 0}function At(M){if(D.call(M,"key")){var ge=Object.getOwnPropertyDescriptor(M,"key").get;if(ge&&ge.isReactWarning)return!1}return M.key!==void 0}function fn(M,ge){if(typeof M.ref=="string"&&G.current&&ge&&G.current.stateNode!==ge){var Se=q(G.current.type);bt[Se]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',q(G.current.type),M.ref),bt[Se]=!0)}}function Rt(M,ge){{var Se=function(){Ge||(Ge=!0,b("%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)",ge))};Se.isReactWarning=!0,Object.defineProperty(M,"key",{get:Se,configurable:!0})}}function Ft(M,ge){{var Se=function(){St||(St=!0,b("%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)",ge))};Se.isReactWarning=!0,Object.defineProperty(M,"ref",{get:Se,configurable:!0})}}var Qt=function(M,ge,Se,Ke,ft,yt,at){var it={$$typeof:t,type:M,key:ge,ref:Se,props:at,_owner:yt};return it._store={},Object.defineProperty(it._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(it,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ke}),Object.defineProperty(it,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ft}),Object.freeze&&(Object.freeze(it.props),Object.freeze(it)),it};function Gt(M,ge,Se,Ke,ft){{var yt,at={},it=null,sn=null;Se!==void 0&&(Q(Se),it=""+Se),At(ge)&&(Q(ge.key),it=""+ge.key),gt(ge)&&(sn=ge.ref,fn(ge,ft));for(yt in ge)D.call(ge,yt)&&!$e.hasOwnProperty(yt)&&(at[yt]=ge[yt]);if(M&&M.defaultProps){var A=M.defaultProps;for(yt in A)at[yt]===void 0&&(at[yt]=A[yt])}if(it||sn){var g=typeof M=="function"?M.displayName||M.name||"Unknown":M;it&&Rt(at,g),sn&&Ft(at,g)}return Qt(M,it,sn,ft,Ke,G.current,at)}}var Rr=v.ReactCurrentOwner,jn=v.ReactDebugCurrentFrame;function fr(M){if(M){var ge=M._owner,Se=qe(M.type,M._source,ge?ge.type:null);jn.setExtraStackFrame(Se)}else jn.setExtraStackFrame(null)}var Ri;Ri=!1;function si(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function oi(){{if(Rr.current){var M=q(Rr.current.type);if(M)return`
20
+ `),P=it.length-1,g=sn.length-1;P>=1&&g>=0&&it[P]!==sn[g];)g--;for(;P>=1&&g>=0;P--,g--)if(it[P]!==sn[g]){if(P!==1||g!==1)do if(P--,g--,g<0||it[P]!==sn[g]){var w=`
21
+ `+it[P].replace(" at new "," at ");return M.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",M.displayName)),typeof M=="function"&&we.set(M,w),w}while(P>=1&&g>=0);break}}}finally{De=!1,Ie.current=gt,Ne(),Error.prepareStackTrace=ft}var C=M?M.displayName||M.name:"",L=C?He(C):"";return typeof M=="function"&&we.set(M,L),L}function ke(M,ge,Ee){return Te(M,!1)}function Re(M){var ge=M.prototype;return!!(ge&&ge.isReactComponent)}function qe(M,ge,Ee){if(M==null)return"";if(typeof M=="function")return Te(M,Re(M));if(typeof M=="string")return He(M);switch(M){case c:return He("Suspense");case u:return He("SuspenseList")}if(typeof M=="object")switch(M.$$typeof){case l:return ke(M.render);case d:return qe(M.type,ge,Ee);case h:{var Ke=M,ft=Ke._payload,gt=Ke._init;try{return qe(gt(ft),ge,Ee)}catch{}}}return""}var D=Object.prototype.hasOwnProperty,ne={},me=y.ReactDebugCurrentFrame;function he(M){if(M){var ge=M._owner,Ee=qe(M.type,M._source,ge?ge.type:null);me.setExtraStackFrame(Ee)}else me.setExtraStackFrame(null)}function Le(M,ge,Ee,Ke,ft){{var gt=Function.call.bind(D);for(var at in M)if(gt(M,at)){var it=void 0;try{if(typeof M[at]!="function"){var sn=Error((Ke||"React class")+": "+Ee+" type `"+at+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof M[at]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw sn.name="Invariant Violation",sn}it=M[at](ge,at,Ke,Ee,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(P){it=P}it&&!(it instanceof Error)&&(he(ft),b("%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).",Ke||"React class",Ee,at,typeof it),he(null)),it instanceof Error&&!(it.message in ne)&&(ne[it.message]=!0,he(ft),b("Failed %s type: %s",Ee,it.message),he(null))}}}var Pe=Array.isArray;function Fe(M){return Pe(M)}function ot(M){{var ge=typeof Symbol=="function"&&Symbol.toStringTag,Ee=ge&&M[Symbol.toStringTag]||M.constructor.name||"Object";return Ee}}function ze(M){try{return V(M),!1}catch{return!0}}function V(M){return""+M}function Q(M){if(ze(M))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ot(M)),V(M)}var J=y.ReactCurrentOwner,$e={key:!0,ref:!0,__self:!0,__source:!0},Ge,St,bt;bt={};function mt(M){if(D.call(M,"ref")){var ge=Object.getOwnPropertyDescriptor(M,"ref").get;if(ge&&ge.isReactWarning)return!1}return M.ref!==void 0}function At(M){if(D.call(M,"key")){var ge=Object.getOwnPropertyDescriptor(M,"key").get;if(ge&&ge.isReactWarning)return!1}return M.key!==void 0}function fn(M,ge){if(typeof M.ref=="string"&&J.current&&ge&&J.current.stateNode!==ge){var Ee=W(J.current.type);bt[Ee]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',W(J.current.type),M.ref),bt[Ee]=!0)}}function Rt(M,ge){{var Ee=function(){Ge||(Ge=!0,b("%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)",ge))};Ee.isReactWarning=!0,Object.defineProperty(M,"key",{get:Ee,configurable:!0})}}function Ft(M,ge){{var Ee=function(){St||(St=!0,b("%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)",ge))};Ee.isReactWarning=!0,Object.defineProperty(M,"ref",{get:Ee,configurable:!0})}}var Qt=function(M,ge,Ee,Ke,ft,gt,at){var it={$$typeof:t,type:M,key:ge,ref:Ee,props:at,_owner:gt};return it._store={},Object.defineProperty(it._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(it,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ke}),Object.defineProperty(it,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ft}),Object.freeze&&(Object.freeze(it.props),Object.freeze(it)),it};function Gt(M,ge,Ee,Ke,ft){{var gt,at={},it=null,sn=null;Ee!==void 0&&(Q(Ee),it=""+Ee),At(ge)&&(Q(ge.key),it=""+ge.key),mt(ge)&&(sn=ge.ref,fn(ge,ft));for(gt in ge)D.call(ge,gt)&&!$e.hasOwnProperty(gt)&&(at[gt]=ge[gt]);if(M&&M.defaultProps){var P=M.defaultProps;for(gt in P)at[gt]===void 0&&(at[gt]=P[gt])}if(it||sn){var g=typeof M=="function"?M.displayName||M.name||"Unknown":M;it&&Rt(at,g),sn&&Ft(at,g)}return Qt(M,it,sn,ft,Ke,J.current,at)}}var Rr=y.ReactCurrentOwner,jn=y.ReactDebugCurrentFrame;function fr(M){if(M){var ge=M._owner,Ee=qe(M.type,M._source,ge?ge.type:null);jn.setExtraStackFrame(Ee)}else jn.setExtraStackFrame(null)}var Ai;Ai=!1;function si(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function oi(){{if(Rr.current){var M=W(Rr.current.type);if(M)return`
22
22
 
23
- Check the render method of \``+M+"`."}return""}}function $r(M){{if(M!==void 0){var ge=M.fileName.replace(/^.*[\\\/]/,""),Se=M.lineNumber;return`
23
+ Check the render method of \``+M+"`."}return""}}function $r(M){{if(M!==void 0){var ge=M.fileName.replace(/^.*[\\\/]/,""),Ee=M.lineNumber;return`
24
24
 
25
- Check your code at `+ge+":"+Se+"."}return""}}var Tt={};function Ot(M){{var ge=oi();if(!ge){var Se=typeof M=="string"?M:M.displayName||M.name;Se&&(ge=`
25
+ Check your code at `+ge+":"+Ee+"."}return""}}var Tt={};function Ot(M){{var ge=oi();if(!ge){var Ee=typeof M=="string"?M:M.displayName||M.name;Ee&&(ge=`
26
26
 
27
- Check the top-level render call using <`+Se+">.")}return ge}}function Xt(M,ge){{if(!M._store||M._store.validated||M.key!=null)return;M._store.validated=!0;var Se=Ot(ge);if(Tt[Se])return;Tt[Se]=!0;var Ke="";M&&M._owner&&M._owner!==Rr.current&&(Ke=" It was passed a child from "+q(M._owner.type)+"."),fr(M),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Se,Ke),fr(null)}}function en(M,ge){{if(typeof M!="object")return;if(Be(M))for(var Se=0;Se<M.length;Se++){var Ke=M[Se];si(Ke)&&Xt(Ke,ge)}else if(si(M))M._store&&(M._store.validated=!0);else if(M){var ft=y(M);if(typeof ft=="function"&&ft!==M.entries)for(var yt=ft.call(M),at;!(at=yt.next()).done;)si(at.value)&&Xt(at.value,ge)}}}function Yt(M){{var ge=M.type;if(ge==null||typeof ge=="string")return;var Se;if(typeof ge=="function")Se=ge.propTypes;else if(typeof ge=="object"&&(ge.$$typeof===l||ge.$$typeof===d))Se=ge.propTypes;else return;if(Se){var Ke=q(ge);Le(Se,M.props,"prop",Ke,M)}else if(ge.PropTypes!==void 0&&!Ri){Ri=!0;var ft=q(ge);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ft||"Unknown")}typeof ge.getDefaultProps=="function"&&!ge.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Lt(M){{for(var ge=Object.keys(M.props),Se=0;Se<ge.length;Se++){var Ke=ge[Se];if(Ke!=="children"&&Ke!=="key"){fr(M),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ke),fr(null);break}}M.ref!==null&&(fr(M),b("Invalid attribute `ref` supplied to `React.Fragment`."),fr(null))}}function _n(M,ge,Se,Ke,ft,yt){{var at=O(M);if(!at){var it="";(M===void 0||typeof M=="object"&&M!==null&&Object.keys(M).length===0)&&(it+=" 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 sn=$r(ft);sn?it+=sn:it+=oi();var A;M===null?A="null":Be(M)?A="array":M!==void 0&&M.$$typeof===t?(A="<"+(q(M.type)||"Unknown")+" />",it=" Did you accidentally export a JSX literal instead of a component?"):A=typeof M,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,it)}var g=Gt(M,ge,Se,ft,yt);if(g==null)return g;if(at){var w=ge.children;if(w!==void 0)if(Ke)if(Be(w)){for(var C=0;C<w.length;C++)en(w[C],M);Object.freeze&&Object.freeze(w)}else b("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 en(w,M)}return M===r?Lt(g):Yt(g),g}}function In(M,ge,Se){return _n(M,ge,Se,!0)}function hr(M,ge,Se){return _n(M,ge,Se,!1)}var Fd=hr,Bd=In;ws.Fragment=r,ws.jsx=Fd,ws.jsxs=Bd}()),ws}process.env.NODE_ENV==="production"?Dl.exports=Uw():Dl.exports=Fw();var z=Dl.exports;function _t(){return _t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_t.apply(this,arguments)}function Nl(e,t=[]){let n=[];function r(s,o){const a=_.createContext(o),l=n.length;n=[...n,o];function c(d){const{scope:h,children:f,...p}=d,m=(h==null?void 0:h[e][l])||a,y=_.useMemo(()=>p,Object.values(p));return _.createElement(m.Provider,{value:y},f)}function u(d,h){const f=(h==null?void 0:h[e][l])||a,p=_.useContext(f);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=n.map(o=>_.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return _.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,Bw(i,...t)]}function Bw(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Mr(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const xs=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{};function Vw(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Hd(...e){return t=>e.forEach(n=>Vw(n,t))}function li(...e){return _.useCallback(Hd(...e),e)}const jl=_.forwardRef((e,t)=>{const{children:n,...r}=e,i=_.Children.toArray(n),s=i.find(Zw);if(s){const o=s.props.children,a=i.map(l=>l===s?_.Children.count(o)>1?_.Children.only(null):_.isValidElement(o)?o.props.children:null:l);return _.createElement(Ul,_t({},r,{ref:t}),_.isValidElement(o)?_.cloneElement(o,void 0,a):null)}return _.createElement(Ul,_t({},r,{ref:t}),n)});jl.displayName="Slot";const Ul=_.forwardRef((e,t)=>{const{children:n,...r}=e;return _.isValidElement(n)?_.cloneElement(n,{...Ww(r,n.props),ref:t?Hd(t,n.ref):n.ref}):_.Children.count(n)>1?_.Children.only(null):null});Ul.displayName="SlotClone";const zw=({children:e})=>_.createElement(_.Fragment,null,e);function Zw(e){return _.isValidElement(e)&&e.type===zw}function Ww(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{s(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}const Pn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=_.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?jl:t;return _.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),_.createElement(a,_t({},o,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Hw(e,t){e&&Gn.flushSync(()=>e.dispatchEvent(t))}const qd="Avatar",[qw,tF]=Nl(qd),[Kw,Kd]=qw(qd),Jd=_.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,s]=_.useState("idle");return _.createElement(Kw,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s},_.createElement(Pn.span,_t({},r,{ref:t})))}),Jw="AvatarImage",Gd=_.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=e,o=Kd(Jw,n),a=Yw(r),l=Mr(c=>{i(c),o.onImageLoadingStatusChange(c)});return xs(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?_.createElement(Pn.img,_t({},s,{ref:t,src:r})):null}),Gw="AvatarFallback",Yd=_.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,s=Kd(Gw,n),[o,a]=_.useState(r===void 0);return _.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&s.imageLoadingStatus!=="loaded"?_.createElement(Pn.span,_t({},i,{ref:t})):null});function Yw(e){const[t,n]=_.useState("idle");return _.useEffect(()=>{if(!e){n("error");return}let r=!0;const i=new window.Image,s=o=>()=>{r&&n(o)};return n("loading"),i.onload=s("loaded"),i.onerror=s("error"),i.src=e,()=>{r=!1}},[e]),t}let Fl=class{constructor(){E(this,"eventMap");this.eventMap={}}on(t,n){var r;return this.eventMap[t]||(this.eventMap[t]=new Set),(r=this.eventMap[t])==null||r.add(n),()=>{var i;(i=this.eventMap[t])==null||i.delete(n)}}emit(t,n){var r;(r=this.eventMap[t])==null||r.forEach(i=>{i(n)})}};const Qw=new Fl;function Qd(e,t){let n=0;if(e.length==0)return n;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);n=(n<<5)-n+i,n=n&n}return Math.abs(n)%t}const Bl=_.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...s},o)=>{const a=Qd(e??"",15);return z.jsxs(Jd,{ref:o,"data-color":a,...n,...s,children:[z.jsx(Gd,{src:t,...r}),z.jsx(Yd,{...i,children:typeof s.children=="string"?s.children[0]:s.children})]})});function nF(){}function rF(){}function Xw(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const e0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,t0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,n0={};function Xd(e,t){return((t||n0).jsx?t0:e0).test(e)}const r0=/[ \t\n\f\r]/g;function i0(e){return typeof e=="object"?e.type==="text"?ef(e.value):!1:ef(e)}function ef(e){return e.replace(r0,"")===""}class _s{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}_s.prototype.property={},_s.prototype.normal={},_s.prototype.space=null;function tf(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new _s(n,r,t)}function Vl(e){return e.toLowerCase()}class An{constructor(t,n){this.property=t,this.attribute=n}}An.prototype.space=null,An.prototype.boolean=!1,An.prototype.booleanish=!1,An.prototype.overloadedBoolean=!1,An.prototype.number=!1,An.prototype.commaSeparated=!1,An.prototype.spaceSeparated=!1,An.prototype.commaOrSpaceSeparated=!1,An.prototype.mustUseProperty=!1,An.prototype.defined=!1;let s0=0;const et=ci(),Dt=ci(),nf=ci(),be=ci(),xt=ci(),$i=ci(),kn=ci();function ci(){return 2**++s0}const zl=Object.freeze(Object.defineProperty({__proto__:null,boolean:et,booleanish:Dt,commaOrSpaceSeparated:kn,commaSeparated:$i,number:be,overloadedBoolean:nf,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),Zl=Object.keys(zl);class Wl extends An{constructor(t,n,r,i){let s=-1;if(super(t,n),rf(this,"space",i),typeof r=="number")for(;++s<Zl.length;){const o=Zl[s];rf(this,Zl[s],(r&zl[o])===zl[o])}}}Wl.prototype.defined=!0;function rf(e,t,n){n&&(e[t]=n)}const o0={}.hasOwnProperty;function Mi(e){const t={},n={};let r;for(r in e.properties)if(o0.call(e.properties,r)){const i=e.properties[r],s=new Wl(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Vl(r)]=r,n[Vl(s.attribute)]=r}return new _s(t,n,e.space)}const sf=Mi({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),of=Mi({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function af(e,t){return t in e?e[t]:t}function lf(e,t){return af(e,t.toLowerCase())}const cf=Mi({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:lf,properties:{xmlns:null,xmlnsXLink:null}}),uf=Mi({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Dt,ariaAutoComplete:null,ariaBusy:Dt,ariaChecked:Dt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:xt,ariaCurrent:null,ariaDescribedBy:xt,ariaDetails:null,ariaDisabled:Dt,ariaDropEffect:xt,ariaErrorMessage:null,ariaExpanded:Dt,ariaFlowTo:xt,ariaGrabbed:Dt,ariaHasPopup:null,ariaHidden:Dt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xt,ariaLevel:be,ariaLive:null,ariaModal:Dt,ariaMultiLine:Dt,ariaMultiSelectable:Dt,ariaOrientation:null,ariaOwns:xt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Dt,ariaReadOnly:Dt,ariaRelevant:null,ariaRequired:Dt,ariaRoleDescription:xt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Dt,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null}}),a0=Mi({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:lf,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$i,acceptCharset:xt,accessKey:xt,action:null,allow:null,allowFullScreen:et,allowPaymentRequest:et,allowUserMedia:et,alt:null,as:null,async:et,autoCapitalize:null,autoComplete:xt,autoFocus:et,autoPlay:et,capture:et,charSet:null,checked:et,cite:null,className:xt,cols:be,colSpan:null,content:null,contentEditable:Dt,controls:et,controlsList:xt,coords:be|$i,crossOrigin:null,data:null,dateTime:null,decoding:null,default:et,defer:et,dir:null,dirName:null,disabled:et,download:nf,draggable:Dt,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:et,formTarget:null,headers:xt,height:be,hidden:et,high:be,href:null,hrefLang:null,htmlFor:xt,httpEquiv:xt,id:null,imageSizes:null,imageSrcSet:null,inputMode:null,integrity:null,is:null,isMap:et,itemId:null,itemProp:xt,itemRef:xt,itemScope:et,itemType:xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:et,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:et,muted:et,name:null,nonce:null,noModule:et,noValidate:et,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:et,optimum:be,pattern:null,ping:xt,placeholder:null,playsInline:et,poster:null,preload:null,readOnly:et,referrerPolicy:null,rel:xt,required:et,reversed:et,rows:be,rowSpan:be,sandbox:xt,scope:null,scoped:et,seamless:et,selected:et,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Dt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:et,useMap:null,value:Dt,width:be,wrap:null,align:null,aLink:null,archive:xt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:et,declare:et,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:et,noHref:et,noShade:et,noWrap:et,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Dt,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:et,disableRemotePlayback:et,prefix:null,property:null,results:be,security:null,unselectable:null}}),l0=Mi({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:af,properties:{about:kn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:xt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:et,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$i,g2:$i,glyphName:$i,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:kn,rev:kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:kn,requiredFeatures:kn,requiredFonts:kn,requiredFormats:kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:kn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:kn,to:null,transform:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),c0=/^data[-\w.:]+$/i,df=/-[a-z]/g,u0=/[A-Z]/g;function d0(e,t){const n=Vl(t);let r=t,i=An;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&c0.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(df,h0);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!df.test(s)){let o=s.replace(u0,f0);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Wl}return new i(r,t)}function f0(e){return"-"+e.toLowerCase()}function h0(e){return e.charAt(1).toUpperCase()}const p0={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},m0=tf([of,sf,cf,uf,a0],"html"),Hl=tf([of,sf,cf,uf,l0],"svg");function g0(e){return e.join(" ").trim()}var ff={},hf=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,y0=/\n/g,v0=/^\s*/,b0=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,w0=/^:\s*/,x0=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,_0=/^[;\s]*/,k0=/^\s+|\s+$/g,C0=`
28
- `,pf="/",mf="*",ui="",E0="comment",S0="declaration",T0=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var m=p.match(y0);m&&(n+=m.length);var y=p.lastIndexOf(C0);r=~y?p.length-y:r+p.length}function s(){var p={line:n,column:r};return function(m){return m.position=new o(p),c(),m}}function o(p){this.start=p,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(p){var m=new Error(t.source+":"+n+":"+r+": "+p);if(m.reason=p,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function l(p){var m=p.exec(e);if(m){var y=m[0];return i(y),e=e.slice(y.length),m}}function c(){l(v0)}function u(p){var m;for(p=p||[];m=d();)m!==!1&&p.push(m);return p}function d(){var p=s();if(!(pf!=e.charAt(0)||mf!=e.charAt(1))){for(var m=2;ui!=e.charAt(m)&&(mf!=e.charAt(m)||pf!=e.charAt(m+1));)++m;if(m+=2,ui===e.charAt(m-1))return a("End of comment missing");var y=e.slice(2,m-2);return r+=2,i(y),e=e.slice(m),r+=2,p({type:E0,comment:y})}}function h(){var p=s(),m=l(b0);if(m){if(d(),!l(w0))return a("property missing ':'");var y=l(x0),v=p({type:S0,property:gf(m[0].replace(hf,ui)),value:y?gf(y[0].replace(hf,ui)):ui});return l(_0),v}}function f(){var p=[];u(p);for(var m;m=h();)m!==!1&&(p.push(m),u(p));return p}return c(),f()};function gf(e){return e?e.replace(k0,ui):ui}var O0=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ff,"__esModule",{value:!0});var I0=O0(T0);function P0(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,I0.default)(e),i=typeof t=="function";return r.forEach(function(s){if(s.type==="declaration"){var o=s.property,a=s.value;i?t(o,a,s):a&&(n=n||{},n[o]=a)}}),n}var yf=ff.default=P0;const A0=yf.default||yf,vf=bf("end"),ql=bf("start");function bf(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function R0(e){const t=ql(e),n=vf(e);if(t&&n)return{start:t,end:n}}function ks(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?wf(e.position):"start"in e||"end"in e?wf(e):"line"in e||"column"in e?Kl(e):""}function Kl(e){return xf(e&&e.line)+":"+xf(e&&e.column)}function wf(e){return Kl(e&&e.start)+"-"+Kl(e&&e.end)}function xf(e){return e&&typeof e=="number"?e:1}class on extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=ks(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}on.prototype.file="",on.prototype.name="",on.prototype.reason="",on.prototype.message="",on.prototype.stack="",on.prototype.column=void 0,on.prototype.line=void 0,on.prototype.ancestors=void 0,on.prototype.cause=void 0,on.prototype.fatal=void 0,on.prototype.place=void 0,on.prototype.ruleId=void 0,on.prototype.source=void 0;const Jl={}.hasOwnProperty,$0=new Map,M0=/[A-Z]/g,L0=/-([a-z])/g,D0=new Set(["table","tbody","thead","tfoot","tr"]),N0=new Set(["td","th"]),_f="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function j0(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=H0(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=W0(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Hl:m0,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=kf(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function kf(e,t,n){if(t.type==="element")return U0(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return F0(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return V0(e,t,n);if(t.type==="mdxjsEsm")return B0(e,t);if(t.type==="root")return z0(e,t,n);if(t.type==="text")return Z0(e,t)}function U0(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Hl,e.schema=i),e.ancestors.push(t);const s=Ef(e,t.tagName,!1),o=q0(e,t);let a=Yl(e,t);return D0.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!i0(l):!0})),Cf(e,o,s,t),Gl(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function F0(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Cs(e,t.position)}function B0(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Cs(e,t.position)}function V0(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Hl,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Ef(e,t.name,!0),o=K0(e,t),a=Yl(e,t);return Cf(e,o,s,t),Gl(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function z0(e,t,n){const r={};return Gl(r,Yl(e,t)),e.create(t,e.Fragment,r,n)}function Z0(e,t){return t.value}function Cf(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Gl(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function W0(e,t,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:t;return a?c(s,o,a):c(s,o)}}function H0(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=ql(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function q0(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Jl.call(t.properties,i)){const s=J0(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&N0.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function K0(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Cs(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else Cs(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Yl(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:$0;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const a=kf(e,s,o);a!==void 0&&n.push(a)}return n}function J0(e,t,n){const r=d0(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Xw(n):g0(n)),r.property==="style"){let i=typeof n=="object"?n:G0(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Y0(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?p0[r.property]||r.property:r.attribute,n]}}function G0(e,t){const n={};try{A0(t,r)}catch(i){if(!e.ignoreInvalidStyle){const s=i,o=new on("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=_f+"#cannot-parse-style-attribute",o}}return n;function r(i,s){let o=i;o.slice(0,2)!=="--"&&(o.slice(0,4)==="-ms-"&&(o="ms-"+o.slice(4)),o=o.replace(L0,X0)),n[o]=s}}function Ef(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=Xd(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=Xd(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Jl.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Cs(e)}function Cs(e,t){const n=new on("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=_f+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Y0(e){const t={};let n;for(n in e)Jl.call(e,n)&&(t[Q0(n)]=e[n]);return t}function Q0(e){let t=e.replace(M0,ex);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function X0(e,t){return t.toUpperCase()}function ex(e){return"-"+e.toLowerCase()}const Ql={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},tx={};function Xl(e,t){const n=t||tx,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Sf(e,r,i)}function Sf(e,t,n){if(nx(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Tf(e.children,t,n)}return Array.isArray(e)?Tf(e,t,n):""}function Tf(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Sf(e[i],t,n);return r.join("")}function nx(e){return!!(e&&typeof e=="object")}const Of=document.createElement("i");function ec(e){const t="&"+e+";";Of.innerHTML=t;const n=Of.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Cn(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function Rn(e,t){return e.length>0?(Cn(e,e.length,0,t),e):t}const If={}.hasOwnProperty;function Pf(e){const t={};let n=-1;for(;++n<e.length;)rx(t,e[n]);return t}function rx(e,t){let n;for(n in t){const i=(If.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){If.call(i,o)||(i[o]=[]);const a=s[o];ix(i[o],Array.isArray(a)?a:a?[a]:[])}}}function ix(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Cn(e,0,0,r)}function Af(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Fn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const hn=Lr(/[A-Za-z]/),an=Lr(/[\dA-Za-z]/),sx=Lr(/[#-'*+\--9=?A-Z^-~]/);function Co(e){return e!==null&&(e<32||e===127)}const tc=Lr(/\d/),ox=Lr(/[\dA-Fa-f]/),ax=Lr(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function vt(e){return e!==null&&(e<0||e===32)}function st(e){return e===-2||e===-1||e===32}const Eo=Lr(/\p{P}|\p{S}/u),di=Lr(/\s/);function Lr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Li(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&an(e.charCodeAt(n+1))&&an(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ct(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return st(l)?(e.enter(n),a(l)):t(l)}function a(l){return st(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const lx={tokenize:cx};function cx(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ct(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ze(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const ux={tokenize:dx},Rf={tokenize:fx};function dx(e){const t=this,n=[];let r=0,i,s,o;return a;function a(x){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,l,c)(x)}return c(x)}function l(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const I=t.events.length;let P=I,T;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){T=t.events[P][1].end;break}v(r);let j=I;for(;j<t.events.length;)t.events[j][1].end=Object.assign({},T),j++;return Cn(t.events,P+1,0,t.events.slice(I)),t.events.length=j,c(x)}return a(x)}function c(x){if(r===n.length){if(!i)return h(x);if(i.currentConstruct&&i.currentConstruct.concrete)return p(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Rf,u,d)(x)}function u(x){return i&&b(),v(r),h(x)}function d(x){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,p(x)}function h(x){return t.containerState={},e.attempt(Rf,f,p)(x)}function f(x){return r++,n.push([t.currentConstruct,t.containerState]),h(x)}function p(x){if(x===null){i&&b(),v(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:s,_tokenizer:i}),m(x)}function m(x){if(x===null){y(e.exit("chunkFlow"),!0),v(0),e.consume(x);return}return ze(x)?(e.consume(x),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(x),m)}function y(x,I){const P=t.sliceStream(x);if(I&&P.push(null),x.previous=s,s&&(s.next=x),s=x,i.defineSkip(x.start),i.write(P),t.parser.lazy[x.start.line]){let T=i.events.length;for(;T--;)if(i.events[T][1].start.offset<o&&(!i.events[T][1].end||i.events[T][1].end.offset>o))return;const j=t.events.length;let U=j,F,O;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(F){O=t.events[U][1].end;break}F=!0}for(v(r),T=j;T<t.events.length;)t.events[T][1].end=Object.assign({},O),T++;Cn(t.events,U+1,0,t.events.slice(j)),t.events.length=T}}function v(x){let I=n.length;for(;I-- >x;){const P=n[I];t.containerState=P[1],P[0].exit.call(t,e)}n.length=x}function b(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function fx(e,t,n){return ct(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function So(e){if(e===null||vt(e)||di(e))return 1;if(Eo(e))return 2}function To(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const nc={name:"attention",tokenize:px,resolveAll:hx};function hx(e,t){let n=-1,r,i,s,o,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d=Object.assign({},e[r][1].end),h=Object.assign({},e[n][1].start);$f(d,-l),$f(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:h},s={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Rn(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Rn(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=Rn(c,To(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Rn(c,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Rn(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Cn(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function px(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=So(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const c=e.exit("attentionSequence"),u=So(l),d=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?d:d&&(i||!h)),c._close=!!(s===42?h:h&&(u||!d)),t(l)}}function $f(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const mx={name:"autolink",tokenize:gx};function gx(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(f){return hn(f)?(e.consume(f),o):c(f)}function o(f){return f===43||f===45||f===46||an(f)?(r=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||an(f))&&r++<32?(e.consume(f),a):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Co(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):sx(f)?(e.consume(f),c):n(f)}function u(f){return an(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||an(f))&&r++<63){const p=f===45?h:d;return e.consume(f),p}return n(f)}}const Es={tokenize:yx,partial:!0};function yx(e,t,n){return r;function r(s){return st(s)?ct(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||ze(s)?t(s):n(s)}}const Mf={name:"blockQuote",tokenize:vx,continuation:{tokenize:bx},exit:wx};function vx(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return st(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function bx(e,t,n){const r=this;return i;function i(o){return st(o)?ct(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(Mf,t,n)(o)}}function wx(e){e.exit("blockQuote")}const Lf={name:"characterEscape",tokenize:xx};function xx(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return ax(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Df={name:"characterReference",tokenize:_x};function _x(e,t,n){const r=this;let i=0,s,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=an,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=ox,u):(e.enter("characterReferenceValue"),s=7,o=tc,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return o===an&&!ec(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<s?(e.consume(d),u):n(d)}}const Nf={tokenize:Cx,partial:!0},jf={name:"codeFenced",tokenize:kx,concrete:!0};function kx(e,t,n){const r=this,i={tokenize:P,partial:!0};let s=0,o=0,a;return l;function l(T){return c(T)}function c(T){const j=r.events[r.events.length-1];return s=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,a=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(T)}function u(T){return T===a?(o++,e.consume(T),u):o<3?n(T):(e.exit("codeFencedFenceSequence"),st(T)?ct(e,d,"whitespace")(T):d(T))}function d(T){return T===null||ze(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(Nf,m,I)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(T))}function h(T){return T===null||ze(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(T)):st(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ct(e,f,"whitespace")(T)):T===96&&T===a?n(T):(e.consume(T),h)}function f(T){return T===null||ze(T)?d(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(T))}function p(T){return T===null||ze(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(T)):T===96&&T===a?n(T):(e.consume(T),p)}function m(T){return e.attempt(i,I,y)(T)}function y(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),v}function v(T){return s>0&&st(T)?ct(e,b,"linePrefix",s+1)(T):b(T)}function b(T){return T===null||ze(T)?e.check(Nf,m,I)(T):(e.enter("codeFlowValue"),x(T))}function x(T){return T===null||ze(T)?(e.exit("codeFlowValue"),b(T)):(e.consume(T),x)}function I(T){return e.exit("codeFenced"),t(T)}function P(T,j,U){let F=0;return O;function O(B){return T.enter("lineEnding"),T.consume(B),T.exit("lineEnding"),N}function N(B){return T.enter("codeFencedFence"),st(B)?ct(T,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):J(B)}function J(B){return B===a?(T.enter("codeFencedFenceSequence"),q(B)):U(B)}function q(B){return B===a?(F++,T.consume(B),q):F>=o?(T.exit("codeFencedFenceSequence"),st(B)?ct(T,W,"whitespace")(B):W(B)):U(B)}function W(B){return B===null||ze(B)?(T.exit("codeFencedFence"),j(B)):U(B)}}}function Cx(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const rc={name:"codeIndented",tokenize:Sx},Ex={tokenize:Tx,partial:!0};function Sx(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ct(e,s,"linePrefix",4+1)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):ze(c)?e.attempt(Ex,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||ze(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function Tx(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):ze(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):ct(e,s,"linePrefix",4+1)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):ze(o)?i(o):n(o)}}const Ox={name:"codeText",tokenize:Ax,resolve:Ix,previous:Px};function Ix(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Px(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ax(e,t,n){let r=0,i,s;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(s=e.enter("codeTextSequence"),i=0,u(d)):ze(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||ze(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",c(d))}}function Uf(e){const t={};let n=-1,r,i,s,o,a,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Rx(e,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--&&(o=e[s],o[1].type==="lineEnding"||o[1].type==="lineEndingBlank");)o[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);i&&(r[1].end=Object.assign({},e[i][1].start),a=e.slice(i,n),a.unshift(r),Cn(e,i,n-i+1,a))}}return!c}function Rx(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const s=[],o=n._tokenizer||r.parser[n.contentType](n.start),a=o.events,l=[],c={};let u,d,h=-1,f=n,p=0,m=0;const y=[m];for(;f;){for(;e[++i][1]!==f;);s.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(m=h+1,y.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),h=y.length;h--;){const v=a.slice(y[h],y[h+1]),b=s.pop();l.unshift([b,b+v.length-1]),Cn(e,b,2,v)}for(h=-1;++h<l.length;)c[p+l[h][0]]=p+l[h][1],p+=l[h][1]-l[h][0]-1;return c}const $x={tokenize:Dx,resolve:Lx},Mx={tokenize:Nx,partial:!0};function Lx(e){return Uf(e),e}function Dx(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):ze(a)?e.check(Mx,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Nx(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ct(e,s,"linePrefix")}function s(o){if(o===null||ze(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Ff(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(v){return v===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(v),e.exit(s),h):v===null||v===32||v===41||Co(v)?n(v):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(v))}function h(v){return v===62?(e.enter(s),e.consume(v),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===62?(e.exit("chunkString"),e.exit(a),h(v)):v===null||v===60||ze(v)?n(v):(e.consume(v),v===92?p:f)}function p(v){return v===60||v===62||v===92?(e.consume(v),f):f(v)}function m(v){return!u&&(v===null||v===41||vt(v))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(v)):u<c&&v===40?(e.consume(v),u++,m):v===41?(e.consume(v),u--,m):v===null||v===32||v===40||Co(v)?n(v):(e.consume(v),v===92?y:m)}function y(v){return v===40||v===41||v===92?(e.consume(v),m):m(v)}}function Bf(e,t,n,r,i,s){const o=this;let a=0,l;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(s),u}function u(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):ze(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||ze(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!st(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function Vf(e,t,n,r,i,s){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),c(h))}function c(h){return h===o?(e.exit(s),l(o)):h===null?n(h):ze(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ct(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||ze(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===o||h===92?(e.consume(h),u):u(h)}}function Ss(e,t){let n;return r;function r(i){return ze(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):st(i)?ct(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const jx={name:"definition",tokenize:Fx},Ux={tokenize:Bx,partial:!0};function Fx(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),o(f)}function o(f){return Bf.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=Fn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return vt(f)?Ss(e,c)(f):c(f)}function c(f){return Ff(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(Ux,d,d)(f)}function d(f){return st(f)?ct(e,h,"whitespace")(f):h(f)}function h(f){return f===null||ze(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function Bx(e,t,n){return r;function r(a){return vt(a)?Ss(e,i)(a):n(a)}function i(a){return Vf(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return st(a)?ct(e,o,"whitespace")(a):o(a)}function o(a){return a===null||ze(a)?t(a):n(a)}}const Vx={name:"hardBreakEscape",tokenize:zx};function zx(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return ze(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Zx={name:"headingAtx",tokenize:Hx,resolve:Wx};function Wx(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Cn(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Hx(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||vt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||ze(u)?(e.exit("atxHeading"),t(u)):st(u)?ct(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||vt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const qx=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],zf=["pre","script","style","textarea"],Kx={name:"htmlFlow",tokenize:Qx,resolveTo:Yx,concrete:!0},Jx={tokenize:e_,partial:!0},Gx={tokenize:Xx,partial:!0};function Yx(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Qx(e,t,n){const r=this;let i,s,o,a,l;return c;function c(S){return u(S)}function u(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),d}function d(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),s=!0,m):S===63?(e.consume(S),i=3,r.interrupt?t:k):hn(S)?(e.consume(S),o=String.fromCharCode(S),y):n(S)}function h(S){return S===45?(e.consume(S),i=2,f):S===91?(e.consume(S),i=5,a=0,p):hn(S)?(e.consume(S),i=4,r.interrupt?t:k):n(S)}function f(S){return S===45?(e.consume(S),r.interrupt?t:k):n(S)}function p(S){const Te="CDATA[";return S===Te.charCodeAt(a++)?(e.consume(S),a===Te.length?r.interrupt?t:J:p):n(S)}function m(S){return hn(S)?(e.consume(S),o=String.fromCharCode(S),y):n(S)}function y(S){if(S===null||S===47||S===62||vt(S)){const Te=S===47,Ne=o.toLowerCase();return!Te&&!s&&zf.includes(Ne)?(i=1,r.interrupt?t(S):J(S)):qx.includes(o.toLowerCase())?(i=6,Te?(e.consume(S),v):r.interrupt?t(S):J(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):s?b(S):x(S))}return S===45||an(S)?(e.consume(S),o+=String.fromCharCode(S),y):n(S)}function v(S){return S===62?(e.consume(S),r.interrupt?t:J):n(S)}function b(S){return st(S)?(e.consume(S),b):O(S)}function x(S){return S===47?(e.consume(S),O):S===58||S===95||hn(S)?(e.consume(S),I):st(S)?(e.consume(S),x):O(S)}function I(S){return S===45||S===46||S===58||S===95||an(S)?(e.consume(S),I):P(S)}function P(S){return S===61?(e.consume(S),T):st(S)?(e.consume(S),P):x(S)}function T(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),l=S,j):st(S)?(e.consume(S),T):U(S)}function j(S){return S===l?(e.consume(S),l=null,F):S===null||ze(S)?n(S):(e.consume(S),j)}function U(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||vt(S)?P(S):(e.consume(S),U)}function F(S){return S===47||S===62||st(S)?x(S):n(S)}function O(S){return S===62?(e.consume(S),N):n(S)}function N(S){return S===null||ze(S)?J(S):st(S)?(e.consume(S),N):n(S)}function J(S){return S===45&&i===2?(e.consume(S),V):S===60&&i===1?(e.consume(S),Y):S===62&&i===4?(e.consume(S),ee):S===63&&i===3?(e.consume(S),k):S===93&&i===5?(e.consume(S),pe):ze(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Jx,xe,q)(S)):S===null||ze(S)?(e.exit("htmlFlowData"),q(S)):(e.consume(S),J)}function q(S){return e.check(Gx,W,xe)(S)}function W(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),B}function B(S){return S===null||ze(S)?q(S):(e.enter("htmlFlowData"),J(S))}function V(S){return S===45?(e.consume(S),k):J(S)}function Y(S){return S===47?(e.consume(S),o="",K):J(S)}function K(S){if(S===62){const Te=o.toLowerCase();return zf.includes(Te)?(e.consume(S),ee):J(S)}return hn(S)&&o.length<8?(e.consume(S),o+=String.fromCharCode(S),K):J(S)}function pe(S){return S===93?(e.consume(S),k):J(S)}function k(S){return S===62?(e.consume(S),ee):S===45&&i===2?(e.consume(S),k):J(S)}function ee(S){return S===null||ze(S)?(e.exit("htmlFlowData"),xe(S)):(e.consume(S),ee)}function xe(S){return e.exit("htmlFlow"),t(S)}}function Xx(e,t,n){const r=this;return i;function i(o){return ze(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function e_(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Es,t,n)}}const t_={name:"htmlText",tokenize:n_};function n_(e,t,n){const r=this;let i,s,o;return a;function a(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),l}function l(k){return k===33?(e.consume(k),c):k===47?(e.consume(k),P):k===63?(e.consume(k),x):hn(k)?(e.consume(k),U):n(k)}function c(k){return k===45?(e.consume(k),u):k===91?(e.consume(k),s=0,p):hn(k)?(e.consume(k),b):n(k)}function u(k){return k===45?(e.consume(k),f):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),h):ze(k)?(o=d,Y(k)):(e.consume(k),d)}function h(k){return k===45?(e.consume(k),f):d(k)}function f(k){return k===62?V(k):k===45?h(k):d(k)}function p(k){const ee="CDATA[";return k===ee.charCodeAt(s++)?(e.consume(k),s===ee.length?m:p):n(k)}function m(k){return k===null?n(k):k===93?(e.consume(k),y):ze(k)?(o=m,Y(k)):(e.consume(k),m)}function y(k){return k===93?(e.consume(k),v):m(k)}function v(k){return k===62?V(k):k===93?(e.consume(k),v):m(k)}function b(k){return k===null||k===62?V(k):ze(k)?(o=b,Y(k)):(e.consume(k),b)}function x(k){return k===null?n(k):k===63?(e.consume(k),I):ze(k)?(o=x,Y(k)):(e.consume(k),x)}function I(k){return k===62?V(k):x(k)}function P(k){return hn(k)?(e.consume(k),T):n(k)}function T(k){return k===45||an(k)?(e.consume(k),T):j(k)}function j(k){return ze(k)?(o=j,Y(k)):st(k)?(e.consume(k),j):V(k)}function U(k){return k===45||an(k)?(e.consume(k),U):k===47||k===62||vt(k)?F(k):n(k)}function F(k){return k===47?(e.consume(k),V):k===58||k===95||hn(k)?(e.consume(k),O):ze(k)?(o=F,Y(k)):st(k)?(e.consume(k),F):V(k)}function O(k){return k===45||k===46||k===58||k===95||an(k)?(e.consume(k),O):N(k)}function N(k){return k===61?(e.consume(k),J):ze(k)?(o=N,Y(k)):st(k)?(e.consume(k),N):F(k)}function J(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,q):ze(k)?(o=J,Y(k)):st(k)?(e.consume(k),J):(e.consume(k),W)}function q(k){return k===i?(e.consume(k),i=void 0,B):k===null?n(k):ze(k)?(o=q,Y(k)):(e.consume(k),q)}function W(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||vt(k)?F(k):(e.consume(k),W)}function B(k){return k===47||k===62||vt(k)?F(k):n(k)}function V(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function Y(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),K}function K(k){return st(k)?ct(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):pe(k)}function pe(k){return e.enter("htmlTextData"),o(k)}}const ic={name:"labelEnd",tokenize:l_,resolveTo:a_,resolveAll:o_},r_={tokenize:c_},i_={tokenize:u_},s_={tokenize:d_};function o_(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function a_(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:Object.assign({},e[s][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[s][1].start),end:Object.assign({},e[o][1].end)},u={type:"labelText",start:Object.assign({},e[s+r+2][1].end),end:Object.assign({},e[o-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=Rn(a,e.slice(s+1,s+r+3)),a=Rn(a,[["enter",u,t]]),a=Rn(a,To(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=Rn(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=Rn(a,e.slice(o+1)),a=Rn(a,[["exit",l,t]]),Cn(e,s,e.length,a),e}function l_(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(h){return s?s._inactive?d(h):(o=r.parser.defined.includes(Fn(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(r_,u,o?u:d)(h):h===91?e.attempt(i_,u,o?c:d)(h):o?u(h):d(h)}function c(h){return e.attempt(s_,u,d)(h)}function u(h){return t(h)}function d(h){return s._balanced=!0,n(h)}}function c_(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return vt(d)?Ss(e,s)(d):s(d)}function s(d){return d===41?u(d):Ff(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return vt(d)?Ss(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?Vf(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return vt(d)?Ss(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function u_(e,t,n){const r=this;return i;function i(a){return Bf.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Fn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function d_(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const f_={name:"labelStartImage",tokenize:h_,resolveAll:ic.resolveAll};function h_(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const p_={name:"labelStartLink",tokenize:m_,resolveAll:ic.resolveAll};function m_(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const sc={name:"lineEnding",tokenize:g_};function g_(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ct(e,t,"linePrefix")}}const Oo={name:"thematicBreak",tokenize:y_};function y_(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ze(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),st(c)?ct(e,a,"whitespace")(c):a(c))}}const yn={name:"list",tokenize:w_,continuation:{tokenize:x_},exit:k_},v_={tokenize:C_,partial:!0},b_={tokenize:__,partial:!0};function w_(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(f){const p=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:tc(f)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Oo,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return tc(f)&&++o<10?(e.consume(f),l):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Es,r.interrupt?n:u,e.attempt(v_,h,d))}function u(f){return r.containerState.initialBlankLine=!0,s++,h(f)}function d(f){return st(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function x_(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Es,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ct(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!st(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(b_,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ct(e,e.attempt(yn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function __(e,t,n){const r=this;return ct(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function k_(e){e.exit(this.containerState.type)}function C_(e,t,n){const r=this;return ct(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(s){const o=r.events[r.events.length-1];return!st(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Zf={name:"setextUnderline",tokenize:S_,resolveTo:E_};function E_(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[s][1].end)):e[r][1]=o,e.push(["exit",o,t]),e}function S_(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),st(c)?ct(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ze(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const T_={tokenize:O_};function O_(e){const t=this,n=e.attempt(Es,r,e.attempt(this.parser.constructs.flowInitial,i,ct(e,e.attempt(this.parser.constructs.flow,i,e.attempt($x,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const I_={resolveAll:Hf()},P_=Wf("string"),A_=Wf("text");function Wf(e){return{tokenize:t,resolveAll:Hf(e==="text"?R_:void 0)};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(u){return c(u)?s(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function Hf(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function R_(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+s,_bufferIndex:s?o:r.start._bufferIndex+o},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function $_(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},s=[];let o=[],a=[];const l={consume:b,enter:x,exit:I,attempt:j(P),check:j(T),interrupt:j(T,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:f,sliceSerialize:h,now:p,defineSkip:m,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function d(N){return o=Rn(o,N),y(),o[o.length-1]!==null?[]:(U(t,0),c.events=To(s,c.events,c),c.events)}function h(N,J){return L_(f(N),J)}function f(N){return M_(o,N)}function p(){const{line:N,column:J,offset:q,_index:W,_bufferIndex:B}=r;return{line:N,column:J,offset:q,_index:W,_bufferIndex:B}}function m(N){i[N.line]=N.column,O()}function y(){let N;for(;r._index<o.length;){const J=o[r._index];if(typeof J=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<J.length;)v(J.charCodeAt(r._bufferIndex));else v(J)}}function v(N){u=u(N)}function b(N){ze(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,O()):N!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=N}function x(N,J){const q=J||{};return q.type=N,q.start=p(),c.events.push(["enter",q,c]),a.push(q),q}function I(N){const J=a.pop();return J.end=p(),c.events.push(["exit",J,c]),J}function P(N,J){U(N,J.from)}function T(N,J){J.restore()}function j(N,J){return q;function q(W,B,V){let Y,K,pe,k;return Array.isArray(W)?xe(W):"tokenize"in W?xe([W]):ee(W);function ee(Ie){return je;function je(De){const Ue=De!==null&&Ie[De],_e=De!==null&&Ie.null,ve=[...Array.isArray(Ue)?Ue:Ue?[Ue]:[],...Array.isArray(_e)?_e:_e?[_e]:[]];return xe(ve)(De)}}function xe(Ie){return Y=Ie,K=0,Ie.length===0?V:S(Ie[K])}function S(Ie){return je;function je(De){return k=F(),pe=Ie,Ie.partial||(c.currentConstruct=Ie),Ie.name&&c.parser.constructs.disable.null.includes(Ie.name)?Ne():Ie.tokenize.call(J?Object.assign(Object.create(c),J):c,l,Te,Ne)(De)}}function Te(Ie){return N(pe,k),B}function Ne(Ie){return k.restore(),++K<Y.length?S(Y[K]):V}}}function U(N,J){N.resolveAll&&!s.includes(N)&&s.push(N),N.resolve&&Cn(c.events,J,c.events.length-J,N.resolve(c.events.slice(J),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function F(){const N=p(),J=c.previous,q=c.currentConstruct,W=c.events.length,B=Array.from(a);return{restore:V,from:W};function V(){r=N,c.previous=J,c.currentConstruct=q,c.events.length=W,a=B,O()}}function O(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function M_(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function L_(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
27
+ Check the top-level render call using <`+Ee+">.")}return ge}}function Xt(M,ge){{if(!M._store||M._store.validated||M.key!=null)return;M._store.validated=!0;var Ee=Ot(ge);if(Tt[Ee])return;Tt[Ee]=!0;var Ke="";M&&M._owner&&M._owner!==Rr.current&&(Ke=" It was passed a child from "+W(M._owner.type)+"."),fr(M),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Ee,Ke),fr(null)}}function en(M,ge){{if(typeof M!="object")return;if(Fe(M))for(var Ee=0;Ee<M.length;Ee++){var Ke=M[Ee];si(Ke)&&Xt(Ke,ge)}else if(si(M))M._store&&(M._store.validated=!0);else if(M){var ft=v(M);if(typeof ft=="function"&&ft!==M.entries)for(var gt=ft.call(M),at;!(at=gt.next()).done;)si(at.value)&&Xt(at.value,ge)}}}function Yt(M){{var ge=M.type;if(ge==null||typeof ge=="string")return;var Ee;if(typeof ge=="function")Ee=ge.propTypes;else if(typeof ge=="object"&&(ge.$$typeof===l||ge.$$typeof===d))Ee=ge.propTypes;else return;if(Ee){var Ke=W(ge);Le(Ee,M.props,"prop",Ke,M)}else if(ge.PropTypes!==void 0&&!Ai){Ai=!0;var ft=W(ge);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ft||"Unknown")}typeof ge.getDefaultProps=="function"&&!ge.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Lt(M){{for(var ge=Object.keys(M.props),Ee=0;Ee<ge.length;Ee++){var Ke=ge[Ee];if(Ke!=="children"&&Ke!=="key"){fr(M),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ke),fr(null);break}}M.ref!==null&&(fr(M),b("Invalid attribute `ref` supplied to `React.Fragment`."),fr(null))}}function _n(M,ge,Ee,Ke,ft,gt){{var at=T(M);if(!at){var it="";(M===void 0||typeof M=="object"&&M!==null&&Object.keys(M).length===0)&&(it+=" 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 sn=$r(ft);sn?it+=sn:it+=oi();var P;M===null?P="null":Fe(M)?P="array":M!==void 0&&M.$$typeof===t?(P="<"+(W(M.type)||"Unknown")+" />",it=" Did you accidentally export a JSX literal instead of a component?"):P=typeof M,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",P,it)}var g=Gt(M,ge,Ee,ft,gt);if(g==null)return g;if(at){var w=ge.children;if(w!==void 0)if(Ke)if(Fe(w)){for(var C=0;C<w.length;C++)en(w[C],M);Object.freeze&&Object.freeze(w)}else b("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 en(w,M)}return M===r?Lt(g):Yt(g),g}}function Pn(M,ge,Ee){return _n(M,ge,Ee,!0)}function hr(M,ge,Ee){return _n(M,ge,Ee,!1)}var jd=hr,Ud=Pn;ws.Fragment=r,ws.jsx=jd,ws.jsxs=Ud}()),ws}process.env.NODE_ENV==="production"?Ml.exports=Nw():Ml.exports=jw();var F=Ml.exports;function _t(){return _t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_t.apply(this,arguments)}function Ll(e,t=[]){let n=[];function r(s,o){const a=_.createContext(o),l=n.length;n=[...n,o];function c(d){const{scope:h,children:f,...p}=d,m=(h==null?void 0:h[e][l])||a,v=_.useMemo(()=>p,Object.values(p));return _.createElement(m.Provider,{value:v},f)}function u(d,h){const f=(h==null?void 0:h[e][l])||a,p=_.useContext(f);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=n.map(o=>_.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return _.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,Uw(i,...t)]}function Uw(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Mr(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const xs=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{};function Fw(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Zd(...e){return t=>e.forEach(n=>Fw(n,t))}function li(...e){return _.useCallback(Zd(...e),e)}const Dl=_.forwardRef((e,t)=>{const{children:n,...r}=e,i=_.Children.toArray(n),s=i.find(Vw);if(s){const o=s.props.children,a=i.map(l=>l===s?_.Children.count(o)>1?_.Children.only(null):_.isValidElement(o)?o.props.children:null:l);return _.createElement(Nl,_t({},r,{ref:t}),_.isValidElement(o)?_.cloneElement(o,void 0,a):null)}return _.createElement(Nl,_t({},r,{ref:t}),n)});Dl.displayName="Slot";const Nl=_.forwardRef((e,t)=>{const{children:n,...r}=e;return _.isValidElement(n)?_.cloneElement(n,{...zw(r,n.props),ref:t?Zd(t,n.ref):n.ref}):_.Children.count(n)>1?_.Children.only(null):null});Nl.displayName="SlotClone";const Bw=({children:e})=>_.createElement(_.Fragment,null,e);function Vw(e){return _.isValidElement(e)&&e.type===Bw}function zw(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{s(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}const An=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=_.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?Dl:t;return _.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),_.createElement(a,_t({},o,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Zw(e,t){e&&Gn.flushSync(()=>e.dispatchEvent(t))}const Wd="Avatar",[Ww,KU]=Ll(Wd),[Hw,Hd]=Ww(Wd),qd=_.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,s]=_.useState("idle");return _.createElement(Hw,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s},_.createElement(An.span,_t({},r,{ref:t})))}),qw="AvatarImage",Kd=_.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=e,o=Hd(qw,n),a=Jw(r),l=Mr(c=>{i(c),o.onImageLoadingStatusChange(c)});return xs(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?_.createElement(An.img,_t({},s,{ref:t,src:r})):null}),Kw="AvatarFallback",Jd=_.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,s=Hd(Kw,n),[o,a]=_.useState(r===void 0);return _.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&s.imageLoadingStatus!=="loaded"?_.createElement(An.span,_t({},i,{ref:t})):null});function Jw(e){const[t,n]=_.useState("idle");return _.useEffect(()=>{if(!e){n("error");return}let r=!0;const i=new window.Image,s=o=>()=>{r&&n(o)};return n("loading"),i.onload=s("loaded"),i.onerror=s("error"),i.src=e,()=>{r=!1}},[e]),t}let jl=class{constructor(){E(this,"eventMap");this.eventMap={}}on(t,n){var r;return this.eventMap[t]||(this.eventMap[t]=new Set),(r=this.eventMap[t])==null||r.add(n),()=>{var i;(i=this.eventMap[t])==null||i.delete(n)}}emit(t,n){var r;(r=this.eventMap[t])==null||r.forEach(i=>{i(n)})}};const Gw=new jl;function Gd(e,t){let n=0;if(e.length==0)return n;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);n=(n<<5)-n+i,n=n&n}return Math.abs(n)%t}const Ul=_.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...s},o)=>{const a=Gd(e??"",15);return F.jsxs(qd,{ref:o,"data-color":a,...n,...s,children:[F.jsx(Kd,{src:t,...r}),F.jsx(Jd,{...i,children:typeof s.children=="string"?s.children[0]:s.children})]})});function JU(){}function GU(){}function Yw(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Qw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,e0={};function Yd(e,t){return((t||e0).jsx?Xw:Qw).test(e)}const t0=/[ \t\n\f\r]/g;function n0(e){return typeof e=="object"?e.type==="text"?Qd(e.value):!1:Qd(e)}function Qd(e){return e.replace(t0,"")===""}class _s{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}_s.prototype.property={},_s.prototype.normal={},_s.prototype.space=null;function Xd(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new _s(n,r,t)}function Fl(e){return e.toLowerCase()}class Rn{constructor(t,n){this.property=t,this.attribute=n}}Rn.prototype.space=null,Rn.prototype.boolean=!1,Rn.prototype.booleanish=!1,Rn.prototype.overloadedBoolean=!1,Rn.prototype.number=!1,Rn.prototype.commaSeparated=!1,Rn.prototype.spaceSeparated=!1,Rn.prototype.commaOrSpaceSeparated=!1,Rn.prototype.mustUseProperty=!1,Rn.prototype.defined=!1;let r0=0;const et=ci(),Dt=ci(),ef=ci(),be=ci(),xt=ci(),Ri=ci(),kn=ci();function ci(){return 2**++r0}const Bl=Object.freeze(Object.defineProperty({__proto__:null,boolean:et,booleanish:Dt,commaOrSpaceSeparated:kn,commaSeparated:Ri,number:be,overloadedBoolean:ef,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),Vl=Object.keys(Bl);class zl extends Rn{constructor(t,n,r,i){let s=-1;if(super(t,n),tf(this,"space",i),typeof r=="number")for(;++s<Vl.length;){const o=Vl[s];tf(this,Vl[s],(r&Bl[o])===Bl[o])}}}zl.prototype.defined=!0;function tf(e,t,n){n&&(e[t]=n)}const i0={}.hasOwnProperty;function $i(e){const t={},n={};let r;for(r in e.properties)if(i0.call(e.properties,r)){const i=e.properties[r],s=new zl(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Fl(r)]=r,n[Fl(s.attribute)]=r}return new _s(t,n,e.space)}const nf=$i({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),rf=$i({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function sf(e,t){return t in e?e[t]:t}function of(e,t){return sf(e,t.toLowerCase())}const af=$i({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:of,properties:{xmlns:null,xmlnsXLink:null}}),lf=$i({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Dt,ariaAutoComplete:null,ariaBusy:Dt,ariaChecked:Dt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:xt,ariaCurrent:null,ariaDescribedBy:xt,ariaDetails:null,ariaDisabled:Dt,ariaDropEffect:xt,ariaErrorMessage:null,ariaExpanded:Dt,ariaFlowTo:xt,ariaGrabbed:Dt,ariaHasPopup:null,ariaHidden:Dt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xt,ariaLevel:be,ariaLive:null,ariaModal:Dt,ariaMultiLine:Dt,ariaMultiSelectable:Dt,ariaOrientation:null,ariaOwns:xt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Dt,ariaReadOnly:Dt,ariaRelevant:null,ariaRequired:Dt,ariaRoleDescription:xt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Dt,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null}}),s0=$i({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:of,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ri,acceptCharset:xt,accessKey:xt,action:null,allow:null,allowFullScreen:et,allowPaymentRequest:et,allowUserMedia:et,alt:null,as:null,async:et,autoCapitalize:null,autoComplete:xt,autoFocus:et,autoPlay:et,capture:et,charSet:null,checked:et,cite:null,className:xt,cols:be,colSpan:null,content:null,contentEditable:Dt,controls:et,controlsList:xt,coords:be|Ri,crossOrigin:null,data:null,dateTime:null,decoding:null,default:et,defer:et,dir:null,dirName:null,disabled:et,download:ef,draggable:Dt,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:et,formTarget:null,headers:xt,height:be,hidden:et,high:be,href:null,hrefLang:null,htmlFor:xt,httpEquiv:xt,id:null,imageSizes:null,imageSrcSet:null,inputMode:null,integrity:null,is:null,isMap:et,itemId:null,itemProp:xt,itemRef:xt,itemScope:et,itemType:xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:et,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:et,muted:et,name:null,nonce:null,noModule:et,noValidate:et,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:et,optimum:be,pattern:null,ping:xt,placeholder:null,playsInline:et,poster:null,preload:null,readOnly:et,referrerPolicy:null,rel:xt,required:et,reversed:et,rows:be,rowSpan:be,sandbox:xt,scope:null,scoped:et,seamless:et,selected:et,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Dt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:et,useMap:null,value:Dt,width:be,wrap:null,align:null,aLink:null,archive:xt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:et,declare:et,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:et,noHref:et,noShade:et,noWrap:et,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Dt,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:et,disableRemotePlayback:et,prefix:null,property:null,results:be,security:null,unselectable:null}}),o0=$i({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:sf,properties:{about:kn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:xt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:et,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ri,g2:Ri,glyphName:Ri,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:kn,rev:kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:kn,requiredFeatures:kn,requiredFonts:kn,requiredFormats:kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:kn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:kn,to:null,transform:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),a0=/^data[-\w.:]+$/i,cf=/-[a-z]/g,l0=/[A-Z]/g;function c0(e,t){const n=Fl(t);let r=t,i=Rn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&a0.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(cf,d0);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!cf.test(s)){let o=s.replace(l0,u0);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=zl}return new i(r,t)}function u0(e){return"-"+e.toLowerCase()}function d0(e){return e.charAt(1).toUpperCase()}const f0={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},h0=Xd([rf,nf,af,lf,s0],"html"),Zl=Xd([rf,nf,af,lf,o0],"svg");function p0(e){return e.join(" ").trim()}var uf={},df=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,m0=/\n/g,g0=/^\s*/,y0=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,v0=/^:\s*/,b0=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,w0=/^[;\s]*/,x0=/^\s+|\s+$/g,_0=`
28
+ `,ff="/",hf="*",ui="",k0="comment",C0="declaration",E0=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var m=p.match(m0);m&&(n+=m.length);var v=p.lastIndexOf(_0);r=~v?p.length-v:r+p.length}function s(){var p={line:n,column:r};return function(m){return m.position=new o(p),c(),m}}function o(p){this.start=p,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(p){var m=new Error(t.source+":"+n+":"+r+": "+p);if(m.reason=p,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function l(p){var m=p.exec(e);if(m){var v=m[0];return i(v),e=e.slice(v.length),m}}function c(){l(g0)}function u(p){var m;for(p=p||[];m=d();)m!==!1&&p.push(m);return p}function d(){var p=s();if(!(ff!=e.charAt(0)||hf!=e.charAt(1))){for(var m=2;ui!=e.charAt(m)&&(hf!=e.charAt(m)||ff!=e.charAt(m+1));)++m;if(m+=2,ui===e.charAt(m-1))return a("End of comment missing");var v=e.slice(2,m-2);return r+=2,i(v),e=e.slice(m),r+=2,p({type:k0,comment:v})}}function h(){var p=s(),m=l(y0);if(m){if(d(),!l(v0))return a("property missing ':'");var v=l(b0),y=p({type:C0,property:pf(m[0].replace(df,ui)),value:v?pf(v[0].replace(df,ui)):ui});return l(w0),y}}function f(){var p=[];u(p);for(var m;m=h();)m!==!1&&(p.push(m),u(p));return p}return c(),f()};function pf(e){return e?e.replace(x0,ui):ui}var S0=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(uf,"__esModule",{value:!0});var T0=S0(E0);function O0(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,T0.default)(e),i=typeof t=="function";return r.forEach(function(s){if(s.type==="declaration"){var o=s.property,a=s.value;i?t(o,a,s):a&&(n=n||{},n[o]=a)}}),n}var mf=uf.default=O0;const I0=mf.default||mf,gf=yf("end"),Wl=yf("start");function yf(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function P0(e){const t=Wl(e),n=gf(e);if(t&&n)return{start:t,end:n}}function ks(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?vf(e.position):"start"in e||"end"in e?vf(e):"line"in e||"column"in e?Hl(e):""}function Hl(e){return bf(e&&e.line)+":"+bf(e&&e.column)}function vf(e){return Hl(e&&e.start)+"-"+Hl(e&&e.end)}function bf(e){return e&&typeof e=="number"?e:1}class on extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=ks(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}on.prototype.file="",on.prototype.name="",on.prototype.reason="",on.prototype.message="",on.prototype.stack="",on.prototype.column=void 0,on.prototype.line=void 0,on.prototype.ancestors=void 0,on.prototype.cause=void 0,on.prototype.fatal=void 0,on.prototype.place=void 0,on.prototype.ruleId=void 0,on.prototype.source=void 0;const ql={}.hasOwnProperty,A0=new Map,R0=/[A-Z]/g,$0=/-([a-z])/g,M0=new Set(["table","tbody","thead","tfoot","tr"]),L0=new Set(["td","th"]),wf="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function D0(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Z0(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=z0(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Zl:h0,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=xf(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function xf(e,t,n){if(t.type==="element")return N0(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return j0(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return F0(e,t,n);if(t.type==="mdxjsEsm")return U0(e,t);if(t.type==="root")return B0(e,t,n);if(t.type==="text")return V0(e,t)}function N0(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Zl,e.schema=i),e.ancestors.push(t);const s=kf(e,t.tagName,!1),o=W0(e,t);let a=Jl(e,t);return M0.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!n0(l):!0})),_f(e,o,s,t),Kl(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function j0(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Cs(e,t.position)}function U0(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Cs(e,t.position)}function F0(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Zl,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:kf(e,t.name,!0),o=H0(e,t),a=Jl(e,t);return _f(e,o,s,t),Kl(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function B0(e,t,n){const r={};return Kl(r,Jl(e,t)),e.create(t,e.Fragment,r,n)}function V0(e,t){return t.value}function _f(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Kl(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function z0(e,t,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:t;return a?c(s,o,a):c(s,o)}}function Z0(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=Wl(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function W0(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ql.call(t.properties,i)){const s=q0(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&L0.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function H0(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Cs(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else Cs(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Jl(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:A0;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const a=xf(e,s,o);a!==void 0&&n.push(a)}return n}function q0(e,t,n){const r=c0(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Yw(n):p0(n)),r.property==="style"){let i=typeof n=="object"?n:K0(e,String(n));return e.stylePropertyNameCase==="css"&&(i=J0(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?f0[r.property]||r.property:r.attribute,n]}}function K0(e,t){const n={};try{I0(t,r)}catch(i){if(!e.ignoreInvalidStyle){const s=i,o=new on("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=wf+"#cannot-parse-style-attribute",o}}return n;function r(i,s){let o=i;o.slice(0,2)!=="--"&&(o.slice(0,4)==="-ms-"&&(o="ms-"+o.slice(4)),o=o.replace($0,Y0)),n[o]=s}}function kf(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=Yd(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=Yd(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ql.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Cs(e)}function Cs(e,t){const n=new on("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=wf+"#cannot-handle-mdx-estrees-without-createevaluater",n}function J0(e){const t={};let n;for(n in e)ql.call(e,n)&&(t[G0(n)]=e[n]);return t}function G0(e){let t=e.replace(R0,Q0);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Y0(e,t){return t.toUpperCase()}function Q0(e){return"-"+e.toLowerCase()}const Gl={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},X0={};function Yl(e,t){const n=t||X0,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Cf(e,r,i)}function Cf(e,t,n){if(ex(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ef(e.children,t,n)}return Array.isArray(e)?Ef(e,t,n):""}function Ef(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Cf(e[i],t,n);return r.join("")}function ex(e){return!!(e&&typeof e=="object")}const Sf=document.createElement("i");function Ql(e){const t="&"+e+";";Sf.innerHTML=t;const n=Sf.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Cn(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function $n(e,t){return e.length>0?(Cn(e,e.length,0,t),e):t}const Tf={}.hasOwnProperty;function Of(e){const t={};let n=-1;for(;++n<e.length;)tx(t,e[n]);return t}function tx(e,t){let n;for(n in t){const i=(Tf.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){Tf.call(i,o)||(i[o]=[]);const a=s[o];nx(i[o],Array.isArray(a)?a:a?[a]:[])}}}function nx(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Cn(e,0,0,r)}function If(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Fn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const hn=Lr(/[A-Za-z]/),an=Lr(/[\dA-Za-z]/),rx=Lr(/[#-'*+\--9=?A-Z^-~]/);function Co(e){return e!==null&&(e<32||e===127)}const Xl=Lr(/\d/),ix=Lr(/[\dA-Fa-f]/),sx=Lr(/[!-/:-@[-`{-~]/);function Ve(e){return e!==null&&e<-2}function yt(e){return e!==null&&(e<0||e===32)}function st(e){return e===-2||e===-1||e===32}const Eo=Lr(/\p{P}|\p{S}/u),di=Lr(/\s/);function Lr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Mi(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&an(e.charCodeAt(n+1))&&an(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ct(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return st(l)?(e.enter(n),a(l)):t(l)}function a(l){return st(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const ox={tokenize:ax};function ax(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ct(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Ve(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const lx={tokenize:cx},Pf={tokenize:ux};function cx(e){const t=this,n=[];let r=0,i,s,o;return a;function a(x){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,l,c)(x)}return c(x)}function l(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const I=t.events.length;let A=I,O;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){O=t.events[A][1].end;break}y(r);let j=I;for(;j<t.events.length;)t.events[j][1].end=Object.assign({},O),j++;return Cn(t.events,A+1,0,t.events.slice(I)),t.events.length=j,c(x)}return a(x)}function c(x){if(r===n.length){if(!i)return h(x);if(i.currentConstruct&&i.currentConstruct.concrete)return p(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Pf,u,d)(x)}function u(x){return i&&b(),y(r),h(x)}function d(x){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,p(x)}function h(x){return t.containerState={},e.attempt(Pf,f,p)(x)}function f(x){return r++,n.push([t.currentConstruct,t.containerState]),h(x)}function p(x){if(x===null){i&&b(),y(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:s,_tokenizer:i}),m(x)}function m(x){if(x===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(x);return}return Ve(x)?(e.consume(x),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(x),m)}function v(x,I){const A=t.sliceStream(x);if(I&&A.push(null),x.previous=s,s&&(s.next=x),s=x,i.defineSkip(x.start),i.write(A),t.parser.lazy[x.start.line]){let O=i.events.length;for(;O--;)if(i.events[O][1].start.offset<o&&(!i.events[O][1].end||i.events[O][1].end.offset>o))return;const j=t.events.length;let U=j,H,T;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(H){T=t.events[U][1].end;break}H=!0}for(y(r),O=j;O<t.events.length;)t.events[O][1].end=Object.assign({},T),O++;Cn(t.events,U+1,0,t.events.slice(j)),t.events.length=O}}function y(x){let I=n.length;for(;I-- >x;){const A=n[I];t.containerState=A[1],A[0].exit.call(t,e)}n.length=x}function b(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ux(e,t,n){return ct(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function So(e){if(e===null||yt(e)||di(e))return 1;if(Eo(e))return 2}function To(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const ec={name:"attention",tokenize:fx,resolveAll:dx};function dx(e,t){let n=-1,r,i,s,o,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d=Object.assign({},e[r][1].end),h=Object.assign({},e[n][1].start);Af(d,-l),Af(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:h},s={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=$n(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=$n(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=$n(c,To(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=$n(c,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=$n(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Cn(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function fx(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=So(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const c=e.exit("attentionSequence"),u=So(l),d=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?d:d&&(i||!h)),c._close=!!(s===42?h:h&&(u||!d)),t(l)}}function Af(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const hx={name:"autolink",tokenize:px};function px(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(f){return hn(f)?(e.consume(f),o):c(f)}function o(f){return f===43||f===45||f===46||an(f)?(r=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||an(f))&&r++<32?(e.consume(f),a):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Co(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):rx(f)?(e.consume(f),c):n(f)}function u(f){return an(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||an(f))&&r++<63){const p=f===45?h:d;return e.consume(f),p}return n(f)}}const Es={tokenize:mx,partial:!0};function mx(e,t,n){return r;function r(s){return st(s)?ct(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||Ve(s)?t(s):n(s)}}const Rf={name:"blockQuote",tokenize:gx,continuation:{tokenize:yx},exit:vx};function gx(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return st(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function yx(e,t,n){const r=this;return i;function i(o){return st(o)?ct(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(Rf,t,n)(o)}}function vx(e){e.exit("blockQuote")}const $f={name:"characterEscape",tokenize:bx};function bx(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return sx(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Mf={name:"characterReference",tokenize:wx};function wx(e,t,n){const r=this;let i=0,s,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=an,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=ix,u):(e.enter("characterReferenceValue"),s=7,o=Xl,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return o===an&&!Ql(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<s?(e.consume(d),u):n(d)}}const Lf={tokenize:_x,partial:!0},Df={name:"codeFenced",tokenize:xx,concrete:!0};function xx(e,t,n){const r=this,i={tokenize:A,partial:!0};let s=0,o=0,a;return l;function l(O){return c(O)}function c(O){const j=r.events[r.events.length-1];return s=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,a=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(O)}function u(O){return O===a?(o++,e.consume(O),u):o<3?n(O):(e.exit("codeFencedFenceSequence"),st(O)?ct(e,d,"whitespace")(O):d(O))}function d(O){return O===null||Ve(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(Lf,m,I)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(O))}function h(O){return O===null||Ve(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(O)):st(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ct(e,f,"whitespace")(O)):O===96&&O===a?n(O):(e.consume(O),h)}function f(O){return O===null||Ve(O)?d(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(O))}function p(O){return O===null||Ve(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(O)):O===96&&O===a?n(O):(e.consume(O),p)}function m(O){return e.attempt(i,I,v)(O)}function v(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),y}function y(O){return s>0&&st(O)?ct(e,b,"linePrefix",s+1)(O):b(O)}function b(O){return O===null||Ve(O)?e.check(Lf,m,I)(O):(e.enter("codeFlowValue"),x(O))}function x(O){return O===null||Ve(O)?(e.exit("codeFlowValue"),b(O)):(e.consume(O),x)}function I(O){return e.exit("codeFenced"),t(O)}function A(O,j,U){let H=0;return T;function T(B){return O.enter("lineEnding"),O.consume(B),O.exit("lineEnding"),N}function N(B){return O.enter("codeFencedFence"),st(B)?ct(O,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):G(B)}function G(B){return B===a?(O.enter("codeFencedFenceSequence"),W(B)):U(B)}function W(B){return B===a?(H++,O.consume(B),W):H>=o?(O.exit("codeFencedFenceSequence"),st(B)?ct(O,q,"whitespace")(B):q(B)):U(B)}function q(B){return B===null||Ve(B)?(O.exit("codeFencedFence"),j(B)):U(B)}}}function _x(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const tc={name:"codeIndented",tokenize:Cx},kx={tokenize:Ex,partial:!0};function Cx(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ct(e,s,"linePrefix",4+1)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):Ve(c)?e.attempt(kx,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Ve(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function Ex(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Ve(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):ct(e,s,"linePrefix",4+1)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):Ve(o)?i(o):n(o)}}const Sx={name:"codeText",tokenize:Ix,resolve:Tx,previous:Ox};function Tx(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Ox(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ix(e,t,n){let r=0,i,s;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(s=e.enter("codeTextSequence"),i=0,u(d)):Ve(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||Ve(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",c(d))}}function Nf(e){const t={};let n=-1,r,i,s,o,a,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Px(e,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--&&(o=e[s],o[1].type==="lineEnding"||o[1].type==="lineEndingBlank");)o[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);i&&(r[1].end=Object.assign({},e[i][1].start),a=e.slice(i,n),a.unshift(r),Cn(e,i,n-i+1,a))}}return!c}function Px(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const s=[],o=n._tokenizer||r.parser[n.contentType](n.start),a=o.events,l=[],c={};let u,d,h=-1,f=n,p=0,m=0;const v=[m];for(;f;){for(;e[++i][1]!==f;);s.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(m=h+1,v.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):v.pop(),h=v.length;h--;){const y=a.slice(v[h],v[h+1]),b=s.pop();l.unshift([b,b+y.length-1]),Cn(e,b,2,y)}for(h=-1;++h<l.length;)c[p+l[h][0]]=p+l[h][1],p+=l[h][1]-l[h][0]-1;return c}const Ax={tokenize:Mx,resolve:$x},Rx={tokenize:Lx,partial:!0};function $x(e){return Nf(e),e}function Mx(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):Ve(a)?e.check(Rx,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Lx(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ct(e,s,"linePrefix")}function s(o){if(o===null||Ve(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function jf(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(y),e.exit(s),h):y===null||y===32||y===41||Co(y)?n(y):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(y))}function h(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||Ve(y)?n(y):(e.consume(y),y===92?p:f)}function p(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function m(y){return!u&&(y===null||y===41||yt(y))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(y)):u<c&&y===40?(e.consume(y),u++,m):y===41?(e.consume(y),u--,m):y===null||y===32||y===40||Co(y)?n(y):(e.consume(y),y===92?v:m)}function v(y){return y===40||y===41||y===92?(e.consume(y),m):m(y)}}function Uf(e,t,n,r,i,s){const o=this;let a=0,l;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(s),u}function u(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):Ve(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||Ve(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!st(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function Ff(e,t,n,r,i,s){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),c(h))}function c(h){return h===o?(e.exit(s),l(o)):h===null?n(h):Ve(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ct(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||Ve(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===o||h===92?(e.consume(h),u):u(h)}}function Ss(e,t){let n;return r;function r(i){return Ve(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):st(i)?ct(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Dx={name:"definition",tokenize:jx},Nx={tokenize:Ux,partial:!0};function jx(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),o(f)}function o(f){return Uf.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=Fn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return yt(f)?Ss(e,c)(f):c(f)}function c(f){return jf(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(Nx,d,d)(f)}function d(f){return st(f)?ct(e,h,"whitespace")(f):h(f)}function h(f){return f===null||Ve(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function Ux(e,t,n){return r;function r(a){return yt(a)?Ss(e,i)(a):n(a)}function i(a){return Ff(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return st(a)?ct(e,o,"whitespace")(a):o(a)}function o(a){return a===null||Ve(a)?t(a):n(a)}}const Fx={name:"hardBreakEscape",tokenize:Bx};function Bx(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return Ve(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Vx={name:"headingAtx",tokenize:Zx,resolve:zx};function zx(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Cn(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Zx(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||yt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Ve(u)?(e.exit("atxHeading"),t(u)):st(u)?ct(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||yt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const Wx=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Bf=["pre","script","style","textarea"],Hx={name:"htmlFlow",tokenize:Gx,resolveTo:Jx,concrete:!0},qx={tokenize:Qx,partial:!0},Kx={tokenize:Yx,partial:!0};function Jx(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Gx(e,t,n){const r=this;let i,s,o,a,l;return c;function c(S){return u(S)}function u(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),d}function d(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),s=!0,m):S===63?(e.consume(S),i=3,r.interrupt?t:k):hn(S)?(e.consume(S),o=String.fromCharCode(S),v):n(S)}function h(S){return S===45?(e.consume(S),i=2,f):S===91?(e.consume(S),i=5,a=0,p):hn(S)?(e.consume(S),i=4,r.interrupt?t:k):n(S)}function f(S){return S===45?(e.consume(S),r.interrupt?t:k):n(S)}function p(S){const Se="CDATA[";return S===Se.charCodeAt(a++)?(e.consume(S),a===Se.length?r.interrupt?t:G:p):n(S)}function m(S){return hn(S)?(e.consume(S),o=String.fromCharCode(S),v):n(S)}function v(S){if(S===null||S===47||S===62||yt(S)){const Se=S===47,Ne=o.toLowerCase();return!Se&&!s&&Bf.includes(Ne)?(i=1,r.interrupt?t(S):G(S)):Wx.includes(o.toLowerCase())?(i=6,Se?(e.consume(S),y):r.interrupt?t(S):G(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):s?b(S):x(S))}return S===45||an(S)?(e.consume(S),o+=String.fromCharCode(S),v):n(S)}function y(S){return S===62?(e.consume(S),r.interrupt?t:G):n(S)}function b(S){return st(S)?(e.consume(S),b):T(S)}function x(S){return S===47?(e.consume(S),T):S===58||S===95||hn(S)?(e.consume(S),I):st(S)?(e.consume(S),x):T(S)}function I(S){return S===45||S===46||S===58||S===95||an(S)?(e.consume(S),I):A(S)}function A(S){return S===61?(e.consume(S),O):st(S)?(e.consume(S),A):x(S)}function O(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),l=S,j):st(S)?(e.consume(S),O):U(S)}function j(S){return S===l?(e.consume(S),l=null,H):S===null||Ve(S)?n(S):(e.consume(S),j)}function U(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||yt(S)?A(S):(e.consume(S),U)}function H(S){return S===47||S===62||st(S)?x(S):n(S)}function T(S){return S===62?(e.consume(S),N):n(S)}function N(S){return S===null||Ve(S)?G(S):st(S)?(e.consume(S),N):n(S)}function G(S){return S===45&&i===2?(e.consume(S),z):S===60&&i===1?(e.consume(S),Y):S===62&&i===4?(e.consume(S),ee):S===63&&i===3?(e.consume(S),k):S===93&&i===5?(e.consume(S),pe):Ve(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(qx,_e,W)(S)):S===null||Ve(S)?(e.exit("htmlFlowData"),W(S)):(e.consume(S),G)}function W(S){return e.check(Kx,q,_e)(S)}function q(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),B}function B(S){return S===null||Ve(S)?W(S):(e.enter("htmlFlowData"),G(S))}function z(S){return S===45?(e.consume(S),k):G(S)}function Y(S){return S===47?(e.consume(S),o="",K):G(S)}function K(S){if(S===62){const Se=o.toLowerCase();return Bf.includes(Se)?(e.consume(S),ee):G(S)}return hn(S)&&o.length<8?(e.consume(S),o+=String.fromCharCode(S),K):G(S)}function pe(S){return S===93?(e.consume(S),k):G(S)}function k(S){return S===62?(e.consume(S),ee):S===45&&i===2?(e.consume(S),k):G(S)}function ee(S){return S===null||Ve(S)?(e.exit("htmlFlowData"),_e(S)):(e.consume(S),ee)}function _e(S){return e.exit("htmlFlow"),t(S)}}function Yx(e,t,n){const r=this;return i;function i(o){return Ve(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Qx(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Es,t,n)}}const Xx={name:"htmlText",tokenize:e_};function e_(e,t,n){const r=this;let i,s,o;return a;function a(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),l}function l(k){return k===33?(e.consume(k),c):k===47?(e.consume(k),A):k===63?(e.consume(k),x):hn(k)?(e.consume(k),U):n(k)}function c(k){return k===45?(e.consume(k),u):k===91?(e.consume(k),s=0,p):hn(k)?(e.consume(k),b):n(k)}function u(k){return k===45?(e.consume(k),f):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),h):Ve(k)?(o=d,Y(k)):(e.consume(k),d)}function h(k){return k===45?(e.consume(k),f):d(k)}function f(k){return k===62?z(k):k===45?h(k):d(k)}function p(k){const ee="CDATA[";return k===ee.charCodeAt(s++)?(e.consume(k),s===ee.length?m:p):n(k)}function m(k){return k===null?n(k):k===93?(e.consume(k),v):Ve(k)?(o=m,Y(k)):(e.consume(k),m)}function v(k){return k===93?(e.consume(k),y):m(k)}function y(k){return k===62?z(k):k===93?(e.consume(k),y):m(k)}function b(k){return k===null||k===62?z(k):Ve(k)?(o=b,Y(k)):(e.consume(k),b)}function x(k){return k===null?n(k):k===63?(e.consume(k),I):Ve(k)?(o=x,Y(k)):(e.consume(k),x)}function I(k){return k===62?z(k):x(k)}function A(k){return hn(k)?(e.consume(k),O):n(k)}function O(k){return k===45||an(k)?(e.consume(k),O):j(k)}function j(k){return Ve(k)?(o=j,Y(k)):st(k)?(e.consume(k),j):z(k)}function U(k){return k===45||an(k)?(e.consume(k),U):k===47||k===62||yt(k)?H(k):n(k)}function H(k){return k===47?(e.consume(k),z):k===58||k===95||hn(k)?(e.consume(k),T):Ve(k)?(o=H,Y(k)):st(k)?(e.consume(k),H):z(k)}function T(k){return k===45||k===46||k===58||k===95||an(k)?(e.consume(k),T):N(k)}function N(k){return k===61?(e.consume(k),G):Ve(k)?(o=N,Y(k)):st(k)?(e.consume(k),N):H(k)}function G(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,W):Ve(k)?(o=G,Y(k)):st(k)?(e.consume(k),G):(e.consume(k),q)}function W(k){return k===i?(e.consume(k),i=void 0,B):k===null?n(k):Ve(k)?(o=W,Y(k)):(e.consume(k),W)}function q(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||yt(k)?H(k):(e.consume(k),q)}function B(k){return k===47||k===62||yt(k)?H(k):n(k)}function z(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function Y(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),K}function K(k){return st(k)?ct(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):pe(k)}function pe(k){return e.enter("htmlTextData"),o(k)}}const nc={name:"labelEnd",tokenize:o_,resolveTo:s_,resolveAll:i_},t_={tokenize:a_},n_={tokenize:l_},r_={tokenize:c_};function i_(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function s_(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:Object.assign({},e[s][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[s][1].start),end:Object.assign({},e[o][1].end)},u={type:"labelText",start:Object.assign({},e[s+r+2][1].end),end:Object.assign({},e[o-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=$n(a,e.slice(s+1,s+r+3)),a=$n(a,[["enter",u,t]]),a=$n(a,To(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=$n(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=$n(a,e.slice(o+1)),a=$n(a,[["exit",l,t]]),Cn(e,s,e.length,a),e}function o_(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(h){return s?s._inactive?d(h):(o=r.parser.defined.includes(Fn(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(t_,u,o?u:d)(h):h===91?e.attempt(n_,u,o?c:d)(h):o?u(h):d(h)}function c(h){return e.attempt(r_,u,d)(h)}function u(h){return t(h)}function d(h){return s._balanced=!0,n(h)}}function a_(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return yt(d)?Ss(e,s)(d):s(d)}function s(d){return d===41?u(d):jf(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return yt(d)?Ss(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?Ff(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return yt(d)?Ss(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function l_(e,t,n){const r=this;return i;function i(a){return Uf.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Fn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function c_(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const u_={name:"labelStartImage",tokenize:d_,resolveAll:nc.resolveAll};function d_(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const f_={name:"labelStartLink",tokenize:h_,resolveAll:nc.resolveAll};function h_(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const rc={name:"lineEnding",tokenize:p_};function p_(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ct(e,t,"linePrefix")}}const Oo={name:"thematicBreak",tokenize:m_};function m_(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Ve(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),st(c)?ct(e,a,"whitespace")(c):a(c))}}const yn={name:"list",tokenize:v_,continuation:{tokenize:b_},exit:x_},g_={tokenize:__,partial:!0},y_={tokenize:w_,partial:!0};function v_(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(f){const p=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Xl(f)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Oo,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return Xl(f)&&++o<10?(e.consume(f),l):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Es,r.interrupt?n:u,e.attempt(g_,h,d))}function u(f){return r.containerState.initialBlankLine=!0,s++,h(f)}function d(f){return st(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function b_(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Es,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ct(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!st(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(y_,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ct(e,e.attempt(yn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function w_(e,t,n){const r=this;return ct(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function x_(e){e.exit(this.containerState.type)}function __(e,t,n){const r=this;return ct(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(s){const o=r.events[r.events.length-1];return!st(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Vf={name:"setextUnderline",tokenize:C_,resolveTo:k_};function k_(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[s][1].end)):e[r][1]=o,e.push(["exit",o,t]),e}function C_(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),st(c)?ct(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Ve(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const E_={tokenize:S_};function S_(e){const t=this,n=e.attempt(Es,r,e.attempt(this.parser.constructs.flowInitial,i,ct(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ax,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const T_={resolveAll:Zf()},O_=zf("string"),I_=zf("text");function zf(e){return{tokenize:t,resolveAll:Zf(e==="text"?P_:void 0)};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(u){return c(u)?s(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function Zf(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function P_(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+s,_bufferIndex:s?o:r.start._bufferIndex+o},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function A_(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},s=[];let o=[],a=[];const l={consume:b,enter:x,exit:I,attempt:j(A),check:j(O),interrupt:j(O,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:f,sliceSerialize:h,now:p,defineSkip:m,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function d(N){return o=$n(o,N),v(),o[o.length-1]!==null?[]:(U(t,0),c.events=To(s,c.events,c),c.events)}function h(N,G){return $_(f(N),G)}function f(N){return R_(o,N)}function p(){const{line:N,column:G,offset:W,_index:q,_bufferIndex:B}=r;return{line:N,column:G,offset:W,_index:q,_bufferIndex:B}}function m(N){i[N.line]=N.column,T()}function v(){let N;for(;r._index<o.length;){const G=o[r._index];if(typeof G=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<G.length;)y(G.charCodeAt(r._bufferIndex));else y(G)}}function y(N){u=u(N)}function b(N){Ve(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,T()):N!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=N}function x(N,G){const W=G||{};return W.type=N,W.start=p(),c.events.push(["enter",W,c]),a.push(W),W}function I(N){const G=a.pop();return G.end=p(),c.events.push(["exit",G,c]),G}function A(N,G){U(N,G.from)}function O(N,G){G.restore()}function j(N,G){return W;function W(q,B,z){let Y,K,pe,k;return Array.isArray(q)?_e(q):"tokenize"in q?_e([q]):ee(q);function ee(Ie){return je;function je(He){const De=He!==null&&Ie[He],we=He!==null&&Ie.null,ye=[...Array.isArray(De)?De:De?[De]:[],...Array.isArray(we)?we:we?[we]:[]];return _e(ye)(He)}}function _e(Ie){return Y=Ie,K=0,Ie.length===0?z:S(Ie[K])}function S(Ie){return je;function je(He){return k=H(),pe=Ie,Ie.partial||(c.currentConstruct=Ie),Ie.name&&c.parser.constructs.disable.null.includes(Ie.name)?Ne():Ie.tokenize.call(G?Object.assign(Object.create(c),G):c,l,Se,Ne)(He)}}function Se(Ie){return N(pe,k),B}function Ne(Ie){return k.restore(),++K<Y.length?S(Y[K]):z}}}function U(N,G){N.resolveAll&&!s.includes(N)&&s.push(N),N.resolve&&Cn(c.events,G,c.events.length-G,N.resolve(c.events.slice(G),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function H(){const N=p(),G=c.previous,W=c.currentConstruct,q=c.events.length,B=Array.from(a);return{restore:z,from:q};function z(){r=N,c.previous=G,c.currentConstruct=W,c.events.length=q,a=B,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function R_(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function $_(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
29
29
  `;break}case-3:{o=`\r
30
- `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}const D_=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:jx},disable:{null:[]},document:{42:yn,43:yn,45:yn,48:yn,49:yn,50:yn,51:yn,52:yn,53:yn,54:yn,55:yn,56:yn,57:yn,62:Mf},flow:{35:Zx,42:Oo,45:[Zf,Oo],60:Kx,61:Zf,95:Oo,96:jf,126:jf},flowInitial:{[-2]:rc,[-1]:rc,32:rc},insideSpan:{null:[nc,I_]},string:{38:Df,92:Lf},text:{[-5]:sc,[-4]:sc,[-3]:sc,33:f_,38:Df,42:nc,60:[mx,t_],91:p_,92:[Vx,Lf],93:ic,95:nc,96:Ox}},Symbol.toStringTag,{value:"Module"}));function N_(e){const n=Pf([D_,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(lx),document:i(ux),flow:i(T_),string:i(P_),text:i(A_)};return r;function i(s){return o;function o(a){return $_(r,s,a)}}}function j_(e){for(;!Uf(e););return e}const qf=/[\0\t\n\r]/g;function U_(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let c,u,d,h,f;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(qf.lastIndex=d,c=qf.exec(s),h=c&&c.index!==void 0?c.index:s.length,f=s.charCodeAt(h),!c){t=s.slice(d);break}if(f===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(s.slice(d,h)),e+=h-d),f){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const F_=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function B_(e){return e.replace(F_,V_)}function V_(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Af(n.slice(s?2:1),s?16:10)}return ec(n)||e}const Kf={}.hasOwnProperty;function z_(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Z_(n)(j_(N_(n).document().write(U_()(e,t,!0))))}function Z_(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(me),autolinkProtocol:F,autolinkEmail:F,atxHeading:s(Re),blockQuote:s(Ue),characterEscape:F,characterReference:F,codeFenced:s(_e),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(_e,o),codeText:s(ve,o),codeTextData:F,data:F,codeFlowValue:F,definition:s(ke),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Ce),hardBreakEscape:s(qe),hardBreakTrailing:s(qe),htmlFlow:s(D,o),htmlFlowData:F,htmlText:s(D,o),htmlTextData:F,image:s(ne),label:o,link:s(me),listItem:s(Le),listItemValue:h,listOrdered:s(he,d),listUnordered:s(he),paragraph:s(Pe),reference:S,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Re),strong:s(Be),thematicBreak:s(Ze)},exit:{atxHeading:l(),atxHeadingSequence:P,autolink:l(),autolinkEmail:De,autolinkProtocol:je,blockQuote:l(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:Ne,characterReferenceMarkerNumeric:Ne,characterReferenceValue:Ie,codeFenced:l(y),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:O,codeIndented:l(v),codeText:l(B),codeTextData:O,data:O,definition:l(),definitionDestinationString:I,definitionLabelString:b,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(J),hardBreakTrailing:l(J),htmlFlow:l(q),htmlFlowData:O,htmlText:l(W),htmlTextData:O,image:l(Y),label:pe,labelText:K,lineEnding:N,link:l(V),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Te,resourceDestinationString:k,resourceTitleString:ee,resource:xe,setextHeading:l(U),setextHeadingLineSequence:j,setextHeadingText:T,strong:l(),thematicBreak:l()}};Jf(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Z){let Q={type:"root",children:[]};const G={stack:[Q],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},$e=[];let Ge=-1;for(;++Ge<Z.length;)if(Z[Ge][1].type==="listOrdered"||Z[Ge][1].type==="listUnordered")if(Z[Ge][0]==="enter")$e.push(Ge);else{const St=$e.pop();Ge=i(Z,St,Ge)}for(Ge=-1;++Ge<Z.length;){const St=t[Z[Ge][0]];Kf.call(St,Z[Ge][1].type)&&St[Z[Ge][1].type].call(Object.assign({sliceSerialize:Z[Ge][2].sliceSerialize},G),Z[Ge][1])}if(G.tokenStack.length>0){const St=G.tokenStack[G.tokenStack.length-1];(St[1]||Gf).call(G,void 0,St[0])}for(Q.position={start:Dr(Z.length>0?Z[0][1].start:{line:1,column:1,offset:0}),end:Dr(Z.length>0?Z[Z.length-2][1].end:{line:1,column:1,offset:0})},Ge=-1;++Ge<t.transforms.length;)Q=t.transforms[Ge](Q)||Q;return Q}function i(Z,Q,G){let $e=Q-1,Ge=-1,St=!1,bt,gt,At,fn;for(;++$e<=G;){const Rt=Z[$e];switch(Rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Rt[0]==="enter"?Ge++:Ge--,fn=void 0;break}case"lineEndingBlank":{Rt[0]==="enter"&&(bt&&!fn&&!Ge&&!At&&(At=$e),fn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fn=void 0}if(!Ge&&Rt[0]==="enter"&&Rt[1].type==="listItemPrefix"||Ge===-1&&Rt[0]==="exit"&&(Rt[1].type==="listUnordered"||Rt[1].type==="listOrdered")){if(bt){let Ft=$e;for(gt=void 0;Ft--;){const Qt=Z[Ft];if(Qt[1].type==="lineEnding"||Qt[1].type==="lineEndingBlank"){if(Qt[0]==="exit")continue;gt&&(Z[gt][1].type="lineEndingBlank",St=!0),Qt[1].type="lineEnding",gt=Ft}else if(!(Qt[1].type==="linePrefix"||Qt[1].type==="blockQuotePrefix"||Qt[1].type==="blockQuotePrefixWhitespace"||Qt[1].type==="blockQuoteMarker"||Qt[1].type==="listItemIndent"))break}At&&(!gt||At<gt)&&(bt._spread=!0),bt.end=Object.assign({},gt?Z[gt][1].start:Rt[1].end),Z.splice(gt||$e,0,["exit",bt,Rt[2]]),$e++,G++}if(Rt[1].type==="listItemPrefix"){const Ft={type:"listItem",_spread:!1,start:Object.assign({},Rt[1].start),end:void 0};bt=Ft,Z.splice($e,0,["enter",Ft,Rt[2]]),$e++,G++,At=void 0,fn=!0}}}return Z[Q][1]._spread=St,G}function s(Z,Q){return G;function G($e){a.call(this,Z($e),$e),Q&&Q.call(this,$e)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(Z,Q,G){this.stack[this.stack.length-1].children.push(Z),this.stack.push(Z),this.tokenStack.push([Q,G]),Z.position={start:Dr(Q.start),end:void 0}}function l(Z){return Q;function Q(G){Z&&Z.call(this,G),c.call(this,G)}}function c(Z,Q){const G=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==Z.type&&(Q?Q.call(this,Z,$e[0]):($e[1]||Gf).call(this,Z,$e[0]));else throw new Error("Cannot close `"+Z.type+"` ("+ks({start:Z.start,end:Z.end})+"): it’s not open");G.position.end=Dr(Z.end)}function u(){return Xl(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(Z){if(this.data.expectingFirstListItemValue){const Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize(Z),10),this.data.expectingFirstListItemValue=void 0}}function f(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=Z}function p(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=Z}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.value=Z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.value=Z.replace(/(\r?\n|\r)$/g,"")}function b(Z){const Q=this.resume(),G=this.stack[this.stack.length-1];G.label=Q,G.identifier=Fn(this.sliceSerialize(Z)).toLowerCase()}function x(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.title=Z}function I(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.url=Z}function P(Z){const Q=this.stack[this.stack.length-1];if(!Q.depth){const G=this.sliceSerialize(Z).length;Q.depth=G}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function j(Z){const Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize(Z).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function F(Z){const G=this.stack[this.stack.length-1].children;let $e=G[G.length-1];(!$e||$e.type!=="text")&&($e=ot(),$e.position={start:Dr(Z.start),end:void 0},G.push($e)),this.stack.push($e)}function O(Z){const Q=this.stack.pop();Q.value+=this.sliceSerialize(Z),Q.position.end=Dr(Z.end)}function N(Z){const Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const G=Q.children[Q.children.length-1];G.position.end=Dr(Z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Q.type)&&(F.call(this,Z),O.call(this,Z))}function J(){this.data.atHardBreak=!0}function q(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.value=Z}function W(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.value=Z}function B(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.value=Z}function V(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=Q,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function Y(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=Q,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function K(Z){const Q=this.sliceSerialize(Z),G=this.stack[this.stack.length-2];G.label=B_(Q),G.identifier=Fn(Q).toLowerCase()}function pe(){const Z=this.stack[this.stack.length-1],Q=this.resume(),G=this.stack[this.stack.length-1];if(this.data.inReference=!0,G.type==="link"){const $e=Z.children;G.children=$e}else G.alt=Q}function k(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.url=Z}function ee(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.title=Z}function xe(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function Te(Z){const Q=this.resume(),G=this.stack[this.stack.length-1];G.label=Q,G.identifier=Fn(this.sliceSerialize(Z)).toLowerCase(),this.data.referenceType="full"}function Ne(Z){this.data.characterReferenceType=Z.type}function Ie(Z){const Q=this.sliceSerialize(Z),G=this.data.characterReferenceType;let $e;G?($e=Af(Q,G==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=ec(Q);const Ge=this.stack.pop();Ge.value+=$e,Ge.position.end=Dr(Z.end)}function je(Z){O.call(this,Z);const Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize(Z)}function De(Z){O.call(this,Z);const Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize(Z)}function Ue(){return{type:"blockquote",children:[]}}function _e(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ce(){return{type:"emphasis",children:[]}}function Re(){return{type:"heading",depth:0,children:[]}}function qe(){return{type:"break"}}function D(){return{type:"html",value:""}}function ne(){return{type:"image",title:null,url:"",alt:null}}function me(){return{type:"link",title:null,url:"",children:[]}}function he(Z){return{type:"list",ordered:Z.type==="listOrdered",start:null,spread:Z._spread,children:[]}}function Le(Z){return{type:"listItem",spread:Z._spread,checked:null,children:[]}}function Pe(){return{type:"paragraph",children:[]}}function Be(){return{type:"strong",children:[]}}function ot(){return{type:"text",value:""}}function Ze(){return{type:"thematicBreak"}}}function Dr(e){return{line:e.line,column:e.column,offset:e.offset}}function Jf(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Jf(e,r):W_(e,r)}}function W_(e,t){let n;for(n in t)if(Kf.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Gf(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ks({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ks({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ks({start:t.start,end:t.end})+") is still open")}function H_(e){const t=this;t.parser=n;function n(r){return z_(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function q_(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function K_(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
31
- `}]}function J_(e,t){const n=t.value?t.value+`
32
- `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function G_(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Y_(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Q_(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Li(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function X_(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ek(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Yf(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function tk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Yf(e,t);const i={src:Li(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function nk(e,t){const n={src:Li(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function rk(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function ik(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Yf(e,t);const i={href:Li(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function sk(e,t){const n={href:Li(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ok(e,t,n){const r=e.all(t),i=n?ak(n):Qf(t),s={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
30
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}const M_=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:Dx},disable:{null:[]},document:{42:yn,43:yn,45:yn,48:yn,49:yn,50:yn,51:yn,52:yn,53:yn,54:yn,55:yn,56:yn,57:yn,62:Rf},flow:{35:Vx,42:Oo,45:[Vf,Oo],60:Hx,61:Vf,95:Oo,96:Df,126:Df},flowInitial:{[-2]:tc,[-1]:tc,32:tc},insideSpan:{null:[ec,T_]},string:{38:Mf,92:$f},text:{[-5]:rc,[-4]:rc,[-3]:rc,33:u_,38:Mf,42:ec,60:[hx,Xx],91:f_,92:[Fx,$f],93:nc,95:ec,96:Sx}},Symbol.toStringTag,{value:"Module"}));function L_(e){const n=Of([M_,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(ox),document:i(lx),flow:i(E_),string:i(O_),text:i(I_)};return r;function i(s){return o;function o(a){return A_(r,s,a)}}}function D_(e){for(;!Nf(e););return e}const Wf=/[\0\t\n\r]/g;function N_(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let c,u,d,h,f;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(Wf.lastIndex=d,c=Wf.exec(s),h=c&&c.index!==void 0?c.index:s.length,f=s.charCodeAt(h),!c){t=s.slice(d);break}if(f===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(s.slice(d,h)),e+=h-d),f){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const j_=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function U_(e){return e.replace(j_,F_)}function F_(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return If(n.slice(s?2:1),s?16:10)}return Ql(n)||e}const Hf={}.hasOwnProperty;function B_(e,t,n){return typeof t!="string"&&(n=t,t=void 0),V_(n)(D_(L_(n).document().write(N_()(e,t,!0))))}function V_(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(me),autolinkProtocol:H,autolinkEmail:H,atxHeading:s(Re),blockQuote:s(De),characterEscape:H,characterReference:H,codeFenced:s(we),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(we,o),codeText:s(ye,o),codeTextData:H,data:H,codeFlowValue:H,definition:s(Te),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(ke),hardBreakEscape:s(qe),hardBreakTrailing:s(qe),htmlFlow:s(D,o),htmlFlowData:H,htmlText:s(D,o),htmlTextData:H,image:s(ne),label:o,link:s(me),listItem:s(Le),listItemValue:h,listOrdered:s(he,d),listUnordered:s(he),paragraph:s(Pe),reference:S,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Re),strong:s(Fe),thematicBreak:s(ze)},exit:{atxHeading:l(),atxHeadingSequence:A,autolink:l(),autolinkEmail:He,autolinkProtocol:je,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:Ne,characterReferenceMarkerNumeric:Ne,characterReferenceValue:Ie,codeFenced:l(v),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:T,codeIndented:l(y),codeText:l(B),codeTextData:T,data:T,definition:l(),definitionDestinationString:I,definitionLabelString:b,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(G),hardBreakTrailing:l(G),htmlFlow:l(W),htmlFlowData:T,htmlText:l(q),htmlTextData:T,image:l(Y),label:pe,labelText:K,lineEnding:N,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Se,resourceDestinationString:k,resourceTitleString:ee,resource:_e,setextHeading:l(U),setextHeadingLineSequence:j,setextHeadingText:O,strong:l(),thematicBreak:l()}};qf(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(V){let Q={type:"root",children:[]};const J={stack:[Q],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},$e=[];let Ge=-1;for(;++Ge<V.length;)if(V[Ge][1].type==="listOrdered"||V[Ge][1].type==="listUnordered")if(V[Ge][0]==="enter")$e.push(Ge);else{const St=$e.pop();Ge=i(V,St,Ge)}for(Ge=-1;++Ge<V.length;){const St=t[V[Ge][0]];Hf.call(St,V[Ge][1].type)&&St[V[Ge][1].type].call(Object.assign({sliceSerialize:V[Ge][2].sliceSerialize},J),V[Ge][1])}if(J.tokenStack.length>0){const St=J.tokenStack[J.tokenStack.length-1];(St[1]||Kf).call(J,void 0,St[0])}for(Q.position={start:Dr(V.length>0?V[0][1].start:{line:1,column:1,offset:0}),end:Dr(V.length>0?V[V.length-2][1].end:{line:1,column:1,offset:0})},Ge=-1;++Ge<t.transforms.length;)Q=t.transforms[Ge](Q)||Q;return Q}function i(V,Q,J){let $e=Q-1,Ge=-1,St=!1,bt,mt,At,fn;for(;++$e<=J;){const Rt=V[$e];switch(Rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Rt[0]==="enter"?Ge++:Ge--,fn=void 0;break}case"lineEndingBlank":{Rt[0]==="enter"&&(bt&&!fn&&!Ge&&!At&&(At=$e),fn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fn=void 0}if(!Ge&&Rt[0]==="enter"&&Rt[1].type==="listItemPrefix"||Ge===-1&&Rt[0]==="exit"&&(Rt[1].type==="listUnordered"||Rt[1].type==="listOrdered")){if(bt){let Ft=$e;for(mt=void 0;Ft--;){const Qt=V[Ft];if(Qt[1].type==="lineEnding"||Qt[1].type==="lineEndingBlank"){if(Qt[0]==="exit")continue;mt&&(V[mt][1].type="lineEndingBlank",St=!0),Qt[1].type="lineEnding",mt=Ft}else if(!(Qt[1].type==="linePrefix"||Qt[1].type==="blockQuotePrefix"||Qt[1].type==="blockQuotePrefixWhitespace"||Qt[1].type==="blockQuoteMarker"||Qt[1].type==="listItemIndent"))break}At&&(!mt||At<mt)&&(bt._spread=!0),bt.end=Object.assign({},mt?V[mt][1].start:Rt[1].end),V.splice(mt||$e,0,["exit",bt,Rt[2]]),$e++,J++}if(Rt[1].type==="listItemPrefix"){const Ft={type:"listItem",_spread:!1,start:Object.assign({},Rt[1].start),end:void 0};bt=Ft,V.splice($e,0,["enter",Ft,Rt[2]]),$e++,J++,At=void 0,fn=!0}}}return V[Q][1]._spread=St,J}function s(V,Q){return J;function J($e){a.call(this,V($e),$e),Q&&Q.call(this,$e)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(V,Q,J){this.stack[this.stack.length-1].children.push(V),this.stack.push(V),this.tokenStack.push([Q,J]),V.position={start:Dr(Q.start),end:void 0}}function l(V){return Q;function Q(J){V&&V.call(this,J),c.call(this,J)}}function c(V,Q){const J=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==V.type&&(Q?Q.call(this,V,$e[0]):($e[1]||Kf).call(this,V,$e[0]));else throw new Error("Cannot close `"+V.type+"` ("+ks({start:V.start,end:V.end})+"): it’s not open");J.position.end=Dr(V.end)}function u(){return Yl(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(V){if(this.data.expectingFirstListItemValue){const Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize(V),10),this.data.expectingFirstListItemValue=void 0}}function f(){const V=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=V}function p(){const V=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=V}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const V=this.resume(),Q=this.stack[this.stack.length-1];Q.value=V.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const V=this.resume(),Q=this.stack[this.stack.length-1];Q.value=V.replace(/(\r?\n|\r)$/g,"")}function b(V){const Q=this.resume(),J=this.stack[this.stack.length-1];J.label=Q,J.identifier=Fn(this.sliceSerialize(V)).toLowerCase()}function x(){const V=this.resume(),Q=this.stack[this.stack.length-1];Q.title=V}function I(){const V=this.resume(),Q=this.stack[this.stack.length-1];Q.url=V}function A(V){const Q=this.stack[this.stack.length-1];if(!Q.depth){const J=this.sliceSerialize(V).length;Q.depth=J}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function j(V){const Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize(V).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function H(V){const J=this.stack[this.stack.length-1].children;let $e=J[J.length-1];(!$e||$e.type!=="text")&&($e=ot(),$e.position={start:Dr(V.start),end:void 0},J.push($e)),this.stack.push($e)}function T(V){const Q=this.stack.pop();Q.value+=this.sliceSerialize(V),Q.position.end=Dr(V.end)}function N(V){const Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const J=Q.children[Q.children.length-1];J.position.end=Dr(V.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Q.type)&&(H.call(this,V),T.call(this,V))}function G(){this.data.atHardBreak=!0}function W(){const V=this.resume(),Q=this.stack[this.stack.length-1];Q.value=V}function q(){const V=this.resume(),Q=this.stack[this.stack.length-1];Q.value=V}function B(){const V=this.resume(),Q=this.stack[this.stack.length-1];Q.value=V}function z(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=Q,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function Y(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=Q,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function K(V){const Q=this.sliceSerialize(V),J=this.stack[this.stack.length-2];J.label=U_(Q),J.identifier=Fn(Q).toLowerCase()}function pe(){const V=this.stack[this.stack.length-1],Q=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){const $e=V.children;J.children=$e}else J.alt=Q}function k(){const V=this.resume(),Q=this.stack[this.stack.length-1];Q.url=V}function ee(){const V=this.resume(),Q=this.stack[this.stack.length-1];Q.title=V}function _e(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function Se(V){const Q=this.resume(),J=this.stack[this.stack.length-1];J.label=Q,J.identifier=Fn(this.sliceSerialize(V)).toLowerCase(),this.data.referenceType="full"}function Ne(V){this.data.characterReferenceType=V.type}function Ie(V){const Q=this.sliceSerialize(V),J=this.data.characterReferenceType;let $e;J?($e=If(Q,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=Ql(Q);const Ge=this.stack.pop();Ge.value+=$e,Ge.position.end=Dr(V.end)}function je(V){T.call(this,V);const Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize(V)}function He(V){T.call(this,V);const Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize(V)}function De(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function ye(){return{type:"inlineCode",value:""}}function Te(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ke(){return{type:"emphasis",children:[]}}function Re(){return{type:"heading",depth:0,children:[]}}function qe(){return{type:"break"}}function D(){return{type:"html",value:""}}function ne(){return{type:"image",title:null,url:"",alt:null}}function me(){return{type:"link",title:null,url:"",children:[]}}function he(V){return{type:"list",ordered:V.type==="listOrdered",start:null,spread:V._spread,children:[]}}function Le(V){return{type:"listItem",spread:V._spread,checked:null,children:[]}}function Pe(){return{type:"paragraph",children:[]}}function Fe(){return{type:"strong",children:[]}}function ot(){return{type:"text",value:""}}function ze(){return{type:"thematicBreak"}}}function Dr(e){return{line:e.line,column:e.column,offset:e.offset}}function qf(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?qf(e,r):z_(e,r)}}function z_(e,t){let n;for(n in t)if(Hf.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Kf(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ks({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ks({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ks({start:t.start,end:t.end})+") is still open")}function Z_(e){const t=this;t.parser=n;function n(r){return B_(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function W_(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function H_(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
31
+ `}]}function q_(e,t){const n=t.value?t.value+`
32
+ `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function K_(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function J_(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function G_(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Mi(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function Y_(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Q_(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Jf(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function X_(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Jf(e,t);const i={src:Mi(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function ek(e,t){const n={src:Mi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function tk(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function nk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Jf(e,t);const i={href:Mi(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function rk(e,t){const n={href:Mi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ik(e,t,n){const r=e.all(t),i=n?sk(n):Gf(t),s={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
33
33
  `}),u.type==="element"&&u.tagName==="p"&&!i?o.push(...u.children):o.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
34
- `});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)}function ak(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Qf(n[r])}return t}function Qf(e){const t=e.spread;return t??e.children.length>1}function lk(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function ck(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uk(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function dk(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fk(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=ql(t.children[1]),l=vf(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function hk(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const d=t.children[l],h={},f=o?o[l]:void 0;f&&(h.align=f);let p={type:"element",tagName:s,properties:h,children:[]};d&&(p.children=e.all(d),e.patch(d,p),p=e.applyData(d,p)),c.push(p)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function pk(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Xf=9,eh=32;function mk(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(th(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(th(t.slice(i),i>0,!1)),s.join("")}function th(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Xf||s===eh;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Xf||s===eh;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function gk(e,t){const n={type:"text",value:mk(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function yk(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const vk={blockquote:q_,break:K_,code:J_,delete:G_,emphasis:Y_,footnoteReference:Q_,heading:X_,html:ek,imageReference:tk,image:nk,inlineCode:rk,linkReference:ik,link:sk,listItem:ok,list:lk,paragraph:ck,root:uk,strong:dk,table:fk,tableCell:pk,tableRow:hk,text:gk,thematicBreak:yk,toml:Io,yaml:Io,definition:Io,footnoteDefinition:Io};function Io(){}const nh=-1,Po=0,Ao=1,Ro=2,oc=3,ac=4,lc=5,cc=6,rh=7,ih=8,sh=typeof self=="object"?self:globalThis,bk=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Po:case nh:return n(o,i);case Ao:{const a=n([],i);for(const l of o)a.push(r(l));return a}case Ro:{const a=n({},i);for(const[l,c]of o)a[r(l)]=r(c);return a}case oc:return n(new Date(o),i);case ac:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case lc:{const a=n(new Map,i);for(const[l,c]of o)a.set(r(l),r(c));return a}case cc:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case rh:{const{name:a,message:l}=o;return n(new sh[a](l),i)}case ih:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i)}return n(new sh[s](o),i)};return r},oh=e=>bk(new Map,e)(0),Di="",{toString:wk}={},{keys:xk}=Object,Ts=e=>{const t=typeof e;if(t!=="object"||!e)return[Po,t];const n=wk.call(e).slice(8,-1);switch(n){case"Array":return[Ao,Di];case"Object":return[Ro,Di];case"Date":return[oc,Di];case"RegExp":return[ac,Di];case"Map":return[lc,Di];case"Set":return[cc,Di]}return n.includes("Array")?[Ao,n]:n.includes("Error")?[rh,n]:[Ro,n]},$o=([e,t])=>e===Po&&(t==="function"||t==="symbol"),_k=(e,t,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=Ts(o);switch(a){case Po:{let u=o;switch(l){case"bigint":a=ih,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([nh],o)}return i([a,u],o)}case Ao:{if(l)return i([l,[...o]],o);const u=[],d=i([a,u],o);for(const h of o)u.push(s(h));return d}case Ro:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const u=[],d=i([a,u],o);for(const h of xk(o))(e||!$o(Ts(o[h])))&&u.push([s(h),s(o[h])]);return d}case oc:return i([a,o.toISOString()],o);case ac:{const{source:u,flags:d}=o;return i([a,{source:u,flags:d}],o)}case lc:{const u=[],d=i([a,u],o);for(const[h,f]of o)(e||!($o(Ts(h))||$o(Ts(f))))&&u.push([s(h),s(f)]);return d}case cc:{const u=[],d=i([a,u],o);for(const h of o)(e||!$o(Ts(h)))&&u.push(s(h));return d}}const{message:c}=o;return i([a,{name:l,message:c}],o)};return s},ah=(e,{json:t,lossy:n}={})=>{const r=[];return _k(!(t||n),!!t,new Map,r)(e),r},Mo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?oh(ah(e,t)):structuredClone(e):(e,t)=>oh(ah(e,t));function kk(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Ck(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Ek(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||kk,r=e.options.footnoteBackLabel||Ck,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),h=Li(d.toLowerCase());let f=0;const p=[],m=e.footnoteCounts.get(d);for(;m!==void 0&&++f<=m;){p.length>0&&p.push({type:"text",value:" "});let b=typeof n=="string"?n:n(l,f);typeof b=="string"&&(b={type:"text",value:b}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const b=y.children[y.children.length-1];b&&b.type==="text"?b.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...p)}else u.push(...p);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,v),a.push(v)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Mo(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
34
+ `});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)}function sk(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Gf(n[r])}return t}function Gf(e){const t=e.spread;return t??e.children.length>1}function ok(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function ak(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lk(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ck(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uk(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Wl(t.children[1]),l=gf(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function dk(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const d=t.children[l],h={},f=o?o[l]:void 0;f&&(h.align=f);let p={type:"element",tagName:s,properties:h,children:[]};d&&(p.children=e.all(d),e.patch(d,p),p=e.applyData(d,p)),c.push(p)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function fk(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Yf=9,Qf=32;function hk(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(Xf(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Xf(t.slice(i),i>0,!1)),s.join("")}function Xf(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Yf||s===Qf;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Yf||s===Qf;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function pk(e,t){const n={type:"text",value:hk(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function mk(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const gk={blockquote:W_,break:H_,code:q_,delete:K_,emphasis:J_,footnoteReference:G_,heading:Y_,html:Q_,imageReference:X_,image:ek,inlineCode:tk,linkReference:nk,link:rk,listItem:ik,list:ok,paragraph:ak,root:lk,strong:ck,table:uk,tableCell:fk,tableRow:dk,text:pk,thematicBreak:mk,toml:Io,yaml:Io,definition:Io,footnoteDefinition:Io};function Io(){}const eh=-1,Po=0,Ao=1,Ro=2,ic=3,sc=4,oc=5,ac=6,th=7,nh=8,rh=typeof self=="object"?self:globalThis,yk=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Po:case eh:return n(o,i);case Ao:{const a=n([],i);for(const l of o)a.push(r(l));return a}case Ro:{const a=n({},i);for(const[l,c]of o)a[r(l)]=r(c);return a}case ic:return n(new Date(o),i);case sc:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case oc:{const a=n(new Map,i);for(const[l,c]of o)a.set(r(l),r(c));return a}case ac:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case th:{const{name:a,message:l}=o;return n(new rh[a](l),i)}case nh:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i)}return n(new rh[s](o),i)};return r},ih=e=>yk(new Map,e)(0),Li="",{toString:vk}={},{keys:bk}=Object,Ts=e=>{const t=typeof e;if(t!=="object"||!e)return[Po,t];const n=vk.call(e).slice(8,-1);switch(n){case"Array":return[Ao,Li];case"Object":return[Ro,Li];case"Date":return[ic,Li];case"RegExp":return[sc,Li];case"Map":return[oc,Li];case"Set":return[ac,Li]}return n.includes("Array")?[Ao,n]:n.includes("Error")?[th,n]:[Ro,n]},$o=([e,t])=>e===Po&&(t==="function"||t==="symbol"),wk=(e,t,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=Ts(o);switch(a){case Po:{let u=o;switch(l){case"bigint":a=nh,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([eh],o)}return i([a,u],o)}case Ao:{if(l)return i([l,[...o]],o);const u=[],d=i([a,u],o);for(const h of o)u.push(s(h));return d}case Ro:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const u=[],d=i([a,u],o);for(const h of bk(o))(e||!$o(Ts(o[h])))&&u.push([s(h),s(o[h])]);return d}case ic:return i([a,o.toISOString()],o);case sc:{const{source:u,flags:d}=o;return i([a,{source:u,flags:d}],o)}case oc:{const u=[],d=i([a,u],o);for(const[h,f]of o)(e||!($o(Ts(h))||$o(Ts(f))))&&u.push([s(h),s(f)]);return d}case ac:{const u=[],d=i([a,u],o);for(const h of o)(e||!$o(Ts(h)))&&u.push(s(h));return d}}const{message:c}=o;return i([a,{name:l,message:c}],o)};return s},sh=(e,{json:t,lossy:n}={})=>{const r=[];return wk(!(t||n),!!t,new Map,r)(e),r},Mo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ih(sh(e,t)):structuredClone(e):(e,t)=>ih(sh(e,t));function xk(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function _k(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function kk(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||xk,r=e.options.footnoteBackLabel||_k,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),h=Mi(d.toLowerCase());let f=0;const p=[],m=e.footnoteCounts.get(d);for(;m!==void 0&&++f<=m;){p.length>0&&p.push({type:"text",value:" "});let b=typeof n=="string"?n:n(l,f);typeof b=="string"&&(b={type:"text",value:b}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const b=v.children[v.children.length-1];b&&b.type==="text"?b.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...p)}else u.push(...p);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Mo(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
35
35
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
36
- `}]}}const Lo=function(e){if(e==null)return Ik;if(typeof e=="function")return Do(e);if(typeof e=="object")return Array.isArray(e)?Sk(e):Tk(e);if(typeof e=="string")return Ok(e);throw new Error("Expected function, string, or object as test")};function Sk(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Lo(e[n]);return Do(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function Tk(e){const t=e;return Do(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function Ok(e){return Do(t);function t(n){return n&&n.type===e}}function Do(e){return t;function t(n,r,i){return!!(Pk(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Ik(){return!0}function Pk(e){return e!==null&&typeof e=="object"&&"type"in e}function hF(e){return e}const lh=[],Ak=!0,uc=!1,Rk="skip";function ch(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Lo(i),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=lh,p,m,y;if((!t||s(l,c,u[u.length-1]||void 0))&&(f=$k(n(l,u)),f[0]===uc))return f;if("children"in l&&l.children){const v=l;if(v.children&&f[0]!==Rk)for(m=(r?v.children.length:-1)+o,y=u.concat(v);m>-1&&m<v.children.length;){const b=v.children[m];if(p=a(b,m,y)(),p[0]===uc)return p;m=typeof p[1]=="number"?p[1]:m+o}}return f}}}function $k(e){return Array.isArray(e)?e:typeof e=="number"?[Ak,e]:e==null?lh:[e]}function dc(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),ch(e,s,a,i);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return o(l,d,u)}}const fc={}.hasOwnProperty,Mk={};function Lk(e,t){const n=t||Mk,r=new Map,i=new Map,s=new Map,o={...vk,...n.handlers},a={all:c,applyData:Nk,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:Dk,wrap:Uk};return dc(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),a;function l(u,d){const h=u.type,f=a.handlers[h];if(fc.call(a.handlers,h)&&f)return f(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:m,...y}=u,v=Mo(y);return v.children=a.all(u),v}return Mo(u)}return(a.options.unknownHandler||jk)(a,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let f=-1;for(;++f<h.length;){const p=a.one(h[f],u);if(p){if(f&&h[f-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=uh(p.value)),!Array.isArray(p)&&p.type==="element")){const m=p.children[0];m&&m.type==="text"&&(m.value=uh(m.value))}Array.isArray(p)?d.push(...p):d.push(p)}}}return d}}function Dk(e,t){e.position&&(t.position=R0(e))}function Nk(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,Mo(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function jk(e,t){const n=t.data||{},r="value"in t&&!(fc.call(n,"hProperties")||fc.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Uk(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
36
+ `}]}}const Lo=function(e){if(e==null)return Tk;if(typeof e=="function")return Do(e);if(typeof e=="object")return Array.isArray(e)?Ck(e):Ek(e);if(typeof e=="string")return Sk(e);throw new Error("Expected function, string, or object as test")};function Ck(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Lo(e[n]);return Do(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function Ek(e){const t=e;return Do(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function Sk(e){return Do(t);function t(n){return n&&n.type===e}}function Do(e){return t;function t(n,r,i){return!!(Ok(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Tk(){return!0}function Ok(e){return e!==null&&typeof e=="object"&&"type"in e}function oF(e){return e}const oh=[],Ik=!0,lc=!1,Pk="skip";function ah(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Lo(i),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=oh,p,m,v;if((!t||s(l,c,u[u.length-1]||void 0))&&(f=Ak(n(l,u)),f[0]===lc))return f;if("children"in l&&l.children){const y=l;if(y.children&&f[0]!==Pk)for(m=(r?y.children.length:-1)+o,v=u.concat(y);m>-1&&m<y.children.length;){const b=y.children[m];if(p=a(b,m,v)(),p[0]===lc)return p;m=typeof p[1]=="number"?p[1]:m+o}}return f}}}function Ak(e){return Array.isArray(e)?e:typeof e=="number"?[Ik,e]:e==null?oh:[e]}function cc(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),ah(e,s,a,i);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return o(l,d,u)}}const uc={}.hasOwnProperty,Rk={};function $k(e,t){const n=t||Rk,r=new Map,i=new Map,s=new Map,o={...gk,...n.handlers},a={all:c,applyData:Lk,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:Mk,wrap:Nk};return cc(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),a;function l(u,d){const h=u.type,f=a.handlers[h];if(uc.call(a.handlers,h)&&f)return f(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:m,...v}=u,y=Mo(v);return y.children=a.all(u),y}return Mo(u)}return(a.options.unknownHandler||Dk)(a,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let f=-1;for(;++f<h.length;){const p=a.one(h[f],u);if(p){if(f&&h[f-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=lh(p.value)),!Array.isArray(p)&&p.type==="element")){const m=p.children[0];m&&m.type==="text"&&(m.value=lh(m.value))}Array.isArray(p)?d.push(...p):d.push(p)}}}return d}}function Mk(e,t){e.position&&(t.position=P0(e))}function Lk(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,Mo(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Dk(e,t){const n=t.data||{},r="value"in t&&!(uc.call(n,"hProperties")||uc.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Nk(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
37
37
  `});++r<e.length;)r&&n.push({type:"text",value:`
38
38
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
39
- `}),n}function uh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function dh(e,t){const n=Lk(e,t),r=n.one(e,void 0),i=Ek(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
40
- `},i),s}function Fk(e,t){return e&&"run"in e?async function(n,r){const i=dh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return dh(n,{file:r,...t||e})}}function fh(e){if(e)throw e}var No=Object.prototype.hasOwnProperty,hh=Object.prototype.toString,ph=Object.defineProperty,mh=Object.getOwnPropertyDescriptor,gh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):hh.call(t)==="[object Array]"},yh=function(t){if(!t||hh.call(t)!=="[object Object]")return!1;var n=No.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&No.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||No.call(t,i)},vh=function(t,n){ph&&n.name==="__proto__"?ph(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},bh=function(t,n){if(n==="__proto__")if(No.call(t,n)){if(mh)return mh(t,n).value}else return;return t[n]},Bk=function e(){var t,n,r,i,s,o,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=bh(a,n),i=bh(t,n),a!==i&&(u&&i&&(yh(i)||(s=gh(i)))?(s?(s=!1,o=r&&gh(r)?r:[]):o=r&&yh(r)?r:{},vh(a,{name:n,newValue:e(u,o,i)})):typeof i<"u"&&vh(a,{name:n,newValue:i}));return a};const hc=ai(Bk);function pc(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Vk(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...c){const u=e[++s];let d=-1;if(l){o(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?zk(u,a)(...c):o(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function zk(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l instanceof Promise?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const Yn={basename:Zk,dirname:Wk,extname:Hk,join:qk,sep:"/"};function Zk(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Os(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Wk(e){if(Os(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Hk(e){Os(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function qk(...e){let t=-1,n;for(;++t<e.length;)Os(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Kk(n)}function Kk(e){Os(e);const t=e.codePointAt(0)===47;let n=Jk(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Jk(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function Os(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Gk={cwd:Yk};function Yk(){return"/"}function mc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Qk(e){if(typeof e=="string")e=new URL(e);else if(!mc(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Xk(e)}function Xk(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const gc=["history","path","basename","stem","extname","dirname"];class wh{constructor(t){let n;t?mc(t)?n={path:t}:typeof t=="string"||e1(t)?n={value:t}:n=t:n={},this.cwd=Gk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<gc.length;){const s=gc[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)gc.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Yn.basename(this.path):void 0}set basename(t){vc(t,"basename"),yc(t,"basename"),this.path=Yn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Yn.dirname(this.path):void 0}set dirname(t){xh(this.basename,"dirname"),this.path=Yn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Yn.extname(this.path):void 0}set extname(t){if(yc(t,"extname"),xh(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Yn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){mc(t)&&(t=Qk(t)),vc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Yn.basename(this.path,this.extname):void 0}set stem(t){vc(t,"stem"),yc(t,"stem"),this.path=Yn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new on(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function yc(e,t){if(e&&e.includes(Yn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Yn.sep+"`")}function vc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function xh(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function e1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const t1=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};Object.setPrototypeOf(s,r);const o=Object.getOwnPropertyNames(i);for(const a of o){const l=Object.getOwnPropertyDescriptor(i,a);l&&Object.defineProperty(s,a,l)}return s},n1={}.hasOwnProperty;class bc extends t1{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Vk()}copy(){const t=new bc;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(hc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(_c("data",this.frozen),this.namespace[t]=n,this):n1.call(this.namespace,t)&&this.namespace[t]||void 0:t?(_c("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=jo(t),r=this.parser||this.Parser;return wc("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),wc("process",this.parser||this.Parser),xc("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=jo(t),l=r.parse(a);r.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const f=d,p=r.stringify(f,h);s1(p)?h.value=p:h.result=p,c(u,h)});function c(u,d){u||!d?o(u):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),wc("processSync",this.parser||this.Parser),xc("processSync",this.compiler||this.Compiler),this.process(t,i),kh("processSync","process",n),r;function i(s,o){n=!0,fh(s),r=o}}run(t,n,r){_h(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=jo(n);i.run(t,l,c);function c(u,d,h){const f=d||t;u?a(u):o?o(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),kh("runSync","run",r),i;function s(o,a){fh(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=jo(n),i=this.compiler||this.Compiler;return xc("stringify",i),_h(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(_c("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=hc(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];s(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[f,...p]=u;const m=r[h][1];pc(m)&&pc(f)&&(f=hc(!0,m,f)),r[h]=[c,f,...p]}}}}const r1=new bc().freeze();function wc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function xc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function _c(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _h(e){if(!pc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function kh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function jo(e){return i1(e)?e:new wh(e)}function i1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function s1(e){return typeof e=="string"||o1(e)}function o1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const a1="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ch=[],Eh={allowDangerousHtml:!0},l1=/^(https?|ircs?|mailto|xmpp)$/i,c1=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function u1(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,s=e.components,o=e.disallowedElements,a=e.rehypePlugins||Ch,l=e.remarkPlugins||Ch,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Eh}:Eh,u=e.skipHtml,d=e.unwrapDisallowed,h=e.urlTransform||d1,f=r1().use(H_).use(l).use(Fk,c).use(a),p=new wh;typeof r=="string"&&(p.value=r);for(const b of c1)Object.hasOwn(e,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+a1+b.id,void 0);const m=f.parse(p);let y=f.runSync(m,p);return i&&(y={type:"element",tagName:"div",properties:{className:i},children:y.type==="root"?y.children:[y]}),dc(y,v),j0(y,{Fragment:z.Fragment,components:s,ignoreInvalidStyle:!0,jsx:z.jsx,jsxs:z.jsxs,passKeys:!0,passNode:!0});function v(b,x,I){if(b.type==="raw"&&I&&typeof x=="number")return u?I.children.splice(x,1):I.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let P;for(P in Ql)if(Object.hasOwn(Ql,P)&&Object.hasOwn(b.properties,P)){const T=b.properties[P],j=Ql[P];(j===null||j.includes(b.tagName))&&(b.properties[P]=h(String(T||""),P,b))}}if(b.type==="element"){let P=t?!t.includes(b.tagName):o?o.includes(b.tagName):!1;if(!P&&n&&typeof x=="number"&&(P=!n(b,x,I)),P&&I&&typeof x=="number")return d&&b.children?I.children.splice(x,1,...b.children):I.children.splice(x,1),x}}}function d1(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||l1.test(e.slice(0,t))?e:""}function f1(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Sh(e,t,n){const i=Lo((n||{}).ignore||[]),s=h1(t);let o=-1;for(;++o<s.length;)ch(e,"text",a);function a(c,u){let d=-1,h;for(;++d<u.length;){const f=u[d],p=h?h.children:void 0;if(i(f,p?p.indexOf(f):void 0,h))return;h=f}if(h)return l(c,u)}function l(c,u){const d=u[u.length-1],h=s[o][0],f=s[o][1];let p=0;const y=d.children.indexOf(c);let v=!1,b=[];h.lastIndex=0;let x=h.exec(c.value);for(;x;){const I=x.index,P={index:x.index,input:x.input,stack:[...u,c]};let T=f(...x,P);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?h.lastIndex=I+1:(p!==I&&b.push({type:"text",value:c.value.slice(p,I)}),Array.isArray(T)?b.push(...T):T&&b.push(T),p=I+x[0].length,v=!0),!h.global)break;x=h.exec(c.value)}return v?(p<c.value.length&&b.push({type:"text",value:c.value.slice(p)}),d.children.splice(y,1,...b)):b=[c],y+b.length}}function h1(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([p1(i[0]),m1(i[1])])}return t}function p1(e){return typeof e=="string"?new RegExp(f1(e),"g"):e}function m1(e){return typeof e=="function"?e:function(){return e}}function g1(e){Sh(e,[/\r?\n|\r/g,y1])}function y1(){return{type:"break"}}function v1(){return function(e){g1(e)}}function Th(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const kc="phrasing",Cc=["autolink","link","image","label"];function b1(){return{transforms:[S1],enter:{literalAutolink:x1,literalAutolinkEmail:Ec,literalAutolinkHttp:Ec,literalAutolinkWww:Ec},exit:{literalAutolink:E1,literalAutolinkEmail:C1,literalAutolinkHttp:_1,literalAutolinkWww:k1}}}function w1(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:kc,notInConstruct:Cc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:kc,notInConstruct:Cc},{character:":",before:"[ps]",after:"\\/",inConstruct:kc,notInConstruct:Cc}]}}function x1(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ec(e){this.config.enter.autolinkProtocol.call(this,e)}function _1(e){this.config.exit.autolinkProtocol.call(this,e)}function k1(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function C1(e){this.config.exit.autolinkEmail.call(this,e)}function E1(e){this.exit(e)}function S1(e){Sh(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,T1],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,O1]],{ignore:["link","linkReference"]})}function T1(e,t,n,r,i){let s="";if(!Oh(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!I1(n)))return!1;const o=P1(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function O1(e,t,n,r){return!Oh(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function I1(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function P1(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Th(e,"(");let s=Th(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Oh(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||di(n)||Eo(n))&&(!t||n!==47)}Ih.peek=B1;function A1(){return{enter:{gfmFootnoteDefinition:$1,gfmFootnoteDefinitionLabelString:M1,gfmFootnoteCall:N1,gfmFootnoteCallString:j1},exit:{gfmFootnoteDefinition:D1,gfmFootnoteDefinitionLabelString:L1,gfmFootnoteCall:F1,gfmFootnoteCallString:U1}}}function R1(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:V1,footnoteReference:Ih}}}function $1(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function M1(){this.buffer()}function L1(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Fn(this.sliceSerialize(e)).toLowerCase()}function D1(e){this.exit(e)}function N1(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function j1(){this.buffer()}function U1(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Fn(this.sliceSerialize(e)).toLowerCase()}function F1(e){this.exit(e)}function Ih(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{...i.current(),before:s,after:"]"})),a(),o(),s+=i.move("]"),s}function B1(){return"["}function V1(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteDefinition"),a=n.enter("label");return s+=i.move(n.safe(n.associationId(e),{...i.current(),before:s,after:"]"})),a(),s+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),s+=i.move(n.indentLines(n.containerFlow(e,i.current()),z1)),o(),s}function z1(e,t,n){return t===0?e:(n?"":" ")+e}const Z1=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ph.peek=J1;function W1(){return{canContainEols:["delete"],enter:{strikethrough:q1},exit:{strikethrough:K1}}}function H1(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Z1}],handlers:{delete:Ph}}}function q1(e){this.enter({type:"delete",children:[]},e)}function K1(e){this.exit(e)}function Ph(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function J1(){return"~"}function G1(e,t={}){const n=(t.align||[]).concat(),r=t.stringLength||Q1,i=[],s=[],o=[],a=[];let l=0,c=-1;for(;++c<e.length;){const p=[],m=[];let y=-1;for(e[c].length>l&&(l=e[c].length);++y<e[c].length;){const v=Y1(e[c][y]);if(t.alignDelimiters!==!1){const b=r(v);m[y]=b,(a[y]===void 0||b>a[y])&&(a[y]=b)}p.push(v)}s[c]=p,o[c]=m}let u=-1;if(typeof n=="object"&&"length"in n)for(;++u<l;)i[u]=Ah(n[u]);else{const p=Ah(n);for(;++u<l;)i[u]=p}u=-1;const d=[],h=[];for(;++u<l;){const p=i[u];let m="",y="";p===99?(m=":",y=":"):p===108?m=":":p===114&&(y=":");let v=t.alignDelimiters===!1?1:Math.max(1,a[u]-m.length-y.length);const b=m+"-".repeat(v)+y;t.alignDelimiters!==!1&&(v=m.length+v+y.length,v>a[u]&&(a[u]=v),h[u]=v),d[u]=b}s.splice(1,0,d),o.splice(1,0,h),c=-1;const f=[];for(;++c<s.length;){const p=s[c],m=o[c];u=-1;const y=[];for(;++u<l;){const v=p[u]||"";let b="",x="";if(t.alignDelimiters!==!1){const I=a[u]-(m[u]||0),P=i[u];P===114?b=" ".repeat(I):P===99?I%2?(b=" ".repeat(I/2+.5),x=" ".repeat(I/2-.5)):(b=" ".repeat(I/2),x=b):x=" ".repeat(I)}t.delimiterStart!==!1&&!u&&y.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&v==="")&&(t.delimiterStart!==!1||u)&&y.push(" "),t.alignDelimiters!==!1&&y.push(b),y.push(v),t.alignDelimiters!==!1&&y.push(x),t.padding!==!1&&y.push(" "),(t.delimiterEnd!==!1||u!==l-1)&&y.push("|")}f.push(t.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return f.join(`
41
- `)}function Y1(e){return e==null?"":String(e)}function Q1(e){return e.length}function Ah(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function X1(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),eC);return i(),o}function eC(e,t,n){return">"+(n?"":" ")+e}function tC(e,t){return Rh(e,t.inConstruct,!0)&&!Rh(e,t.notInConstruct,!1)}function Rh(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function $h(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
42
- `&&tC(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
43
- `}function nC(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function rC(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function iC(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function sC(e,t,n,r){const i=iC(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(rC(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(s,oC);return d(),h}const a=n.createTracker(r),l=i.repeat(Math.max(nC(s,i)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const d=n.enter(`codeFencedLang${o}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
39
+ `}),n}function lh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ch(e,t){const n=$k(e,t),r=n.one(e,void 0),i=kk(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
40
+ `},i),s}function jk(e,t){return e&&"run"in e?async function(n,r){const i=ch(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ch(n,{file:r,...t||e})}}function uh(e){if(e)throw e}var No=Object.prototype.hasOwnProperty,dh=Object.prototype.toString,fh=Object.defineProperty,hh=Object.getOwnPropertyDescriptor,ph=function(t){return typeof Array.isArray=="function"?Array.isArray(t):dh.call(t)==="[object Array]"},mh=function(t){if(!t||dh.call(t)!=="[object Object]")return!1;var n=No.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&No.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||No.call(t,i)},gh=function(t,n){fh&&n.name==="__proto__"?fh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},yh=function(t,n){if(n==="__proto__")if(No.call(t,n)){if(hh)return hh(t,n).value}else return;return t[n]},Uk=function e(){var t,n,r,i,s,o,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=yh(a,n),i=yh(t,n),a!==i&&(u&&i&&(mh(i)||(s=ph(i)))?(s?(s=!1,o=r&&ph(r)?r:[]):o=r&&mh(r)?r:{},gh(a,{name:n,newValue:e(u,o,i)})):typeof i<"u"&&gh(a,{name:n,newValue:i}));return a};const dc=ai(Uk);function fc(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Fk(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...c){const u=e[++s];let d=-1;if(l){o(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?Bk(u,a)(...c):o(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Bk(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l instanceof Promise?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const Yn={basename:Vk,dirname:zk,extname:Zk,join:Wk,sep:"/"};function Vk(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Os(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function zk(e){if(Os(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Zk(e){Os(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Wk(...e){let t=-1,n;for(;++t<e.length;)Os(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Hk(n)}function Hk(e){Os(e);const t=e.codePointAt(0)===47;let n=qk(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function qk(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function Os(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Kk={cwd:Jk};function Jk(){return"/"}function hc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Gk(e){if(typeof e=="string")e=new URL(e);else if(!hc(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Yk(e)}function Yk(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const pc=["history","path","basename","stem","extname","dirname"];class vh{constructor(t){let n;t?hc(t)?n={path:t}:typeof t=="string"||Qk(t)?n={value:t}:n=t:n={},this.cwd=Kk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<pc.length;){const s=pc[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)pc.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Yn.basename(this.path):void 0}set basename(t){gc(t,"basename"),mc(t,"basename"),this.path=Yn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Yn.dirname(this.path):void 0}set dirname(t){bh(this.basename,"dirname"),this.path=Yn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Yn.extname(this.path):void 0}set extname(t){if(mc(t,"extname"),bh(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Yn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){hc(t)&&(t=Gk(t)),gc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Yn.basename(this.path,this.extname):void 0}set stem(t){gc(t,"stem"),mc(t,"stem"),this.path=Yn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new on(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function mc(e,t){if(e&&e.includes(Yn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Yn.sep+"`")}function gc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function bh(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Qk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Xk=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};Object.setPrototypeOf(s,r);const o=Object.getOwnPropertyNames(i);for(const a of o){const l=Object.getOwnPropertyDescriptor(i,a);l&&Object.defineProperty(s,a,l)}return s},e1={}.hasOwnProperty;class yc extends Xk{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Fk()}copy(){const t=new yc;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(dc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(wc("data",this.frozen),this.namespace[t]=n,this):e1.call(this.namespace,t)&&this.namespace[t]||void 0:t?(wc("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=jo(t),r=this.parser||this.Parser;return vc("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),vc("process",this.parser||this.Parser),bc("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=jo(t),l=r.parse(a);r.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const f=d,p=r.stringify(f,h);r1(p)?h.value=p:h.result=p,c(u,h)});function c(u,d){u||!d?o(u):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),vc("processSync",this.parser||this.Parser),bc("processSync",this.compiler||this.Compiler),this.process(t,i),xh("processSync","process",n),r;function i(s,o){n=!0,uh(s),r=o}}run(t,n,r){wh(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=jo(n);i.run(t,l,c);function c(u,d,h){const f=d||t;u?a(u):o?o(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),xh("runSync","run",r),i;function s(o,a){uh(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=jo(n),i=this.compiler||this.Compiler;return bc("stringify",i),wh(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(wc("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=dc(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];s(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[f,...p]=u;const m=r[h][1];fc(m)&&fc(f)&&(f=dc(!0,m,f)),r[h]=[c,f,...p]}}}}const t1=new yc().freeze();function vc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function bc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function wc(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function wh(e){if(!fc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function xh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function jo(e){return n1(e)?e:new vh(e)}function n1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function r1(e){return typeof e=="string"||i1(e)}function i1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const s1="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",_h=[],kh={allowDangerousHtml:!0},o1=/^(https?|ircs?|mailto|xmpp)$/i,a1=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function l1(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,s=e.components,o=e.disallowedElements,a=e.rehypePlugins||_h,l=e.remarkPlugins||_h,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...kh}:kh,u=e.skipHtml,d=e.unwrapDisallowed,h=e.urlTransform||c1,f=t1().use(Z_).use(l).use(jk,c).use(a),p=new vh;typeof r=="string"&&(p.value=r);for(const b of a1)Object.hasOwn(e,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+s1+b.id,void 0);const m=f.parse(p);let v=f.runSync(m,p);return i&&(v={type:"element",tagName:"div",properties:{className:i},children:v.type==="root"?v.children:[v]}),cc(v,y),D0(v,{Fragment:F.Fragment,components:s,ignoreInvalidStyle:!0,jsx:F.jsx,jsxs:F.jsxs,passKeys:!0,passNode:!0});function y(b,x,I){if(b.type==="raw"&&I&&typeof x=="number")return u?I.children.splice(x,1):I.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let A;for(A in Gl)if(Object.hasOwn(Gl,A)&&Object.hasOwn(b.properties,A)){const O=b.properties[A],j=Gl[A];(j===null||j.includes(b.tagName))&&(b.properties[A]=h(String(O||""),A,b))}}if(b.type==="element"){let A=t?!t.includes(b.tagName):o?o.includes(b.tagName):!1;if(!A&&n&&typeof x=="number"&&(A=!n(b,x,I)),A&&I&&typeof x=="number")return d&&b.children?I.children.splice(x,1,...b.children):I.children.splice(x,1),x}}}function c1(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||o1.test(e.slice(0,t))?e:""}function u1(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ch(e,t,n){const i=Lo((n||{}).ignore||[]),s=d1(t);let o=-1;for(;++o<s.length;)ah(e,"text",a);function a(c,u){let d=-1,h;for(;++d<u.length;){const f=u[d],p=h?h.children:void 0;if(i(f,p?p.indexOf(f):void 0,h))return;h=f}if(h)return l(c,u)}function l(c,u){const d=u[u.length-1],h=s[o][0],f=s[o][1];let p=0;const v=d.children.indexOf(c);let y=!1,b=[];h.lastIndex=0;let x=h.exec(c.value);for(;x;){const I=x.index,A={index:x.index,input:x.input,stack:[...u,c]};let O=f(...x,A);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?h.lastIndex=I+1:(p!==I&&b.push({type:"text",value:c.value.slice(p,I)}),Array.isArray(O)?b.push(...O):O&&b.push(O),p=I+x[0].length,y=!0),!h.global)break;x=h.exec(c.value)}return y?(p<c.value.length&&b.push({type:"text",value:c.value.slice(p)}),d.children.splice(v,1,...b)):b=[c],v+b.length}}function d1(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([f1(i[0]),h1(i[1])])}return t}function f1(e){return typeof e=="string"?new RegExp(u1(e),"g"):e}function h1(e){return typeof e=="function"?e:function(){return e}}function p1(e){Ch(e,[/\r?\n|\r/g,m1])}function m1(){return{type:"break"}}function g1(){return function(e){p1(e)}}function Eh(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const xc="phrasing",_c=["autolink","link","image","label"];function y1(){return{transforms:[C1],enter:{literalAutolink:b1,literalAutolinkEmail:kc,literalAutolinkHttp:kc,literalAutolinkWww:kc},exit:{literalAutolink:k1,literalAutolinkEmail:_1,literalAutolinkHttp:w1,literalAutolinkWww:x1}}}function v1(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:xc,notInConstruct:_c},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:xc,notInConstruct:_c},{character:":",before:"[ps]",after:"\\/",inConstruct:xc,notInConstruct:_c}]}}function b1(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function kc(e){this.config.enter.autolinkProtocol.call(this,e)}function w1(e){this.config.exit.autolinkProtocol.call(this,e)}function x1(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function _1(e){this.config.exit.autolinkEmail.call(this,e)}function k1(e){this.exit(e)}function C1(e){Ch(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,E1],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,S1]],{ignore:["link","linkReference"]})}function E1(e,t,n,r,i){let s="";if(!Sh(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!T1(n)))return!1;const o=O1(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function S1(e,t,n,r){return!Sh(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function T1(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function O1(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Eh(e,"(");let s=Eh(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Sh(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||di(n)||Eo(n))&&(!t||n!==47)}Th.peek=U1;function I1(){return{enter:{gfmFootnoteDefinition:A1,gfmFootnoteDefinitionLabelString:R1,gfmFootnoteCall:L1,gfmFootnoteCallString:D1},exit:{gfmFootnoteDefinition:M1,gfmFootnoteDefinitionLabelString:$1,gfmFootnoteCall:j1,gfmFootnoteCallString:N1}}}function P1(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:F1,footnoteReference:Th}}}function A1(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function R1(){this.buffer()}function $1(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Fn(this.sliceSerialize(e)).toLowerCase()}function M1(e){this.exit(e)}function L1(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function D1(){this.buffer()}function N1(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Fn(this.sliceSerialize(e)).toLowerCase()}function j1(e){this.exit(e)}function Th(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{...i.current(),before:s,after:"]"})),a(),o(),s+=i.move("]"),s}function U1(){return"["}function F1(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteDefinition"),a=n.enter("label");return s+=i.move(n.safe(n.associationId(e),{...i.current(),before:s,after:"]"})),a(),s+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),s+=i.move(n.indentLines(n.containerFlow(e,i.current()),B1)),o(),s}function B1(e,t,n){return t===0?e:(n?"":" ")+e}const V1=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Oh.peek=q1;function z1(){return{canContainEols:["delete"],enter:{strikethrough:W1},exit:{strikethrough:H1}}}function Z1(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:V1}],handlers:{delete:Oh}}}function W1(e){this.enter({type:"delete",children:[]},e)}function H1(e){this.exit(e)}function Oh(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function q1(){return"~"}function K1(e,t={}){const n=(t.align||[]).concat(),r=t.stringLength||G1,i=[],s=[],o=[],a=[];let l=0,c=-1;for(;++c<e.length;){const p=[],m=[];let v=-1;for(e[c].length>l&&(l=e[c].length);++v<e[c].length;){const y=J1(e[c][v]);if(t.alignDelimiters!==!1){const b=r(y);m[v]=b,(a[v]===void 0||b>a[v])&&(a[v]=b)}p.push(y)}s[c]=p,o[c]=m}let u=-1;if(typeof n=="object"&&"length"in n)for(;++u<l;)i[u]=Ih(n[u]);else{const p=Ih(n);for(;++u<l;)i[u]=p}u=-1;const d=[],h=[];for(;++u<l;){const p=i[u];let m="",v="";p===99?(m=":",v=":"):p===108?m=":":p===114&&(v=":");let y=t.alignDelimiters===!1?1:Math.max(1,a[u]-m.length-v.length);const b=m+"-".repeat(y)+v;t.alignDelimiters!==!1&&(y=m.length+y+v.length,y>a[u]&&(a[u]=y),h[u]=y),d[u]=b}s.splice(1,0,d),o.splice(1,0,h),c=-1;const f=[];for(;++c<s.length;){const p=s[c],m=o[c];u=-1;const v=[];for(;++u<l;){const y=p[u]||"";let b="",x="";if(t.alignDelimiters!==!1){const I=a[u]-(m[u]||0),A=i[u];A===114?b=" ".repeat(I):A===99?I%2?(b=" ".repeat(I/2+.5),x=" ".repeat(I/2-.5)):(b=" ".repeat(I/2),x=b):x=" ".repeat(I)}t.delimiterStart!==!1&&!u&&v.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&y==="")&&(t.delimiterStart!==!1||u)&&v.push(" "),t.alignDelimiters!==!1&&v.push(b),v.push(y),t.alignDelimiters!==!1&&v.push(x),t.padding!==!1&&v.push(" "),(t.delimiterEnd!==!1||u!==l-1)&&v.push("|")}f.push(t.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return f.join(`
41
+ `)}function J1(e){return e==null?"":String(e)}function G1(e){return e.length}function Ih(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Y1(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),Q1);return i(),o}function Q1(e,t,n){return">"+(n?"":" ")+e}function X1(e,t){return Ph(e,t.inConstruct,!0)&&!Ph(e,t.notInConstruct,!1)}function Ph(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Ah(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
42
+ `&&X1(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
43
+ `}function eC(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function tC(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function nC(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function rC(e,t,n,r){const i=nC(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(tC(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(s,iC);return d(),h}const a=n.createTracker(r),l=i.repeat(Math.max(eC(s,i)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const d=n.enter(`codeFencedLang${o}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
44
44
  `,encode:["`"],...a.current()})),d()}return u+=a.move(`
45
45
  `),s&&(u+=a.move(s+`
46
- `)),u+=a.move(l),c(),u}function oC(e,t,n){return(n?"":" ")+e}function Sc(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function aC(e,t,n,r){const i=Sc(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
47
- `,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),o(),c}function lC(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}Mh.peek=cC;function Mh(e,t,n,r){const i=lC(n),s=n.enter("emphasis"),o=n.createTracker(r);let a=o.move(i);return a+=o.move(n.containerPhrasing(e,{before:a,after:i,...o.current()})),a+=o.move(i),s(),a}function cC(e,t,n){return n.options.emphasis||"*"}function uC(e,t){let n=!1;return dc(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,uc}),!!((!e.depth||e.depth<3)&&Xl(e)&&(t.options.setext||n))}function dC(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(uC(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
46
+ `)),u+=a.move(l),c(),u}function iC(e,t,n){return(n?"":" ")+e}function Cc(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function sC(e,t,n,r){const i=Cc(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
47
+ `,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),o(),c}function oC(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}Rh.peek=aC;function Rh(e,t,n,r){const i=oC(n),s=n.enter("emphasis"),o=n.createTracker(r);let a=o.move(i);return a+=o.move(n.containerPhrasing(e,{before:a,after:i,...o.current()})),a+=o.move(i),s(),a}function aC(e,t,n){return n.options.emphasis||"*"}function lC(e,t){let n=!1;return cc(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,lc}),!!((!e.depth||e.depth<3)&&Yl(e)&&(t.options.setext||n))}function cC(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(lC(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
48
48
  `,after:`
49
49
  `});return d(),u(),h+`
50
50
  `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
51
51
  `))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
52
- `,...s.current()});return/^[\t ]/.test(c)&&(c="&#x"+c.charCodeAt(0).toString(16).toUpperCase()+";"+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}Lh.peek=fC;function Lh(e){return e.value||""}function fC(){return"<"}Dh.peek=hC;function Dh(e,t,n,r){const i=Sc(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),o(),c}function hC(){return"!"}Nh.peek=pC;function Nh(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function pC(){return"!"}jh.peek=mC;function jh(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function mC(){return"`"}function Uh(e,t){const n=Xl(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Fh.peek=gC;function Fh(e,t,n,r){const i=Sc(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(Uh(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),a(),n.stack=u,d}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),a(),c}function gC(e,t,n){return Uh(e,n)?"<":"["}Bh.peek=yC;function Bh(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function yC(){return"["}function Tc(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function vC(e){const t=Tc(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function bC(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Vh(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function wC(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?bC(n):Tc(n);const a=e.ordered?o==="."?")":".":vC(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Vh(n)===o&&u){let d=-1;for(;++d<e.children.length;){const h=e.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const c=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),c}function xC(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function _C(e,t,n,r){const i=xC(n);let s=n.bulletCurrent||Tc(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(d,h,f){return h?(f?"":" ".repeat(o))+d:(f?s:s+" ".repeat(o-s.length))+d}}function kC(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const CC=Lo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function EC(e,t,n,r){return(e.children.some(function(o){return CC(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function SC(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}zh.peek=TC;function zh(e,t,n,r){const i=SC(n),s=n.enter("strong"),o=n.createTracker(r);let a=o.move(i+i);return a+=o.move(n.containerPhrasing(e,{before:a,after:i,...o.current()})),a+=o.move(i+i),s(),a}function TC(e,t,n){return n.options.strong||"*"}function OC(e,t,n,r){return n.safe(e.value,r)}function IC(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function PC(e,t,n){const r=(Vh(n)+(n.options.ruleSpaces?" ":"")).repeat(IC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Zh={blockquote:X1,break:$h,code:sC,definition:aC,emphasis:Mh,hardBreak:$h,heading:dC,html:Lh,image:Dh,imageReference:Nh,inlineCode:jh,link:Fh,linkReference:Bh,list:wC,listItem:_C,paragraph:kC,root:EC,strong:zh,text:OC,thematicBreak:PC};function AC(){return{enter:{table:RC,tableData:Wh,tableHeader:Wh,tableRow:MC},exit:{codeText:LC,table:$C,tableData:Oc,tableHeader:Oc,tableRow:Oc}}}function RC(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function $C(e){this.exit(e),this.data.inTable=void 0}function MC(e){this.enter({type:"tableRow",children:[]},e)}function Oc(e){this.exit(e)}function Wh(e){this.enter({type:"tableCell",children:[]},e)}function LC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,DC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function DC(e,t){return t==="|"?t:e}function NC(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
53
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:l,tableRow:a}};function o(f,p,m,y){return c(u(f,m,y),f.align)}function a(f,p,m,y){const v=d(f,m,y),b=c([v]);return b.slice(0,b.indexOf(`
54
- `))}function l(f,p,m,y){const v=m.enter("tableCell"),b=m.enter("phrasing"),x=m.containerPhrasing(f,{...y,before:s,after:s});return b(),v(),x}function c(f,p){return G1(f,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function u(f,p,m){const y=f.children;let v=-1;const b=[],x=p.enter("table");for(;++v<y.length;)b[v]=d(y[v],p,m);return x(),b}function d(f,p,m){const y=f.children;let v=-1;const b=[],x=p.enter("tableRow");for(;++v<y.length;)b[v]=l(y[v],f,p,m);return x(),b}function h(f,p,m){let y=Zh.inlineCode(f,p,m);return m.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function jC(){return{exit:{taskListCheckValueChecked:Hh,taskListCheckValueUnchecked:Hh,paragraph:FC}}}function UC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:BC}}}function Hh(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function FC(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function BC(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=Zh.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+o}}function VC(){return[b1(),A1(),W1(),AC(),jC()]}function zC(e){return{extensions:[w1(),R1(),H1(),NC(e),UC()]}}const ZC={tokenize:GC,partial:!0},qh={tokenize:YC,partial:!0},Kh={tokenize:QC,partial:!0},Jh={tokenize:XC,partial:!0},WC={tokenize:eE,partial:!0},Gh={tokenize:KC,previous:Qh},Yh={tokenize:JC,previous:Xh},pr={tokenize:qC,previous:ep},Qn={};function HC(){return{text:Qn}}let fi=48;for(;fi<123;)Qn[fi]=pr,fi++,fi===58?fi=65:fi===91&&(fi=97);Qn[43]=pr,Qn[45]=pr,Qn[46]=pr,Qn[95]=pr,Qn[72]=[pr,Yh],Qn[104]=[pr,Yh],Qn[87]=[pr,Gh],Qn[119]=[pr,Gh];function qC(e,t,n){const r=this;let i,s;return o;function o(d){return!Ic(d)||!ep.call(r,r.previous)||Pc(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return Ic(d)?(e.consume(d),a):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(WC,u,c)(d):d===45||d===95||an(d)?(s=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return s&&i&&hn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function KC(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!Qh.call(r,r.previous)||Pc(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(ZC,e.attempt(qh,e.attempt(Kh,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function JC(e,t,n){const r=this;let i="",s=!1;return o;function o(d){return(d===72||d===104)&&Xh.call(r,r.previous)&&!Pc(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(hn(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),s?c:(s=!0,l)):n(d)}function c(d){return d===null||Co(d)||vt(d)||di(d)||Eo(d)?n(d):e.attempt(qh,e.attempt(Kh,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function GC(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function YC(e,t,n){let r,i,s;return o;function o(c){return c===46||c===95?e.check(Jh,l,a)(c):c===null||vt(c)||di(c)||c!==45&&Eo(c)?l(c):(s=!0,e.consume(c),o)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),o}function l(c){return i||r||!s?n(c):t(c)}}function QC(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Jh,t,s)(o):o===null||vt(o)||di(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function XC(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||vt(a)||di(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||vt(a)||di(a)?t(a):r(a)}function s(a){return hn(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):hn(a)?(e.consume(a),o):n(a)}}function eE(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return an(s)?n(s):t(s)}}function Qh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||vt(e)}function Xh(e){return!hn(e)}function ep(e){return!(e===47||Ic(e))}function Ic(e){return e===43||e===45||e===46||e===95||an(e)}function Pc(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const tE={tokenize:cE,partial:!0};function nE(){return{document:{91:{tokenize:oE,continuation:{tokenize:aE},exit:lE}},text:{91:{tokenize:sE},93:{add:"after",tokenize:rE,resolveTo:iE}}}}function rE(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const c=Fn(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function iE(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function sE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(s>999||d===93&&!o||d===null||d===91||vt(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Fn(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return vt(d)||(o=!0),s++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),s++,c):c(d)}}function oE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(p)}function u(p){if(o>999||p===93&&!a||p===null||p===91||vt(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return s=Fn(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return vt(p)||(a=!0),o++,e.consume(p),p===92?d:u}function d(p){return p===91||p===92||p===93?(e.consume(p),o++,u):u(p)}function h(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(s)||i.push(s),ct(e,f,"gfmFootnoteDefinitionWhitespace")):n(p)}function f(p){return t(p)}}function aE(e,t,n){return e.check(Es,t,e.attempt(tE,t,n))}function lE(e){e.exit("gfmFootnoteDefinition")}function cE(e,t,n){const r=this;return ct(e,i,"gfmFootnoteDefinitionIndent",4+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function uE(e){let n=(e||{}).singleTilde;const r={tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},d={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},h=[["enter",u,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",d,a]],f=a.parser.constructs.insideSpan.null;f&&Cn(h,h.length,0,To(f,o.slice(c+1,l),a)),Cn(h,h.length,0,[["exit",d,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",u,a]]),Cn(o,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const c=this.previous,u=this.events;let d=0;return h;function h(p){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(p):(o.enter("strikethroughSequenceTemporary"),f(p))}function f(p){const m=So(c);if(p===126)return d>1?l(p):(o.consume(p),d++,f);if(d<2&&!n)return l(p);const y=o.exit("strikethroughSequenceTemporary"),v=So(p);return y._open=!v||v===2&&!!m,y._close=!m||m===2&&!!v,a(p)}}}class dE{constructor(){this.map=[]}add(t,n,r){fE(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let i=r.pop();for(;i;)t.push(...i),i=r.pop();this.map.length=0}}function fE(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function hE(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function pE(){return{flow:{null:{tokenize:mE,resolveAll:gE}}}}function mE(e,t,n){const r=this;let i=0,s=0,o;return a;function a(O){let N=r.events.length-1;for(;N>-1;){const W=r.events[N][1].type;if(W==="lineEnding"||W==="linePrefix")N--;else break}const J=N>-1?r.events[N][1].type:null,q=J==="tableHead"||J==="tableRow"?T:l;return q===T&&r.parser.lazy[r.now().line]?n(O):q(O)}function l(O){return e.enter("tableHead"),e.enter("tableRow"),c(O)}function c(O){return O===124||(o=!0,s+=1),u(O)}function u(O){return O===null?n(O):ze(O)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),f):n(O):st(O)?ct(e,u,"whitespace")(O):(s+=1,o&&(o=!1,i+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),o=!0,u):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||vt(O)?(e.exit("data"),u(O)):(e.consume(O),O===92?h:d)}function h(O){return O===92||O===124?(e.consume(O),d):d(O)}function f(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(O):(e.enter("tableDelimiterRow"),o=!1,st(O)?ct(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):p(O))}function p(O){return O===45||O===58?y(O):O===124?(o=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),m):P(O)}function m(O){return st(O)?ct(e,y,"whitespace")(O):y(O)}function y(O){return O===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),v):O===45?(s+=1,v(O)):O===null||ze(O)?I(O):P(O)}function v(O){return O===45?(e.enter("tableDelimiterFiller"),b(O)):P(O)}function b(O){return O===45?(e.consume(O),b):O===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(O))}function x(O){return st(O)?ct(e,I,"whitespace")(O):I(O)}function I(O){return O===124?p(O):O===null||ze(O)?!o||i!==s?P(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(O)):P(O)}function P(O){return n(O)}function T(O){return e.enter("tableRow"),j(O)}function j(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),j):O===null||ze(O)?(e.exit("tableRow"),t(O)):st(O)?ct(e,j,"whitespace")(O):(e.enter("data"),U(O))}function U(O){return O===null||O===124||vt(O)?(e.exit("data"),j(O)):(e.consume(O),O===92?F:U)}function F(O){return O===92||O===124?(e.consume(O),U):U(O)}}function gE(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,u,d;const h=new dE;for(;++n<e.length;){const f=e[n],p=f[1];f[0]==="enter"?p.type==="tableHead"?(a=!1,l!==0&&(tp(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",c,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,d=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",u,t]])),i=p.type==="tableDelimiterRow"?2:u?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],d=Uo(h,t,s,i,void 0,d),s=[0,0,0,0]),o[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],d=Uo(h,t,s,i,void 0,d)),s=o,o=[s[1],n,0,0])):p.type==="tableHead"?(a=!0,l=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],d=Uo(h,t,s,i,n,d)):o[1]!==0&&(d=Uo(h,t,o,i,n,d)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&tp(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=hE(t.events,n))}return e}function Uo(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Ni(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Ni(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=Ni(t.events,n[2]),u=Ni(t.events,n[3]),d={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,m=n[3]-n[2]-1;e.add(p,m,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(s.end=Object.assign({},Ni(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function tp(e,t,n,r,i){const s=[],o=Ni(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Ni(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const yE={tokenize:bE};function vE(){return{text:{91:yE}}}function bE(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return vt(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return ze(l)?t(l):st(l)?e.check({tokenize:wE},t,n)(l):n(l)}}function wE(e,t,n){return ct(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function xE(e){return Pf([HC(),nE(),uE(e),pE(),vE()])}const _E={};function kE(e){const t=this,n=e||_E,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(xE(n)),s.push(VC()),o.push(zC(n))}const CE=({text:e,type:t,styles:n})=>{const r=n==null?void 0:n[t],i={h1:({node:s,...o})=>z.jsx("h1",{...o,...r==null?void 0:r.heading1}),h2:({node:s,...o})=>z.jsx("h2",{...o,...r==null?void 0:r.heading2}),h3:({node:s,...o})=>z.jsx("h3",{...o,...r==null?void 0:r.heading3}),h4:"h3",h5:"h3",h6:"h3",em:({node:s,...o})=>z.jsx("em",{...o,...r==null?void 0:r.italic}),strong:({node:s,...o})=>z.jsx("strong",{...o,...r==null?void 0:r.bold}),p:({node:s,...o})=>z.jsx("p",{...o,...r==null?void 0:r.text}),hr:({node:s,...o})=>z.jsx("hr",{...o,...r==null?void 0:r.horizontalRule}),a:({node:s,...o})=>z.jsx("a",{...o,...r==null?void 0:r.link}),ol:({node:s,...o})=>z.jsx("ol",{...o,...r==null?void 0:r.orderedList}),ul:({node:s,...o})=>z.jsx("ul",{...o,...r==null?void 0:r.unorderedList}),li:({node:s,...o})=>z.jsx("li",{...o,...r==null?void 0:r.listItem}),br:({node:s,...o})=>z.jsx("br",{...o,...r==null?void 0:r.lineBreak}),img:()=>null,pre:({node:s,...o})=>z.jsx("pre",{...o,...r==null?void 0:r.pre})};return z.jsx(u1,{components:i,remarkPlugins:[kE,v1],children:e})},np=_.createContext(null);function rp(){const e=_.useContext(np);if(!e)throw new Error("useComposerContext must be used within a Message");return e}const ip=_.createContext(null);function EE(){const e=_.useContext(ip);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const sp=_.createContext(null);function op(){const e=_.useContext(sp);if(!e)throw new Error("useModalContext must be used within a ModalProvider");return e}const ap=_.createContext(null);function mt(){const e=_.useContext(ap);if(!e)throw new Error("useWebchatContext must be used within a WebchatProvider");return e}const SE=({text:e,buttonValue:t,type:n,styles:r,variant:i,groupId:s,reusable:o,...a})=>{const{eventEmitter:l,client:c}=mt(),[u,d]=_.useState(!1),[h,f]=_.useState(!1),[p,m]=_.useState(!1),{state:y}=mt();_.useEffect(()=>{if(s)return l.on(`button-group-${s}-click`,()=>{f(!0),o||m(!0)})},[l,s,o]);function v(){s&&l.emit(`button-group-${s}-click`),d(!0),o||m(!0),i!=="link"&&(c==null||c.sendMessage(t))}return z.jsx(TE,{...a,variant:i,onClick:v,disabled:p||y.isReadOnly,"data-activated":u?"":void 0,"data-group-activated":h?"":void 0,"data-type":i,value:t,...r==null?void 0:r[n],children:e})},TE=e=>{if(e.variant==="link"){const{value:r,variant:i,...s}=e;return z.jsx("a",{...s,href:r,target:"_blank",rel:"noopener noreferrer"})}const{variant:t,...n}=e;return z.jsx("button",{...n})},OE=_.forwardRef(({block:e,styles:t,type:n,...r},i)=>z.jsx("div",{...r,...t==null?void 0:t[n],ref:i,children:z.jsx(Wi,{styles:t,block:e})}));function IE(e,t){const n=t?`The ${t} has been copied to your clipboard.`:"Copied to clipboard.";return navigator.clipboard.writeText(e).then(()=>WS({title:n,type:"success"}))}const PE=(e,t={})=>new Promise((n,r)=>{if(typeof window>"u")return r("Window is not defined");if(!e)return r("Url is not defined");let i=null;const s=new Image;s.addEventListener("load",()=>{i&&clearTimeout(i),n({width:s.naturalWidth,height:s.naturalHeight})}),s.addEventListener("error",o=>{i&&clearTimeout(i),r(`${o.type}: ${o.message}`)}),s.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});let AE={data:""},RE=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||AE,$E=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ME=/\/\*[^]*?\*\/| +/g,lp=/\n+/g,Nr=(e,t)=>{let n="",r="",i="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":r+=s[1]=="f"?Nr(o,s):s+"{"+Nr(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=Nr(o,t?t.replace(/([^,])+/g,a=>s.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=Nr.p?Nr.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},mr={},cp=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+cp(e[n]);return t}return e},LE=(e,t,n,r,i)=>{let s=cp(e),o=mr[s]||(mr[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!mr[o]){let l=s!==e?e:(c=>{let u,d,h=[{}];for(;u=$E.exec(c.replace(ME,""));)u[4]?h.shift():u[3]?(d=u[3].replace(lp," ").trim(),h.unshift(h[0][d]=h[0][d]||{})):h[0][u[1]]=u[2].replace(lp," ").trim();return h[0]})(e);mr[o]=Nr(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&mr.g?mr.g:null;return n&&(mr.g=mr[o]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(mr[o],t,r,a),o},DE=(e,t,n)=>e.reduce((r,i,s)=>{let o=t[s];if(o&&o.call){let a=o(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":Nr(a,""):a===!1?"":a}return r+i+(o??"")},"");function Fo(e){let t=this||{},n=e.call?e(t.p):e;return LE(n.unshift?n.raw?DE(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,RE(t.target),t.g,t.o,t.k)}let up,Ac,Rc;Fo.bind({g:1});let gr=Fo.bind({k:1});function NE(e,t,n,r){Nr.p=t,up=e,Ac=n,Rc=r}function jr(e,t){let n=this||{};return function(){let r=arguments;function i(s,o){let a=Object.assign({},s),l=a.className||i.className;n.p=Object.assign({theme:Ac&&Ac()},a),n.o=/ *go\d+/.test(l),a.className=Fo.apply(n,r)+(l?" "+l:""),t&&(a.ref=o);let c=e;return e[0]&&(c=a.as||e,delete a.as),Rc&&c[0]&&Rc(a),up(c,a)}return t?t(i):i}}var jE=e=>typeof e=="function",Bo=(e,t)=>jE(e)?e(t):e,UE=(()=>{let e=0;return()=>(++e).toString()})(),dp=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),FE=20,Vo=new Map,BE=1e3,fp=e=>{if(Vo.has(e))return;let t=setTimeout(()=>{Vo.delete(e),hi({type:4,toastId:e})},BE);Vo.set(e,t)},VE=e=>{let t=Vo.get(e);t&&clearTimeout(t)},$c=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,FE)};case 1:return t.toast.id&&VE(t.toast.id),{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return e.toasts.find(s=>s.id===n.id)?$c(e,{type:1,toast:n}):$c(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?fp(r):e.toasts.forEach(s=>{fp(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===r||r===void 0?{...s,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},zo=[],Zo={toasts:[],pausedAt:void 0},hi=e=>{Zo=$c(Zo,e),zo.forEach(t=>{t(Zo)})},zE={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},ZE=(e={})=>{let[t,n]=_.useState(Zo);_.useEffect(()=>(zo.push(n),()=>{let i=zo.indexOf(n);i>-1&&zo.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var s,o;return{...e,...e[i.type],...i,duration:i.duration||((s=e[i.type])==null?void 0:s.duration)||(e==null?void 0:e.duration)||zE[i.type],style:{...e.style,...(o=e[i.type])==null?void 0:o.style,...i.style}}});return{...t,toasts:r}},WE=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||UE()}),Is=e=>(t,n)=>{let r=WE(t,e,n);return hi({type:2,toast:r}),r.id},vn=(e,t)=>Is("blank")(e,t);vn.error=Is("error"),vn.success=Is("success"),vn.loading=Is("loading"),vn.custom=Is("custom"),vn.dismiss=e=>{hi({type:3,toastId:e})},vn.remove=e=>hi({type:4,toastId:e}),vn.promise=(e,t,n)=>{let r=vn.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(vn.success(Bo(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{vn.error(Bo(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var HE=(e,t)=>{hi({type:1,toast:{id:e,height:t}})},qE=()=>{hi({type:5,time:Date.now()})},KE=e=>{let{toasts:t,pausedAt:n}=ZE(e);_.useEffect(()=>{if(n)return;let s=Date.now(),o=t.map(a=>{if(a.duration===1/0)return;let l=(a.duration||0)+a.pauseDuration-(s-a.createdAt);if(l<0){a.visible&&vn.dismiss(a.id);return}return setTimeout(()=>vn.dismiss(a.id),l)});return()=>{o.forEach(a=>a&&clearTimeout(a))}},[t,n]);let r=_.useCallback(()=>{n&&hi({type:6,time:Date.now()})},[n]),i=_.useCallback((s,o)=>{let{reverseOrder:a=!1,gutter:l=8,defaultPosition:c}=o||{},u=t.filter(f=>(f.position||c)===(s.position||c)&&f.height),d=u.findIndex(f=>f.id===s.id),h=u.filter((f,p)=>p<d&&f.visible).length;return u.filter(f=>f.visible).slice(...a?[h+1]:[0,h]).reduce((f,p)=>f+(p.height||0)+l,0)},[t]);return{toasts:t,handlers:{updateHeight:HE,startPause:qE,endPause:r,calculateOffset:i}}},JE=gr`
52
+ `,...s.current()});return/^[\t ]/.test(c)&&(c="&#x"+c.charCodeAt(0).toString(16).toUpperCase()+";"+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}$h.peek=uC;function $h(e){return e.value||""}function uC(){return"<"}Mh.peek=dC;function Mh(e,t,n,r){const i=Cc(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),o(),c}function dC(){return"!"}Lh.peek=fC;function Lh(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function fC(){return"!"}Dh.peek=hC;function Dh(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function hC(){return"`"}function Nh(e,t){const n=Yl(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}jh.peek=pC;function jh(e,t,n,r){const i=Cc(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(Nh(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),a(),n.stack=u,d}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),a(),c}function pC(e,t,n){return Nh(e,n)?"<":"["}Uh.peek=mC;function Uh(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function mC(){return"["}function Ec(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function gC(e){const t=Ec(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function yC(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Fh(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function vC(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?yC(n):Ec(n);const a=e.ordered?o==="."?")":".":gC(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Fh(n)===o&&u){let d=-1;for(;++d<e.children.length;){const h=e.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const c=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),c}function bC(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function wC(e,t,n,r){const i=bC(n);let s=n.bulletCurrent||Ec(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(d,h,f){return h?(f?"":" ".repeat(o))+d:(f?s:s+" ".repeat(o-s.length))+d}}function xC(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const _C=Lo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function kC(e,t,n,r){return(e.children.some(function(o){return _C(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function CC(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Bh.peek=EC;function Bh(e,t,n,r){const i=CC(n),s=n.enter("strong"),o=n.createTracker(r);let a=o.move(i+i);return a+=o.move(n.containerPhrasing(e,{before:a,after:i,...o.current()})),a+=o.move(i+i),s(),a}function EC(e,t,n){return n.options.strong||"*"}function SC(e,t,n,r){return n.safe(e.value,r)}function TC(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function OC(e,t,n){const r=(Fh(n)+(n.options.ruleSpaces?" ":"")).repeat(TC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Vh={blockquote:Y1,break:Ah,code:rC,definition:sC,emphasis:Rh,hardBreak:Ah,heading:cC,html:$h,image:Mh,imageReference:Lh,inlineCode:Dh,link:jh,linkReference:Uh,list:vC,listItem:wC,paragraph:xC,root:kC,strong:Bh,text:SC,thematicBreak:OC};function IC(){return{enter:{table:PC,tableData:zh,tableHeader:zh,tableRow:RC},exit:{codeText:$C,table:AC,tableData:Sc,tableHeader:Sc,tableRow:Sc}}}function PC(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function AC(e){this.exit(e),this.data.inTable=void 0}function RC(e){this.enter({type:"tableRow",children:[]},e)}function Sc(e){this.exit(e)}function zh(e){this.enter({type:"tableCell",children:[]},e)}function $C(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,MC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function MC(e,t){return t==="|"?t:e}function LC(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
53
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:l,tableRow:a}};function o(f,p,m,v){return c(u(f,m,v),f.align)}function a(f,p,m,v){const y=d(f,m,v),b=c([y]);return b.slice(0,b.indexOf(`
54
+ `))}function l(f,p,m,v){const y=m.enter("tableCell"),b=m.enter("phrasing"),x=m.containerPhrasing(f,{...v,before:s,after:s});return b(),y(),x}function c(f,p){return K1(f,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function u(f,p,m){const v=f.children;let y=-1;const b=[],x=p.enter("table");for(;++y<v.length;)b[y]=d(v[y],p,m);return x(),b}function d(f,p,m){const v=f.children;let y=-1;const b=[],x=p.enter("tableRow");for(;++y<v.length;)b[y]=l(v[y],f,p,m);return x(),b}function h(f,p,m){let v=Vh.inlineCode(f,p,m);return m.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function DC(){return{exit:{taskListCheckValueChecked:Zh,taskListCheckValueUnchecked:Zh,paragraph:jC}}}function NC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:UC}}}function Zh(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function jC(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function UC(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=Vh.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+o}}function FC(){return[y1(),I1(),z1(),IC(),DC()]}function BC(e){return{extensions:[v1(),P1(),Z1(),LC(e),NC()]}}const VC={tokenize:KC,partial:!0},Wh={tokenize:JC,partial:!0},Hh={tokenize:GC,partial:!0},qh={tokenize:YC,partial:!0},zC={tokenize:QC,partial:!0},Kh={tokenize:HC,previous:Gh},Jh={tokenize:qC,previous:Yh},pr={tokenize:WC,previous:Qh},Qn={};function ZC(){return{text:Qn}}let fi=48;for(;fi<123;)Qn[fi]=pr,fi++,fi===58?fi=65:fi===91&&(fi=97);Qn[43]=pr,Qn[45]=pr,Qn[46]=pr,Qn[95]=pr,Qn[72]=[pr,Jh],Qn[104]=[pr,Jh],Qn[87]=[pr,Kh],Qn[119]=[pr,Kh];function WC(e,t,n){const r=this;let i,s;return o;function o(d){return!Tc(d)||!Qh.call(r,r.previous)||Oc(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return Tc(d)?(e.consume(d),a):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(zC,u,c)(d):d===45||d===95||an(d)?(s=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return s&&i&&hn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function HC(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!Gh.call(r,r.previous)||Oc(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(VC,e.attempt(Wh,e.attempt(Hh,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function qC(e,t,n){const r=this;let i="",s=!1;return o;function o(d){return(d===72||d===104)&&Yh.call(r,r.previous)&&!Oc(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(hn(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),s?c:(s=!0,l)):n(d)}function c(d){return d===null||Co(d)||yt(d)||di(d)||Eo(d)?n(d):e.attempt(Wh,e.attempt(Hh,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function KC(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function JC(e,t,n){let r,i,s;return o;function o(c){return c===46||c===95?e.check(qh,l,a)(c):c===null||yt(c)||di(c)||c!==45&&Eo(c)?l(c):(s=!0,e.consume(c),o)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),o}function l(c){return i||r||!s?n(c):t(c)}}function GC(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(qh,t,s)(o):o===null||yt(o)||di(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function YC(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||yt(a)||di(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||yt(a)||di(a)?t(a):r(a)}function s(a){return hn(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):hn(a)?(e.consume(a),o):n(a)}}function QC(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return an(s)?n(s):t(s)}}function Gh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function Yh(e){return!hn(e)}function Qh(e){return!(e===47||Tc(e))}function Tc(e){return e===43||e===45||e===46||e===95||an(e)}function Oc(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const XC={tokenize:aE,partial:!0};function eE(){return{document:{91:{tokenize:iE,continuation:{tokenize:sE},exit:oE}},text:{91:{tokenize:rE},93:{add:"after",tokenize:tE,resolveTo:nE}}}}function tE(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const c=Fn(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function nE(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function rE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(s>999||d===93&&!o||d===null||d===91||yt(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Fn(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return yt(d)||(o=!0),s++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),s++,c):c(d)}}function iE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(p)}function u(p){if(o>999||p===93&&!a||p===null||p===91||yt(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return s=Fn(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return yt(p)||(a=!0),o++,e.consume(p),p===92?d:u}function d(p){return p===91||p===92||p===93?(e.consume(p),o++,u):u(p)}function h(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(s)||i.push(s),ct(e,f,"gfmFootnoteDefinitionWhitespace")):n(p)}function f(p){return t(p)}}function sE(e,t,n){return e.check(Es,t,e.attempt(XC,t,n))}function oE(e){e.exit("gfmFootnoteDefinition")}function aE(e,t,n){const r=this;return ct(e,i,"gfmFootnoteDefinitionIndent",4+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function lE(e){let n=(e||{}).singleTilde;const r={tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},d={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},h=[["enter",u,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",d,a]],f=a.parser.constructs.insideSpan.null;f&&Cn(h,h.length,0,To(f,o.slice(c+1,l),a)),Cn(h,h.length,0,[["exit",d,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",u,a]]),Cn(o,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const c=this.previous,u=this.events;let d=0;return h;function h(p){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(p):(o.enter("strikethroughSequenceTemporary"),f(p))}function f(p){const m=So(c);if(p===126)return d>1?l(p):(o.consume(p),d++,f);if(d<2&&!n)return l(p);const v=o.exit("strikethroughSequenceTemporary"),y=So(p);return v._open=!y||y===2&&!!m,v._close=!m||m===2&&!!y,a(p)}}}class cE{constructor(){this.map=[]}add(t,n,r){uE(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let i=r.pop();for(;i;)t.push(...i),i=r.pop();this.map.length=0}}function uE(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function dE(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function fE(){return{flow:{null:{tokenize:hE,resolveAll:pE}}}}function hE(e,t,n){const r=this;let i=0,s=0,o;return a;function a(T){let N=r.events.length-1;for(;N>-1;){const q=r.events[N][1].type;if(q==="lineEnding"||q==="linePrefix")N--;else break}const G=N>-1?r.events[N][1].type:null,W=G==="tableHead"||G==="tableRow"?O:l;return W===O&&r.parser.lazy[r.now().line]?n(T):W(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),c(T)}function c(T){return T===124||(o=!0,s+=1),u(T)}function u(T){return T===null?n(T):Ve(T)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),f):n(T):st(T)?ct(e,u,"whitespace")(T):(s+=1,o&&(o=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,u):(e.enter("data"),d(T)))}function d(T){return T===null||T===124||yt(T)?(e.exit("data"),u(T)):(e.consume(T),T===92?h:d)}function h(T){return T===92||T===124?(e.consume(T),d):d(T)}function f(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,st(T)?ct(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):p(T))}function p(T){return T===45||T===58?v(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),m):A(T)}function m(T){return st(T)?ct(e,v,"whitespace")(T):v(T)}function v(T){return T===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(s+=1,y(T)):T===null||Ve(T)?I(T):A(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),b(T)):A(T)}function b(T){return T===45?(e.consume(T),b):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(T))}function x(T){return st(T)?ct(e,I,"whitespace")(T):I(T)}function I(T){return T===124?p(T):T===null||Ve(T)?!o||i!==s?A(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):A(T)}function A(T){return n(T)}function O(T){return e.enter("tableRow"),j(T)}function j(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),j):T===null||Ve(T)?(e.exit("tableRow"),t(T)):st(T)?ct(e,j,"whitespace")(T):(e.enter("data"),U(T))}function U(T){return T===null||T===124||yt(T)?(e.exit("data"),j(T)):(e.consume(T),T===92?H:U)}function H(T){return T===92||T===124?(e.consume(T),U):U(T)}}function pE(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,u,d;const h=new cE;for(;++n<e.length;){const f=e[n],p=f[1];f[0]==="enter"?p.type==="tableHead"?(a=!1,l!==0&&(Xh(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",c,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,d=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",u,t]])),i=p.type==="tableDelimiterRow"?2:u?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],d=Uo(h,t,s,i,void 0,d),s=[0,0,0,0]),o[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],d=Uo(h,t,s,i,void 0,d)),s=o,o=[s[1],n,0,0])):p.type==="tableHead"?(a=!0,l=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],d=Uo(h,t,s,i,n,d)):o[1]!==0&&(d=Uo(h,t,o,i,n,d)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&Xh(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=dE(t.events,n))}return e}function Uo(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Di(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Di(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=Di(t.events,n[2]),u=Di(t.events,n[3]),d={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,m=n[3]-n[2]-1;e.add(p,m,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(s.end=Object.assign({},Di(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function Xh(e,t,n,r,i){const s=[],o=Di(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Di(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const mE={tokenize:yE};function gE(){return{text:{91:mE}}}function yE(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return yt(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return Ve(l)?t(l):st(l)?e.check({tokenize:vE},t,n)(l):n(l)}}function vE(e,t,n){return ct(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function bE(e){return Of([ZC(),eE(),lE(e),fE(),gE()])}const wE={};function xE(e){const t=this,n=e||wE,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(bE(n)),s.push(FC()),o.push(BC(n))}const _E=({text:e,type:t,styles:n})=>{const r=n==null?void 0:n[t],i={h1:({node:s,...o})=>F.jsx("h1",{...o,...r==null?void 0:r.heading1}),h2:({node:s,...o})=>F.jsx("h2",{...o,...r==null?void 0:r.heading2}),h3:({node:s,...o})=>F.jsx("h3",{...o,...r==null?void 0:r.heading3}),h4:"h3",h5:"h3",h6:"h3",em:({node:s,...o})=>F.jsx("em",{...o,...r==null?void 0:r.italic}),strong:({node:s,...o})=>F.jsx("strong",{...o,...r==null?void 0:r.bold}),p:({node:s,...o})=>F.jsx("p",{...o,...r==null?void 0:r.text}),hr:({node:s,...o})=>F.jsx("hr",{...o,...r==null?void 0:r.horizontalRule}),a:({node:s,...o})=>F.jsx("a",{...o,...r==null?void 0:r.link}),ol:({node:s,...o})=>F.jsx("ol",{...o,...r==null?void 0:r.orderedList}),ul:({node:s,...o})=>F.jsx("ul",{...o,...r==null?void 0:r.unorderedList}),li:({node:s,...o})=>F.jsx("li",{...o,...r==null?void 0:r.listItem}),br:({node:s,...o})=>F.jsx("br",{...o,...r==null?void 0:r.lineBreak}),img:()=>null,pre:({node:s,...o})=>F.jsx("pre",{...o,...r==null?void 0:r.pre})};return F.jsx(l1,{components:i,remarkPlugins:[xE,g1],children:e})},ep=_.createContext(null);function tp(){const e=_.useContext(ep);if(!e)throw new Error("useComposerContext must be used within a Message");return e}const np=_.createContext(null);function kE(){const e=_.useContext(np);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const rp=_.createContext(null);function ip(){const e=_.useContext(rp);if(!e)throw new Error("useModalContext must be used within a ModalProvider");return e}const sp=_.createContext(null);function vt(){const e=_.useContext(sp);if(!e)throw new Error("useWebchatContext must be used within a WebchatProvider");return e}const CE=({text:e,buttonValue:t,type:n,styles:r,variant:i,groupId:s,reusable:o,...a})=>{const{eventEmitter:l,client:c}=vt(),[u,d]=_.useState(!1),[h,f]=_.useState(!1),[p,m]=_.useState(!1),{state:v}=vt();_.useEffect(()=>{if(s)return l.on(`button-group-${s}-click`,()=>{f(!0),o||m(!0)})},[l,s,o]);function y(){s&&l.emit(`button-group-${s}-click`),d(!0),o||m(!0),i!=="link"&&(c==null||c.sendMessage(t))}return F.jsx(EE,{...a,variant:i,onClick:y,disabled:p||v.isReadOnly,"data-activated":u?"":void 0,"data-group-activated":h?"":void 0,"data-type":i,value:t,...r==null?void 0:r[n],children:e})},EE=e=>{if(e.variant==="link"){const{value:r,variant:i,...s}=e;return F.jsx("a",{...s,href:r,target:"_blank",rel:"noopener noreferrer"})}const{variant:t,...n}=e;return F.jsx("button",{...n})},SE=_.forwardRef(({block:e,styles:t,type:n,...r},i)=>F.jsx("div",{...r,...t==null?void 0:t[n],ref:i,children:F.jsx(Wi,{styles:t,block:e})}));function TE(e,t){const n=t?`The ${t} has been copied to your clipboard.`:"Copied to clipboard.";return navigator.clipboard.writeText(e).then(()=>zS({title:n,type:"success"}))}const OE=(e,t={})=>new Promise((n,r)=>{if(typeof window>"u")return r("Window is not defined");if(!e)return r("Url is not defined");let i=null;const s=new Image;s.addEventListener("load",()=>{i&&clearTimeout(i),n({width:s.naturalWidth,height:s.naturalHeight})}),s.addEventListener("error",o=>{i&&clearTimeout(i),r(`${o.type}: ${o.message}`)}),s.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});let IE={data:""},PE=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||IE,AE=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,RE=/\/\*[^]*?\*\/| +/g,op=/\n+/g,Nr=(e,t)=>{let n="",r="",i="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":r+=s[1]=="f"?Nr(o,s):s+"{"+Nr(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=Nr(o,t?t.replace(/([^,])+/g,a=>s.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=Nr.p?Nr.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},mr={},ap=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+ap(e[n]);return t}return e},$E=(e,t,n,r,i)=>{let s=ap(e),o=mr[s]||(mr[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!mr[o]){let l=s!==e?e:(c=>{let u,d,h=[{}];for(;u=AE.exec(c.replace(RE,""));)u[4]?h.shift():u[3]?(d=u[3].replace(op," ").trim(),h.unshift(h[0][d]=h[0][d]||{})):h[0][u[1]]=u[2].replace(op," ").trim();return h[0]})(e);mr[o]=Nr(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&mr.g?mr.g:null;return n&&(mr.g=mr[o]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(mr[o],t,r,a),o},ME=(e,t,n)=>e.reduce((r,i,s)=>{let o=t[s];if(o&&o.call){let a=o(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":Nr(a,""):a===!1?"":a}return r+i+(o??"")},"");function Fo(e){let t=this||{},n=e.call?e(t.p):e;return $E(n.unshift?n.raw?ME(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,PE(t.target),t.g,t.o,t.k)}let lp,Ic,Pc;Fo.bind({g:1});let gr=Fo.bind({k:1});function LE(e,t,n,r){Nr.p=t,lp=e,Ic=n,Pc=r}function jr(e,t){let n=this||{};return function(){let r=arguments;function i(s,o){let a=Object.assign({},s),l=a.className||i.className;n.p=Object.assign({theme:Ic&&Ic()},a),n.o=/ *go\d+/.test(l),a.className=Fo.apply(n,r)+(l?" "+l:""),t&&(a.ref=o);let c=e;return e[0]&&(c=a.as||e,delete a.as),Pc&&c[0]&&Pc(a),lp(c,a)}return t?t(i):i}}var DE=e=>typeof e=="function",Bo=(e,t)=>DE(e)?e(t):e,NE=(()=>{let e=0;return()=>(++e).toString()})(),cp=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),jE=20,Vo=new Map,UE=1e3,up=e=>{if(Vo.has(e))return;let t=setTimeout(()=>{Vo.delete(e),hi({type:4,toastId:e})},UE);Vo.set(e,t)},FE=e=>{let t=Vo.get(e);t&&clearTimeout(t)},Ac=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,jE)};case 1:return t.toast.id&&FE(t.toast.id),{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return e.toasts.find(s=>s.id===n.id)?Ac(e,{type:1,toast:n}):Ac(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?up(r):e.toasts.forEach(s=>{up(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===r||r===void 0?{...s,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},zo=[],Zo={toasts:[],pausedAt:void 0},hi=e=>{Zo=Ac(Zo,e),zo.forEach(t=>{t(Zo)})},BE={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},VE=(e={})=>{let[t,n]=_.useState(Zo);_.useEffect(()=>(zo.push(n),()=>{let i=zo.indexOf(n);i>-1&&zo.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var s,o;return{...e,...e[i.type],...i,duration:i.duration||((s=e[i.type])==null?void 0:s.duration)||(e==null?void 0:e.duration)||BE[i.type],style:{...e.style,...(o=e[i.type])==null?void 0:o.style,...i.style}}});return{...t,toasts:r}},zE=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||NE()}),Is=e=>(t,n)=>{let r=zE(t,e,n);return hi({type:2,toast:r}),r.id},vn=(e,t)=>Is("blank")(e,t);vn.error=Is("error"),vn.success=Is("success"),vn.loading=Is("loading"),vn.custom=Is("custom"),vn.dismiss=e=>{hi({type:3,toastId:e})},vn.remove=e=>hi({type:4,toastId:e}),vn.promise=(e,t,n)=>{let r=vn.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(vn.success(Bo(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{vn.error(Bo(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var ZE=(e,t)=>{hi({type:1,toast:{id:e,height:t}})},WE=()=>{hi({type:5,time:Date.now()})},HE=e=>{let{toasts:t,pausedAt:n}=VE(e);_.useEffect(()=>{if(n)return;let s=Date.now(),o=t.map(a=>{if(a.duration===1/0)return;let l=(a.duration||0)+a.pauseDuration-(s-a.createdAt);if(l<0){a.visible&&vn.dismiss(a.id);return}return setTimeout(()=>vn.dismiss(a.id),l)});return()=>{o.forEach(a=>a&&clearTimeout(a))}},[t,n]);let r=_.useCallback(()=>{n&&hi({type:6,time:Date.now()})},[n]),i=_.useCallback((s,o)=>{let{reverseOrder:a=!1,gutter:l=8,defaultPosition:c}=o||{},u=t.filter(f=>(f.position||c)===(s.position||c)&&f.height),d=u.findIndex(f=>f.id===s.id),h=u.filter((f,p)=>p<d&&f.visible).length;return u.filter(f=>f.visible).slice(...a?[h+1]:[0,h]).reduce((f,p)=>f+(p.height||0)+l,0)},[t]);return{toasts:t,handlers:{updateHeight:ZE,startPause:WE,endPause:r,calculateOffset:i}}},qE=gr`
55
55
  from {
56
56
  transform: scale(0) rotate(45deg);
57
57
  opacity: 0;
@@ -59,7 +59,7 @@ from {
59
59
  to {
60
60
  transform: scale(1) rotate(45deg);
61
61
  opacity: 1;
62
- }`,GE=gr`
62
+ }`,KE=gr`
63
63
  from {
64
64
  transform: scale(0);
65
65
  opacity: 0;
@@ -67,7 +67,7 @@ from {
67
67
  to {
68
68
  transform: scale(1);
69
69
  opacity: 1;
70
- }`,YE=gr`
70
+ }`,JE=gr`
71
71
  from {
72
72
  transform: scale(0) rotate(90deg);
73
73
  opacity: 0;
@@ -75,7 +75,7 @@ from {
75
75
  to {
76
76
  transform: scale(1) rotate(90deg);
77
77
  opacity: 1;
78
- }`,QE=jr("div")`
78
+ }`,GE=jr("div")`
79
79
  width: 20px;
80
80
  opacity: 0;
81
81
  height: 20px;
@@ -84,14 +84,14 @@ to {
84
84
  position: relative;
85
85
  transform: rotate(45deg);
86
86
 
87
- animation: ${JE} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
87
+ animation: ${qE} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
88
88
  forwards;
89
89
  animation-delay: 100ms;
90
90
 
91
91
  &:after,
92
92
  &:before {
93
93
  content: '';
94
- animation: ${GE} 0.15s ease-out forwards;
94
+ animation: ${KE} 0.15s ease-out forwards;
95
95
  animation-delay: 150ms;
96
96
  position: absolute;
97
97
  border-radius: 3px;
@@ -104,18 +104,18 @@ to {
104
104
  }
105
105
 
106
106
  &:before {
107
- animation: ${YE} 0.15s ease-out forwards;
107
+ animation: ${JE} 0.15s ease-out forwards;
108
108
  animation-delay: 180ms;
109
109
  transform: rotate(90deg);
110
110
  }
111
- `,XE=gr`
111
+ `,YE=gr`
112
112
  from {
113
113
  transform: rotate(0deg);
114
114
  }
115
115
  to {
116
116
  transform: rotate(360deg);
117
117
  }
118
- `,eS=jr("div")`
118
+ `,QE=jr("div")`
119
119
  width: 12px;
120
120
  height: 12px;
121
121
  box-sizing: border-box;
@@ -123,8 +123,8 @@ to {
123
123
  border-radius: 100%;
124
124
  border-color: ${e=>e.secondary||"#e0e0e0"};
125
125
  border-right-color: ${e=>e.primary||"#616161"};
126
- animation: ${XE} 1s linear infinite;
127
- `,tS=gr`
126
+ animation: ${YE} 1s linear infinite;
127
+ `,XE=gr`
128
128
  from {
129
129
  transform: scale(0) rotate(45deg);
130
130
  opacity: 0;
@@ -132,7 +132,7 @@ from {
132
132
  to {
133
133
  transform: scale(1) rotate(45deg);
134
134
  opacity: 1;
135
- }`,nS=gr`
135
+ }`,eS=gr`
136
136
  0% {
137
137
  height: 0;
138
138
  width: 0;
@@ -146,7 +146,7 @@ to {
146
146
  100% {
147
147
  opacity: 1;
148
148
  height: 10px;
149
- }`,rS=jr("div")`
149
+ }`,tS=jr("div")`
150
150
  width: 20px;
151
151
  opacity: 0;
152
152
  height: 20px;
@@ -155,13 +155,13 @@ to {
155
155
  position: relative;
156
156
  transform: rotate(45deg);
157
157
 
158
- animation: ${tS} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
158
+ animation: ${XE} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
159
159
  forwards;
160
160
  animation-delay: 100ms;
161
161
  &:after {
162
162
  content: '';
163
163
  box-sizing: border-box;
164
- animation: ${nS} 0.2s ease-out forwards;
164
+ animation: ${eS} 0.2s ease-out forwards;
165
165
  opacity: 0;
166
166
  animation-delay: 200ms;
167
167
  position: absolute;
@@ -173,16 +173,16 @@ to {
173
173
  height: 10px;
174
174
  width: 6px;
175
175
  }
176
- `,iS=jr("div")`
176
+ `,nS=jr("div")`
177
177
  position: absolute;
178
- `,sS=jr("div")`
178
+ `,rS=jr("div")`
179
179
  position: relative;
180
180
  display: flex;
181
181
  justify-content: center;
182
182
  align-items: center;
183
183
  min-width: 20px;
184
184
  min-height: 20px;
185
- `,oS=gr`
185
+ `,iS=gr`
186
186
  from {
187
187
  transform: scale(0.6);
188
188
  opacity: 0.4;
@@ -190,20 +190,20 @@ from {
190
190
  to {
191
191
  transform: scale(1);
192
192
  opacity: 1;
193
- }`,aS=jr("div")`
193
+ }`,sS=jr("div")`
194
194
  position: relative;
195
195
  transform: scale(0.6);
196
196
  opacity: 0.4;
197
197
  min-width: 20px;
198
- animation: ${oS} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
198
+ animation: ${iS} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
199
199
  forwards;
200
- `,lS=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?R.createElement(aS,null,t):t:n==="blank"?null:R.createElement(sS,null,R.createElement(eS,{...r}),n!=="loading"&&R.createElement(iS,null,n==="error"?R.createElement(QE,{...r}):R.createElement(rS,{...r})))},cS=e=>`
200
+ `,oS=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?R.createElement(sS,null,t):t:n==="blank"?null:R.createElement(rS,null,R.createElement(QE,{...r}),n!=="loading"&&R.createElement(nS,null,n==="error"?R.createElement(GE,{...r}):R.createElement(tS,{...r})))},aS=e=>`
201
201
  0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
202
202
  100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
203
- `,uS=e=>`
203
+ `,lS=e=>`
204
204
  0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
205
205
  100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
206
- `,dS="0%{opacity:0;} 100%{opacity:1;}",fS="0%{opacity:1;} 100%{opacity:0;}",hS=jr("div")`
206
+ `,cS="0%{opacity:0;} 100%{opacity:1;}",uS="0%{opacity:1;} 100%{opacity:0;}",dS=jr("div")`
207
207
  display: flex;
208
208
  align-items: center;
209
209
  background: #fff;
@@ -215,25 +215,25 @@ to {
215
215
  pointer-events: auto;
216
216
  padding: 8px 10px;
217
217
  border-radius: 8px;
218
- `,pS=jr("div")`
218
+ `,fS=jr("div")`
219
219
  display: flex;
220
220
  justify-content: center;
221
221
  margin: 4px 10px;
222
222
  color: inherit;
223
223
  flex: 1 1 auto;
224
224
  white-space: pre-line;
225
- `,mS=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=dp()?[dS,fS]:[cS(n),uS(n)];return{animation:t?`${gr(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${gr(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},gS=R.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?mS(e.position||t||"top-center",e.visible):{opacity:0},s=R.createElement(lS,{toast:e}),o=R.createElement(pS,{...e.ariaProps},Bo(e.message,e));return R.createElement(hS,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:s,message:o}):R.createElement(R.Fragment,null,s,o))});NE(R.createElement);var yS=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let s=R.useCallback(o=>{if(o){let a=()=>{let l=o.getBoundingClientRect().height;r(e,l)};a(),new MutationObserver(a).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return R.createElement("div",{ref:s,className:t,style:n},i)},vS=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:dp()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},bS=Fo`
225
+ `,hS=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=cp()?[cS,uS]:[aS(n),lS(n)];return{animation:t?`${gr(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${gr(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},pS=R.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?hS(e.position||t||"top-center",e.visible):{opacity:0},s=R.createElement(oS,{toast:e}),o=R.createElement(fS,{...e.ariaProps},Bo(e.message,e));return R.createElement(dS,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:s,message:o}):R.createElement(R.Fragment,null,s,o))});LE(R.createElement);var mS=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let s=R.useCallback(o=>{if(o){let a=()=>{let l=o.getBoundingClientRect().height;r(e,l)};a(),new MutationObserver(a).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return R.createElement("div",{ref:s,className:t,style:n},i)},gS=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:cp()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},yS=Fo`
226
226
  z-index: 9999;
227
227
  > * {
228
228
  pointer-events: auto;
229
229
  }
230
- `,Wo=16,wS=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:s,containerClassName:o})=>{let{toasts:a,handlers:l}=KE(n);return R.createElement("div",{style:{position:"fixed",zIndex:9999,top:Wo,left:Wo,right:Wo,bottom:Wo,pointerEvents:"none",...s},className:o,onMouseEnter:l.startPause,onMouseLeave:l.endPause},a.map(c=>{let u=c.position||t,d=l.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),h=vS(u,d);return R.createElement(yS,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?bS:"",style:h},c.type==="custom"?Bo(c.message,c):i?i(c):R.createElement(gS,{toast:c,position:u}))}))},xS=Object.defineProperty,_S=(e,t,n)=>t in e?xS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mc=(e,t,n)=>(_S(e,typeof t!="symbol"?t+"":t,n),n);let kS=class{constructor(){Mc(this,"current",this.detect()),Mc(this,"handoffState","pending"),Mc(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Ps=new kS,Ho=(e,t)=>{Ps.isServer?_.useEffect(e,t):_.useLayoutEffect(e,t)};function ji(e){let t=_.useRef(e);return Ho(()=>{t.current=e},[e]),t}function CS(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function qo(){let e=[],t=[],n={enqueue(r){t.push(r)},addEventListener(r,i,s,o){return r.addEventListener(i,s,o),n.add(()=>r.removeEventListener(i,s,o))},requestAnimationFrame(...r){let i=requestAnimationFrame(...r);return n.add(()=>cancelAnimationFrame(i))},nextFrame(...r){return n.requestAnimationFrame(()=>n.requestAnimationFrame(...r))},setTimeout(...r){let i=setTimeout(...r);return n.add(()=>clearTimeout(i))},microTask(...r){let i={current:!0};return CS(()=>{i.current&&r[0]()}),n.add(()=>{i.current=!1})},add(r){return e.push(r),()=>{let i=e.indexOf(r);if(i>=0){let[s]=e.splice(i,1);s()}}},dispose(){for(let r of e.splice(0))r()},async workQueue(){for(let r of t.splice(0))await r()},style(r,i,s){let o=r.style.getPropertyValue(i);return Object.assign(r.style,{[i]:s}),this.add(()=>{Object.assign(r.style,{[i]:o})})}};return n}function hp(){let[e]=_.useState(qo);return _.useEffect(()=>()=>e.dispose(),[e]),e}let pi=function(e){let t=ji(e);return _.useCallback((...n)=>t.current(...n),[t])};function pp(){let[e,t]=_.useState(Ps.isHandoffComplete);return e&&Ps.isHandoffComplete===!1&&t(!1),_.useEffect(()=>{e!==!0&&t(!0)},[e]),_.useEffect(()=>Ps.handoff(),[]),e}function Xn(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Xn),r}let ES=Symbol();function mp(...e){let t=_.useRef(e);_.useEffect(()=>{t.current=e},[e]);let n=pi(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[ES]))?void 0:n}function gp(...e){return e.filter(Boolean).join(" ")}var yp=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(yp||{}),yr=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(yr||{});function vp({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:s=!0,name:o}){let a=bp(t,e);if(s)return Ko(a,n,r,o);let l=i??0;if(l&2){let{static:c=!1,...u}=a;if(c)return Ko(u,n,r,o)}if(l&1){let{unmount:c=!0,...u}=a;return Xn(c?0:1,{0(){return null},1(){return Ko({...u,hidden:!0,style:{display:"none"}},n,r,o)}})}return Ko(a,n,r,o)}function Ko(e,t={},n,r){var i;let{as:s=n,children:o,refName:a="ref",...l}=Dc(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},u=typeof o=="function"?o(t):o;l.className&&typeof l.className=="function"&&(l.className=l.className(t));let d={};if(t){let h=!1,f=[];for(let[p,m]of Object.entries(t))typeof m=="boolean"&&(h=!0),m===!0&&f.push(p);h&&(d["data-headlessui-state"]=f.join(" "))}if(s===_.Fragment&&Object.keys(wp(l)).length>0){if(!_.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(p=>` - ${p}`).join(`
230
+ `,Wo=16,vS=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:s,containerClassName:o})=>{let{toasts:a,handlers:l}=HE(n);return R.createElement("div",{style:{position:"fixed",zIndex:9999,top:Wo,left:Wo,right:Wo,bottom:Wo,pointerEvents:"none",...s},className:o,onMouseEnter:l.startPause,onMouseLeave:l.endPause},a.map(c=>{let u=c.position||t,d=l.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),h=gS(u,d);return R.createElement(mS,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?yS:"",style:h},c.type==="custom"?Bo(c.message,c):i?i(c):R.createElement(pS,{toast:c,position:u}))}))},bS=Object.defineProperty,wS=(e,t,n)=>t in e?bS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rc=(e,t,n)=>(wS(e,typeof t!="symbol"?t+"":t,n),n);let xS=class{constructor(){Rc(this,"current",this.detect()),Rc(this,"handoffState","pending"),Rc(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Ps=new xS,Ho=(e,t)=>{Ps.isServer?_.useEffect(e,t):_.useLayoutEffect(e,t)};function Ni(e){let t=_.useRef(e);return Ho(()=>{t.current=e},[e]),t}function _S(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function qo(){let e=[],t=[],n={enqueue(r){t.push(r)},addEventListener(r,i,s,o){return r.addEventListener(i,s,o),n.add(()=>r.removeEventListener(i,s,o))},requestAnimationFrame(...r){let i=requestAnimationFrame(...r);return n.add(()=>cancelAnimationFrame(i))},nextFrame(...r){return n.requestAnimationFrame(()=>n.requestAnimationFrame(...r))},setTimeout(...r){let i=setTimeout(...r);return n.add(()=>clearTimeout(i))},microTask(...r){let i={current:!0};return _S(()=>{i.current&&r[0]()}),n.add(()=>{i.current=!1})},add(r){return e.push(r),()=>{let i=e.indexOf(r);if(i>=0){let[s]=e.splice(i,1);s()}}},dispose(){for(let r of e.splice(0))r()},async workQueue(){for(let r of t.splice(0))await r()},style(r,i,s){let o=r.style.getPropertyValue(i);return Object.assign(r.style,{[i]:s}),this.add(()=>{Object.assign(r.style,{[i]:o})})}};return n}function dp(){let[e]=_.useState(qo);return _.useEffect(()=>()=>e.dispose(),[e]),e}let pi=function(e){let t=Ni(e);return _.useCallback((...n)=>t.current(...n),[t])};function fp(){let[e,t]=_.useState(Ps.isHandoffComplete);return e&&Ps.isHandoffComplete===!1&&t(!1),_.useEffect(()=>{e!==!0&&t(!0)},[e]),_.useEffect(()=>Ps.handoff(),[]),e}function Xn(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Xn),r}let kS=Symbol();function hp(...e){let t=_.useRef(e);_.useEffect(()=>{t.current=e},[e]);let n=pi(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[kS]))?void 0:n}function pp(...e){return e.filter(Boolean).join(" ")}var mp=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(mp||{}),yr=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(yr||{});function gp({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:s=!0,name:o}){let a=yp(t,e);if(s)return Ko(a,n,r,o);let l=i??0;if(l&2){let{static:c=!1,...u}=a;if(c)return Ko(u,n,r,o)}if(l&1){let{unmount:c=!0,...u}=a;return Xn(c?0:1,{0(){return null},1(){return Ko({...u,hidden:!0,style:{display:"none"}},n,r,o)}})}return Ko(a,n,r,o)}function Ko(e,t={},n,r){var i;let{as:s=n,children:o,refName:a="ref",...l}=Mc(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},u=typeof o=="function"?o(t):o;l.className&&typeof l.className=="function"&&(l.className=l.className(t));let d={};if(t){let h=!1,f=[];for(let[p,m]of Object.entries(t))typeof m=="boolean"&&(h=!0),m===!0&&f.push(p);h&&(d["data-headlessui-state"]=f.join(" "))}if(s===_.Fragment&&Object.keys(vp(l)).length>0){if(!_.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(p=>` - ${p}`).join(`
231
231
  `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(`
232
232
  `)].join(`
233
- `));let h=gp((i=u.props)==null?void 0:i.className,l.className),f=h?{className:h}:{};return _.cloneElement(u,Object.assign({},bp(u.props,wp(Dc(l,["ref"]))),d,c,SS(u.ref,c.ref),f))}return _.createElement(s,Object.assign({},Dc(l,["ref"]),s!==_.Fragment&&c,s!==_.Fragment&&d),u)}function SS(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}}function bp(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](i,...s){let o=n[r];for(let a of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...s)}}});return t}function Lc(e){var t;return Object.assign(_.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function wp(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Dc(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let Nc=_.createContext(null);Nc.displayName="OpenClosedContext";var vr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(vr||{});function xp(){return _.useContext(Nc)}function TS({value:e,children:t}){return _.createElement(Nc.Provider,{value:e},t)}function _p(){let e=_.useRef(!1);return Ho(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function OS(e=0){let[t,n]=_.useState(e),r=_.useCallback(a=>n(l=>l|a),[t]),i=_.useCallback(a=>!!(t&a),[t]),s=_.useCallback(a=>n(l=>l&~a),[n]),o=_.useCallback(a=>n(l=>l^a),[n]);return{flags:t,addFlag:r,hasFlag:i,removeFlag:s,toggleFlag:o}}function IS(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function jc(e,...t){e&&t.length>0&&e.classList.add(...t)}function Uc(e,...t){e&&t.length>0&&e.classList.remove(...t)}function PS(e,t){let n=qo();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[s,o]=[r,i].map(a=>{let[l=0]=a.split(",").filter(Boolean).map(c=>c.includes("ms")?parseFloat(c):parseFloat(c)*1e3).sort((c,u)=>u-c);return l});if(s+o!==0){let a=n.addEventListener(e,"transitionend",l=>{l.target===l.currentTarget&&(t(),a())})}else t();return n.add(()=>t()),n.dispose}function AS(e,t,n,r){let i=n?"enter":"leave",s=qo(),o=r!==void 0?IS(r):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Xn(i,{enter:()=>t.enter,leave:()=>t.leave}),l=Xn(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Xn(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Uc(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),jc(e,...a,...c),s.nextFrame(()=>{Uc(e,...c),jc(e,...l),PS(e,()=>(Uc(e,...a),jc(e,...t.entered),o()))}),s.dispose}function RS({container:e,direction:t,classes:n,onStart:r,onStop:i}){let s=_p(),o=hp(),a=ji(t);Ho(()=>{let l=qo();o.add(l.dispose);let c=e.current;if(c&&a.current!=="idle"&&s.current)return l.dispose(),r.current(a.current),l.add(AS(c,n.current,a.current==="enter",()=>{l.dispose(),i.current(a.current)})),l.dispose},[t])}function mi(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let Jo=_.createContext(null);Jo.displayName="TransitionContext";var $S=(e=>(e.Visible="visible",e.Hidden="hidden",e))($S||{});function MS(){let e=_.useContext(Jo);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function LS(){let e=_.useContext(Go);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Go=_.createContext(null);Go.displayName="NestingContext";function Yo(e){return"children"in e?Yo(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function kp(e,t){let n=ji(e),r=_.useRef([]),i=_p(),s=hp(),o=pi((f,p=yr.Hidden)=>{let m=r.current.findIndex(({el:y})=>y===f);m!==-1&&(Xn(p,{[yr.Unmount](){r.current.splice(m,1)},[yr.Hidden](){r.current[m].state="hidden"}}),s.microTask(()=>{var y;!Yo(r)&&i.current&&((y=n.current)==null||y.call(n))}))}),a=pi(f=>{let p=r.current.find(({el:m})=>m===f);return p?p.state!=="visible"&&(p.state="visible"):r.current.push({el:f,state:"visible"}),()=>o(f,yr.Unmount)}),l=_.useRef([]),c=_.useRef(Promise.resolve()),u=_.useRef({enter:[],leave:[],idle:[]}),d=pi((f,p,m)=>{l.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([y])=>y!==f)),t==null||t.chains.current[p].push([f,new Promise(y=>{l.current.push(y)})]),t==null||t.chains.current[p].push([f,new Promise(y=>{Promise.all(u.current[p].map(([v,b])=>b)).then(()=>y())})]),p==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(p)):m(p)}),h=pi((f,p,m)=>{Promise.all(u.current[p].splice(0).map(([y,v])=>v)).then(()=>{var y;(y=l.current.shift())==null||y()}).then(()=>m(p))});return _.useMemo(()=>({children:r,register:a,unregister:o,onStart:d,onStop:h,wait:c,chains:u}),[a,o,r,d,h,u,c])}function DS(){}let NS=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Cp(e){var t;let n={};for(let r of NS)n[r]=(t=e[r])!=null?t:DS;return n}function jS(e){let t=_.useRef(Cp(e));return _.useEffect(()=>{t.current=Cp(e)},[e]),t}let US="div",Ep=yp.RenderStrategy,Sp=Lc(function(e,t){let{beforeEnter:n,afterEnter:r,beforeLeave:i,afterLeave:s,enter:o,enterFrom:a,enterTo:l,entered:c,leave:u,leaveFrom:d,leaveTo:h,...f}=e,p=_.useRef(null),m=mp(p,t),y=f.unmount?yr.Unmount:yr.Hidden,{show:v,appear:b,initial:x}=MS(),[I,P]=_.useState(v?"visible":"hidden"),T=LS(),{register:j,unregister:U}=T,F=_.useRef(null);_.useEffect(()=>j(p),[j,p]),_.useEffect(()=>{if(y===yr.Hidden&&p.current){if(v&&I!=="visible"){P("visible");return}return Xn(I,{hidden:()=>U(p),visible:()=>j(p)})}},[I,p,j,U,v,y]);let O=ji({enter:mi(o),enterFrom:mi(a),enterTo:mi(l),entered:mi(c),leave:mi(u),leaveFrom:mi(d),leaveTo:mi(h)}),N=jS({beforeEnter:n,afterEnter:r,beforeLeave:i,afterLeave:s}),J=pp();_.useEffect(()=>{if(J&&I==="visible"&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,I,J]);let q=x&&!b,W=(()=>!J||q||F.current===v?"idle":v?"enter":"leave")(),B=OS(0),V=pi(ee=>Xn(ee,{enter:()=>{B.addFlag(vr.Opening),N.current.beforeEnter()},leave:()=>{B.addFlag(vr.Closing),N.current.beforeLeave()},idle:()=>{}})),Y=pi(ee=>Xn(ee,{enter:()=>{B.removeFlag(vr.Opening),N.current.afterEnter()},leave:()=>{B.removeFlag(vr.Closing),N.current.afterLeave()},idle:()=>{}})),K=kp(()=>{P("hidden"),U(p)},T);RS({container:p,classes:O,direction:W,onStart:ji(ee=>{K.onStart(p,ee,V)}),onStop:ji(ee=>{K.onStop(p,ee,Y),ee==="leave"&&!Yo(K)&&(P("hidden"),U(p))})}),_.useEffect(()=>{!q||(y===yr.Hidden?F.current=null:F.current=v)},[v,q,I]);let pe=f,k={ref:m};return b&&v&&Ps.isServer&&(pe={...pe,className:gp(f.className,...O.current.enter,...O.current.enterFrom)}),_.createElement(Go.Provider,{value:K},_.createElement(TS,{value:Xn(I,{visible:vr.Open,hidden:vr.Closed})|B.flags},vp({ourProps:k,theirProps:pe,defaultTag:US,features:Ep,visible:I==="visible",name:"Transition.Child"})))}),Fc=Lc(function(e,t){let{show:n,appear:r=!1,unmount:i,...s}=e,o=_.useRef(null),a=mp(o,t);pp();let l=xp();if(n===void 0&&l!==null&&(n=(l&vr.Open)===vr.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=_.useState(n?"visible":"hidden"),d=kp(()=>{u("hidden")}),[h,f]=_.useState(!0),p=_.useRef([n]);Ho(()=>{h!==!1&&p.current[p.current.length-1]!==n&&(p.current.push(n),f(!1))},[p,n]);let m=_.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);_.useEffect(()=>{if(n)u("visible");else if(!Yo(d))u("hidden");else{let v=o.current;if(!v)return;let b=v.getBoundingClientRect();b.x===0&&b.y===0&&b.width===0&&b.height===0&&u("hidden")}},[n,d]);let y={unmount:i};return _.createElement(Go.Provider,{value:d},_.createElement(Jo.Provider,{value:m},vp({ourProps:{...y,as:_.Fragment,children:_.createElement(Sp,{ref:a,...y,...s})},theirProps:{},defaultTag:_.Fragment,features:Ep,visible:c==="visible",name:"Transition"})))}),FS=Lc(function(e,t){let n=_.useContext(Jo)!==null,r=xp()!==null;return _.createElement(_.Fragment,null,!n&&r?_.createElement(Fc,{ref:t,...e}):_.createElement(Sp,{ref:t,...e}))}),BS=Object.assign(Fc,{Child:FS,Root:Fc});const VS=e=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,...e},R.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"})),zS=e=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",...e},R.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M18 6 6 18M6 6l12 12"})),ZS=e=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,...e},R.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));function WS(e){return vn.custom(t=>z.jsx(qS,{type:e.type,show:t.visible,children:e.type==="custom"?e.content:z.jsx(HS,{...e,toastId:t.id})}))}const HS=({icon:e,type:t,title:n,description:r,toastId:i})=>{const{theme:{notification:s}}=mt();return z.jsxs(z.Fragment,{children:[e?z.jsx(e,{...s==null?void 0:s.icon}):z.jsx(KS,{...s==null?void 0:s.icon,type:t}),z.jsx("p",{...s==null?void 0:s.title,children:n}),r?z.jsx("p",{...s==null?void 0:s.description,children:r}):null,z.jsx(zS,{...s==null?void 0:s.closeIcon,onClick:()=>vn.dismiss(i)})]})},qS=({type:e,...t})=>{const{theme:{notification:n}}=mt();return z.jsx(BS,{...t,...n==null?void 0:n.container,appear:!0,"data-type":e??"neutral"})},KS=({type:e,className:t})=>{switch(e){case"success":return z.jsx(VS,{className:t});case"error":return z.jsx(ZS,{className:t});default:return null}},JS=_.forwardRef(({url:e,type:t,styles:n,orientation:r="auto",...i},s)=>{var h,f;const o=_.useId(),{setIsLoading:a}=EE(),[l,c]=_.useState(r),[u,d]=_.useState(!1);return _.useLayoutEffect(()=>{a(p=>[...p,o])},[]),_.useEffect(()=>{e&&l==="auto"&&PE(e).then(({width:p,height:m})=>{c(GS(p,m)),a(y=>y.filter(v=>v!==o))})},[e]),z.jsxs(z.Fragment,{children:[u?null:z.jsx("div",{"data-orientation":l,...(h=n==null?void 0:n[t])==null?void 0:h.placeholder}),z.jsx("img",{"data-orientation":l,"data-loaded":u,...i,...(f=n==null?void 0:n[t])==null?void 0:f.image,src:e,alt:"",ref:s,loading:"lazy",onLoad:()=>{d(!0)}})]})});function GS(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((s,o)=>Math.abs(n[o]-r)<Math.abs(n[s]-r)?o:s)}const YS=_.forwardRef(({url:e,type:t,styles:n,...r},i)=>z.jsx("div",{children:z.jsx("video",{...r,controls:!0,src:e,...n==null?void 0:n[t],ref:i})})),QS=_.forwardRef(({url:e,type:t,styles:n,...r},i)=>z.jsx("div",{children:z.jsx("audio",{...r,controls:!0,src:e,...n==null?void 0:n[t],ref:i})}));function XS({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.75.75v10.638l3.96-4.158a.75.75 0 111.08 1.04l-5.25 5.5a.75.75 0 01-1.08 0l-5.25-5.5a.75.75 0 111.08-1.04l3.96 4.158V3.75A.75.75 0 0110 3z",clipRule:"evenodd"}))}const eT=R.forwardRef(XS);function tT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0V5.36l-.31-.31A7 7 0 003.239 8.188a.75.75 0 101.448.389A5.5 5.5 0 0113.89 6.11l.311.31h-2.432a.75.75 0 000 1.5h4.243a.75.75 0 00.53-.219z",clipRule:"evenodd"}))}const nT=R.forwardRef(tT);function rT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm-.75-4.75a.75.75 0 001.5 0V8.66l1.95 2.1a.75.75 0 101.1-1.02l-3.25-3.5a.75.75 0 00-1.1 0L6.2 9.74a.75.75 0 101.1 1.02l1.95-2.1v4.59z",clipRule:"evenodd"}))}const iT=R.forwardRef(rT);function sT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"}))}const oT=R.forwardRef(sT);function aT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M4.5 2A1.5 1.5 0 003 3.5v13A1.5 1.5 0 004.5 18h11a1.5 1.5 0 001.5-1.5V7.621a1.5 1.5 0 00-.44-1.06l-4.12-4.122A1.5 1.5 0 0011.378 2H4.5zm4.75 6.75a.75.75 0 011.5 0v2.546l.943-1.048a.75.75 0 011.114 1.004l-2.25 2.5a.75.75 0 01-1.114 0l-2.25-2.5a.75.75 0 111.114-1.004l.943 1.048V8.75z",clipRule:"evenodd"}))}const lT=R.forwardRef(aT);function cT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M9.69 18.933l.003.001C9.89 19.02 10 19 10 19s.11.02.308-.066l.002-.001.006-.003.018-.008a5.741 5.741 0 00.281-.14c.186-.096.446-.24.757-.433.62-.384 1.445-.966 2.274-1.765C15.302 14.988 17 12.493 17 9A7 7 0 103 9c0 3.492 1.698 5.988 3.355 7.584a13.731 13.731 0 002.273 1.765 11.842 11.842 0 00.976.544l.062.029.018.008.006.003zM10 11.25a2.25 2.25 0 100-4.5 2.25 2.25 0 000 4.5z",clipRule:"evenodd"}))}const uT=R.forwardRef(cT),dT=_.forwardRef(({type:e,latitude:t,longitude:n,title:r,styles:i,...s},o)=>{var l,c,u;const a=`https://www.google.com/maps/search/?api=1&query=${t},${n}`;return z.jsxs("a",{...s,...(l=i==null?void 0:i[e])==null?void 0:l.container,href:a,type:"_blank",rel:"noopener",ref:o,children:[z.jsx("p",{...(c=i==null?void 0:i[e])==null?void 0:c.title,children:r}),z.jsx(uT,{...(u=i==null?void 0:i[e])==null?void 0:u.icon})]})}),fT=_.forwardRef(({blocks:e,styles:t,type:n,horizontalAlignment:r,verticalAlignment:i,...s},o)=>z.jsx("div",{"data-horizontal":r,"data-vertical":i,...s,...t==null?void 0:t[n],ref:o,children:e.map((a,l)=>z.jsx(Wi,{styles:t,block:a},l))})),hT=_.forwardRef(({blocks:e,styles:t,type:n,horizontalAlignment:r,verticalAlignment:i,...s},o)=>z.jsx("div",{"data-horizontal":r,"data-vertical":i,...s,...t==null?void 0:t[n],ref:o,children:e.map((a,l)=>z.jsx(Wi,{styles:t,block:a},l))}));function pT(e){return Object.prototype.toString.call(e)==="[object Object]"}function Tp(e){return pT(e)||Array.isArray(e)}function mT(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Bc(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),s=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==s?!1:n.every(o=>{const a=e[o],l=t[o];return typeof a=="function"?`${a}`==`${l}`:!Tp(a)||!Tp(l)?a===l:Bc(a,l)})}function Op(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function gT(e,t){if(e.length!==t.length)return!1;const n=Op(e),r=Op(t);return n.every((i,s)=>{const o=r[s];return Bc(i,o)})}function Vc(e){return typeof e=="number"}function Ip(e){return typeof e=="string"}function zc(e){return typeof e=="boolean"}function Pp(e){return Object.prototype.toString.call(e)==="[object Object]"}function It(e){return Math.abs(e)}function Zc(e){return Math.sign(e)}function Qo(e,t){return It(e-t)}function yT(e,t){if(e===0||t===0||It(e)<=It(t))return 0;const n=Qo(It(e),It(t));return It(n/e)}function As(e){return ea(e).map(Number)}function br(e){return e[Xo(e)]}function Xo(e){return Math.max(0,e.length-1)}function ea(e){return Object.keys(e)}function Ap(e,t){return[e,t].reduce((n,r)=>(ea(r).forEach(i=>{const s=n[i],o=r[i],a=Pp(s)&&Pp(o);n[i]=a?Ap(s,o):o}),n),{})}function Rp(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function vT(e,t){const n={start:r,center:i,end:s};function r(){return 0}function i(c){return s(c)/2}function s(c){return t-c}function o(){return t*Number(e)}function a(c){return Vc(e)?o():n[e](c)}return{measure:a}}function bT(e,t){const n=e==="y"?"y":"x",r=e==="y"?"x":"y",i=a(),s=l();function o(u){const{width:d,height:h}=u;return n==="x"?d:h}function a(){return n==="y"?"top":t==="rtl"?"right":"left"}function l(){return n==="y"?"bottom":t==="rtl"?"left":"right"}return{scroll:n,cross:r,startEdge:i,endEdge:s,measureSize:o}}function Ur(e,t){const n=It(e-t);function r(c){return c<e}function i(c){return c>t}function s(c){return r(c)||i(c)}function o(c){return s(c)?r(c)?e:t:c}function a(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:o,reachedAny:s,reachedMax:i,reachedMin:r,removeOffset:a}}function $p(e,t,n){const{constrain:r}=Ur(0,e),i=e+1;let s=o(t);function o(h){return n?It((i+h)%i):r(h)}function a(){return s}function l(h){return s=o(h),d}function c(h){return u().set(a()+h)}function u(){return $p(e,a(),n)}const d={get:a,set:l,add:c,clone:u};return d}function wT(e){const t=e==="rtl"?-1:1;function n(i){return i*t}return{apply:n}}function Rs(){let e=[];function t(i,s,o,a={passive:!0}){return i.addEventListener(s,o,a),e.push(()=>i.removeEventListener(s,o,a)),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function xT(e,t,n,r,i,s,o,a,l,c,u,d,h,f,p,m,y,v,b){const{cross:x}=e,I=["INPUT","SELECT","TEXTAREA"],P={passive:!1},T=Rs(),j=Rs(),U=Ur(50,225).constrain(p.measure(20)),F={mouse:300,touch:400},O={mouse:500,touch:600},N=m?43:25;let J=!1,q=0,W=0,B=!1,V=!1,Y=!1,K=!1;function pe(ve,ke){if(!ke)return;function Ce(qe){(zc(ke)||ke(ve,qe))&&Ne(qe)}const Re=n;T.add(Re,"dragstart",qe=>qe.preventDefault(),P).add(Re,"touchmove",()=>{},P).add(Re,"touchend",()=>{}).add(Re,"touchstart",Ce).add(Re,"mousedown",Ce).add(Re,"touchcancel",je).add(Re,"contextmenu",je).add(Re,"click",De,!0)}function k(){T.clear(),j.clear()}function ee(){const ve=K?r:n;j.add(ve,"touchmove",Ie,P).add(ve,"touchend",je).add(ve,"mousemove",Ie,P).add(ve,"mouseup",je)}function xe(ve){const ke=ve.nodeName||"";return I.includes(ke)}function S(){return(m?O:F)[K?"mouse":"touch"]}function Te(ve,ke){const Ce=h.add(Zc(ve)*-1),Re=d.byDistance(ve,!m).distance;return m||It(ve)<U?Re:v&&ke?Re*.5:d.byIndex(Ce.get(),0).distance}function Ne(ve){const ke=Rp(ve,i);K=ke,!(ke&&ve.button!==0)&&(xe(ve.target)||(Y=m&&ke&&!ve.buttons&&J,J=Qo(s.get(),a.get())>=2,B=!0,o.pointerDown(ve),u.useFriction(0).useDuration(0),s.set(a),ee(),q=o.readPoint(ve),W=o.readPoint(ve,x),f.emit("pointerDown")))}function Ie(ve){const ke=o.readPoint(ve),Ce=o.readPoint(ve,x),Re=Qo(ke,q),qe=Qo(Ce,W);if(!V&&!K&&(!ve.cancelable||(V=Re>qe,!V)))return je(ve);const D=o.pointerMove(ve);Re>y&&(Y=!0),u.useFriction(.3).useDuration(1),l.start(),s.add(t.apply(D)),ve.preventDefault()}function je(ve){const Ce=d.byDistance(0,!1).index!==h.get(),Re=o.pointerUp(ve)*S(),qe=Te(t.apply(Re),Ce),D=yT(Re,qe),ne=N-10*D,me=b+D/50;V=!1,B=!1,j.clear(),u.useDuration(ne).useFriction(me),c.distance(qe,!m),K=!1,f.emit("pointerUp")}function De(ve){Y&&(ve.stopPropagation(),ve.preventDefault())}function Ue(){return B}return{init:pe,pointerDown:Ue,destroy:k}}function _T(e,t){let r,i;function s(d){return d.timeStamp}function o(d,h){const p=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(Rp(d,t)?d:d.touches[0])[p]}function a(d){return r=d,i=d,o(d)}function l(d){const h=o(d)-o(i),f=s(d)-s(r)>170;return i=d,f&&(r=d),h}function c(d){if(!r||!i)return 0;const h=o(i)-o(r),f=s(d)-s(r),p=s(d)-s(i)>170,m=h/f;return f&&!p&&It(m)>.1?m:0}return{pointerDown:a,pointerMove:l,pointerUp:c,readPoint:o}}function kT(e){function t(r){return e*(r/100)}return{measure:t}}function CT(e,t,n,r,i){let s,o,a=[],l=!1;function c(f){return i.measureSize(f.getBoundingClientRect())}function u(f,p){if(!p)return;o=c(e),a=r.map(c);function m(v){for(const b of v){const x=b.target===e,I=r.indexOf(b.target),P=x?o:a[I],T=c(x?e:r[I]);if(P!==T){n.requestAnimationFrame(()=>{f.reInit(),t.emit("resize")});break}}}s=new ResizeObserver(v=>{l||(zc(p)||p(f,v))&&m(v)}),[e].concat(r).forEach(v=>s.observe(v))}function d(){s&&s.disconnect(),l=!0}return{init:u,destroy:d}}function ET(e,t,n,r){let i=!0,s=0,o=0,a=n,l=r,c=e.get(),u=0;function d(){const P=t.get()-e.get(),T=!a;let j=0;return T?(s=0,e.set(t),j=P):(s+=P/a,s*=l,c+=s,e.add(s),j=c-u),o=Zc(j),u=c,i=It(P)<.001,I}function h(){return i}function f(){return a}function p(){return o}function m(){return s}function y(){return b(n)}function v(){return x(r)}function b(P){return a=P,I}function x(P){return l=P,I}const I={direction:p,duration:f,velocity:m,seek:d,settled:h,useBaseFriction:v,useBaseDuration:y,useFriction:x,useDuration:b};return I}function ST(e,t,n,r,i){const s=i.measure(10),o=i.measure(50),a=Ur(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(f){if(!c())return;const p=e.reachedMin(t.get())?"min":"max",m=It(e[p]-t.get()),y=n.get()-t.get(),v=a.constrain(m/o);n.subtract(y*v),!f&&It(y)<s&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function d(f){l=!f}return{constrain:u,toggleActive:d}}function TT(e,t,n,r){const i=Ur(-t+e,n[0]),s=l(),o=c();function a(){const d=s[0],h=br(s),f=s.lastIndexOf(d),p=s.indexOf(h)+1;return Ur(f,p)}function l(){return n.map(i.constrain).map(d=>parseFloat(d.toFixed(3)))}function c(){if(t<=e)return[i.max];if(r==="keepSnaps")return s;const{min:d,max:h}=a();return s.slice(d,h)}return{snapsContained:o}}function OT(e,t,n){const r=t[0],i=n?r-e:br(t);return{limit:Ur(i,r)}}function IT(e,t,n,r){const s=t.min+.1,o=t.max+.1,{reachedMin:a,reachedMax:l}=Ur(s,o);function c(h){return h===1?l(n.get()):h===-1?a(n.get()):!1}function u(h){if(!c(h))return;const f=e*(h*-1);r.forEach(p=>p.add(f))}return{loop:u}}function PT(e){const{max:t,length:n}=e;function r(s){return(s-t)/-n}return{get:r}}function AT(e,t,n,r,i,s,o){const{startEdge:a,endEdge:l}=e,{groupSlides:c}=s,u=f().map(t.measure),d=p(),h=m();function f(){return c(r).map(v=>br(v)[l]-v[0][a]).map(It)}function p(){return r.map(v=>n[a]-v[a]).map(v=>-It(v))}function m(){const b=br(d)-br(i);return c(d).map(x=>x[0]).map((x,I,P)=>{const T=!I,j=I===Xo(P);return o&&T?0:o&&j?b:x+u[I]})}return{snaps:d,snapsAligned:h}}function RT(e,t,n,r,i){const{reachedAny:s,removeOffset:o,constrain:a}=r;function l(p){return p.concat().sort((m,y)=>It(m)-It(y))[0]}function c(p){const m=e?o(p):a(p),y=t.map(b=>b-m).map(b=>u(b,0)).map((b,x)=>({diff:b,index:x})).sort((b,x)=>It(b.diff)-It(x.diff)),{index:v}=y[0];return{index:v,distance:m}}function u(p,m){const y=[p,p+n,p-n];if(!e)return y[0];if(!m)return l(y);const v=y.filter(b=>Zc(b)===m);return l(v)}function d(p,m){const y=t[p]-i.get(),v=u(y,m);return{index:p,distance:v}}function h(p,m){const y=i.get()+p,{index:v,distance:b}=c(y),x=!e&&s(y);if(!m||x)return{index:v,distance:p};const I=t[v]-b,P=p+u(I,0);return{index:v,distance:P}}return{byDistance:h,byIndex:d,shortcut:u}}function $T(e,t,n,r,i,s,o){function a(d){const h=d.distance,f=d.index!==t.get();s.add(h),h&&(i.duration()?e.start():(e.update(),e.render(1),e.update())),f&&(n.set(t.get()),t.set(d.index),o.emit("select"))}function l(d,h){const f=r.byDistance(d,h);a(f)}function c(d,h){const f=t.clone().set(d),p=r.byIndex(f.get(),h);a(p)}return{distance:l,index:c}}function ta(e){let t=e;function n(){return t}function r(l){t=o(l)}function i(l){t+=o(l)}function s(l){t-=o(l)}function o(l){return Vc(l)?l:l.get()}return{get:n,set:r,add:i,subtract:s}}function Mp(e,t,n){const r=e.scroll==="x"?o:a,i=n.style;let s=!1;function o(h){return`translate3d(${h}px,0px,0px)`}function a(h){return`translate3d(0px,${h}px,0px)`}function l(h){s||(i.transform=r(t.apply(h)))}function c(h){s=!h}function u(){s||(i.transform="",n.getAttribute("style")||n.removeAttribute("style"))}return{clear:u,to:l,toggleActive:c}}function MT(e,t,n,r,i,s,o,a,l){const c=As(i),u=As(i).reverse(),d=m().concat(y());function h(P,T){return P.reduce((j,U)=>j-i[U],T)}function f(P,T){return P.reduce((j,U)=>h(j,T)>0?j.concat([U]):j,[])}function p(P,T){const j=T==="start",U=j?-r:r,F=o.findSlideBounds([U]);return P.map(O=>{const N=j?0:-r,J=j?r:0,W=F.filter(B=>B.index===O)[0][j?"end":"start"];return{index:O,slideLocation:ta(-1),translate:Mp(e,t,l[O]),target:()=>a.get()>W?N:J}})}function m(){const P=s[0]-1,T=f(u,P);return p(T,"end")}function y(){const P=n-s[0]-1,T=f(c,P);return p(T,"start")}function v(){return d.every(({index:P})=>{const T=c.filter(j=>j!==P);return h(T,n)<=.1})}function b(){d.forEach(P=>{const{target:T,translate:j,slideLocation:U}=P,F=T();F!==U.get()&&(j.to(F),U.set(F))})}function x(){d.forEach(P=>P.translate.clear())}return{canLoop:v,clear:x,loop:b,loopPoints:d}}function LT(e,t){let n,r=!1;function i(a,l){if(!l)return;function c(u){for(const d of u)if(d.type==="childList"){a.reInit(),t.emit("slidesChanged");break}}n=new MutationObserver(u=>{r||(zc(l)||l(a,u))&&c(u)}),n.observe(e,{childList:!0})}function s(){n&&n.disconnect(),r=!0}return{init:i,destroy:s}}function DT(e,t,n,r,i,s,o){const{removeOffset:a,constrain:l}=i,c=.5,u=s?[0,t,-t]:[0],d=f(u,o);function h(y){const v=y||0;return n.map(b=>Ur(c,b-c).constrain(b*v))}function f(y,v){const b=y||u,x=h(v);return b.reduce((I,P)=>{const T=r.map((j,U)=>({start:j-n[U]+x[U]+P,end:j+e-x[U]+P,index:U}));return I.concat(T)},[])}function p(y,v){const b=s?a(y):l(y);return(v||d).reduce((I,P)=>{const{index:T,start:j,end:U}=P,F=I.includes(T),O=j<b&&U>b;return!F&&O?I.concat([T]):I},[])}return{check:p,findSlideBounds:f}}function NT(e,t,n,r,i,s){const{measureSize:o,startEdge:a,endEdge:l}=e,c=n[0]&&i,u=p(),d=m(),h=n.map(o),f=y();function p(){if(!c)return 0;const b=n[0];return It(t[a]-b[a])}function m(){if(!c)return 0;const b=s.getComputedStyle(br(r));return parseFloat(b.getPropertyValue(`margin-${l}`))}function y(){return n.map((b,x,I)=>{const P=!x,T=x===Xo(I);return P?h[x]+u:T?h[x]+d:I[x+1][a]-b[a]}).map(It)}return{slideSizes:h,slideSizesWithGaps:f}}function jT(e,t,n){const r=Vc(n);function i(l,c){return As(l).filter(u=>u%c===0).map(u=>l.slice(u,u+c))}function s(l){return As(l).reduce((c,u)=>{const h=t.slice(br(c),u+1).reduce((f,p)=>f+p,0);return!u||h>e?c.concat(u):c},[]).map((c,u,d)=>l.slice(c,d[u+1]))}function o(l){return r?i(l,n):s(l)}return{groupSlides:o}}function UT(e,t,n,r,i,s,o,a){const{align:l,axis:c,direction:u,startIndex:d,inViewThreshold:h,loop:f,duration:p,dragFree:m,dragThreshold:y,slidesToScroll:v,skipSnaps:b,containScroll:x}=s,I=t.getBoundingClientRect(),P=n.map(me=>me.getBoundingClientRect()),T=wT(u),j=bT(c,u),U=j.measureSize(I),F=kT(U),O=vT(l,U),N=!f&&!!x,J=f||!!x,{slideSizes:q,slideSizesWithGaps:W}=NT(j,I,P,n,J,i),B=jT(U,W,v),{snaps:V,snapsAligned:Y}=AT(j,O,I,P,W,B,N),K=-br(V)+br(W),{snapsContained:pe}=TT(U,K,Y,x),k=N?pe:Y,{limit:ee}=OT(K,k,f),xe=$p(Xo(k),d,f),S=xe.clone(),Te=As(n),Ne=({dragHandler:me,scrollBody:he,scrollBounds:Le,eventHandler:Pe,animation:Be,options:{loop:ot}})=>{const Ze=me.pointerDown();ot||Le.constrain(Ze);const Z=he.seek().settled();Z&&!Ze&&(Be.stop(),Pe.emit("settle")),Z||Pe.emit("scroll")},Ie=({scrollBody:me,translate:he,location:Le,offsetLocation:Pe,scrollLooper:Be,slideLooper:ot,options:{loop:Ze}},Z)=>{const Q=me.velocity();Pe.set(Le.get()-Q+Q*Z),Ze&&(Be.loop(me.direction()),ot.loop()),he.to(Pe.get())},je={start:()=>a.start(ne),stop:()=>a.stop(ne),update:()=>Ne(ne),render:me=>Ie(ne,me)},De=.68,Ue=k[xe.get()],_e=ta(Ue),ve=ta(Ue),ke=ta(Ue),Ce=ET(_e,ke,p,De),Re=RT(f,k,K,ee,ke),qe=$T(je,xe,S,Re,Ce,ke,o),D=DT(U,K,q,V,ee,f,h),ne={ownerDocument:r,ownerWindow:i,eventHandler:o,containerRect:I,slideRects:P,animation:je,axis:j,direction:T,dragHandler:xT(j,T,e,r,i,ke,_T(j,i),_e,je,qe,Ce,Re,xe,o,F,m,y,b,De),eventStore:Rs(),percentOfView:F,index:xe,indexPrevious:S,limit:ee,location:_e,offsetLocation:ve,options:s,resizeHandler:CT(t,o,i,n,j),scrollBody:Ce,scrollBounds:ST(ee,_e,ke,Ce,F),scrollLooper:IT(K,ee,ve,[_e,ve,ke]),scrollProgress:PT(ee),scrollSnaps:k,scrollTarget:Re,scrollTo:qe,slideLooper:MT(j,T,U,K,W,k,D,ve,n),slidesHandler:LT(t,o),slidesInView:D,slideIndexes:Te,slidesToScroll:B,target:ke,translate:Mp(j,T,t)};return ne}function FT(e){const t=16.666666666666668;let n=[],r=null,i=0,s=0;function o(d){r||(r=d);const h=d-r;for(r=d,i+=h;i>=t;)n.forEach(({animation:p})=>p.update()),i-=t;const f=It(i/t);n.forEach(({animation:p})=>p.render(f)),s&&e.requestAnimationFrame(o)}function a(d){n.includes(d)||n.push(d),!s&&(s=e.requestAnimationFrame(o))}function l(d){n=n.filter(h=>h!==d),!n.length&&(e.cancelAnimationFrame(s),r=null,i=0,s=0)}function c(){r=null,i=0}return{start:a,stop:l,reset:c,window:e}}function BT(){const e={};let t;function n(l){t=l}function r(l){return e[l]||[]}function i(l){return r(l).forEach(c=>c(t,l)),a}function s(l,c){return e[l]=r(l).concat([c]),a}function o(l,c){return e[l]=r(l).filter(u=>u!==c),a}const a={init:n,emit:i,off:o,on:s};return a}const VT={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,breakpoints:{},dragFree:!1,dragThreshold:10,inViewThreshold:0,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0};function zT(e){function t(s,o){return Ap(s,o||{})}function n(s){const o=s.breakpoints||{},a=ea(o).filter(l=>e.matchMedia(l).matches).map(l=>o[l]).reduce((l,c)=>t(l,c),{});return t(s,a)}function r(s){return s.map(o=>ea(o.breakpoints||{})).reduce((o,a)=>o.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function ZT(e){let t=[];function n(s,o){return t=s.filter(({options:a})=>e.optionsAtMedia(a).active!==!1),t.forEach(a=>a.init(o,e)),s.reduce((a,l)=>Object.assign(a,{[l.name]:l}),{})}function r(){t=t.filter(s=>s.destroy())}return{init:n,destroy:r}}function Ui(e,t,n){const r=e.ownerDocument,i=r.defaultView,s=zT(i),o=ZT(s),a=Rs(),l=Rs(),c=BT(),{animationRealms:u}=Ui,{mergeOptions:d,optionsAtMedia:h,optionsMediaQueries:f}=s,{on:p,off:m,emit:y}=c,v=q;let b=!1,x,I=d(VT,Ui.globalOptions),P=d(I),T=[],j,U,F;function O(){const{container:Ce,slides:Re}=P;U=(Ip(Ce)?e.querySelector(Ce):Ce)||e.children[0];const D=Ip(Re)?U.querySelectorAll(Re):Re;F=[].slice.call(D||U.children)}function N(Ce,Re){const qe=UT(e,U,F,r,i,Ce,c,Re);if(Ce.loop&&!qe.slideLooper.canLoop()){const D=Object.assign({},Ce,{loop:!1});return N(D,Re)}return qe}function J(Ce,Re){if(b)return;const qe=u.find(ne=>ne.window===i),D=qe||FT(i);qe||u.push(D),I=d(I,Ce),P=h(I),T=Re||T,O(),x=N(P,D),f([I,...T.map(({options:ne})=>ne)]).forEach(ne=>a.add(ne,"change",q)),P.active&&(x.translate.to(x.location.get()),x.eventHandler.init(ke),x.resizeHandler.init(ke,P.watchResize),x.slidesHandler.init(ke,P.watchSlides),l.add(r,"visibilitychange",()=>{r.hidden&&D.reset()}),x.options.loop&&x.slideLooper.loop(),U.offsetParent&&F.length&&x.dragHandler.init(ke,P.watchDrag),j=o.init(T,ke))}function q(Ce,Re){const qe=Ne();W(),J(d({startIndex:qe},Ce),Re),c.emit("reInit")}function W(){x.dragHandler.destroy(),x.animation.stop(),x.eventStore.clear(),x.translate.clear(),x.slideLooper.clear(),x.resizeHandler.destroy(),x.slidesHandler.destroy(),o.destroy(),a.clear(),l.clear()}function B(){b||(b=!0,a.clear(),W(),c.emit("destroy"))}function V(Ce){const Re=x[Ce?"target":"location"].get(),qe=P.loop?"removeOffset":"constrain";return x.slidesInView.check(x.limit[qe](Re))}function Y(Ce){const Re=V(Ce);return x.slideIndexes.filter(qe=>!Re.includes(qe))}function K(Ce,Re,qe){!P.active||b||(x.scrollBody.useBaseFriction().useDuration(Re?0:P.duration),x.scrollTo.index(Ce,qe||0))}function pe(Ce){const Re=x.index.add(1).get();K(Re,Ce===!0,-1)}function k(Ce){const Re=x.index.add(-1).get();K(Re,Ce===!0,1)}function ee(){return x.index.add(1).get()!==Ne()}function xe(){return x.index.add(-1).get()!==Ne()}function S(){return x.scrollSnaps.map(x.scrollProgress.get)}function Te(){return x.scrollProgress.get(x.location.get())}function Ne(){return x.index.get()}function Ie(){return x.indexPrevious.get()}function je(){return j}function De(){return x}function Ue(){return e}function _e(){return U}function ve(){return F}const ke={canScrollNext:ee,canScrollPrev:xe,containerNode:_e,internalEngine:De,destroy:B,off:m,on:p,emit:y,plugins:je,previousScrollSnap:Ie,reInit:v,rootNode:Ue,scrollNext:pe,scrollPrev:k,scrollProgress:Te,scrollSnapList:S,scrollTo:K,selectedScrollSnap:Ne,slideNodes:ve,slidesInView:V,slidesNotInView:Y};return J(t,n),setTimeout(()=>c.emit("init"),0),ke}Ui.animationRealms=[],Ui.globalOptions=void 0;function Wc(e={},t=[]){const n=_.useRef(e),r=_.useRef(t),[i,s]=_.useState(),[o,a]=_.useState(),l=_.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return _.useEffect(()=>{if(mT()&&o){Ui.globalOptions=Wc.globalOptions;const c=Ui(o,n.current,r.current);return s(c),()=>c.destroy()}else s(void 0)},[o,s]),_.useEffect(()=>{Bc(n.current,e)||(n.current=e,l())},[e,l]),_.useEffect(()=>{gT(r.current,t)||(r.current=t,l())},[t,l]),[a,i]}Wc.globalOptions=void 0;function WT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M7.72 12.53a.75.75 0 010-1.06l7.5-7.5a.75.75 0 111.06 1.06L9.31 12l6.97 6.97a.75.75 0 11-1.06 1.06l-7.5-7.5z",clipRule:"evenodd"}))}const HT=R.forwardRef(WT);function qT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z",clipRule:"evenodd"}))}const KT=R.forwardRef(qT);function JT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0016.5 9h-1.875a1.875 1.875 0 01-1.875-1.875V5.25A3.75 3.75 0 009 1.5H5.625zM7.5 15a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5A.75.75 0 017.5 15zm.75 2.25a.75.75 0 000 1.5H12a.75.75 0 000-1.5H8.25z",clipRule:"evenodd"}),R.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0114.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 013.434 1.279 9.768 9.768 0 00-6.963-6.963z"}))}const GT=R.forwardRef(JT);function YT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{d:"M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z"}),R.createElement("path",{d:"M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z"}))}const QT=R.forwardRef(YT);function XT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{d:"M21.721 12.752a9.711 9.711 0 00-.945-5.003 12.754 12.754 0 01-4.339 2.708 18.991 18.991 0 01-.214 4.772 17.165 17.165 0 005.498-2.477zM14.634 15.55a17.324 17.324 0 00.332-4.647c-.952.227-1.945.347-2.966.347-1.021 0-2.014-.12-2.966-.347a17.515 17.515 0 00.332 4.647 17.385 17.385 0 005.268 0zM9.772 17.119a18.963 18.963 0 004.456 0A17.182 17.182 0 0112 21.724a17.18 17.18 0 01-2.228-4.605zM7.777 15.23a18.87 18.87 0 01-.214-4.774 12.753 12.753 0 01-4.34-2.708 9.711 9.711 0 00-.944 5.004 17.165 17.165 0 005.498 2.477zM21.356 14.752a9.765 9.765 0 01-7.478 6.817 18.64 18.64 0 001.988-4.718 18.627 18.627 0 005.49-2.098zM2.644 14.752c1.682.971 3.53 1.688 5.49 2.099a18.64 18.64 0 001.988 4.718 9.765 9.765 0 01-7.478-6.816zM13.878 2.43a9.755 9.755 0 016.116 3.986 11.267 11.267 0 01-3.746 2.504 18.63 18.63 0 00-2.37-6.49zM12 2.276a17.152 17.152 0 012.805 7.121c-.897.23-1.837.353-2.805.353-.968 0-1.908-.122-2.805-.353A17.151 17.151 0 0112 2.276zM10.122 2.43a18.629 18.629 0 00-2.37 6.49 11.266 11.266 0 01-3.746-2.504 9.754 9.754 0 016.116-3.985z"}))}const eO=R.forwardRef(XT);function tO({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"}))}const nO=R.forwardRef(tO);function rO({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M1.5 4.5a3 3 0 013-3h1.372c.86 0 1.61.586 1.819 1.42l1.105 4.423a1.875 1.875 0 01-.694 1.955l-1.293.97c-.135.101-.164.249-.126.352a11.285 11.285 0 006.697 6.697c.103.038.25.009.352-.126l.97-1.293a1.875 1.875 0 011.955-.694l4.423 1.105c.834.209 1.42.959 1.42 1.82V19.5a3 3 0 01-3 3h-2.25C8.552 22.5 1.5 15.448 1.5 6.75V4.5z",clipRule:"evenodd"}))}const iO=R.forwardRef(rO),sO=_.forwardRef(({type:e,styles:t,blocks:n},r)=>{const[i,s]=Wc({skipSnaps:!0}),[o,a]=_.useState(!0),[l,c]=_.useState(!0),u=_.useCallback(()=>s&&s.scrollPrev(),[s]),d=_.useCallback(()=>s&&s.scrollNext(),[s]),h=t==null?void 0:t[e],f=_.useCallback(p=>{a(!p.canScrollPrev()),c(!p.canScrollNext())},[]);return _.useEffect(()=>{s&&(f(s),s.on("reInit",f),s.on("select",f))},[s,f]),z.jsxs("div",{...h==null?void 0:h.container,"data-container":"carousel",ref:i,children:[z.jsx("div",{ref:r,...h==null?void 0:h.slidesContainer,children:n.map((p,m)=>z.jsx(Wi,{styles:t,block:p},m))}),z.jsx(HT,{...h==null?void 0:h.backButton,"data-disabled":o?"":void 0,onClick:u}),z.jsx(KT,{...h==null?void 0:h.nextButton,"data-disabled":l?"":void 0,onClick:d})]})}),$s=Math.min,$n=Math.max,na=Math.round,Fi=Math.floor,Fr=e=>({x:e,y:e}),oO={left:"right",right:"left",bottom:"top",top:"bottom"},aO={start:"end",end:"start"};function ra(e,t){return typeof e=="function"?e(t):e}function gi(e){return e.split("-")[0]}function Ms(e){return e.split("-")[1]}function lO(e){return e==="x"?"y":"x"}function Lp(e){return e==="y"?"height":"width"}function ia(e){return["top","bottom"].includes(gi(e))?"y":"x"}function Dp(e){return lO(ia(e))}function cO(e,t,n){n===void 0&&(n=!1);const r=Ms(e),i=Dp(e),s=Lp(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=sa(o)),[o,sa(o)]}function uO(e){const t=sa(e);return[Hc(e),t,Hc(t)]}function Hc(e){return e.replace(/start|end/g,t=>aO[t])}function dO(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function fO(e,t,n,r){const i=Ms(e);let s=dO(gi(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Hc)))),s}function sa(e){return e.replace(/left|right|bottom|top/g,t=>oO[t])}function hO(e){return{top:0,right:0,bottom:0,left:0,...e}}function pO(e){return typeof e!="number"?hO(e):{top:e,right:e,bottom:e,left:e}}function oa(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Br(e){return Np(e)?(e.nodeName||"").toLowerCase():"#document"}function En(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wr(e){var t;return(t=(Np(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Np(e){return e instanceof Node||e instanceof En(e).Node}function $t(e){return e instanceof Element||e instanceof En(e).Element}function ln(e){return e instanceof HTMLElement||e instanceof En(e).HTMLElement}function qc(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof En(e).ShadowRoot}function Ls(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Sn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function mO(e){return["table","td","th"].includes(Br(e))}function Kc(e){const t=Jc(),n=Sn(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function gO(e){let t=yi(e);for(;ln(t)&&!Ds(t);){if(Kc(t))return t;t=yi(t)}return null}function Jc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ds(e){return["html","body","#document"].includes(Br(e))}function Sn(e){return En(e).getComputedStyle(e)}function aa(e){return $t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function yi(e){if(Br(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qc(e)&&e.host||wr(e);return qc(t)?t.host:t}function jp(e){const t=yi(e);return Ds(t)?e.ownerDocument?e.ownerDocument.body:e.body:ln(t)&&Ls(t)?t:jp(t)}function Vr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=jp(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=En(i);return s?t.concat(o,o.visualViewport||[],Ls(i)?i:[],o.frameElement&&n?Vr(o.frameElement):[]):t.concat(i,Vr(i,[],n))}function zr(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function bn(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&qc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Up(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function yO(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Fp(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Up())||t.test(yO()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Bp(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function Vp(){return/apple/i.test(navigator.vendor)}function vO(){return Up().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function zp(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function bO(e){return"nativeEvent"in e}function wO(e){return e.matches("html,body")}function Bn(e){return(e==null?void 0:e.ownerDocument)||document}function Gc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Zp(e){return"composedPath"in e?e.composedPath()[0]:e.target}const xO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Wp(e){return ln(e)&&e.matches(xO)}function tn(e){e.preventDefault(),e.stopPropagation()}function Hp(e,t,n){let{reference:r,floating:i}=e;const s=ia(t),o=Dp(t),a=Lp(o),l=gi(t),c=s==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Ms(t)){case"start":f[o]-=h*(n&&c?-1:1);break;case"end":f[o]+=h*(n&&c?-1:1);break}return f}const _O=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Hp(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:y,fn:v}=a[m],{x:b,y:x,data:I,reset:P}=await v({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:c,platform:o,elements:{reference:e,floating:t}});if(u=b??u,d=x??d,f={...f,[y]:{...f[y],...I}},P&&p<=50){p++,typeof P=="object"&&(P.placement&&(h=P.placement),P.rects&&(c=P.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):P.rects),{x:u,y:d}=Hp(c,h,l)),m=-1;continue}}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}};async function qp(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=ra(t,e),p=pO(f),y=a[h?d==="floating"?"reference":"floating":d],v=oa(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{...o.floating,x:r,y:i}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),I=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},P=oa(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:x,strategy:l}):b);return{top:(v.top-P.top+p.top)/I.y,bottom:(P.bottom-v.bottom+p.bottom)/I.y,left:(v.left-P.left+p.left)/I.x,right:(P.right-v.right+p.right)/I.x}}const kO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=ra(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=gi(i),b=gi(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),I=h||(b||!m?[sa(a)]:uO(a));!h&&p!=="none"&&I.push(...fO(a,m,p,x));const P=[a,...I],T=await qp(t,y),j=[];let U=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&j.push(T[v]),d){const J=cO(i,o,x);j.push(T[J[0]],T[J[1]])}if(U=[...U,{placement:i,overflows:j}],!j.every(J=>J<=0)){var F,O;const J=(((F=s.flip)==null?void 0:F.index)||0)+1,q=P[J];if(q)return{data:{index:J,overflows:U},reset:{placement:q}};let W=(O=U.filter(B=>B.overflows[0]<=0).sort((B,V)=>B.overflows[1]-V.overflows[1])[0])==null?void 0:O.placement;if(!W)switch(f){case"bestFit":{var N;const B=(N=U.map(V=>[V.placement,V.overflows.filter(Y=>Y>0).reduce((Y,K)=>Y+K,0)]).sort((V,Y)=>V[1]-Y[1])[0])==null?void 0:N[0];B&&(W=B);break}case"initialPlacement":W=a;break}if(i!==W)return{reset:{placement:W}}}return{}}}};async function CO(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=gi(n),a=Ms(n),l=ia(n)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,d=ra(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const EO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await CO(t,e);return{x:n+i.x,y:r+i.y,data:i}}}},SO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=ra(e,t),l=await qp(t,a),c=gi(n),u=Ms(n),d=ia(n)==="y",{width:h,height:f}=r.floating;let p,m;c==="top"||c==="bottom"?(p=c,m=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,p=u==="end"?"top":"bottom");const y=f-l[p],v=h-l[m],b=!t.middlewareData.shift;let x=y,I=v;if(d){const T=h-l.left-l.right;I=u||b?$s(v,T):T}else{const T=f-l.top-l.bottom;x=u||b?$s(y,T):T}if(b&&!u){const T=$n(l.left,0),j=$n(l.right,0),U=$n(l.top,0),F=$n(l.bottom,0);d?I=h-2*(T!==0||j!==0?T+j:$n(l.left,l.right)):x=f-2*(U!==0||F!==0?U+F:$n(l.top,l.bottom))}await o({...t,availableWidth:I,availableHeight:x});const P=await i.getDimensions(s.floating);return h!==P.width||f!==P.height?{reset:{rects:!0}}:{}}}};function Kp(e){const t=Sn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ln(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=na(n)!==s||na(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Yc(e){return $t(e)?e:e.contextElement}function Bi(e){const t=Yc(e);if(!ln(t))return Fr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=Kp(t);let o=(s?na(n.width):n.width)/r,a=(s?na(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const TO=Fr(0);function Jp(e){const t=En(e);return!Jc()||!t.visualViewport?TO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function OO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==En(e)?!1:t}function vi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Yc(e);let o=Fr(1);t&&(r?$t(r)&&(o=Bi(r)):o=Bi(e));const a=OO(s,n,r)?Jp(s):Fr(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const h=En(s),f=r&&$t(r)?En(r):r;let p=h.frameElement;for(;p&&r&&f!==h;){const m=Bi(p),y=p.getBoundingClientRect(),v=Sn(p),b=y.left+(p.clientLeft+parseFloat(v.paddingLeft))*m.x,x=y.top+(p.clientTop+parseFloat(v.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=b,c+=x,p=En(p).frameElement}}return oa({width:u,height:d,x:l,y:c})}function IO(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=ln(n),s=wr(n);if(n===s)return t;let o={scrollLeft:0,scrollTop:0},a=Fr(1);const l=Fr(0);if((i||!i&&r!=="fixed")&&((Br(n)!=="body"||Ls(s))&&(o=aa(n)),ln(n))){const c=vi(n);a=Bi(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-o.scrollLeft*a.x+l.x,y:t.y*a.y-o.scrollTop*a.y+l.y}}function PO(e){return Array.from(e.getClientRects())}function Gp(e){return vi(wr(e)).left+aa(e).scrollLeft}function AO(e){const t=wr(e),n=aa(e),r=e.ownerDocument.body,i=$n(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=$n(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Gp(e);const a=-n.scrollTop;return Sn(r).direction==="rtl"&&(o+=$n(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function RO(e,t){const n=En(e),r=wr(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=Jc();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function $O(e,t){const n=vi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=ln(e)?Bi(e):Fr(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function Yp(e,t,n){let r;if(t==="viewport")r=RO(e,n);else if(t==="document")r=AO(wr(e));else if($t(t))r=$O(t,n);else{const i=Jp(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return oa(r)}function Qp(e,t){const n=yi(e);return n===t||!$t(n)||Ds(n)?!1:Sn(n).position==="fixed"||Qp(n,t)}function MO(e,t){const n=t.get(e);if(n)return n;let r=Vr(e,[],!1).filter(a=>$t(a)&&Br(a)!=="body"),i=null;const s=Sn(e).position==="fixed";let o=s?yi(e):e;for(;$t(o)&&!Ds(o);){const a=Sn(o),l=Kc(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ls(o)&&!l&&Qp(e,o))?r=r.filter(u=>u!==o):i=a,o=yi(o)}return t.set(e,r),r}function LO(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?MO(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const d=Yp(t,u,i);return c.top=$n(d.top,c.top),c.right=$s(d.right,c.right),c.bottom=$s(d.bottom,c.bottom),c.left=$n(d.left,c.left),c},Yp(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function DO(e){return Kp(e)}function NO(e,t,n){const r=ln(t),i=wr(t),s=n==="fixed",o=vi(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Fr(0);if(r||!r&&!s)if((Br(t)!=="body"||Ls(i))&&(a=aa(t)),r){const c=vi(t,!0,s,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else i&&(l.x=Gp(i));return{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Xp(e,t){return!ln(e)||Sn(e).position==="fixed"?null:t?t(e):e.offsetParent}function em(e,t){const n=En(e);if(!ln(e))return n;let r=Xp(e,t);for(;r&&mO(r)&&Sn(r).position==="static";)r=Xp(r,t);return r&&(Br(r)==="html"||Br(r)==="body"&&Sn(r).position==="static"&&!Kc(r))?n:r||gO(e)||n}const jO=async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||em,s=this.getDimensions;return{reference:NO(t,await i(n),r),floating:{x:0,y:0,...await s(n)}}};function UO(e){return Sn(e).direction==="rtl"}const FO={convertOffsetParentRelativeRectToViewportRelativeRect:IO,getDocumentElement:wr,getClippingRect:LO,getOffsetParent:em,getElementRects:jO,getClientRects:PO,getDimensions:DO,getScale:Bi,isElement:$t,isRTL:UO};function BO(e,t){let n=null,r;const i=wr(e);function s(){clearTimeout(r),n&&n.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f=Fi(u),p=Fi(i.clientWidth-(c+d)),m=Fi(i.clientHeight-(u+h)),y=Fi(c),b={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:$n(0,$s(1,l))||1};let x=!0;function I(P){const T=P[0].intersectionRatio;if(T!==l){if(!x)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},100)}x=!1}try{n=new IntersectionObserver(I,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,b)}n.observe(e)}return o(!0),s}function VO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Yc(e),u=i||s?[...c?Vr(c):[],...Vr(t)]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=c&&a?BO(c,n):null;let h=-1,f=null;o&&(f=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{f&&f.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let p,m=l?vi(e):null;l&&y();function y(){const v=vi(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,p=requestAnimationFrame(y)}return n(),()=>{u.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d&&d(),f&&f.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const zO=(e,t,n)=>{const r=new Map,i={platform:FO,...n},s={...i.platform,_c:r};return _O(e,t,{...i,platform:s})};var la=typeof document<"u"?_.useLayoutEffect:_.useEffect;function ca(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ca(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!ca(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function tm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nm(e,t){const n=tm(e);return Math.round(t*n)/n}function rm(e){const t=R.useRef(e);return la(()=>{t.current=e}),t}function ZO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=R.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=R.useState(r);ca(h,r)||f(r);const[p,m]=R.useState(null),[y,v]=R.useState(null),b=R.useCallback(V=>{V!=T.current&&(T.current=V,m(V))},[m]),x=R.useCallback(V=>{V!==j.current&&(j.current=V,v(V))},[v]),I=s||p,P=o||y,T=R.useRef(null),j=R.useRef(null),U=R.useRef(u),F=rm(l),O=rm(i),N=R.useCallback(()=>{if(!T.current||!j.current)return;const V={placement:t,strategy:n,middleware:h};O.current&&(V.platform=O.current),zO(T.current,j.current,V).then(Y=>{const K={...Y,isPositioned:!0};J.current&&!ca(U.current,K)&&(U.current=K,jw.flushSync(()=>{d(K)}))})},[h,t,n,O]);la(()=>{c===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[c]);const J=R.useRef(!1);la(()=>(J.current=!0,()=>{J.current=!1}),[]),la(()=>{if(I&&(T.current=I),P&&(j.current=P),I&&P){if(F.current)return F.current(I,P,N);N()}},[I,P,N,F]);const q=R.useMemo(()=>({reference:T,floating:j,setReference:b,setFloating:x}),[b,x]),W=R.useMemo(()=>({reference:I,floating:P}),[I,P]),B=R.useMemo(()=>{const V={position:n,left:0,top:0};if(!W.floating)return V;const Y=nm(W.floating,u.x),K=nm(W.floating,u.y);return a?{...V,transform:"translate("+Y+"px, "+K+"px)",...tm(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:K}},[n,a,W.floating,u.x,u.y]);return R.useMemo(()=>({...u,update:N,refs:q,elements:W,floatingStyles:B}),[u,N,q,W,B])}/*!
233
+ `));let h=pp((i=u.props)==null?void 0:i.className,l.className),f=h?{className:h}:{};return _.cloneElement(u,Object.assign({},yp(u.props,vp(Mc(l,["ref"]))),d,c,CS(u.ref,c.ref),f))}return _.createElement(s,Object.assign({},Mc(l,["ref"]),s!==_.Fragment&&c,s!==_.Fragment&&d),u)}function CS(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}}function yp(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](i,...s){let o=n[r];for(let a of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...s)}}});return t}function $c(e){var t;return Object.assign(_.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function vp(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Mc(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let Lc=_.createContext(null);Lc.displayName="OpenClosedContext";var vr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(vr||{});function bp(){return _.useContext(Lc)}function ES({value:e,children:t}){return _.createElement(Lc.Provider,{value:e},t)}function wp(){let e=_.useRef(!1);return Ho(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function SS(e=0){let[t,n]=_.useState(e),r=_.useCallback(a=>n(l=>l|a),[t]),i=_.useCallback(a=>!!(t&a),[t]),s=_.useCallback(a=>n(l=>l&~a),[n]),o=_.useCallback(a=>n(l=>l^a),[n]);return{flags:t,addFlag:r,hasFlag:i,removeFlag:s,toggleFlag:o}}function TS(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Dc(e,...t){e&&t.length>0&&e.classList.add(...t)}function Nc(e,...t){e&&t.length>0&&e.classList.remove(...t)}function OS(e,t){let n=qo();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[s,o]=[r,i].map(a=>{let[l=0]=a.split(",").filter(Boolean).map(c=>c.includes("ms")?parseFloat(c):parseFloat(c)*1e3).sort((c,u)=>u-c);return l});if(s+o!==0){let a=n.addEventListener(e,"transitionend",l=>{l.target===l.currentTarget&&(t(),a())})}else t();return n.add(()=>t()),n.dispose}function IS(e,t,n,r){let i=n?"enter":"leave",s=qo(),o=r!==void 0?TS(r):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Xn(i,{enter:()=>t.enter,leave:()=>t.leave}),l=Xn(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Xn(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Nc(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Dc(e,...a,...c),s.nextFrame(()=>{Nc(e,...c),Dc(e,...l),OS(e,()=>(Nc(e,...a),Dc(e,...t.entered),o()))}),s.dispose}function PS({container:e,direction:t,classes:n,onStart:r,onStop:i}){let s=wp(),o=dp(),a=Ni(t);Ho(()=>{let l=qo();o.add(l.dispose);let c=e.current;if(c&&a.current!=="idle"&&s.current)return l.dispose(),r.current(a.current),l.add(IS(c,n.current,a.current==="enter",()=>{l.dispose(),i.current(a.current)})),l.dispose},[t])}function mi(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let Jo=_.createContext(null);Jo.displayName="TransitionContext";var AS=(e=>(e.Visible="visible",e.Hidden="hidden",e))(AS||{});function RS(){let e=_.useContext(Jo);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function $S(){let e=_.useContext(Go);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Go=_.createContext(null);Go.displayName="NestingContext";function Yo(e){return"children"in e?Yo(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function xp(e,t){let n=Ni(e),r=_.useRef([]),i=wp(),s=dp(),o=pi((f,p=yr.Hidden)=>{let m=r.current.findIndex(({el:v})=>v===f);m!==-1&&(Xn(p,{[yr.Unmount](){r.current.splice(m,1)},[yr.Hidden](){r.current[m].state="hidden"}}),s.microTask(()=>{var v;!Yo(r)&&i.current&&((v=n.current)==null||v.call(n))}))}),a=pi(f=>{let p=r.current.find(({el:m})=>m===f);return p?p.state!=="visible"&&(p.state="visible"):r.current.push({el:f,state:"visible"}),()=>o(f,yr.Unmount)}),l=_.useRef([]),c=_.useRef(Promise.resolve()),u=_.useRef({enter:[],leave:[],idle:[]}),d=pi((f,p,m)=>{l.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([v])=>v!==f)),t==null||t.chains.current[p].push([f,new Promise(v=>{l.current.push(v)})]),t==null||t.chains.current[p].push([f,new Promise(v=>{Promise.all(u.current[p].map(([y,b])=>b)).then(()=>v())})]),p==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(p)):m(p)}),h=pi((f,p,m)=>{Promise.all(u.current[p].splice(0).map(([v,y])=>y)).then(()=>{var v;(v=l.current.shift())==null||v()}).then(()=>m(p))});return _.useMemo(()=>({children:r,register:a,unregister:o,onStart:d,onStop:h,wait:c,chains:u}),[a,o,r,d,h,u,c])}function MS(){}let LS=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function _p(e){var t;let n={};for(let r of LS)n[r]=(t=e[r])!=null?t:MS;return n}function DS(e){let t=_.useRef(_p(e));return _.useEffect(()=>{t.current=_p(e)},[e]),t}let NS="div",kp=mp.RenderStrategy,Cp=$c(function(e,t){let{beforeEnter:n,afterEnter:r,beforeLeave:i,afterLeave:s,enter:o,enterFrom:a,enterTo:l,entered:c,leave:u,leaveFrom:d,leaveTo:h,...f}=e,p=_.useRef(null),m=hp(p,t),v=f.unmount?yr.Unmount:yr.Hidden,{show:y,appear:b,initial:x}=RS(),[I,A]=_.useState(y?"visible":"hidden"),O=$S(),{register:j,unregister:U}=O,H=_.useRef(null);_.useEffect(()=>j(p),[j,p]),_.useEffect(()=>{if(v===yr.Hidden&&p.current){if(y&&I!=="visible"){A("visible");return}return Xn(I,{hidden:()=>U(p),visible:()=>j(p)})}},[I,p,j,U,y,v]);let T=Ni({enter:mi(o),enterFrom:mi(a),enterTo:mi(l),entered:mi(c),leave:mi(u),leaveFrom:mi(d),leaveTo:mi(h)}),N=DS({beforeEnter:n,afterEnter:r,beforeLeave:i,afterLeave:s}),G=fp();_.useEffect(()=>{if(G&&I==="visible"&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,I,G]);let W=x&&!b,q=(()=>!G||W||H.current===y?"idle":y?"enter":"leave")(),B=SS(0),z=pi(ee=>Xn(ee,{enter:()=>{B.addFlag(vr.Opening),N.current.beforeEnter()},leave:()=>{B.addFlag(vr.Closing),N.current.beforeLeave()},idle:()=>{}})),Y=pi(ee=>Xn(ee,{enter:()=>{B.removeFlag(vr.Opening),N.current.afterEnter()},leave:()=>{B.removeFlag(vr.Closing),N.current.afterLeave()},idle:()=>{}})),K=xp(()=>{A("hidden"),U(p)},O);PS({container:p,classes:T,direction:q,onStart:Ni(ee=>{K.onStart(p,ee,z)}),onStop:Ni(ee=>{K.onStop(p,ee,Y),ee==="leave"&&!Yo(K)&&(A("hidden"),U(p))})}),_.useEffect(()=>{!W||(v===yr.Hidden?H.current=null:H.current=y)},[y,W,I]);let pe=f,k={ref:m};return b&&y&&Ps.isServer&&(pe={...pe,className:pp(f.className,...T.current.enter,...T.current.enterFrom)}),_.createElement(Go.Provider,{value:K},_.createElement(ES,{value:Xn(I,{visible:vr.Open,hidden:vr.Closed})|B.flags},gp({ourProps:k,theirProps:pe,defaultTag:NS,features:kp,visible:I==="visible",name:"Transition.Child"})))}),jc=$c(function(e,t){let{show:n,appear:r=!1,unmount:i,...s}=e,o=_.useRef(null),a=hp(o,t);fp();let l=bp();if(n===void 0&&l!==null&&(n=(l&vr.Open)===vr.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=_.useState(n?"visible":"hidden"),d=xp(()=>{u("hidden")}),[h,f]=_.useState(!0),p=_.useRef([n]);Ho(()=>{h!==!1&&p.current[p.current.length-1]!==n&&(p.current.push(n),f(!1))},[p,n]);let m=_.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);_.useEffect(()=>{if(n)u("visible");else if(!Yo(d))u("hidden");else{let y=o.current;if(!y)return;let b=y.getBoundingClientRect();b.x===0&&b.y===0&&b.width===0&&b.height===0&&u("hidden")}},[n,d]);let v={unmount:i};return _.createElement(Go.Provider,{value:d},_.createElement(Jo.Provider,{value:m},gp({ourProps:{...v,as:_.Fragment,children:_.createElement(Cp,{ref:a,...v,...s})},theirProps:{},defaultTag:_.Fragment,features:kp,visible:c==="visible",name:"Transition"})))}),jS=$c(function(e,t){let n=_.useContext(Jo)!==null,r=bp()!==null;return _.createElement(_.Fragment,null,!n&&r?_.createElement(jc,{ref:t,...e}):_.createElement(Cp,{ref:t,...e}))}),US=Object.assign(jc,{Child:jS,Root:jc});const FS=e=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,...e},R.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"})),BS=e=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",...e},R.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M18 6 6 18M6 6l12 12"})),VS=e=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,...e},R.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));function zS(e){return vn.custom(t=>F.jsx(WS,{type:e.type,show:t.visible,children:e.type==="custom"?e.content:F.jsx(ZS,{...e,toastId:t.id})}))}const ZS=({icon:e,type:t,title:n,description:r,toastId:i})=>{const{theme:{notification:s}}=vt();return F.jsxs(F.Fragment,{children:[e?F.jsx(e,{...s==null?void 0:s.icon}):F.jsx(HS,{...s==null?void 0:s.icon,type:t}),F.jsx("p",{...s==null?void 0:s.title,children:n}),r?F.jsx("p",{...s==null?void 0:s.description,children:r}):null,F.jsx(BS,{...s==null?void 0:s.closeIcon,onClick:()=>vn.dismiss(i)})]})},WS=({type:e,...t})=>{const{theme:{notification:n}}=vt();return F.jsx(US,{...t,...n==null?void 0:n.container,appear:!0,"data-type":e??"neutral"})},HS=({type:e,className:t})=>{switch(e){case"success":return F.jsx(FS,{className:t});case"error":return F.jsx(VS,{className:t});default:return null}},qS=_.forwardRef(({url:e,type:t,styles:n,orientation:r="auto",...i},s)=>{var h,f;const o=_.useId(),{setIsLoading:a}=kE(),[l,c]=_.useState(r),[u,d]=_.useState(!1);return _.useLayoutEffect(()=>{a(p=>[...p,o])},[]),_.useEffect(()=>{e&&l==="auto"&&OE(e).then(({width:p,height:m})=>{c(KS(p,m)),a(v=>v.filter(y=>y!==o))})},[e]),F.jsxs(F.Fragment,{children:[u?null:F.jsx("div",{"data-orientation":l,...(h=n==null?void 0:n[t])==null?void 0:h.placeholder}),F.jsx("img",{"data-orientation":l,"data-loaded":u,...i,...(f=n==null?void 0:n[t])==null?void 0:f.image,src:e,alt:"",ref:s,loading:"lazy",onLoad:()=>{d(!0)}})]})});function KS(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((s,o)=>Math.abs(n[o]-r)<Math.abs(n[s]-r)?o:s)}const JS=_.forwardRef(({url:e,type:t,styles:n,...r},i)=>F.jsx("div",{children:F.jsx("video",{...r,controls:!0,src:e,...n==null?void 0:n[t],ref:i})})),GS=_.forwardRef(({url:e,type:t,styles:n,...r},i)=>F.jsx("div",{children:F.jsx("audio",{...r,controls:!0,src:e,...n==null?void 0:n[t],ref:i})}));function YS({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.75.75v10.638l3.96-4.158a.75.75 0 111.08 1.04l-5.25 5.5a.75.75 0 01-1.08 0l-5.25-5.5a.75.75 0 111.08-1.04l3.96 4.158V3.75A.75.75 0 0110 3z",clipRule:"evenodd"}))}const QS=R.forwardRef(YS);function XS({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0V5.36l-.31-.31A7 7 0 003.239 8.188a.75.75 0 101.448.389A5.5 5.5 0 0113.89 6.11l.311.31h-2.432a.75.75 0 000 1.5h4.243a.75.75 0 00.53-.219z",clipRule:"evenodd"}))}const eT=R.forwardRef(XS);function tT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm-.75-4.75a.75.75 0 001.5 0V8.66l1.95 2.1a.75.75 0 101.1-1.02l-3.25-3.5a.75.75 0 00-1.1 0L6.2 9.74a.75.75 0 101.1 1.02l1.95-2.1v4.59z",clipRule:"evenodd"}))}const nT=R.forwardRef(tT);function rT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"}))}const iT=R.forwardRef(rT);function sT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M4.5 2A1.5 1.5 0 003 3.5v13A1.5 1.5 0 004.5 18h11a1.5 1.5 0 001.5-1.5V7.621a1.5 1.5 0 00-.44-1.06l-4.12-4.122A1.5 1.5 0 0011.378 2H4.5zm4.75 6.75a.75.75 0 011.5 0v2.546l.943-1.048a.75.75 0 011.114 1.004l-2.25 2.5a.75.75 0 01-1.114 0l-2.25-2.5a.75.75 0 111.114-1.004l.943 1.048V8.75z",clipRule:"evenodd"}))}const oT=R.forwardRef(sT);function aT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M9.69 18.933l.003.001C9.89 19.02 10 19 10 19s.11.02.308-.066l.002-.001.006-.003.018-.008a5.741 5.741 0 00.281-.14c.186-.096.446-.24.757-.433.62-.384 1.445-.966 2.274-1.765C15.302 14.988 17 12.493 17 9A7 7 0 103 9c0 3.492 1.698 5.988 3.355 7.584a13.731 13.731 0 002.273 1.765 11.842 11.842 0 00.976.544l.062.029.018.008.006.003zM10 11.25a2.25 2.25 0 100-4.5 2.25 2.25 0 000 4.5z",clipRule:"evenodd"}))}const lT=R.forwardRef(aT),cT=_.forwardRef(({type:e,latitude:t,longitude:n,title:r,styles:i,...s},o)=>{var l,c,u;const a=`https://www.google.com/maps/search/?api=1&query=${t},${n}`;return F.jsxs("a",{...s,...(l=i==null?void 0:i[e])==null?void 0:l.container,href:a,type:"_blank",rel:"noopener",ref:o,children:[F.jsx("p",{...(c=i==null?void 0:i[e])==null?void 0:c.title,children:r}),F.jsx(lT,{...(u=i==null?void 0:i[e])==null?void 0:u.icon})]})}),uT=_.forwardRef(({blocks:e,styles:t,type:n,horizontalAlignment:r,verticalAlignment:i,...s},o)=>F.jsx("div",{"data-horizontal":r,"data-vertical":i,...s,...t==null?void 0:t[n],ref:o,children:e.map((a,l)=>F.jsx(Wi,{styles:t,block:a},l))})),dT=_.forwardRef(({blocks:e,styles:t,type:n,horizontalAlignment:r,verticalAlignment:i,...s},o)=>F.jsx("div",{"data-horizontal":r,"data-vertical":i,...s,...t==null?void 0:t[n],ref:o,children:e.map((a,l)=>F.jsx(Wi,{styles:t,block:a},l))}));function fT(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ep(e){return fT(e)||Array.isArray(e)}function hT(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Uc(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),s=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==s?!1:n.every(o=>{const a=e[o],l=t[o];return typeof a=="function"?`${a}`==`${l}`:!Ep(a)||!Ep(l)?a===l:Uc(a,l)})}function Sp(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function pT(e,t){if(e.length!==t.length)return!1;const n=Sp(e),r=Sp(t);return n.every((i,s)=>{const o=r[s];return Uc(i,o)})}function Fc(e){return typeof e=="number"}function Tp(e){return typeof e=="string"}function Bc(e){return typeof e=="boolean"}function Op(e){return Object.prototype.toString.call(e)==="[object Object]"}function It(e){return Math.abs(e)}function Vc(e){return Math.sign(e)}function Qo(e,t){return It(e-t)}function mT(e,t){if(e===0||t===0||It(e)<=It(t))return 0;const n=Qo(It(e),It(t));return It(n/e)}function As(e){return ea(e).map(Number)}function br(e){return e[Xo(e)]}function Xo(e){return Math.max(0,e.length-1)}function ea(e){return Object.keys(e)}function Ip(e,t){return[e,t].reduce((n,r)=>(ea(r).forEach(i=>{const s=n[i],o=r[i],a=Op(s)&&Op(o);n[i]=a?Ip(s,o):o}),n),{})}function Pp(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function gT(e,t){const n={start:r,center:i,end:s};function r(){return 0}function i(c){return s(c)/2}function s(c){return t-c}function o(){return t*Number(e)}function a(c){return Fc(e)?o():n[e](c)}return{measure:a}}function yT(e,t){const n=e==="y"?"y":"x",r=e==="y"?"x":"y",i=a(),s=l();function o(u){const{width:d,height:h}=u;return n==="x"?d:h}function a(){return n==="y"?"top":t==="rtl"?"right":"left"}function l(){return n==="y"?"bottom":t==="rtl"?"left":"right"}return{scroll:n,cross:r,startEdge:i,endEdge:s,measureSize:o}}function Ur(e,t){const n=It(e-t);function r(c){return c<e}function i(c){return c>t}function s(c){return r(c)||i(c)}function o(c){return s(c)?r(c)?e:t:c}function a(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:o,reachedAny:s,reachedMax:i,reachedMin:r,removeOffset:a}}function Ap(e,t,n){const{constrain:r}=Ur(0,e),i=e+1;let s=o(t);function o(h){return n?It((i+h)%i):r(h)}function a(){return s}function l(h){return s=o(h),d}function c(h){return u().set(a()+h)}function u(){return Ap(e,a(),n)}const d={get:a,set:l,add:c,clone:u};return d}function vT(e){const t=e==="rtl"?-1:1;function n(i){return i*t}return{apply:n}}function Rs(){let e=[];function t(i,s,o,a={passive:!0}){return i.addEventListener(s,o,a),e.push(()=>i.removeEventListener(s,o,a)),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function bT(e,t,n,r,i,s,o,a,l,c,u,d,h,f,p,m,v,y,b){const{cross:x}=e,I=["INPUT","SELECT","TEXTAREA"],A={passive:!1},O=Rs(),j=Rs(),U=Ur(50,225).constrain(p.measure(20)),H={mouse:300,touch:400},T={mouse:500,touch:600},N=m?43:25;let G=!1,W=0,q=0,B=!1,z=!1,Y=!1,K=!1;function pe(ye,Te){if(!Te)return;function ke(qe){(Bc(Te)||Te(ye,qe))&&Ne(qe)}const Re=n;O.add(Re,"dragstart",qe=>qe.preventDefault(),A).add(Re,"touchmove",()=>{},A).add(Re,"touchend",()=>{}).add(Re,"touchstart",ke).add(Re,"mousedown",ke).add(Re,"touchcancel",je).add(Re,"contextmenu",je).add(Re,"click",He,!0)}function k(){O.clear(),j.clear()}function ee(){const ye=K?r:n;j.add(ye,"touchmove",Ie,A).add(ye,"touchend",je).add(ye,"mousemove",Ie,A).add(ye,"mouseup",je)}function _e(ye){const Te=ye.nodeName||"";return I.includes(Te)}function S(){return(m?T:H)[K?"mouse":"touch"]}function Se(ye,Te){const ke=h.add(Vc(ye)*-1),Re=d.byDistance(ye,!m).distance;return m||It(ye)<U?Re:y&&Te?Re*.5:d.byIndex(ke.get(),0).distance}function Ne(ye){const Te=Pp(ye,i);K=Te,!(Te&&ye.button!==0)&&(_e(ye.target)||(Y=m&&Te&&!ye.buttons&&G,G=Qo(s.get(),a.get())>=2,B=!0,o.pointerDown(ye),u.useFriction(0).useDuration(0),s.set(a),ee(),W=o.readPoint(ye),q=o.readPoint(ye,x),f.emit("pointerDown")))}function Ie(ye){const Te=o.readPoint(ye),ke=o.readPoint(ye,x),Re=Qo(Te,W),qe=Qo(ke,q);if(!z&&!K&&(!ye.cancelable||(z=Re>qe,!z)))return je(ye);const D=o.pointerMove(ye);Re>v&&(Y=!0),u.useFriction(.3).useDuration(1),l.start(),s.add(t.apply(D)),ye.preventDefault()}function je(ye){const ke=d.byDistance(0,!1).index!==h.get(),Re=o.pointerUp(ye)*S(),qe=Se(t.apply(Re),ke),D=mT(Re,qe),ne=N-10*D,me=b+D/50;z=!1,B=!1,j.clear(),u.useDuration(ne).useFriction(me),c.distance(qe,!m),K=!1,f.emit("pointerUp")}function He(ye){Y&&(ye.stopPropagation(),ye.preventDefault())}function De(){return B}return{init:pe,pointerDown:De,destroy:k}}function wT(e,t){let r,i;function s(d){return d.timeStamp}function o(d,h){const p=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(Pp(d,t)?d:d.touches[0])[p]}function a(d){return r=d,i=d,o(d)}function l(d){const h=o(d)-o(i),f=s(d)-s(r)>170;return i=d,f&&(r=d),h}function c(d){if(!r||!i)return 0;const h=o(i)-o(r),f=s(d)-s(r),p=s(d)-s(i)>170,m=h/f;return f&&!p&&It(m)>.1?m:0}return{pointerDown:a,pointerMove:l,pointerUp:c,readPoint:o}}function xT(e){function t(r){return e*(r/100)}return{measure:t}}function _T(e,t,n,r,i){let s,o,a=[],l=!1;function c(f){return i.measureSize(f.getBoundingClientRect())}function u(f,p){if(!p)return;o=c(e),a=r.map(c);function m(y){for(const b of y){const x=b.target===e,I=r.indexOf(b.target),A=x?o:a[I],O=c(x?e:r[I]);if(A!==O){n.requestAnimationFrame(()=>{f.reInit(),t.emit("resize")});break}}}s=new ResizeObserver(y=>{l||(Bc(p)||p(f,y))&&m(y)}),[e].concat(r).forEach(y=>s.observe(y))}function d(){s&&s.disconnect(),l=!0}return{init:u,destroy:d}}function kT(e,t,n,r){let i=!0,s=0,o=0,a=n,l=r,c=e.get(),u=0;function d(){const A=t.get()-e.get(),O=!a;let j=0;return O?(s=0,e.set(t),j=A):(s+=A/a,s*=l,c+=s,e.add(s),j=c-u),o=Vc(j),u=c,i=It(A)<.001,I}function h(){return i}function f(){return a}function p(){return o}function m(){return s}function v(){return b(n)}function y(){return x(r)}function b(A){return a=A,I}function x(A){return l=A,I}const I={direction:p,duration:f,velocity:m,seek:d,settled:h,useBaseFriction:y,useBaseDuration:v,useFriction:x,useDuration:b};return I}function CT(e,t,n,r,i){const s=i.measure(10),o=i.measure(50),a=Ur(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(f){if(!c())return;const p=e.reachedMin(t.get())?"min":"max",m=It(e[p]-t.get()),v=n.get()-t.get(),y=a.constrain(m/o);n.subtract(v*y),!f&&It(v)<s&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function d(f){l=!f}return{constrain:u,toggleActive:d}}function ET(e,t,n,r){const i=Ur(-t+e,n[0]),s=l(),o=c();function a(){const d=s[0],h=br(s),f=s.lastIndexOf(d),p=s.indexOf(h)+1;return Ur(f,p)}function l(){return n.map(i.constrain).map(d=>parseFloat(d.toFixed(3)))}function c(){if(t<=e)return[i.max];if(r==="keepSnaps")return s;const{min:d,max:h}=a();return s.slice(d,h)}return{snapsContained:o}}function ST(e,t,n){const r=t[0],i=n?r-e:br(t);return{limit:Ur(i,r)}}function TT(e,t,n,r){const s=t.min+.1,o=t.max+.1,{reachedMin:a,reachedMax:l}=Ur(s,o);function c(h){return h===1?l(n.get()):h===-1?a(n.get()):!1}function u(h){if(!c(h))return;const f=e*(h*-1);r.forEach(p=>p.add(f))}return{loop:u}}function OT(e){const{max:t,length:n}=e;function r(s){return(s-t)/-n}return{get:r}}function IT(e,t,n,r,i,s,o){const{startEdge:a,endEdge:l}=e,{groupSlides:c}=s,u=f().map(t.measure),d=p(),h=m();function f(){return c(r).map(y=>br(y)[l]-y[0][a]).map(It)}function p(){return r.map(y=>n[a]-y[a]).map(y=>-It(y))}function m(){const b=br(d)-br(i);return c(d).map(x=>x[0]).map((x,I,A)=>{const O=!I,j=I===Xo(A);return o&&O?0:o&&j?b:x+u[I]})}return{snaps:d,snapsAligned:h}}function PT(e,t,n,r,i){const{reachedAny:s,removeOffset:o,constrain:a}=r;function l(p){return p.concat().sort((m,v)=>It(m)-It(v))[0]}function c(p){const m=e?o(p):a(p),v=t.map(b=>b-m).map(b=>u(b,0)).map((b,x)=>({diff:b,index:x})).sort((b,x)=>It(b.diff)-It(x.diff)),{index:y}=v[0];return{index:y,distance:m}}function u(p,m){const v=[p,p+n,p-n];if(!e)return v[0];if(!m)return l(v);const y=v.filter(b=>Vc(b)===m);return l(y)}function d(p,m){const v=t[p]-i.get(),y=u(v,m);return{index:p,distance:y}}function h(p,m){const v=i.get()+p,{index:y,distance:b}=c(v),x=!e&&s(v);if(!m||x)return{index:y,distance:p};const I=t[y]-b,A=p+u(I,0);return{index:y,distance:A}}return{byDistance:h,byIndex:d,shortcut:u}}function AT(e,t,n,r,i,s,o){function a(d){const h=d.distance,f=d.index!==t.get();s.add(h),h&&(i.duration()?e.start():(e.update(),e.render(1),e.update())),f&&(n.set(t.get()),t.set(d.index),o.emit("select"))}function l(d,h){const f=r.byDistance(d,h);a(f)}function c(d,h){const f=t.clone().set(d),p=r.byIndex(f.get(),h);a(p)}return{distance:l,index:c}}function ta(e){let t=e;function n(){return t}function r(l){t=o(l)}function i(l){t+=o(l)}function s(l){t-=o(l)}function o(l){return Fc(l)?l:l.get()}return{get:n,set:r,add:i,subtract:s}}function Rp(e,t,n){const r=e.scroll==="x"?o:a,i=n.style;let s=!1;function o(h){return`translate3d(${h}px,0px,0px)`}function a(h){return`translate3d(0px,${h}px,0px)`}function l(h){s||(i.transform=r(t.apply(h)))}function c(h){s=!h}function u(){s||(i.transform="",n.getAttribute("style")||n.removeAttribute("style"))}return{clear:u,to:l,toggleActive:c}}function RT(e,t,n,r,i,s,o,a,l){const c=As(i),u=As(i).reverse(),d=m().concat(v());function h(A,O){return A.reduce((j,U)=>j-i[U],O)}function f(A,O){return A.reduce((j,U)=>h(j,O)>0?j.concat([U]):j,[])}function p(A,O){const j=O==="start",U=j?-r:r,H=o.findSlideBounds([U]);return A.map(T=>{const N=j?0:-r,G=j?r:0,q=H.filter(B=>B.index===T)[0][j?"end":"start"];return{index:T,slideLocation:ta(-1),translate:Rp(e,t,l[T]),target:()=>a.get()>q?N:G}})}function m(){const A=s[0]-1,O=f(u,A);return p(O,"end")}function v(){const A=n-s[0]-1,O=f(c,A);return p(O,"start")}function y(){return d.every(({index:A})=>{const O=c.filter(j=>j!==A);return h(O,n)<=.1})}function b(){d.forEach(A=>{const{target:O,translate:j,slideLocation:U}=A,H=O();H!==U.get()&&(j.to(H),U.set(H))})}function x(){d.forEach(A=>A.translate.clear())}return{canLoop:y,clear:x,loop:b,loopPoints:d}}function $T(e,t){let n,r=!1;function i(a,l){if(!l)return;function c(u){for(const d of u)if(d.type==="childList"){a.reInit(),t.emit("slidesChanged");break}}n=new MutationObserver(u=>{r||(Bc(l)||l(a,u))&&c(u)}),n.observe(e,{childList:!0})}function s(){n&&n.disconnect(),r=!0}return{init:i,destroy:s}}function MT(e,t,n,r,i,s,o){const{removeOffset:a,constrain:l}=i,c=.5,u=s?[0,t,-t]:[0],d=f(u,o);function h(v){const y=v||0;return n.map(b=>Ur(c,b-c).constrain(b*y))}function f(v,y){const b=v||u,x=h(y);return b.reduce((I,A)=>{const O=r.map((j,U)=>({start:j-n[U]+x[U]+A,end:j+e-x[U]+A,index:U}));return I.concat(O)},[])}function p(v,y){const b=s?a(v):l(v);return(y||d).reduce((I,A)=>{const{index:O,start:j,end:U}=A,H=I.includes(O),T=j<b&&U>b;return!H&&T?I.concat([O]):I},[])}return{check:p,findSlideBounds:f}}function LT(e,t,n,r,i,s){const{measureSize:o,startEdge:a,endEdge:l}=e,c=n[0]&&i,u=p(),d=m(),h=n.map(o),f=v();function p(){if(!c)return 0;const b=n[0];return It(t[a]-b[a])}function m(){if(!c)return 0;const b=s.getComputedStyle(br(r));return parseFloat(b.getPropertyValue(`margin-${l}`))}function v(){return n.map((b,x,I)=>{const A=!x,O=x===Xo(I);return A?h[x]+u:O?h[x]+d:I[x+1][a]-b[a]}).map(It)}return{slideSizes:h,slideSizesWithGaps:f}}function DT(e,t,n){const r=Fc(n);function i(l,c){return As(l).filter(u=>u%c===0).map(u=>l.slice(u,u+c))}function s(l){return As(l).reduce((c,u)=>{const h=t.slice(br(c),u+1).reduce((f,p)=>f+p,0);return!u||h>e?c.concat(u):c},[]).map((c,u,d)=>l.slice(c,d[u+1]))}function o(l){return r?i(l,n):s(l)}return{groupSlides:o}}function NT(e,t,n,r,i,s,o,a){const{align:l,axis:c,direction:u,startIndex:d,inViewThreshold:h,loop:f,duration:p,dragFree:m,dragThreshold:v,slidesToScroll:y,skipSnaps:b,containScroll:x}=s,I=t.getBoundingClientRect(),A=n.map(me=>me.getBoundingClientRect()),O=vT(u),j=yT(c,u),U=j.measureSize(I),H=xT(U),T=gT(l,U),N=!f&&!!x,G=f||!!x,{slideSizes:W,slideSizesWithGaps:q}=LT(j,I,A,n,G,i),B=DT(U,q,y),{snaps:z,snapsAligned:Y}=IT(j,T,I,A,q,B,N),K=-br(z)+br(q),{snapsContained:pe}=ET(U,K,Y,x),k=N?pe:Y,{limit:ee}=ST(K,k,f),_e=Ap(Xo(k),d,f),S=_e.clone(),Se=As(n),Ne=({dragHandler:me,scrollBody:he,scrollBounds:Le,eventHandler:Pe,animation:Fe,options:{loop:ot}})=>{const ze=me.pointerDown();ot||Le.constrain(ze);const V=he.seek().settled();V&&!ze&&(Fe.stop(),Pe.emit("settle")),V||Pe.emit("scroll")},Ie=({scrollBody:me,translate:he,location:Le,offsetLocation:Pe,scrollLooper:Fe,slideLooper:ot,options:{loop:ze}},V)=>{const Q=me.velocity();Pe.set(Le.get()-Q+Q*V),ze&&(Fe.loop(me.direction()),ot.loop()),he.to(Pe.get())},je={start:()=>a.start(ne),stop:()=>a.stop(ne),update:()=>Ne(ne),render:me=>Ie(ne,me)},He=.68,De=k[_e.get()],we=ta(De),ye=ta(De),Te=ta(De),ke=kT(we,Te,p,He),Re=PT(f,k,K,ee,Te),qe=AT(je,_e,S,Re,ke,Te,o),D=MT(U,K,W,z,ee,f,h),ne={ownerDocument:r,ownerWindow:i,eventHandler:o,containerRect:I,slideRects:A,animation:je,axis:j,direction:O,dragHandler:bT(j,O,e,r,i,Te,wT(j,i),we,je,qe,ke,Re,_e,o,H,m,v,b,He),eventStore:Rs(),percentOfView:H,index:_e,indexPrevious:S,limit:ee,location:we,offsetLocation:ye,options:s,resizeHandler:_T(t,o,i,n,j),scrollBody:ke,scrollBounds:CT(ee,we,Te,ke,H),scrollLooper:TT(K,ee,ye,[we,ye,Te]),scrollProgress:OT(ee),scrollSnaps:k,scrollTarget:Re,scrollTo:qe,slideLooper:RT(j,O,U,K,q,k,D,ye,n),slidesHandler:$T(t,o),slidesInView:D,slideIndexes:Se,slidesToScroll:B,target:Te,translate:Rp(j,O,t)};return ne}function jT(e){const t=16.666666666666668;let n=[],r=null,i=0,s=0;function o(d){r||(r=d);const h=d-r;for(r=d,i+=h;i>=t;)n.forEach(({animation:p})=>p.update()),i-=t;const f=It(i/t);n.forEach(({animation:p})=>p.render(f)),s&&e.requestAnimationFrame(o)}function a(d){n.includes(d)||n.push(d),!s&&(s=e.requestAnimationFrame(o))}function l(d){n=n.filter(h=>h!==d),!n.length&&(e.cancelAnimationFrame(s),r=null,i=0,s=0)}function c(){r=null,i=0}return{start:a,stop:l,reset:c,window:e}}function UT(){const e={};let t;function n(l){t=l}function r(l){return e[l]||[]}function i(l){return r(l).forEach(c=>c(t,l)),a}function s(l,c){return e[l]=r(l).concat([c]),a}function o(l,c){return e[l]=r(l).filter(u=>u!==c),a}const a={init:n,emit:i,off:o,on:s};return a}const FT={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,breakpoints:{},dragFree:!1,dragThreshold:10,inViewThreshold:0,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0};function BT(e){function t(s,o){return Ip(s,o||{})}function n(s){const o=s.breakpoints||{},a=ea(o).filter(l=>e.matchMedia(l).matches).map(l=>o[l]).reduce((l,c)=>t(l,c),{});return t(s,a)}function r(s){return s.map(o=>ea(o.breakpoints||{})).reduce((o,a)=>o.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function VT(e){let t=[];function n(s,o){return t=s.filter(({options:a})=>e.optionsAtMedia(a).active!==!1),t.forEach(a=>a.init(o,e)),s.reduce((a,l)=>Object.assign(a,{[l.name]:l}),{})}function r(){t=t.filter(s=>s.destroy())}return{init:n,destroy:r}}function ji(e,t,n){const r=e.ownerDocument,i=r.defaultView,s=BT(i),o=VT(s),a=Rs(),l=Rs(),c=UT(),{animationRealms:u}=ji,{mergeOptions:d,optionsAtMedia:h,optionsMediaQueries:f}=s,{on:p,off:m,emit:v}=c,y=W;let b=!1,x,I=d(FT,ji.globalOptions),A=d(I),O=[],j,U,H;function T(){const{container:ke,slides:Re}=A;U=(Tp(ke)?e.querySelector(ke):ke)||e.children[0];const D=Tp(Re)?U.querySelectorAll(Re):Re;H=[].slice.call(D||U.children)}function N(ke,Re){const qe=NT(e,U,H,r,i,ke,c,Re);if(ke.loop&&!qe.slideLooper.canLoop()){const D=Object.assign({},ke,{loop:!1});return N(D,Re)}return qe}function G(ke,Re){if(b)return;const qe=u.find(ne=>ne.window===i),D=qe||jT(i);qe||u.push(D),I=d(I,ke),A=h(I),O=Re||O,T(),x=N(A,D),f([I,...O.map(({options:ne})=>ne)]).forEach(ne=>a.add(ne,"change",W)),A.active&&(x.translate.to(x.location.get()),x.eventHandler.init(Te),x.resizeHandler.init(Te,A.watchResize),x.slidesHandler.init(Te,A.watchSlides),l.add(r,"visibilitychange",()=>{r.hidden&&D.reset()}),x.options.loop&&x.slideLooper.loop(),U.offsetParent&&H.length&&x.dragHandler.init(Te,A.watchDrag),j=o.init(O,Te))}function W(ke,Re){const qe=Ne();q(),G(d({startIndex:qe},ke),Re),c.emit("reInit")}function q(){x.dragHandler.destroy(),x.animation.stop(),x.eventStore.clear(),x.translate.clear(),x.slideLooper.clear(),x.resizeHandler.destroy(),x.slidesHandler.destroy(),o.destroy(),a.clear(),l.clear()}function B(){b||(b=!0,a.clear(),q(),c.emit("destroy"))}function z(ke){const Re=x[ke?"target":"location"].get(),qe=A.loop?"removeOffset":"constrain";return x.slidesInView.check(x.limit[qe](Re))}function Y(ke){const Re=z(ke);return x.slideIndexes.filter(qe=>!Re.includes(qe))}function K(ke,Re,qe){!A.active||b||(x.scrollBody.useBaseFriction().useDuration(Re?0:A.duration),x.scrollTo.index(ke,qe||0))}function pe(ke){const Re=x.index.add(1).get();K(Re,ke===!0,-1)}function k(ke){const Re=x.index.add(-1).get();K(Re,ke===!0,1)}function ee(){return x.index.add(1).get()!==Ne()}function _e(){return x.index.add(-1).get()!==Ne()}function S(){return x.scrollSnaps.map(x.scrollProgress.get)}function Se(){return x.scrollProgress.get(x.location.get())}function Ne(){return x.index.get()}function Ie(){return x.indexPrevious.get()}function je(){return j}function He(){return x}function De(){return e}function we(){return U}function ye(){return H}const Te={canScrollNext:ee,canScrollPrev:_e,containerNode:we,internalEngine:He,destroy:B,off:m,on:p,emit:v,plugins:je,previousScrollSnap:Ie,reInit:y,rootNode:De,scrollNext:pe,scrollPrev:k,scrollProgress:Se,scrollSnapList:S,scrollTo:K,selectedScrollSnap:Ne,slideNodes:ye,slidesInView:z,slidesNotInView:Y};return G(t,n),setTimeout(()=>c.emit("init"),0),Te}ji.animationRealms=[],ji.globalOptions=void 0;function zc(e={},t=[]){const n=_.useRef(e),r=_.useRef(t),[i,s]=_.useState(),[o,a]=_.useState(),l=_.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return _.useEffect(()=>{if(hT()&&o){ji.globalOptions=zc.globalOptions;const c=ji(o,n.current,r.current);return s(c),()=>c.destroy()}else s(void 0)},[o,s]),_.useEffect(()=>{Uc(n.current,e)||(n.current=e,l())},[e,l]),_.useEffect(()=>{pT(r.current,t)||(r.current=t,l())},[t,l]),[a,i]}zc.globalOptions=void 0;function zT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M7.72 12.53a.75.75 0 010-1.06l7.5-7.5a.75.75 0 111.06 1.06L9.31 12l6.97 6.97a.75.75 0 11-1.06 1.06l-7.5-7.5z",clipRule:"evenodd"}))}const ZT=R.forwardRef(zT);function WT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z",clipRule:"evenodd"}))}const HT=R.forwardRef(WT);function qT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0016.5 9h-1.875a1.875 1.875 0 01-1.875-1.875V5.25A3.75 3.75 0 009 1.5H5.625zM7.5 15a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5A.75.75 0 017.5 15zm.75 2.25a.75.75 0 000 1.5H12a.75.75 0 000-1.5H8.25z",clipRule:"evenodd"}),R.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0114.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 013.434 1.279 9.768 9.768 0 00-6.963-6.963z"}))}const KT=R.forwardRef(qT);function JT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{d:"M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z"}),R.createElement("path",{d:"M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z"}))}const GT=R.forwardRef(JT);function YT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{d:"M21.721 12.752a9.711 9.711 0 00-.945-5.003 12.754 12.754 0 01-4.339 2.708 18.991 18.991 0 01-.214 4.772 17.165 17.165 0 005.498-2.477zM14.634 15.55a17.324 17.324 0 00.332-4.647c-.952.227-1.945.347-2.966.347-1.021 0-2.014-.12-2.966-.347a17.515 17.515 0 00.332 4.647 17.385 17.385 0 005.268 0zM9.772 17.119a18.963 18.963 0 004.456 0A17.182 17.182 0 0112 21.724a17.18 17.18 0 01-2.228-4.605zM7.777 15.23a18.87 18.87 0 01-.214-4.774 12.753 12.753 0 01-4.34-2.708 9.711 9.711 0 00-.944 5.004 17.165 17.165 0 005.498 2.477zM21.356 14.752a9.765 9.765 0 01-7.478 6.817 18.64 18.64 0 001.988-4.718 18.627 18.627 0 005.49-2.098zM2.644 14.752c1.682.971 3.53 1.688 5.49 2.099a18.64 18.64 0 001.988 4.718 9.765 9.765 0 01-7.478-6.816zM13.878 2.43a9.755 9.755 0 016.116 3.986 11.267 11.267 0 01-3.746 2.504 18.63 18.63 0 00-2.37-6.49zM12 2.276a17.152 17.152 0 012.805 7.121c-.897.23-1.837.353-2.805.353-.968 0-1.908-.122-2.805-.353A17.151 17.151 0 0112 2.276zM10.122 2.43a18.629 18.629 0 00-2.37 6.49 11.266 11.266 0 01-3.746-2.504 9.754 9.754 0 016.116-3.985z"}))}const QT=R.forwardRef(YT);function XT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"}))}const eO=R.forwardRef(XT);function tO({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M1.5 4.5a3 3 0 013-3h1.372c.86 0 1.61.586 1.819 1.42l1.105 4.423a1.875 1.875 0 01-.694 1.955l-1.293.97c-.135.101-.164.249-.126.352a11.285 11.285 0 006.697 6.697c.103.038.25.009.352-.126l.97-1.293a1.875 1.875 0 011.955-.694l4.423 1.105c.834.209 1.42.959 1.42 1.82V19.5a3 3 0 01-3 3h-2.25C8.552 22.5 1.5 15.448 1.5 6.75V4.5z",clipRule:"evenodd"}))}const nO=R.forwardRef(tO),rO=_.forwardRef(({type:e,styles:t,blocks:n},r)=>{const[i,s]=zc({skipSnaps:!0}),[o,a]=_.useState(!0),[l,c]=_.useState(!0),u=_.useCallback(()=>s&&s.scrollPrev(),[s]),d=_.useCallback(()=>s&&s.scrollNext(),[s]),h=t==null?void 0:t[e],f=_.useCallback(p=>{a(!p.canScrollPrev()),c(!p.canScrollNext())},[]);return _.useEffect(()=>{s&&(f(s),s.on("reInit",f),s.on("select",f))},[s,f]),F.jsxs("div",{...h==null?void 0:h.container,"data-container":"carousel",ref:i,children:[F.jsx("div",{ref:r,...h==null?void 0:h.slidesContainer,children:n.map((p,m)=>F.jsx(Wi,{styles:t,block:p},m))}),F.jsx(ZT,{...h==null?void 0:h.backButton,"data-disabled":o?"":void 0,onClick:u}),F.jsx(HT,{...h==null?void 0:h.nextButton,"data-disabled":l?"":void 0,onClick:d})]})}),Ui=Math.min,En=Math.max,na=Math.round,Fi=Math.floor,Fr=e=>({x:e,y:e});function $p(e,t,n){return En(e,Ui(t,n))}function ra(e,t){return typeof e=="function"?e(t):e}function $s(e){return e.split("-")[0]}function Zc(e){return e.split("-")[1]}function Mp(e){return e==="x"?"y":"x"}function iO(e){return e==="y"?"height":"width"}function Ms(e){return["top","bottom"].includes($s(e))?"y":"x"}function sO(e){return Mp(Ms(e))}function oO(e){return{top:0,right:0,bottom:0,left:0,...e}}function aO(e){return typeof e!="number"?oO(e):{top:e,right:e,bottom:e,left:e}}function ia(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Br(e){return Lp(e)?(e.nodeName||"").toLowerCase():"#document"}function Sn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wr(e){var t;return(t=(Lp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Lp(e){return e instanceof Node||e instanceof Sn(e).Node}function $t(e){return e instanceof Element||e instanceof Sn(e).Element}function ln(e){return e instanceof HTMLElement||e instanceof Sn(e).HTMLElement}function Wc(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Sn(e).ShadowRoot}function Ls(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Tn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function lO(e){return["table","td","th"].includes(Br(e))}function Hc(e){const t=qc(),n=Tn(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function cO(e){let t=gi(e);for(;ln(t)&&!Ds(t);){if(Hc(t))return t;t=gi(t)}return null}function qc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ds(e){return["html","body","#document"].includes(Br(e))}function Tn(e){return Sn(e).getComputedStyle(e)}function sa(e){return $t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function gi(e){if(Br(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wc(e)&&e.host||wr(e);return Wc(t)?t.host:t}function Dp(e){const t=gi(e);return Ds(t)?e.ownerDocument?e.ownerDocument.body:e.body:ln(t)&&Ls(t)?t:Dp(t)}function Vr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Dp(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Sn(i);return s?t.concat(o,o.visualViewport||[],Ls(i)?i:[],o.frameElement&&n?Vr(o.frameElement):[]):t.concat(i,Vr(i,[],n))}function zr(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function bn(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Wc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Np(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function uO(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function jp(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Np())||t.test(uO()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Up(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function Fp(){return/apple/i.test(navigator.vendor)}function dO(){return Np().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Bp(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function fO(e){return"nativeEvent"in e}function hO(e){return e.matches("html,body")}function Bn(e){return(e==null?void 0:e.ownerDocument)||document}function Kc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Vp(e){return"composedPath"in e?e.composedPath()[0]:e.target}const pO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function zp(e){return ln(e)&&e.matches(pO)}function tn(e){e.preventDefault(),e.stopPropagation()}function Zp(e,t,n){let{reference:r,floating:i}=e;const s=Ms(t),o=sO(t),a=iO(o),l=$s(t),c=s==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Zc(t)){case"start":f[o]-=h*(n&&c?-1:1);break;case"end":f[o]+=h*(n&&c?-1:1);break}return f}const mO=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Zp(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:v,fn:y}=a[m],{x:b,y:x,data:I,reset:A}=await y({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:c,platform:o,elements:{reference:e,floating:t}});if(u=b??u,d=x??d,f={...f,[v]:{...f[v],...I}},A&&p<=50){p++,typeof A=="object"&&(A.placement&&(h=A.placement),A.rects&&(c=A.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:u,y:d}=Zp(c,h,l)),m=-1;continue}}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}};async function Wp(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=ra(t,e),p=aO(f),v=a[h?d==="floating"?"reference":"floating":d],y=ia(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{...o.floating,x:r,y:i}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),I=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},A=ia(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:x,strategy:l}):b);return{top:(y.top-A.top+p.top)/I.y,bottom:(A.bottom-y.bottom+p.bottom)/I.y,left:(y.left-A.left+p.left)/I.x,right:(A.right-y.right+p.right)/I.x}}async function gO(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=$s(n),a=Zc(n),l=Ms(n)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,d=ra(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const yO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await gO(t,e);return{x:n+i.x,y:r+i.y,data:i}}}},vO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:v=>{let{x:y,y:b}=v;return{x:y,y:b}}},...l}=ra(e,t),c={x:n,y:r},u=await Wp(t,l),d=Ms($s(i)),h=Mp(d);let f=c[h],p=c[d];if(s){const v=h==="y"?"top":"left",y=h==="y"?"bottom":"right",b=f+u[v],x=f-u[y];f=$p(b,f,x)}if(o){const v=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=p+u[v],x=p-u[y];p=$p(b,p,x)}const m=a.fn({...t,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},bO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=ra(e,t),l=await Wp(t,a),c=$s(n),u=Zc(n),d=Ms(n)==="y",{width:h,height:f}=r.floating;let p,m;c==="top"||c==="bottom"?(p=c,m=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,p=u==="end"?"top":"bottom");const v=f-l[p],y=h-l[m],b=!t.middlewareData.shift;let x=v,I=y;if(d){const O=h-l.left-l.right;I=u||b?Ui(y,O):O}else{const O=f-l.top-l.bottom;x=u||b?Ui(v,O):O}if(b&&!u){const O=En(l.left,0),j=En(l.right,0),U=En(l.top,0),H=En(l.bottom,0);d?I=h-2*(O!==0||j!==0?O+j:En(l.left,l.right)):x=f-2*(U!==0||H!==0?U+H:En(l.top,l.bottom))}await o({...t,availableWidth:I,availableHeight:x});const A=await i.getDimensions(s.floating);return h!==A.width||f!==A.height?{reset:{rects:!0}}:{}}}};function Hp(e){const t=Tn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ln(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=na(n)!==s||na(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Jc(e){return $t(e)?e:e.contextElement}function Bi(e){const t=Jc(e);if(!ln(t))return Fr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=Hp(t);let o=(s?na(n.width):n.width)/r,a=(s?na(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const wO=Fr(0);function qp(e){const t=Sn(e);return!qc()||!t.visualViewport?wO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Sn(e)?!1:t}function yi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Jc(e);let o=Fr(1);t&&(r?$t(r)&&(o=Bi(r)):o=Bi(e));const a=xO(s,n,r)?qp(s):Fr(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const h=Sn(s),f=r&&$t(r)?Sn(r):r;let p=h.frameElement;for(;p&&r&&f!==h;){const m=Bi(p),v=p.getBoundingClientRect(),y=Tn(p),b=v.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,x=v.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=b,c+=x,p=Sn(p).frameElement}}return ia({width:u,height:d,x:l,y:c})}function _O(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=ln(n),s=wr(n);if(n===s)return t;let o={scrollLeft:0,scrollTop:0},a=Fr(1);const l=Fr(0);if((i||!i&&r!=="fixed")&&((Br(n)!=="body"||Ls(s))&&(o=sa(n)),ln(n))){const c=yi(n);a=Bi(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-o.scrollLeft*a.x+l.x,y:t.y*a.y-o.scrollTop*a.y+l.y}}function kO(e){return Array.from(e.getClientRects())}function Kp(e){return yi(wr(e)).left+sa(e).scrollLeft}function CO(e){const t=wr(e),n=sa(e),r=e.ownerDocument.body,i=En(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=En(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Kp(e);const a=-n.scrollTop;return Tn(r).direction==="rtl"&&(o+=En(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function EO(e,t){const n=Sn(e),r=wr(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=qc();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function SO(e,t){const n=yi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=ln(e)?Bi(e):Fr(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function Jp(e,t,n){let r;if(t==="viewport")r=EO(e,n);else if(t==="document")r=CO(wr(e));else if($t(t))r=SO(t,n);else{const i=qp(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return ia(r)}function Gp(e,t){const n=gi(e);return n===t||!$t(n)||Ds(n)?!1:Tn(n).position==="fixed"||Gp(n,t)}function TO(e,t){const n=t.get(e);if(n)return n;let r=Vr(e,[],!1).filter(a=>$t(a)&&Br(a)!=="body"),i=null;const s=Tn(e).position==="fixed";let o=s?gi(e):e;for(;$t(o)&&!Ds(o);){const a=Tn(o),l=Hc(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ls(o)&&!l&&Gp(e,o))?r=r.filter(u=>u!==o):i=a,o=gi(o)}return t.set(e,r),r}function OO(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?TO(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const d=Jp(t,u,i);return c.top=En(d.top,c.top),c.right=Ui(d.right,c.right),c.bottom=Ui(d.bottom,c.bottom),c.left=En(d.left,c.left),c},Jp(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function IO(e){return Hp(e)}function PO(e,t,n){const r=ln(t),i=wr(t),s=n==="fixed",o=yi(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Fr(0);if(r||!r&&!s)if((Br(t)!=="body"||Ls(i))&&(a=sa(t)),r){const c=yi(t,!0,s,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else i&&(l.x=Kp(i));return{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Yp(e,t){return!ln(e)||Tn(e).position==="fixed"?null:t?t(e):e.offsetParent}function Qp(e,t){const n=Sn(e);if(!ln(e))return n;let r=Yp(e,t);for(;r&&lO(r)&&Tn(r).position==="static";)r=Yp(r,t);return r&&(Br(r)==="html"||Br(r)==="body"&&Tn(r).position==="static"&&!Hc(r))?n:r||cO(e)||n}const AO=async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||Qp,s=this.getDimensions;return{reference:PO(t,await i(n),r),floating:{x:0,y:0,...await s(n)}}};function RO(e){return Tn(e).direction==="rtl"}const $O={convertOffsetParentRelativeRectToViewportRelativeRect:_O,getDocumentElement:wr,getClippingRect:OO,getOffsetParent:Qp,getElementRects:AO,getClientRects:kO,getDimensions:IO,getScale:Bi,isElement:$t,isRTL:RO};function MO(e,t){let n=null,r;const i=wr(e);function s(){clearTimeout(r),n&&n.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f=Fi(u),p=Fi(i.clientWidth-(c+d)),m=Fi(i.clientHeight-(u+h)),v=Fi(c),b={rootMargin:-f+"px "+-p+"px "+-m+"px "+-v+"px",threshold:En(0,Ui(1,l))||1};let x=!0;function I(A){const O=A[0].intersectionRatio;if(O!==l){if(!x)return o();O?o(!1,O):r=setTimeout(()=>{o(!1,1e-7)},100)}x=!1}try{n=new IntersectionObserver(I,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,b)}n.observe(e)}return o(!0),s}function LO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Jc(e),u=i||s?[...c?Vr(c):[],...Vr(t)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=c&&a?MO(c,n):null;let h=-1,f=null;o&&(f=new ResizeObserver(y=>{let[b]=y;b&&b.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{f&&f.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let p,m=l?yi(e):null;l&&v();function v(){const y=yi(e);m&&(y.x!==m.x||y.y!==m.y||y.width!==m.width||y.height!==m.height)&&n(),m=y,p=requestAnimationFrame(v)}return n(),()=>{u.forEach(y=>{i&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),d&&d(),f&&f.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const DO=(e,t,n)=>{const r=new Map,i={platform:$O,...n},s={...i.platform,_c:r};return mO(e,t,{...i,platform:s})};var oa=typeof document<"u"?_.useLayoutEffect:_.useEffect;function aa(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!aa(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!aa(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Xp(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function em(e,t){const n=Xp(e);return Math.round(t*n)/n}function tm(e){const t=R.useRef(e);return oa(()=>{t.current=e}),t}function NO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=R.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=R.useState(r);aa(h,r)||f(r);const[p,m]=R.useState(null),[v,y]=R.useState(null),b=R.useCallback(z=>{z!=O.current&&(O.current=z,m(z))},[m]),x=R.useCallback(z=>{z!==j.current&&(j.current=z,y(z))},[y]),I=s||p,A=o||v,O=R.useRef(null),j=R.useRef(null),U=R.useRef(u),H=tm(l),T=tm(i),N=R.useCallback(()=>{if(!O.current||!j.current)return;const z={placement:t,strategy:n,middleware:h};T.current&&(z.platform=T.current),DO(O.current,j.current,z).then(Y=>{const K={...Y,isPositioned:!0};G.current&&!aa(U.current,K)&&(U.current=K,Dw.flushSync(()=>{d(K)}))})},[h,t,n,T]);oa(()=>{c===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,d(z=>({...z,isPositioned:!1})))},[c]);const G=R.useRef(!1);oa(()=>(G.current=!0,()=>{G.current=!1}),[]),oa(()=>{if(I&&(O.current=I),A&&(j.current=A),I&&A){if(H.current)return H.current(I,A,N);N()}},[I,A,N,H]);const W=R.useMemo(()=>({reference:O,floating:j,setReference:b,setFloating:x}),[b,x]),q=R.useMemo(()=>({reference:I,floating:A}),[I,A]),B=R.useMemo(()=>{const z={position:n,left:0,top:0};if(!q.floating)return z;const Y=em(q.floating,u.x),K=em(q.floating,u.y);return a?{...z,transform:"translate("+Y+"px, "+K+"px)",...Xp(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:K}},[n,a,q.floating,u.x,u.y]);return R.useMemo(()=>({...u,update:N,refs:W,elements:q,floatingStyles:B}),[u,N,W,q,B])}/*!
234
234
  * tabbable 6.2.0
235
235
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
236
- */var WO=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Qc=WO.join(","),im=typeof Element>"u",Ns=im?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ua=!im&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},da=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=i===""||i==="true",o=s||n&&t&&e(t.parentNode);return o},HO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},qO=function(t,n,r){if(da(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Qc));return n&&Ns.call(t,Qc)&&i.unshift(t),i=i.filter(r),i},KO=function e(t,n,r){for(var i=[],s=Array.from(t);s.length;){var o=s.shift();if(!da(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,c=e(l,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:o,candidates:c})}else{var u=Ns.call(o,Qc);u&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var d=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),h=!da(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(d&&h){var f=e(d===!0?o.children:d.children,!0,r);r.flatten?i.push.apply(i,f):i.push({scopeParent:o,candidates:f})}else s.unshift.apply(s,o.children)}}return i},sm=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},om=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||HO(t))&&!sm(t)?0:t.tabIndex},JO=function(t,n){var r=om(t);return r<0&&n&&!sm(t)?0:r},GO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},am=function(t){return t.tagName==="INPUT"},YO=function(t){return am(t)&&t.type==="hidden"},QO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},XO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},eI=function(t){if(!t.name)return!0;var n=t.form||ua(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=XO(i,t.form);return!s||s===t},tI=function(t){return am(t)&&t.type==="radio"},nI=function(t){return tI(t)&&!eI(t)},rI=function(t){var n,r=t&&ua(t),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var o,a,l;for(s=!!((o=i)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&i;){var c,u,d;r=ua(i),i=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=i)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return s},lm=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},iI=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=Ns.call(t,"details>summary:first-of-type"),o=s?t.parentElement:t;if(Ns.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var a=t;t;){var l=t.parentElement,c=ua(t);if(l&&!l.shadowRoot&&i(l)===!0)return lm(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(rI(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return lm(t);return!1},sI=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Ns.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},oI=function(t,n){return!(n.disabled||da(n)||YO(n)||iI(n,t)||QO(n)||sI(n))},cm=function(t,n){return!(nI(n)||om(n)<0||!oI(t,n))},aI=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},lI=function e(t){var n=[],r=[];return t.forEach(function(i,s){var o=!!i.scopeParent,a=o?i.scopeParent:i,l=JO(a,o),c=o?e(i.candidates):a;l===0?o?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:i,isScope:o,content:c})}),r.sort(GO).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Xc=function(t,n){n=n||{};var r;return n.getShadowRoot?r=KO([t],n.includeContainer,{filter:cm.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:aI}):r=qO(t,n.includeContainer,cm.bind(null,n)),lI(r)};const eu="ArrowUp",fa="ArrowDown",Vi="ArrowLeft",js="ArrowRight";function ha(e,t,n){return Math.floor(e/t)!==n}function Us(e,t){return t<0||t>=e.current.length}function tu(e,t){return cn(e,{disabledIndices:t})}function um(e,t){return cn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function cn(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:s=1}=t===void 0?{}:t;const o=e.current;let a=n;do{var l,c;a=a+(r?-s:s)}while(a>=0&&a<=o.length-1&&(i?i.includes(a):o[a]==null||(l=o[a])!=null&&l.hasAttribute("disabled")||((c=o[a])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return a}function cI(e,t){let{event:n,orientation:r,loop:i,cols:s,disabledIndices:o,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===eu){if(u&&tn(n),c===-1)d=l;else if(d=cn(e,{startingIndex:d,amount:s,decrement:!0,disabledIndices:o}),i&&(c-s<a||d<0)){const h=c%s,f=l%s,p=l-(f-h);f===h?d=l:d=f>h?p:p-s}Us(e,d)&&(d=c)}if(n.key===fa&&(u&&tn(n),c===-1?d=a:(d=cn(e,{startingIndex:c,amount:s,disabledIndices:o}),i&&c+s>l&&(d=cn(e,{startingIndex:c%s-s,amount:s,disabledIndices:o}))),Us(e,d)&&(d=c)),r==="both"){const h=Fi(c/s);n.key===js&&(u&&tn(n),c%s!==s-1?(d=cn(e,{startingIndex:c,disabledIndices:o}),i&&ha(d,s,h)&&(d=cn(e,{startingIndex:c-c%s-1,disabledIndices:o}))):i&&(d=cn(e,{startingIndex:c-c%s-1,disabledIndices:o})),ha(d,s,h)&&(d=c)),n.key===Vi&&(u&&tn(n),c%s!==0?(d=cn(e,{startingIndex:c,disabledIndices:o,decrement:!0}),i&&ha(d,s,h)&&(d=cn(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:o}))):i&&(d=cn(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:o})),ha(d,s,h)&&(d=c));const f=Fi(l/s)===h;Us(e,d)&&(i&&f?d=n.key===Vi?l:cn(e,{startingIndex:c-c%s-1,disabledIndices:o}):d=c)}return d}let dm=0;function xr(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(dm);const s=()=>e==null?void 0:e.focus({preventScroll:n});i?s():dm=requestAnimationFrame(s)}var Bt=typeof document<"u"?_.useLayoutEffect:_.useEffect;function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pa.apply(this,arguments)}let nu=!1,uI=0;const fm=()=>"floating-ui-"+uI++;function dI(){const[e,t]=R.useState(()=>nu?fm():void 0);return Bt(()=>{e==null&&t(fm())},[]),R.useEffect(()=>{nu||(nu=!0)},[]),e}const ru=R["useId".toString()]||dI;function fI(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const hI=R.createContext(null),pI=R.createContext(null),hm=()=>{var e;return((e=R.useContext(hI))==null?void 0:e.id)||null},ma=()=>R.useContext(pI);function Fs(e){return"data-floating-ui-"+e}function Zr(e){const t=_.useRef(e);return Bt(()=>{t.current=e}),t}function mI(e,t){var n;let r=[],i=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;i;){const s=e.find(o=>o.id===i);i=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function zi(e,t){let n=e.filter(i=>{var s;return i.parentId===t&&((s=i.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(i=>{var s;return(s=r)==null?void 0:s.some(o=>{var a;return i.parentId===o.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function gI(e,t){let n,r=-1;function i(s,o){o>r&&(n=s,r=o),zi(e,s).forEach(l=>{i(l.id,o+1)})}return i(t,0),e.find(s=>s.id===n)}let Zi=new WeakMap,ga=new WeakSet,ya={},iu=0;const yI=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,pm=e=>e&&(e.host||pm(e.parentNode)),vI=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=pm(n);return e.contains(r)?r:null}).filter(n=>n!=null);function bI(e,t,n,r){const i="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,o=vI(t,e),a=new Set,l=new Set(o),c=[];ya[i]||(ya[i]=new WeakMap);const u=ya[i];o.forEach(d),h(t),a.clear();function d(f){!f||a.has(f)||(a.add(f),f.parentNode&&d(f.parentNode))}function h(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,p=>{if(a.has(p))h(p);else{const m=s?p.getAttribute(s):null,y=m!==null&&m!=="false",v=(Zi.get(p)||0)+1,b=(u.get(p)||0)+1;Zi.set(p,v),u.set(p,b),c.push(p),v===1&&y&&ga.add(p),b===1&&p.setAttribute(i,""),!y&&s&&p.setAttribute(s,"true")}})}return iu++,()=>{c.forEach(f=>{const p=(Zi.get(f)||0)-1,m=(u.get(f)||0)-1;Zi.set(f,p),u.set(f,m),p||(!ga.has(f)&&s&&f.removeAttribute(s),ga.delete(f)),m||f.removeAttribute(i)}),iu--,iu||(Zi=new WeakMap,Zi=new WeakMap,ga=new WeakSet,ya={})}}function mm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Bn(e[0]).body;return bI(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const su=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function gm(e,t){const n=Xc(e,su());t==="prev"&&n.reverse();const r=n.indexOf(zr(Bn(e)));return n.slice(r+1)[0]}function ym(){return gm(document.body,"next")}function vm(){return gm(document.body,"prev")}function Bs(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!bn(n,r)}function wI(e){Xc(e,su()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function xI(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const ou={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let _I;function bm(e){e.key==="Tab"&&(e.target,clearTimeout(_I))}const va=R.forwardRef(function(t,n){const[r,i]=R.useState();Bt(()=>(Vp()&&i("button"),document.addEventListener("keydown",bm),()=>{document.removeEventListener("keydown",bm)}),[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Fs("focus-guard")]:"",style:ou};return R.createElement("span",pa({},t,s))}),wm=R.createContext(null);function kI(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=R.useState(null),s=ru(),o=xm(),a=R.useMemo(()=>({id:t,root:n,portalContext:o,uniqueId:s}),[t,n,o,s]),l=R.useRef();return Bt(()=>()=>{r==null||r.remove()},[r,a]),Bt(()=>{if(l.current===a)return;l.current=a;const{id:c,root:u,portalContext:d,uniqueId:h}=a,f=c?document.getElementById(c):null,p=Fs("portal");if(f){const m=document.createElement("div");m.id=h,m.setAttribute(p,""),f.appendChild(m),i(m)}else{let m=u||(d==null?void 0:d.portalNode);m&&!$t(m)&&(m=m.current),m=m||document.body;let y=null;c&&(y=document.createElement("div"),y.id=c,m.appendChild(y));const v=document.createElement("div");v.id=h,v.setAttribute(p,""),m=y||m,m.appendChild(v),i(v)}},[a]),r}function CI(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const s=kI({id:n,root:r}),[o,a]=R.useState(null),l=R.useRef(null),c=R.useRef(null),u=R.useRef(null),d=R.useRef(null),h=!!o&&!o.modal&&o.open&&i&&!!(r||s);return R.useEffect(()=>{if(!s||!i||o!=null&&o.modal)return;function f(p){s&&Bs(p)&&(p.type==="focusin"?xI:wI)(s)}return s.addEventListener("focusin",f,!0),s.addEventListener("focusout",f,!0),()=>{s.removeEventListener("focusin",f,!0),s.removeEventListener("focusout",f,!0)}},[s,i,o==null?void 0:o.modal]),R.createElement(wm.Provider,{value:R.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:a}),[i,s])},h&&s&&R.createElement(va,{"data-type":"outside",ref:l,onFocus:f=>{if(Bs(f,s)){var p;(p=u.current)==null||p.focus()}else{const m=vm()||(o==null?void 0:o.refs.domReference.current);m==null||m.focus()}}}),h&&s&&R.createElement("span",{"aria-owns":s.id,style:ou}),s&&Gn.createPortal(t,s),h&&s&&R.createElement(va,{"data-type":"outside",ref:c,onFocus:f=>{if(Bs(f,s)){var p;(p=d.current)==null||p.focus()}else{const m=ym()||(o==null?void 0:o.refs.domReference.current);m==null||m.focus(),o!=null&&o.closeOnFocusOut&&(o==null||o.onOpenChange(!1,f.nativeEvent))}}}))}const xm=()=>R.useContext(wm),EI=R.forwardRef(function(t,n){return R.createElement("button",pa({},t,{type:"button",ref:n,tabIndex:-1,style:ou}))});function SI(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:s=!0,initialFocus:o=0,returnFocus:a=!0,modal:l=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:u=!0}=e,{open:d,refs:h,nodeId:f,onOpenChange:p,events:m,dataRef:y,elements:{domReference:v,floating:b}}=t,x=yI()?s:!0,I=Zr(i),P=Zr(o),T=Zr(a),j=ma(),U=xm(),F=typeof o=="number"&&o<0,O=R.useRef(null),N=R.useRef(null),J=R.useRef(!1),q=R.useRef(null),W=R.useRef(!1),B=U!=null,V=v&&v.getAttribute("role")==="combobox"&&Wp(v)&&F,Y=R.useCallback(function(ee){return ee===void 0&&(ee=b),ee?Xc(ee,su()):[]},[b]),K=R.useCallback(ee=>{const xe=Y(ee);return I.current.map(S=>v&&S==="reference"?v:b&&S==="floating"?b:xe).filter(Boolean).flat()},[v,b,I,Y]);R.useEffect(()=>{if(r||!l)return;function ee(S){if(S.key==="Tab"){bn(b,zr(Bn(b)))&&Y().length===0&&!V&&tn(S);const Te=K(),Ne=Zp(S);I.current[0]==="reference"&&Ne===v&&(tn(S),S.shiftKey?xr(Te[Te.length-1]):xr(Te[1])),I.current[1]==="floating"&&Ne===b&&S.shiftKey&&(tn(S),xr(Te[0]))}}const xe=Bn(b);return xe.addEventListener("keydown",ee),()=>{xe.removeEventListener("keydown",ee)}},[r,v,b,l,I,h,V,Y,K]),R.useEffect(()=>{if(r||!u)return;function ee(){W.current=!0,setTimeout(()=>{W.current=!1})}function xe(S){const Te=S.relatedTarget;queueMicrotask(()=>{const Ne=!(bn(v,Te)||bn(b,Te)||bn(Te,b)||bn(U==null?void 0:U.portalNode,Te)||Te!=null&&Te.hasAttribute(Fs("focus-guard"))||j&&(zi(j.nodesRef.current,f).find(Ie=>{var je,De;return bn((je=Ie.context)==null?void 0:je.elements.floating,Te)||bn((De=Ie.context)==null?void 0:De.elements.domReference,Te)})||mI(j.nodesRef.current,f).find(Ie=>{var je,De;return((je=Ie.context)==null?void 0:je.elements.floating)===Te||((De=Ie.context)==null?void 0:De.elements.domReference)===Te})));Te&&Ne&&!W.current&&Te!==q.current&&(J.current=!0,p(!1,S))})}if(b&&ln(v))return v.addEventListener("focusout",xe),v.addEventListener("pointerdown",ee),!l&&b.addEventListener("focusout",xe),()=>{v.removeEventListener("focusout",xe),v.removeEventListener("pointerdown",ee),!l&&b.removeEventListener("focusout",xe)}},[r,v,b,l,f,j,U,p,u]),R.useEffect(()=>{var ee;if(r)return;const xe=Array.from((U==null||(ee=U.portalNode)==null?void 0:ee.querySelectorAll("["+Fs("portal")+"]"))||[]);if(b){const S=[b,...xe,O.current,N.current,I.current.includes("reference")||V?v:null].filter(Ne=>Ne!=null),Te=l?mm(S,x,!x):mm(S);return()=>{Te()}}},[r,v,b,l,I,U,V,x]),Bt(()=>{if(r||!b)return;const ee=Bn(b),xe=zr(ee);queueMicrotask(()=>{const S=K(b),Te=P.current,Ne=(typeof Te=="number"?S[Te]:Te.current)||b,Ie=bn(b,xe);!F&&!Ie&&d&&xr(Ne,{preventScroll:Ne===b})})},[r,d,b,F,K,P]),Bt(()=>{if(r||!b)return;let ee=!1;const xe=Bn(b),S=zr(xe),Te=y.current;q.current=S;function Ne(Ie){if(Ie.type==="escapeKey"&&h.domReference.current&&(q.current=h.domReference.current),["referencePress","escapeKey"].includes(Ie.type))return;const je=Ie.data.returnFocus;typeof je=="object"?(J.current=!1,ee=je.preventScroll):J.current=!je}return m.on("dismiss",Ne),()=>{m.off("dismiss",Ne);const Ie=zr(xe);(bn(b,Ie)||j&&zi(j.nodesRef.current,f).some(De=>{var Ue;return bn((Ue=De.context)==null?void 0:Ue.elements.floating,Ie)})||Te.openEvent&&["click","mousedown"].includes(Te.openEvent.type))&&h.domReference.current&&(q.current=h.domReference.current),T.current&&ln(q.current)&&!J.current&&xr(q.current,{cancelPrevious:!1,preventScroll:ee})}},[r,b,T,y,h,m,j,f]),Bt(()=>{if(!(r||!U))return U.setFocusManagerState({modal:l,closeOnFocusOut:u,open:d,onOpenChange:p,refs:h}),()=>{U.setFocusManagerState(null)}},[r,U,l,d,p,h,u]),Bt(()=>{if(!r&&b&&typeof MutationObserver=="function"&&!F){const ee=()=>{const S=b.getAttribute("tabindex");I.current.includes("floating")||zr(Bn(b))!==h.domReference.current&&Y().length===0?S!=="0"&&b.setAttribute("tabindex","0"):S!=="-1"&&b.setAttribute("tabindex","-1")};ee();const xe=new MutationObserver(ee);return xe.observe(b,{childList:!0,subtree:!0,attributes:!0}),()=>{xe.disconnect()}}},[r,b,h,I,Y,F]);function pe(ee){return r||!c||!l?null:R.createElement(EI,{ref:ee==="start"?O:N,onClick:xe=>p(!1,xe.nativeEvent)},typeof c=="string"?c:"Dismiss")}const k=!r&&x&&!V&&(B||l);return R.createElement(R.Fragment,null,k&&R.createElement(va,{"data-type":"inside",ref:U==null?void 0:U.beforeInsideRef,onFocus:ee=>{if(l){const S=K();xr(i[0]==="reference"?S[0]:S[S.length-1])}else if(U!=null&&U.preserveTabOrder&&U.portalNode)if(J.current=!1,Bs(ee,U.portalNode)){const S=ym()||v;S==null||S.focus()}else{var xe;(xe=U.beforeOutsideRef.current)==null||xe.focus()}}}),!V&&pe("start"),n,pe("end"),k&&R.createElement(va,{"data-type":"inside",ref:U==null?void 0:U.afterInsideRef,onFocus:ee=>{if(l)xr(K()[0]);else if(U!=null&&U.preserveTabOrder&&U.portalNode)if(u&&(J.current=!0),Bs(ee,U.portalNode)){const S=vm()||v;S==null||S.focus()}else{var xe;(xe=U.afterOutsideRef.current)==null||xe.focus()}}}))}function _m(e){return ln(e.target)&&e.target.tagName==="BUTTON"}function km(e){return Wp(e)}function TI(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:s}}=e,{enabled:o=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0}=t,d=R.useRef(),h=R.useRef(!1);return R.useMemo(()=>o?{reference:{onPointerDown(f){d.current=f.pointerType},onMouseDown(f){f.button===0&&(zp(d.current,!0)&&c||a!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,f.nativeEvent):(f.preventDefault(),r(!0,f.nativeEvent))))},onClick(f){if(a==="mousedown"&&d.current){d.current=void 0;return}zp(d.current,!0)&&c||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,f.nativeEvent):r(!0,f.nativeEvent))},onKeyDown(f){d.current=void 0,!(f.defaultPrevented||!u||_m(f))&&(f.key===" "&&!km(s)&&(f.preventDefault(),h.current=!0),f.key==="Enter"&&r(!(n&&l),f.nativeEvent))},onKeyUp(f){f.defaultPrevented||!u||_m(f)||km(s)||f.key===" "&&h.current&&(h.current=!1,r(!(n&&l),f.nativeEvent))}}}:{},[o,i,a,c,u,s,l,n,r])}const OI=R["useInsertionEffect".toString()]||(e=>e());function Wr(e){const t=R.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return OI(()=>{t.current=e}),R.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const II={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},PI={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},AI=e=>{var t,n;return{escapeKeyBubbles:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePressBubbles:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function RI(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:s,elements:{reference:o,domReference:a,floating:l},dataRef:c}=e,{enabled:u=!0,escapeKey:d=!0,outsidePress:h=!0,outsidePressEvent:f="pointerdown",referencePress:p=!1,referencePressEvent:m="pointerdown",ancestorScroll:y=!1,bubbles:v}=t,b=ma(),x=hm()!=null,I=Wr(typeof h=="function"?h:()=>!1),P=typeof h=="function"?I:h,T=R.useRef(!1),{escapeKeyBubbles:j,outsidePressBubbles:U}=AI(v),F=Wr(N=>{if(!n||!u||!d||N.key!=="Escape")return;const J=b?zi(b.nodesRef.current,s):[];if(!j&&(N.stopPropagation(),J.length>0)){let q=!0;if(J.forEach(W=>{var B;if((B=W.context)!=null&&B.open&&!W.context.dataRef.current.__escapeKeyBubbles){q=!1;return}}),!q)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,bO(N)?N.nativeEvent:N)}),O=Wr(N=>{const J=T.current;if(T.current=!1,J||typeof P=="function"&&!P(N))return;const q=Zp(N),W="["+Fs("inert")+"]",B=Bn(l).querySelectorAll(W);let V=$t(q)?q:null;for(;V&&!Ds(V);){const pe=yi(V);if(pe===Bn(l).body||!$t(pe))break;V=pe}if(B.length&&$t(q)&&!wO(q)&&!bn(q,l)&&Array.from(B).every(pe=>!bn(V,pe)))return;if(ln(q)&&l){const pe=q.clientWidth>0&&q.scrollWidth>q.clientWidth,k=q.clientHeight>0&&q.scrollHeight>q.clientHeight;let ee=k&&N.offsetX>q.clientWidth;if(k&&Sn(q).direction==="rtl"&&(ee=N.offsetX<=q.offsetWidth-q.clientWidth),ee||pe&&N.offsetY>q.clientHeight)return}const Y=b&&zi(b.nodesRef.current,s).some(pe=>{var k;return Gc(N,(k=pe.context)==null?void 0:k.elements.floating)});if(Gc(N,l)||Gc(N,a)||Y)return;const K=b?zi(b.nodesRef.current,s):[];if(K.length>0){let pe=!0;if(K.forEach(k=>{var ee;if((ee=k.context)!=null&&ee.open&&!k.context.dataRef.current.__outsidePressBubbles){pe=!1;return}}),!pe)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:x?{preventScroll:!0}:Fp(N)||Bp(N)}}),r(!1,N)});return R.useEffect(()=>{if(!n||!u)return;c.current.__escapeKeyBubbles=j,c.current.__outsidePressBubbles=U;function N(W){r(!1,W)}const J=Bn(l);d&&J.addEventListener("keydown",F),P&&J.addEventListener(f,O);let q=[];return y&&($t(a)&&(q=Vr(a)),$t(l)&&(q=q.concat(Vr(l))),!$t(o)&&o&&o.contextElement&&(q=q.concat(Vr(o.contextElement)))),q=q.filter(W=>{var B;return W!==((B=J.defaultView)==null?void 0:B.visualViewport)}),q.forEach(W=>{W.addEventListener("scroll",N,{passive:!0})}),()=>{d&&J.removeEventListener("keydown",F),P&&J.removeEventListener(f,O),q.forEach(W=>{W.removeEventListener("scroll",N)})}},[c,l,a,o,d,P,f,n,r,y,u,j,U,F,O]),R.useEffect(()=>{T.current=!1},[P,f]),R.useMemo(()=>u?{reference:{onKeyDown:F,[II[m]]:N=>{p&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,N.nativeEvent))}},floating:{onKeyDown:F,[PI[f]]:()=>{T.current=!0}}}:{},[u,i,p,f,m,r,F])}let au;process.env.NODE_ENV!=="production"&&(au=new Set);function $I(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var s;const j="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((s=e.elements)!=null&&s.reference&&!$t(e.elements.reference)){var o;if(!((o=au)!=null&&o.has(j))){var a;(a=au)==null||a.add(j),console.error(j)}}}const[l,c]=R.useState(null),u=((t=e.elements)==null?void 0:t.reference)||l,d=ZO(e),h=ma(),f=Wr((j,U)=>{j&&(m.current.openEvent=U),r==null||r(j,U)}),p=R.useRef(null),m=R.useRef({}),y=R.useState(()=>fI())[0],v=ru(),b=R.useCallback(j=>{const U=$t(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),contextElement:j}:j;d.refs.setReference(U)},[d.refs]),x=R.useCallback(j=>{($t(j)||j===null)&&(p.current=j,c(j)),($t(d.refs.reference.current)||d.refs.reference.current===null||j!==null&&!$t(j))&&d.refs.setReference(j)},[d.refs]),I=R.useMemo(()=>({...d.refs,setReference:x,setPositionReference:b,domReference:p}),[d.refs,x,b]),P=R.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),T=R.useMemo(()=>({...d,refs:I,elements:P,dataRef:m,nodeId:i,floatingId:v,events:y,open:n,onOpenChange:f}),[d,i,v,y,n,f,I,P]);return Bt(()=>{const j=h==null?void 0:h.nodesRef.current.find(U=>U.id===i);j&&(j.context=T)}),R.useMemo(()=>({...d,context:T,refs:I,elements:P}),[d,I,P,T])}function lu(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,s)=>(s&&Object.entries(s).forEach(o=>{let[a,l]=o;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var c;(c=r.get(a))==null||c.push(l),i[a]=function(){for(var u,d=arguments.length,h=new Array(d),f=0;f<d;f++)h[f]=arguments[f];return(u=r.get(a))==null?void 0:u.map(p=>p(...h)).find(p=>p!==void 0)}}}else i[a]=l}),i),{})}}function MI(e){e===void 0&&(e=[]);const t=e,n=R.useCallback(s=>lu(s,e,"reference"),t),r=R.useCallback(s=>lu(s,e,"floating"),t),i=R.useCallback(s=>lu(s,e,"item"),e.map(s=>s==null?void 0:s.item));return R.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let Cm=!1;function ba(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Em(e,t){return ba(t,e===eu||e===fa,e===Vi||e===js)}function cu(e,t,n){return ba(t,e===fa,n?e===Vi:e===js)||e==="Enter"||e==" "||e===""}function LI(e,t,n){return ba(t,n?e===Vi:e===js,e===fa)}function Sm(e,t,n){return ba(t,n?e===js:e===Vi,e===eu)}function DI(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:s,floating:o}}=e,{listRef:a,activeIndex:l,onNavigate:c=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:h=!1,loop:f=!1,nested:p=!1,rtl:m=!1,virtual:y=!1,focusItemOnOpen:v="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:x=!0,disabledIndices:I=void 0,orientation:P="vertical",cols:T=1,scrollItemIntoView:j=!0,virtualItemRef:U}=t;process.env.NODE_ENV!=="production"&&(h&&(f||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),y||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),P==="vertical"&&T>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const F=hm(),O=ma(),N=Wr(c),J=R.useRef(v),q=R.useRef(d??-1),W=R.useRef(null),B=R.useRef(!0),V=R.useRef(N),Y=R.useRef(!!o),K=R.useRef(!1),pe=R.useRef(!1),k=Zr(I),ee=Zr(n),xe=Zr(j),[S,Te]=R.useState(),[Ne,Ie]=R.useState(),je=Wr(function(_e,ve,ke){ke===void 0&&(ke=!1);const Ce=_e.current[ve.current];Ce&&(y?(Te(Ce.id),O==null||O.events.emit("virtualfocus",Ce),U&&(U.current=Ce)):xr(Ce,{preventScroll:!0,sync:vO()&&Vp()?Cm||K.current:!1}),requestAnimationFrame(()=>{const Re=xe.current;Re&&Ce&&(ke||!B.current)&&(Ce.scrollIntoView==null||Ce.scrollIntoView(typeof Re=="boolean"?{block:"nearest",inline:"nearest"}:Re))}))});Bt(()=>{document.createElement("div").focus({get preventScroll(){return Cm=!0,!1}})},[]),Bt(()=>{u&&(n&&o?J.current&&d!=null&&(pe.current=!0,N(d)):Y.current&&(q.current=-1,V.current(null)))},[u,n,o,d,N]),Bt(()=>{if(u&&n&&o)if(l==null){if(K.current=!1,d!=null)return;if(Y.current&&(q.current=-1,je(a,q)),!Y.current&&J.current&&(W.current!=null||J.current===!0&&W.current==null)){let _e=0;const ve=()=>{a.current[0]==null?(_e<2&&(_e?requestAnimationFrame:queueMicrotask)(ve),_e++):(q.current=W.current==null||cu(W.current,P,m)||p?tu(a,k.current):um(a,k.current),W.current=null,N(q.current))};ve()}}else Us(a,l)||(q.current=l,je(a,q,pe.current),pe.current=!1)},[u,n,o,l,d,p,a,P,m,N,je,k]),Bt(()=>{var _e,ve;if(!u||o||!O||y||!Y.current)return;const ke=O.nodesRef.current,Ce=(_e=ke.find(D=>D.id===F))==null||(ve=_e.context)==null?void 0:ve.elements.floating,Re=zr(Bn(o)),qe=ke.some(D=>D.context&&bn(D.context.elements.floating,Re));Ce&&!qe&&B.current&&Ce.focus({preventScroll:!0})},[u,o,O,F,y]),Bt(()=>{if(!u||!O||!y||F)return;function _e(ve){Ie(ve.id),U&&(U.current=ve)}return O.events.on("virtualfocus",_e),()=>{O.events.off("virtualfocus",_e)}},[u,O,y,F,U]),Bt(()=>{V.current=N,Y.current=!!o}),Bt(()=>{n||(W.current=null)},[n]);const De=l!=null,Ue=R.useMemo(()=>{function _e(ke){if(!n)return;const Ce=a.current.indexOf(ke);Ce!==-1&&N(Ce)}return{onFocus(ke){let{currentTarget:Ce}=ke;_e(Ce)},onClick:ke=>{let{currentTarget:Ce}=ke;return Ce.focus({preventScroll:!0})},...b&&{onMouseMove(ke){let{currentTarget:Ce}=ke;_e(Ce)},onPointerLeave(ke){let{pointerType:Ce}=ke;!B.current||Ce==="touch"||(q.current=-1,je(a,q),N(null),y||xr(i.floating.current,{preventScroll:!0}))}}}},[n,i,je,b,a,N,y]);return R.useMemo(()=>{if(!u)return{};const _e=k.current;function ve(D){if(B.current=!1,K.current=!0,!ee.current&&D.currentTarget===i.floating.current)return;if(p&&Sm(D.key,P,m)){tn(D),r(!1,D.nativeEvent),ln(s)&&!y&&s.focus();return}const ne=q.current,me=tu(a,_e),he=um(a,_e);if(D.key==="Home"&&(tn(D),q.current=me,N(q.current)),D.key==="End"&&(tn(D),q.current=he,N(q.current)),!(T>1&&(q.current=cI(a,{event:D,orientation:P,loop:f,cols:T,disabledIndices:_e,minIndex:me,maxIndex:he,prevIndex:q.current,stopEvent:!0}),N(q.current),P==="both"))&&Em(D.key,P)){if(tn(D),n&&!y&&zr(D.currentTarget.ownerDocument)===D.currentTarget){q.current=cu(D.key,P,m)?me:he,N(q.current);return}cu(D.key,P,m)?f?q.current=ne>=he?h&&ne!==a.current.length?-1:me:cn(a,{startingIndex:ne,disabledIndices:_e}):q.current=Math.min(he,cn(a,{startingIndex:ne,disabledIndices:_e})):f?q.current=ne<=me?h&&ne!==-1?a.current.length:he:cn(a,{startingIndex:ne,decrement:!0,disabledIndices:_e}):q.current=Math.max(me,cn(a,{startingIndex:ne,decrement:!0,disabledIndices:_e})),Us(a,q.current)?N(null):N(q.current)}}function ke(D){v==="auto"&&Fp(D.nativeEvent)&&(J.current=!0)}function Ce(D){J.current=v,v==="auto"&&Bp(D.nativeEvent)&&(J.current=!0)}const Re=y&&n&&De&&{"aria-activedescendant":Ne||S},qe=a.current.find(D=>(D==null?void 0:D.id)===S);return{reference:{...Re,onKeyDown(D){B.current=!1;const ne=D.key.indexOf("Arrow")===0,me=LI(D.key,P,m),he=Sm(D.key,P,m),Le=Em(D.key,P),Pe=(p?me:Le)||D.key==="Enter"||D.key.trim()==="";if(y&&n){const Z=O==null?void 0:O.nodesRef.current.find(G=>G.parentId==null),Q=O&&Z?gI(O.nodesRef.current,Z.id):null;if(ne&&Q&&U){const G=new KeyboardEvent("keydown",{key:D.key,bubbles:!0});if(me||he){var Be,ot;const $e=((Be=Q.context)==null?void 0:Be.elements.domReference)===D.currentTarget,Ge=he&&!$e?(ot=Q.context)==null?void 0:ot.elements.domReference:me?qe:null;Ge&&(tn(D),Ge.dispatchEvent(G),Ie(void 0))}if(Le&&Q.context&&Q.context.open&&Q.parentId&&D.currentTarget!==Q.context.elements.domReference){var Ze;tn(D),(Ze=Q.context.elements.domReference)==null||Ze.dispatchEvent(G);return}}return ve(D)}if(!(!n&&!x&&ne)){if(Pe&&(W.current=p&&Le?null:D.key),p){me&&(tn(D),n?(q.current=tu(a,_e),N(q.current)):r(!0,D.nativeEvent));return}Le&&(d!=null&&(q.current=d),tn(D),!n&&x?r(!0,D.nativeEvent):ve(D),n&&N(q.current))}},onFocus(){n&&N(null)},onPointerDown:Ce,onMouseDown:ke,onClick:ke},floating:{"aria-orientation":P==="both"?void 0:P,...Re,onKeyDown:ve,onPointerMove(){B.current=!0}},item:Ue}},[s,i,S,Ne,k,ee,a,u,P,m,y,n,De,p,d,x,h,T,f,v,N,r,Ue,O,U])}function NI(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:s="dialog"}=t,o=ru();return R.useMemo(()=>{const a={id:r,role:s};return i?s==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":s==="alertdialog"?"dialog":s,"aria-controls":n?r:void 0,...s==="listbox"&&{role:"combobox"},...s==="menu"&&{id:o}},floating:{...a,...s==="menu"&&{"aria-labelledby":o}}}:{}},[i,s,n,r,o])}function jI(e,t){var n;const{open:r,dataRef:i}=e,{listRef:s,activeIndex:o,onMatch:a,onTypingChange:l,enabled:c=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:h=[],selectedIndex:f=null}=t,p=R.useRef(),m=R.useRef(""),y=R.useRef((n=f??o)!=null?n:-1),v=R.useRef(null),b=Wr(a),x=Wr(l),I=Zr(u),P=Zr(h);return Bt(()=>{r&&(clearTimeout(p.current),v.current=null,m.current="")},[r]),Bt(()=>{if(r&&m.current===""){var T;y.current=(T=f??o)!=null?T:-1}},[r,f,o]),R.useMemo(()=>{if(!c)return{};function T(F){F?i.current.typing||(i.current.typing=F,x(F)):i.current.typing&&(i.current.typing=F,x(F))}function j(F,O,N){const J=I.current?I.current(O,N):O.find(q=>(q==null?void 0:q.toLocaleLowerCase().indexOf(N.toLocaleLowerCase()))===0);return J?F.indexOf(J):-1}function U(F){const O=s.current;if(m.current.length>0&&m.current[0]!==" "&&(j(O,O,m.current)===-1?T(!1):F.key===" "&&tn(F)),O==null||P.current.includes(F.key)||F.key.length!==1||F.ctrlKey||F.metaKey||F.altKey)return;r&&F.key!==" "&&(tn(F),T(!0)),O.every(W=>{var B,V;return W?((B=W[0])==null?void 0:B.toLocaleLowerCase())!==((V=W[1])==null?void 0:V.toLocaleLowerCase()):!0})&&m.current===F.key&&(m.current="",y.current=v.current),m.current+=F.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",y.current=v.current,T(!1)},d);const J=y.current,q=j(O,[...O.slice((J||0)+1),...O.slice(0,(J||0)+1)],m.current);q!==-1?(b(q),v.current=q):F.key!==" "&&(m.current="",T(!1))}return{reference:{onKeyDown:U},floating:{onKeyDown:U,onKeyUp(F){F.key===" "&&T(!1)}}}},[c,r,i,s,d,P,I,b,x])}const UI=({styles:e,type:t,options:n,label:r,reusable:i})=>{var V,Y,K,pe,k,ee,xe,S,Te,Ne,Ie,je;const{state:s}=mt(),[o,a]=R.useState(!1),[l,c]=R.useState(null),[u,d]=R.useState(null),{client:h}=mt(),f=n.reduce((De,Ue)=>(De[Ue.label]=Ue.value,De),{}),p=f?Object.keys(f):[],m=De=>{a(u!==null&&!i?!1:De)},{refs:y,floatingStyles:v,context:b}=$I({placement:"bottom-start",open:o,onOpenChange:m,whileElementsMounted:VO,middleware:[EO(5),kO({padding:10}),SO({apply({rects:De,elements:Ue,availableHeight:_e}){Object.assign(Ue.floating.style,{maxHeight:`${_e}px`,minWidth:`${De.reference.width}px`})},padding:10})]}),x=R.useRef([]),I=R.useRef(p),P=R.useRef(!1),T=TI(b,{event:"mousedown"}),j=RI(b),U=NI(b,{role:"listbox"}),F=DI(b,{listRef:x,activeIndex:l,selectedIndex:u,onNavigate:c,loop:!0}),O=jI(b,{listRef:I,activeIndex:l,selectedIndex:u,onMatch:o?c:d,onTypingChange(De){P.current=De}}),{getReferenceProps:N,getFloatingProps:J,getItemProps:q}=MI([j,U,F,O,T]),W=De=>{d(De),h==null||h.sendMessage(f[p[De]]),a(!1)},B=u!==null?p[u]:void 0;return z.jsxs(z.Fragment,{children:[z.jsxs("div",{tabIndex:0,ref:y.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":u!==null&&!i?"":void 0,...(Y=(V=e==null?void 0:e[t])==null?void 0:V.button)==null?void 0:Y.container,...N(),children:[z.jsx("span",{...(pe=(K=e==null?void 0:e[t])==null?void 0:K.button)==null?void 0:pe.text,children:B||r||"Select..."}),z.jsx(oT,{...(ee=(k=e==null?void 0:e[t])==null?void 0:k.button)==null?void 0:ee.icon})]}),o&&z.jsx(CI,{children:z.jsx(SI,{context:b,modal:!1,children:z.jsx("div",{ref:y.setFloating,className:(Te=(S=(xe=e==null?void 0:e[t])==null?void 0:xe.content)==null?void 0:S.container)==null?void 0:Te.className,style:{...v,...(je=(Ie=(Ne=e==null?void 0:e[t])==null?void 0:Ne.content)==null?void 0:Ie.container)==null?void 0:je.style},...J(),children:p.map((De,Ue)=>{var _e,ve;return z.jsx("div",{ref:ke=>{x.current[Ue]=ke},role:"option",tabIndex:Ue===l?0:-1,"aria-selected":Ue===u&&Ue===l,"data-active":Ue===l?"":void 0,...(ve=(_e=e==null?void 0:e[t])==null?void 0:_e.content)==null?void 0:ve.item,...q({onClick(){s.isReadOnly||W(Ue)},onKeyDown(ke){s.isReadOnly||(ke.key==="Enter"&&(ke.preventDefault(),W(Ue)),ke.key===" "&&!P.current&&(ke.preventDefault(),W(Ue)))}}),children:De},De)})})})})]})},FI=_.forwardRef(({type:e,title:t,styles:n,url:r,...i},s)=>{var o,a,l;return z.jsxs("a",{...i,...(o=n==null?void 0:n[e])==null?void 0:o.container,href:r,download:!0,ref:s,children:[z.jsx("p",{...(a=n==null?void 0:n[e])==null?void 0:a.title,children:t||r}),z.jsx(lT,{...(l=n==null?void 0:n[e])==null?void 0:l.icon})]})}),uu={text:CE,button:SE,bubble:OE,audio:QS,column:fT,file:FI,image:JS,location:dT,row:hT,video:YS,carousel:sO,dropdown:UI},Wi=({block:e,styles:t,...n})=>{const r=uu[e.type];return z.jsx(r,{...n,...e,styles:t})},Tm=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const d=t;t=c??typeof u!="object"?u:Object.assign({},t,u),n.forEach(h=>h(t,d))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,i,a),a},BI=e=>e?Tm(e):Tm;var du={exports:{}},fu={},wa={exports:{}},hu={};/**
236
+ */var jO=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Gc=jO.join(","),nm=typeof Element>"u",Ns=nm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,la=!nm&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},ca=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=i===""||i==="true",o=s||n&&t&&e(t.parentNode);return o},UO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},FO=function(t,n,r){if(ca(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Gc));return n&&Ns.call(t,Gc)&&i.unshift(t),i=i.filter(r),i},BO=function e(t,n,r){for(var i=[],s=Array.from(t);s.length;){var o=s.shift();if(!ca(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,c=e(l,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:o,candidates:c})}else{var u=Ns.call(o,Gc);u&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var d=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),h=!ca(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(d&&h){var f=e(d===!0?o.children:d.children,!0,r);r.flatten?i.push.apply(i,f):i.push({scopeParent:o,candidates:f})}else s.unshift.apply(s,o.children)}}return i},rm=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},im=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||UO(t))&&!rm(t)?0:t.tabIndex},VO=function(t,n){var r=im(t);return r<0&&n&&!rm(t)?0:r},zO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},sm=function(t){return t.tagName==="INPUT"},ZO=function(t){return sm(t)&&t.type==="hidden"},WO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},HO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},qO=function(t){if(!t.name)return!0;var n=t.form||la(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=HO(i,t.form);return!s||s===t},KO=function(t){return sm(t)&&t.type==="radio"},JO=function(t){return KO(t)&&!qO(t)},GO=function(t){var n,r=t&&la(t),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var o,a,l;for(s=!!((o=i)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&i;){var c,u,d;r=la(i),i=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=i)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return s},om=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},YO=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=Ns.call(t,"details>summary:first-of-type"),o=s?t.parentElement:t;if(Ns.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var a=t;t;){var l=t.parentElement,c=la(t);if(l&&!l.shadowRoot&&i(l)===!0)return om(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(GO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return om(t);return!1},QO=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Ns.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},XO=function(t,n){return!(n.disabled||ca(n)||ZO(n)||YO(n,t)||WO(n)||QO(n))},am=function(t,n){return!(JO(n)||im(n)<0||!XO(t,n))},eI=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},tI=function e(t){var n=[],r=[];return t.forEach(function(i,s){var o=!!i.scopeParent,a=o?i.scopeParent:i,l=VO(a,o),c=o?e(i.candidates):a;l===0?o?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:i,isScope:o,content:c})}),r.sort(zO).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Yc=function(t,n){n=n||{};var r;return n.getShadowRoot?r=BO([t],n.includeContainer,{filter:am.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:eI}):r=FO(t,n.includeContainer,am.bind(null,n)),tI(r)};const Qc="ArrowUp",ua="ArrowDown",Vi="ArrowLeft",js="ArrowRight";function da(e,t,n){return Math.floor(e/t)!==n}function Us(e,t){return t<0||t>=e.current.length}function Xc(e,t){return cn(e,{disabledIndices:t})}function lm(e,t){return cn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function cn(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:s=1}=t===void 0?{}:t;const o=e.current;let a=n;do{var l,c;a=a+(r?-s:s)}while(a>=0&&a<=o.length-1&&(i?i.includes(a):o[a]==null||(l=o[a])!=null&&l.hasAttribute("disabled")||((c=o[a])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return a}function nI(e,t){let{event:n,orientation:r,loop:i,cols:s,disabledIndices:o,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===Qc){if(u&&tn(n),c===-1)d=l;else if(d=cn(e,{startingIndex:d,amount:s,decrement:!0,disabledIndices:o}),i&&(c-s<a||d<0)){const h=c%s,f=l%s,p=l-(f-h);f===h?d=l:d=f>h?p:p-s}Us(e,d)&&(d=c)}if(n.key===ua&&(u&&tn(n),c===-1?d=a:(d=cn(e,{startingIndex:c,amount:s,disabledIndices:o}),i&&c+s>l&&(d=cn(e,{startingIndex:c%s-s,amount:s,disabledIndices:o}))),Us(e,d)&&(d=c)),r==="both"){const h=Fi(c/s);n.key===js&&(u&&tn(n),c%s!==s-1?(d=cn(e,{startingIndex:c,disabledIndices:o}),i&&da(d,s,h)&&(d=cn(e,{startingIndex:c-c%s-1,disabledIndices:o}))):i&&(d=cn(e,{startingIndex:c-c%s-1,disabledIndices:o})),da(d,s,h)&&(d=c)),n.key===Vi&&(u&&tn(n),c%s!==0?(d=cn(e,{startingIndex:c,disabledIndices:o,decrement:!0}),i&&da(d,s,h)&&(d=cn(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:o}))):i&&(d=cn(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:o})),da(d,s,h)&&(d=c));const f=Fi(l/s)===h;Us(e,d)&&(i&&f?d=n.key===Vi?l:cn(e,{startingIndex:c-c%s-1,disabledIndices:o}):d=c)}return d}let cm=0;function xr(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(cm);const s=()=>e==null?void 0:e.focus({preventScroll:n});i?s():cm=requestAnimationFrame(s)}var Bt=typeof document<"u"?_.useLayoutEffect:_.useEffect;function fa(){return fa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fa.apply(this,arguments)}let eu=!1,rI=0;const um=()=>"floating-ui-"+rI++;function iI(){const[e,t]=R.useState(()=>eu?um():void 0);return Bt(()=>{e==null&&t(um())},[]),R.useEffect(()=>{eu||(eu=!0)},[]),e}const tu=R["useId".toString()]||iI;function sI(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const oI=R.createContext(null),aI=R.createContext(null),dm=()=>{var e;return((e=R.useContext(oI))==null?void 0:e.id)||null},ha=()=>R.useContext(aI);function Fs(e){return"data-floating-ui-"+e}function Zr(e){const t=_.useRef(e);return Bt(()=>{t.current=e}),t}function lI(e,t){var n;let r=[],i=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;i;){const s=e.find(o=>o.id===i);i=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function zi(e,t){let n=e.filter(i=>{var s;return i.parentId===t&&((s=i.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(i=>{var s;return(s=r)==null?void 0:s.some(o=>{var a;return i.parentId===o.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function cI(e,t){let n,r=-1;function i(s,o){o>r&&(n=s,r=o),zi(e,s).forEach(l=>{i(l.id,o+1)})}return i(t,0),e.find(s=>s.id===n)}let Zi=new WeakMap,pa=new WeakSet,ma={},nu=0;const uI=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,fm=e=>e&&(e.host||fm(e.parentNode)),dI=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=fm(n);return e.contains(r)?r:null}).filter(n=>n!=null);function fI(e,t,n,r){const i="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,o=dI(t,e),a=new Set,l=new Set(o),c=[];ma[i]||(ma[i]=new WeakMap);const u=ma[i];o.forEach(d),h(t),a.clear();function d(f){!f||a.has(f)||(a.add(f),f.parentNode&&d(f.parentNode))}function h(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,p=>{if(a.has(p))h(p);else{const m=s?p.getAttribute(s):null,v=m!==null&&m!=="false",y=(Zi.get(p)||0)+1,b=(u.get(p)||0)+1;Zi.set(p,y),u.set(p,b),c.push(p),y===1&&v&&pa.add(p),b===1&&p.setAttribute(i,""),!v&&s&&p.setAttribute(s,"true")}})}return nu++,()=>{c.forEach(f=>{const p=(Zi.get(f)||0)-1,m=(u.get(f)||0)-1;Zi.set(f,p),u.set(f,m),p||(!pa.has(f)&&s&&f.removeAttribute(s),pa.delete(f)),m||f.removeAttribute(i)}),nu--,nu||(Zi=new WeakMap,Zi=new WeakMap,pa=new WeakSet,ma={})}}function hm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Bn(e[0]).body;return fI(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const ru=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pm(e,t){const n=Yc(e,ru());t==="prev"&&n.reverse();const r=n.indexOf(zr(Bn(e)));return n.slice(r+1)[0]}function mm(){return pm(document.body,"next")}function gm(){return pm(document.body,"prev")}function Bs(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!bn(n,r)}function hI(e){Yc(e,ru()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function pI(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const iu={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let mI;function ym(e){e.key==="Tab"&&(e.target,clearTimeout(mI))}const ga=R.forwardRef(function(t,n){const[r,i]=R.useState();Bt(()=>(Fp()&&i("button"),document.addEventListener("keydown",ym),()=>{document.removeEventListener("keydown",ym)}),[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Fs("focus-guard")]:"",style:iu};return R.createElement("span",fa({},t,s))}),vm=R.createContext(null);function gI(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=R.useState(null),s=tu(),o=bm(),a=R.useMemo(()=>({id:t,root:n,portalContext:o,uniqueId:s}),[t,n,o,s]),l=R.useRef();return Bt(()=>()=>{r==null||r.remove()},[r,a]),Bt(()=>{if(l.current===a)return;l.current=a;const{id:c,root:u,portalContext:d,uniqueId:h}=a,f=c?document.getElementById(c):null,p=Fs("portal");if(f){const m=document.createElement("div");m.id=h,m.setAttribute(p,""),f.appendChild(m),i(m)}else{let m=u||(d==null?void 0:d.portalNode);m&&!$t(m)&&(m=m.current),m=m||document.body;let v=null;c&&(v=document.createElement("div"),v.id=c,m.appendChild(v));const y=document.createElement("div");y.id=h,y.setAttribute(p,""),m=v||m,m.appendChild(y),i(y)}},[a]),r}function yI(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const s=gI({id:n,root:r}),[o,a]=R.useState(null),l=R.useRef(null),c=R.useRef(null),u=R.useRef(null),d=R.useRef(null),h=!!o&&!o.modal&&o.open&&i&&!!(r||s);return R.useEffect(()=>{if(!s||!i||o!=null&&o.modal)return;function f(p){s&&Bs(p)&&(p.type==="focusin"?pI:hI)(s)}return s.addEventListener("focusin",f,!0),s.addEventListener("focusout",f,!0),()=>{s.removeEventListener("focusin",f,!0),s.removeEventListener("focusout",f,!0)}},[s,i,o==null?void 0:o.modal]),R.createElement(vm.Provider,{value:R.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:a}),[i,s])},h&&s&&R.createElement(ga,{"data-type":"outside",ref:l,onFocus:f=>{if(Bs(f,s)){var p;(p=u.current)==null||p.focus()}else{const m=gm()||(o==null?void 0:o.refs.domReference.current);m==null||m.focus()}}}),h&&s&&R.createElement("span",{"aria-owns":s.id,style:iu}),s&&Gn.createPortal(t,s),h&&s&&R.createElement(ga,{"data-type":"outside",ref:c,onFocus:f=>{if(Bs(f,s)){var p;(p=d.current)==null||p.focus()}else{const m=mm()||(o==null?void 0:o.refs.domReference.current);m==null||m.focus(),o!=null&&o.closeOnFocusOut&&(o==null||o.onOpenChange(!1,f.nativeEvent))}}}))}const bm=()=>R.useContext(vm),vI=R.forwardRef(function(t,n){return R.createElement("button",fa({},t,{type:"button",ref:n,tabIndex:-1,style:iu}))});function bI(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:s=!0,initialFocus:o=0,returnFocus:a=!0,modal:l=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:u=!0}=e,{open:d,refs:h,nodeId:f,onOpenChange:p,events:m,dataRef:v,elements:{domReference:y,floating:b}}=t,x=uI()?s:!0,I=Zr(i),A=Zr(o),O=Zr(a),j=ha(),U=bm(),H=typeof o=="number"&&o<0,T=R.useRef(null),N=R.useRef(null),G=R.useRef(!1),W=R.useRef(null),q=R.useRef(!1),B=U!=null,z=y&&y.getAttribute("role")==="combobox"&&zp(y)&&H,Y=R.useCallback(function(ee){return ee===void 0&&(ee=b),ee?Yc(ee,ru()):[]},[b]),K=R.useCallback(ee=>{const _e=Y(ee);return I.current.map(S=>y&&S==="reference"?y:b&&S==="floating"?b:_e).filter(Boolean).flat()},[y,b,I,Y]);R.useEffect(()=>{if(r||!l)return;function ee(S){if(S.key==="Tab"){bn(b,zr(Bn(b)))&&Y().length===0&&!z&&tn(S);const Se=K(),Ne=Vp(S);I.current[0]==="reference"&&Ne===y&&(tn(S),S.shiftKey?xr(Se[Se.length-1]):xr(Se[1])),I.current[1]==="floating"&&Ne===b&&S.shiftKey&&(tn(S),xr(Se[0]))}}const _e=Bn(b);return _e.addEventListener("keydown",ee),()=>{_e.removeEventListener("keydown",ee)}},[r,y,b,l,I,h,z,Y,K]),R.useEffect(()=>{if(r||!u)return;function ee(){q.current=!0,setTimeout(()=>{q.current=!1})}function _e(S){const Se=S.relatedTarget;queueMicrotask(()=>{const Ne=!(bn(y,Se)||bn(b,Se)||bn(Se,b)||bn(U==null?void 0:U.portalNode,Se)||Se!=null&&Se.hasAttribute(Fs("focus-guard"))||j&&(zi(j.nodesRef.current,f).find(Ie=>{var je,He;return bn((je=Ie.context)==null?void 0:je.elements.floating,Se)||bn((He=Ie.context)==null?void 0:He.elements.domReference,Se)})||lI(j.nodesRef.current,f).find(Ie=>{var je,He;return((je=Ie.context)==null?void 0:je.elements.floating)===Se||((He=Ie.context)==null?void 0:He.elements.domReference)===Se})));Se&&Ne&&!q.current&&Se!==W.current&&(G.current=!0,p(!1,S))})}if(b&&ln(y))return y.addEventListener("focusout",_e),y.addEventListener("pointerdown",ee),!l&&b.addEventListener("focusout",_e),()=>{y.removeEventListener("focusout",_e),y.removeEventListener("pointerdown",ee),!l&&b.removeEventListener("focusout",_e)}},[r,y,b,l,f,j,U,p,u]),R.useEffect(()=>{var ee;if(r)return;const _e=Array.from((U==null||(ee=U.portalNode)==null?void 0:ee.querySelectorAll("["+Fs("portal")+"]"))||[]);if(b){const S=[b,..._e,T.current,N.current,I.current.includes("reference")||z?y:null].filter(Ne=>Ne!=null),Se=l?hm(S,x,!x):hm(S);return()=>{Se()}}},[r,y,b,l,I,U,z,x]),Bt(()=>{if(r||!b)return;const ee=Bn(b),_e=zr(ee);queueMicrotask(()=>{const S=K(b),Se=A.current,Ne=(typeof Se=="number"?S[Se]:Se.current)||b,Ie=bn(b,_e);!H&&!Ie&&d&&xr(Ne,{preventScroll:Ne===b})})},[r,d,b,H,K,A]),Bt(()=>{if(r||!b)return;let ee=!1;const _e=Bn(b),S=zr(_e),Se=v.current;W.current=S;function Ne(Ie){if(Ie.type==="escapeKey"&&h.domReference.current&&(W.current=h.domReference.current),["referencePress","escapeKey"].includes(Ie.type))return;const je=Ie.data.returnFocus;typeof je=="object"?(G.current=!1,ee=je.preventScroll):G.current=!je}return m.on("dismiss",Ne),()=>{m.off("dismiss",Ne);const Ie=zr(_e);(bn(b,Ie)||j&&zi(j.nodesRef.current,f).some(He=>{var De;return bn((De=He.context)==null?void 0:De.elements.floating,Ie)})||Se.openEvent&&["click","mousedown"].includes(Se.openEvent.type))&&h.domReference.current&&(W.current=h.domReference.current),O.current&&ln(W.current)&&!G.current&&xr(W.current,{cancelPrevious:!1,preventScroll:ee})}},[r,b,O,v,h,m,j,f]),Bt(()=>{if(!(r||!U))return U.setFocusManagerState({modal:l,closeOnFocusOut:u,open:d,onOpenChange:p,refs:h}),()=>{U.setFocusManagerState(null)}},[r,U,l,d,p,h,u]),Bt(()=>{if(!r&&b&&typeof MutationObserver=="function"&&!H){const ee=()=>{const S=b.getAttribute("tabindex");I.current.includes("floating")||zr(Bn(b))!==h.domReference.current&&Y().length===0?S!=="0"&&b.setAttribute("tabindex","0"):S!=="-1"&&b.setAttribute("tabindex","-1")};ee();const _e=new MutationObserver(ee);return _e.observe(b,{childList:!0,subtree:!0,attributes:!0}),()=>{_e.disconnect()}}},[r,b,h,I,Y,H]);function pe(ee){return r||!c||!l?null:R.createElement(vI,{ref:ee==="start"?T:N,onClick:_e=>p(!1,_e.nativeEvent)},typeof c=="string"?c:"Dismiss")}const k=!r&&x&&!z&&(B||l);return R.createElement(R.Fragment,null,k&&R.createElement(ga,{"data-type":"inside",ref:U==null?void 0:U.beforeInsideRef,onFocus:ee=>{if(l){const S=K();xr(i[0]==="reference"?S[0]:S[S.length-1])}else if(U!=null&&U.preserveTabOrder&&U.portalNode)if(G.current=!1,Bs(ee,U.portalNode)){const S=mm()||y;S==null||S.focus()}else{var _e;(_e=U.beforeOutsideRef.current)==null||_e.focus()}}}),!z&&pe("start"),n,pe("end"),k&&R.createElement(ga,{"data-type":"inside",ref:U==null?void 0:U.afterInsideRef,onFocus:ee=>{if(l)xr(K()[0]);else if(U!=null&&U.preserveTabOrder&&U.portalNode)if(u&&(G.current=!0),Bs(ee,U.portalNode)){const S=gm()||y;S==null||S.focus()}else{var _e;(_e=U.afterOutsideRef.current)==null||_e.focus()}}}))}function wm(e){return ln(e.target)&&e.target.tagName==="BUTTON"}function xm(e){return zp(e)}function wI(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:s}}=e,{enabled:o=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0}=t,d=R.useRef(),h=R.useRef(!1);return R.useMemo(()=>o?{reference:{onPointerDown(f){d.current=f.pointerType},onMouseDown(f){f.button===0&&(Bp(d.current,!0)&&c||a!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,f.nativeEvent):(f.preventDefault(),r(!0,f.nativeEvent))))},onClick(f){if(a==="mousedown"&&d.current){d.current=void 0;return}Bp(d.current,!0)&&c||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,f.nativeEvent):r(!0,f.nativeEvent))},onKeyDown(f){d.current=void 0,!(f.defaultPrevented||!u||wm(f))&&(f.key===" "&&!xm(s)&&(f.preventDefault(),h.current=!0),f.key==="Enter"&&r(!(n&&l),f.nativeEvent))},onKeyUp(f){f.defaultPrevented||!u||wm(f)||xm(s)||f.key===" "&&h.current&&(h.current=!1,r(!(n&&l),f.nativeEvent))}}}:{},[o,i,a,c,u,s,l,n,r])}const xI=R["useInsertionEffect".toString()]||(e=>e());function Wr(e){const t=R.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return xI(()=>{t.current=e}),R.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const _I={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},kI={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},CI=e=>{var t,n;return{escapeKeyBubbles:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePressBubbles:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function EI(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:s,elements:{reference:o,domReference:a,floating:l},dataRef:c}=e,{enabled:u=!0,escapeKey:d=!0,outsidePress:h=!0,outsidePressEvent:f="pointerdown",referencePress:p=!1,referencePressEvent:m="pointerdown",ancestorScroll:v=!1,bubbles:y}=t,b=ha(),x=dm()!=null,I=Wr(typeof h=="function"?h:()=>!1),A=typeof h=="function"?I:h,O=R.useRef(!1),{escapeKeyBubbles:j,outsidePressBubbles:U}=CI(y),H=Wr(N=>{if(!n||!u||!d||N.key!=="Escape")return;const G=b?zi(b.nodesRef.current,s):[];if(!j&&(N.stopPropagation(),G.length>0)){let W=!0;if(G.forEach(q=>{var B;if((B=q.context)!=null&&B.open&&!q.context.dataRef.current.__escapeKeyBubbles){W=!1;return}}),!W)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,fO(N)?N.nativeEvent:N)}),T=Wr(N=>{const G=O.current;if(O.current=!1,G||typeof A=="function"&&!A(N))return;const W=Vp(N),q="["+Fs("inert")+"]",B=Bn(l).querySelectorAll(q);let z=$t(W)?W:null;for(;z&&!Ds(z);){const pe=gi(z);if(pe===Bn(l).body||!$t(pe))break;z=pe}if(B.length&&$t(W)&&!hO(W)&&!bn(W,l)&&Array.from(B).every(pe=>!bn(z,pe)))return;if(ln(W)&&l){const pe=W.clientWidth>0&&W.scrollWidth>W.clientWidth,k=W.clientHeight>0&&W.scrollHeight>W.clientHeight;let ee=k&&N.offsetX>W.clientWidth;if(k&&Tn(W).direction==="rtl"&&(ee=N.offsetX<=W.offsetWidth-W.clientWidth),ee||pe&&N.offsetY>W.clientHeight)return}const Y=b&&zi(b.nodesRef.current,s).some(pe=>{var k;return Kc(N,(k=pe.context)==null?void 0:k.elements.floating)});if(Kc(N,l)||Kc(N,a)||Y)return;const K=b?zi(b.nodesRef.current,s):[];if(K.length>0){let pe=!0;if(K.forEach(k=>{var ee;if((ee=k.context)!=null&&ee.open&&!k.context.dataRef.current.__outsidePressBubbles){pe=!1;return}}),!pe)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:x?{preventScroll:!0}:jp(N)||Up(N)}}),r(!1,N)});return R.useEffect(()=>{if(!n||!u)return;c.current.__escapeKeyBubbles=j,c.current.__outsidePressBubbles=U;function N(q){r(!1,q)}const G=Bn(l);d&&G.addEventListener("keydown",H),A&&G.addEventListener(f,T);let W=[];return v&&($t(a)&&(W=Vr(a)),$t(l)&&(W=W.concat(Vr(l))),!$t(o)&&o&&o.contextElement&&(W=W.concat(Vr(o.contextElement)))),W=W.filter(q=>{var B;return q!==((B=G.defaultView)==null?void 0:B.visualViewport)}),W.forEach(q=>{q.addEventListener("scroll",N,{passive:!0})}),()=>{d&&G.removeEventListener("keydown",H),A&&G.removeEventListener(f,T),W.forEach(q=>{q.removeEventListener("scroll",N)})}},[c,l,a,o,d,A,f,n,r,v,u,j,U,H,T]),R.useEffect(()=>{O.current=!1},[A,f]),R.useMemo(()=>u?{reference:{onKeyDown:H,[_I[m]]:N=>{p&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,N.nativeEvent))}},floating:{onKeyDown:H,[kI[f]]:()=>{O.current=!0}}}:{},[u,i,p,f,m,r,H])}let su;process.env.NODE_ENV!=="production"&&(su=new Set);function SI(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var s;const j="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((s=e.elements)!=null&&s.reference&&!$t(e.elements.reference)){var o;if(!((o=su)!=null&&o.has(j))){var a;(a=su)==null||a.add(j),console.error(j)}}}const[l,c]=R.useState(null),u=((t=e.elements)==null?void 0:t.reference)||l,d=NO(e),h=ha(),f=Wr((j,U)=>{j&&(m.current.openEvent=U),r==null||r(j,U)}),p=R.useRef(null),m=R.useRef({}),v=R.useState(()=>sI())[0],y=tu(),b=R.useCallback(j=>{const U=$t(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),contextElement:j}:j;d.refs.setReference(U)},[d.refs]),x=R.useCallback(j=>{($t(j)||j===null)&&(p.current=j,c(j)),($t(d.refs.reference.current)||d.refs.reference.current===null||j!==null&&!$t(j))&&d.refs.setReference(j)},[d.refs]),I=R.useMemo(()=>({...d.refs,setReference:x,setPositionReference:b,domReference:p}),[d.refs,x,b]),A=R.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),O=R.useMemo(()=>({...d,refs:I,elements:A,dataRef:m,nodeId:i,floatingId:y,events:v,open:n,onOpenChange:f}),[d,i,y,v,n,f,I,A]);return Bt(()=>{const j=h==null?void 0:h.nodesRef.current.find(U=>U.id===i);j&&(j.context=O)}),R.useMemo(()=>({...d,context:O,refs:I,elements:A}),[d,I,A,O])}function ou(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,s)=>(s&&Object.entries(s).forEach(o=>{let[a,l]=o;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var c;(c=r.get(a))==null||c.push(l),i[a]=function(){for(var u,d=arguments.length,h=new Array(d),f=0;f<d;f++)h[f]=arguments[f];return(u=r.get(a))==null?void 0:u.map(p=>p(...h)).find(p=>p!==void 0)}}}else i[a]=l}),i),{})}}function TI(e){e===void 0&&(e=[]);const t=e,n=R.useCallback(s=>ou(s,e,"reference"),t),r=R.useCallback(s=>ou(s,e,"floating"),t),i=R.useCallback(s=>ou(s,e,"item"),e.map(s=>s==null?void 0:s.item));return R.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let _m=!1;function ya(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function km(e,t){return ya(t,e===Qc||e===ua,e===Vi||e===js)}function au(e,t,n){return ya(t,e===ua,n?e===Vi:e===js)||e==="Enter"||e==" "||e===""}function OI(e,t,n){return ya(t,n?e===Vi:e===js,e===ua)}function Cm(e,t,n){return ya(t,n?e===js:e===Vi,e===Qc)}function II(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:s,floating:o}}=e,{listRef:a,activeIndex:l,onNavigate:c=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:h=!1,loop:f=!1,nested:p=!1,rtl:m=!1,virtual:v=!1,focusItemOnOpen:y="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:x=!0,disabledIndices:I=void 0,orientation:A="vertical",cols:O=1,scrollItemIntoView:j=!0,virtualItemRef:U}=t;process.env.NODE_ENV!=="production"&&(h&&(f||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),v||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),A==="vertical"&&O>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const H=dm(),T=ha(),N=Wr(c),G=R.useRef(y),W=R.useRef(d??-1),q=R.useRef(null),B=R.useRef(!0),z=R.useRef(N),Y=R.useRef(!!o),K=R.useRef(!1),pe=R.useRef(!1),k=Zr(I),ee=Zr(n),_e=Zr(j),[S,Se]=R.useState(),[Ne,Ie]=R.useState(),je=Wr(function(we,ye,Te){Te===void 0&&(Te=!1);const ke=we.current[ye.current];ke&&(v?(Se(ke.id),T==null||T.events.emit("virtualfocus",ke),U&&(U.current=ke)):xr(ke,{preventScroll:!0,sync:dO()&&Fp()?_m||K.current:!1}),requestAnimationFrame(()=>{const Re=_e.current;Re&&ke&&(Te||!B.current)&&(ke.scrollIntoView==null||ke.scrollIntoView(typeof Re=="boolean"?{block:"nearest",inline:"nearest"}:Re))}))});Bt(()=>{document.createElement("div").focus({get preventScroll(){return _m=!0,!1}})},[]),Bt(()=>{u&&(n&&o?G.current&&d!=null&&(pe.current=!0,N(d)):Y.current&&(W.current=-1,z.current(null)))},[u,n,o,d,N]),Bt(()=>{if(u&&n&&o)if(l==null){if(K.current=!1,d!=null)return;if(Y.current&&(W.current=-1,je(a,W)),!Y.current&&G.current&&(q.current!=null||G.current===!0&&q.current==null)){let we=0;const ye=()=>{a.current[0]==null?(we<2&&(we?requestAnimationFrame:queueMicrotask)(ye),we++):(W.current=q.current==null||au(q.current,A,m)||p?Xc(a,k.current):lm(a,k.current),q.current=null,N(W.current))};ye()}}else Us(a,l)||(W.current=l,je(a,W,pe.current),pe.current=!1)},[u,n,o,l,d,p,a,A,m,N,je,k]),Bt(()=>{var we,ye;if(!u||o||!T||v||!Y.current)return;const Te=T.nodesRef.current,ke=(we=Te.find(D=>D.id===H))==null||(ye=we.context)==null?void 0:ye.elements.floating,Re=zr(Bn(o)),qe=Te.some(D=>D.context&&bn(D.context.elements.floating,Re));ke&&!qe&&B.current&&ke.focus({preventScroll:!0})},[u,o,T,H,v]),Bt(()=>{if(!u||!T||!v||H)return;function we(ye){Ie(ye.id),U&&(U.current=ye)}return T.events.on("virtualfocus",we),()=>{T.events.off("virtualfocus",we)}},[u,T,v,H,U]),Bt(()=>{z.current=N,Y.current=!!o}),Bt(()=>{n||(q.current=null)},[n]);const He=l!=null,De=R.useMemo(()=>{function we(Te){if(!n)return;const ke=a.current.indexOf(Te);ke!==-1&&N(ke)}return{onFocus(Te){let{currentTarget:ke}=Te;we(ke)},onClick:Te=>{let{currentTarget:ke}=Te;return ke.focus({preventScroll:!0})},...b&&{onMouseMove(Te){let{currentTarget:ke}=Te;we(ke)},onPointerLeave(Te){let{pointerType:ke}=Te;!B.current||ke==="touch"||(W.current=-1,je(a,W),N(null),v||xr(i.floating.current,{preventScroll:!0}))}}}},[n,i,je,b,a,N,v]);return R.useMemo(()=>{if(!u)return{};const we=k.current;function ye(D){if(B.current=!1,K.current=!0,!ee.current&&D.currentTarget===i.floating.current)return;if(p&&Cm(D.key,A,m)){tn(D),r(!1,D.nativeEvent),ln(s)&&!v&&s.focus();return}const ne=W.current,me=Xc(a,we),he=lm(a,we);if(D.key==="Home"&&(tn(D),W.current=me,N(W.current)),D.key==="End"&&(tn(D),W.current=he,N(W.current)),!(O>1&&(W.current=nI(a,{event:D,orientation:A,loop:f,cols:O,disabledIndices:we,minIndex:me,maxIndex:he,prevIndex:W.current,stopEvent:!0}),N(W.current),A==="both"))&&km(D.key,A)){if(tn(D),n&&!v&&zr(D.currentTarget.ownerDocument)===D.currentTarget){W.current=au(D.key,A,m)?me:he,N(W.current);return}au(D.key,A,m)?f?W.current=ne>=he?h&&ne!==a.current.length?-1:me:cn(a,{startingIndex:ne,disabledIndices:we}):W.current=Math.min(he,cn(a,{startingIndex:ne,disabledIndices:we})):f?W.current=ne<=me?h&&ne!==-1?a.current.length:he:cn(a,{startingIndex:ne,decrement:!0,disabledIndices:we}):W.current=Math.max(me,cn(a,{startingIndex:ne,decrement:!0,disabledIndices:we})),Us(a,W.current)?N(null):N(W.current)}}function Te(D){y==="auto"&&jp(D.nativeEvent)&&(G.current=!0)}function ke(D){G.current=y,y==="auto"&&Up(D.nativeEvent)&&(G.current=!0)}const Re=v&&n&&He&&{"aria-activedescendant":Ne||S},qe=a.current.find(D=>(D==null?void 0:D.id)===S);return{reference:{...Re,onKeyDown(D){B.current=!1;const ne=D.key.indexOf("Arrow")===0,me=OI(D.key,A,m),he=Cm(D.key,A,m),Le=km(D.key,A),Pe=(p?me:Le)||D.key==="Enter"||D.key.trim()==="";if(v&&n){const V=T==null?void 0:T.nodesRef.current.find(J=>J.parentId==null),Q=T&&V?cI(T.nodesRef.current,V.id):null;if(ne&&Q&&U){const J=new KeyboardEvent("keydown",{key:D.key,bubbles:!0});if(me||he){var Fe,ot;const $e=((Fe=Q.context)==null?void 0:Fe.elements.domReference)===D.currentTarget,Ge=he&&!$e?(ot=Q.context)==null?void 0:ot.elements.domReference:me?qe:null;Ge&&(tn(D),Ge.dispatchEvent(J),Ie(void 0))}if(Le&&Q.context&&Q.context.open&&Q.parentId&&D.currentTarget!==Q.context.elements.domReference){var ze;tn(D),(ze=Q.context.elements.domReference)==null||ze.dispatchEvent(J);return}}return ye(D)}if(!(!n&&!x&&ne)){if(Pe&&(q.current=p&&Le?null:D.key),p){me&&(tn(D),n?(W.current=Xc(a,we),N(W.current)):r(!0,D.nativeEvent));return}Le&&(d!=null&&(W.current=d),tn(D),!n&&x?r(!0,D.nativeEvent):ye(D),n&&N(W.current))}},onFocus(){n&&N(null)},onPointerDown:ke,onMouseDown:Te,onClick:Te},floating:{"aria-orientation":A==="both"?void 0:A,...Re,onKeyDown:ye,onPointerMove(){B.current=!0}},item:De}},[s,i,S,Ne,k,ee,a,u,A,m,v,n,He,p,d,x,h,O,f,y,N,r,De,T,U])}function PI(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:s="dialog"}=t,o=tu();return R.useMemo(()=>{const a={id:r,role:s};return i?s==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":s==="alertdialog"?"dialog":s,"aria-controls":n?r:void 0,...s==="listbox"&&{role:"combobox"},...s==="menu"&&{id:o}},floating:{...a,...s==="menu"&&{"aria-labelledby":o}}}:{}},[i,s,n,r,o])}function AI(e,t){var n;const{open:r,dataRef:i}=e,{listRef:s,activeIndex:o,onMatch:a,onTypingChange:l,enabled:c=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:h=[],selectedIndex:f=null}=t,p=R.useRef(),m=R.useRef(""),v=R.useRef((n=f??o)!=null?n:-1),y=R.useRef(null),b=Wr(a),x=Wr(l),I=Zr(u),A=Zr(h);return Bt(()=>{r&&(clearTimeout(p.current),y.current=null,m.current="")},[r]),Bt(()=>{if(r&&m.current===""){var O;v.current=(O=f??o)!=null?O:-1}},[r,f,o]),R.useMemo(()=>{if(!c)return{};function O(H){H?i.current.typing||(i.current.typing=H,x(H)):i.current.typing&&(i.current.typing=H,x(H))}function j(H,T,N){const G=I.current?I.current(T,N):T.find(W=>(W==null?void 0:W.toLocaleLowerCase().indexOf(N.toLocaleLowerCase()))===0);return G?H.indexOf(G):-1}function U(H){const T=s.current;if(m.current.length>0&&m.current[0]!==" "&&(j(T,T,m.current)===-1?O(!1):H.key===" "&&tn(H)),T==null||A.current.includes(H.key)||H.key.length!==1||H.ctrlKey||H.metaKey||H.altKey)return;r&&H.key!==" "&&(tn(H),O(!0)),T.every(q=>{var B,z;return q?((B=q[0])==null?void 0:B.toLocaleLowerCase())!==((z=q[1])==null?void 0:z.toLocaleLowerCase()):!0})&&m.current===H.key&&(m.current="",v.current=y.current),m.current+=H.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",v.current=y.current,O(!1)},d);const G=v.current,W=j(T,[...T.slice((G||0)+1),...T.slice(0,(G||0)+1)],m.current);W!==-1?(b(W),y.current=W):H.key!==" "&&(m.current="",O(!1))}return{reference:{onKeyDown:U},floating:{onKeyDown:U,onKeyUp(H){H.key===" "&&O(!1)}}}},[c,r,i,s,d,A,I,b,x])}const RI=({styles:e,type:t,options:n,label:r,reusable:i})=>{var Y,K,pe,k,ee,_e,S,Se,Ne,Ie,je,He;const{state:s,client:o,messageContainerRef:a}=vt(),[l,c]=R.useState(!1),[u,d]=R.useState(null),[h,f]=R.useState(null),p=n.reduce((De,we)=>(De[we.label]=we.value,De),{}),m=p?Object.keys(p):[],v=De=>{c(h!==null&&!i?!1:De)},{refs:y,floatingStyles:b,context:x}=SI({placement:"bottom-start",open:l,onOpenChange:v,whileElementsMounted:LO,middleware:[yO(5),vO({padding:10,boundary:(a==null?void 0:a.current)??void 0,crossAxis:!0}),bO({apply({rects:De,elements:we,availableHeight:ye}){Object.assign(we.floating.style,{maxHeight:`${ye}px`,minWidth:`${De.reference.width}px`})},padding:10})]}),I=R.useRef([]),A=R.useRef(m),O=R.useRef(!1),j=wI(x,{event:"mousedown"}),U=EI(x),H=PI(x,{role:"listbox"}),T=II(x,{listRef:I,activeIndex:u,selectedIndex:h,onNavigate:d,loop:!0}),N=AI(x,{listRef:A,activeIndex:u,selectedIndex:h,onMatch:l?d:f,onTypingChange(De){O.current=De}}),{getReferenceProps:G,getFloatingProps:W,getItemProps:q}=TI([U,H,T,N,j]),B=De=>{f(De),o==null||o.sendMessage(p[m[De]]),c(!1)},z=h!==null?m[h]:void 0;return F.jsxs(F.Fragment,{children:[F.jsxs("div",{tabIndex:0,ref:y.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":h!==null&&!i?"":void 0,...(K=(Y=e==null?void 0:e[t])==null?void 0:Y.button)==null?void 0:K.container,...G(),children:[F.jsx("span",{...(k=(pe=e==null?void 0:e[t])==null?void 0:pe.button)==null?void 0:k.text,children:z||r||"Select..."}),F.jsx(iT,{...(_e=(ee=e==null?void 0:e[t])==null?void 0:ee.button)==null?void 0:_e.icon})]}),l&&F.jsx(yI,{children:F.jsx(bI,{context:x,modal:!1,children:F.jsx("div",{ref:y.setFloating,className:(Ne=(Se=(S=e==null?void 0:e[t])==null?void 0:S.content)==null?void 0:Se.container)==null?void 0:Ne.className,style:{...b,...(He=(je=(Ie=e==null?void 0:e[t])==null?void 0:Ie.content)==null?void 0:je.container)==null?void 0:He.style},...W(),children:m.map((De,we)=>{var ye,Te;return F.jsx("div",{ref:ke=>{I.current[we]=ke},role:"option",tabIndex:we===u?0:-1,"aria-selected":we===h&&we===u,"data-active":we===u?"":void 0,...(Te=(ye=e==null?void 0:e[t])==null?void 0:ye.content)==null?void 0:Te.item,...q({onClick(){s.isReadOnly||B(we)},onKeyDown(ke){s.isReadOnly||(ke.key==="Enter"&&(ke.preventDefault(),B(we)),ke.key===" "&&!O.current&&(ke.preventDefault(),B(we)))}}),children:De},De)})})})})]})},$I=_.forwardRef(({type:e,title:t,styles:n,url:r,...i},s)=>{var o,a,l;return F.jsxs("a",{...i,...(o=n==null?void 0:n[e])==null?void 0:o.container,href:r,download:!0,ref:s,children:[F.jsx("p",{...(a=n==null?void 0:n[e])==null?void 0:a.title,children:t||r}),F.jsx(oT,{...(l=n==null?void 0:n[e])==null?void 0:l.icon})]})}),lu={text:_E,button:CE,bubble:SE,audio:GS,column:uT,file:$I,image:qS,location:cT,row:dT,video:JS,carousel:rO,dropdown:RI},Wi=({block:e,styles:t,...n})=>{const r=lu[e.type];return F.jsx(r,{...n,...e,styles:t})},Em=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const d=t;t=c??typeof u!="object"?u:Object.assign({},t,u),n.forEach(h=>h(t,d))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,i,a),a},MI=e=>e?Em(e):Em;var cu={exports:{}},uu={},va={exports:{}},du={};/**
237
237
  * @license React
238
238
  * use-sync-external-store-shim.production.min.js
239
239
  *
@@ -241,7 +241,7 @@ to {
241
241
  *
242
242
  * This source code is licensed under the MIT license found in the
243
243
  * LICENSE file in the root directory of this source tree.
244
- */var Om;function VI(){if(Om)return hu;Om=1;var e=_;function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,s=e.useLayoutEffect,o=e.useDebugValue;function a(d,h){var f=h(),p=r({inst:{value:f,getSnapshot:h}}),m=p[0].inst,y=p[1];return s(function(){m.value=f,m.getSnapshot=h,l(m)&&y({inst:m})},[d,f,h]),i(function(){return l(m)&&y({inst:m}),d(function(){l(m)&&y({inst:m})})},[d]),o(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!n(d,f)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return hu.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,hu}var pu={};/**
244
+ */var Sm;function LI(){if(Sm)return du;Sm=1;var e=_;function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,s=e.useLayoutEffect,o=e.useDebugValue;function a(d,h){var f=h(),p=r({inst:{value:f,getSnapshot:h}}),m=p[0].inst,v=p[1];return s(function(){m.value=f,m.getSnapshot=h,l(m)&&v({inst:m})},[d,f,h]),i(function(){return l(m)&&v({inst:m}),d(function(){l(m)&&v({inst:m})})},[d]),o(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!n(d,f)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return du.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,du}var fu={};/**
245
245
  * @license React
246
246
  * use-sync-external-store-shim.development.js
247
247
  *
@@ -249,7 +249,7 @@ to {
249
249
  *
250
250
  * This source code is licensed under the MIT license found in the
251
251
  * LICENSE file in the root directory of this source tree.
252
- */var Im;function zI(){return Im||(Im=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=_,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(x){{for(var I=arguments.length,P=new Array(I>1?I-1:0),T=1;T<I;T++)P[T-1]=arguments[T];r("error",x,P)}}function r(x,I,P){{var T=t.ReactDebugCurrentFrame,j=T.getStackAddendum();j!==""&&(I+="%s",P=P.concat([j]));var U=P.map(function(F){return String(F)});U.unshift("Warning: "+I),Function.prototype.apply.call(console[x],console,U)}}function i(x,I){return x===I&&(x!==0||1/x===1/I)||x!==x&&I!==I}var s=typeof Object.is=="function"?Object.is:i,o=e.useState,a=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,u=!1,d=!1;function h(x,I,P){u||e.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var T=I();if(!d){var j=I();s(T,j)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var U=o({inst:{value:T,getSnapshot:I}}),F=U[0].inst,O=U[1];return l(function(){F.value=T,F.getSnapshot=I,f(F)&&O({inst:F})},[x,T,I]),a(function(){f(F)&&O({inst:F});var N=function(){f(F)&&O({inst:F})};return x(N)},[x]),c(T),T}function f(x){var I=x.getSnapshot,P=x.value;try{var T=I();return!s(P,T)}catch{return!0}}function p(x,I,P){return I()}var m=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!m,v=y?p:h,b=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v;pu.useSyncExternalStore=b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),pu}var Pm;function Am(){return Pm||(Pm=1,process.env.NODE_ENV==="production"?wa.exports=VI():wa.exports=zI()),wa.exports}/**
252
+ */var Tm;function DI(){return Tm||(Tm=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=_,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(x){{for(var I=arguments.length,A=new Array(I>1?I-1:0),O=1;O<I;O++)A[O-1]=arguments[O];r("error",x,A)}}function r(x,I,A){{var O=t.ReactDebugCurrentFrame,j=O.getStackAddendum();j!==""&&(I+="%s",A=A.concat([j]));var U=A.map(function(H){return String(H)});U.unshift("Warning: "+I),Function.prototype.apply.call(console[x],console,U)}}function i(x,I){return x===I&&(x!==0||1/x===1/I)||x!==x&&I!==I}var s=typeof Object.is=="function"?Object.is:i,o=e.useState,a=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,u=!1,d=!1;function h(x,I,A){u||e.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var O=I();if(!d){var j=I();s(O,j)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var U=o({inst:{value:O,getSnapshot:I}}),H=U[0].inst,T=U[1];return l(function(){H.value=O,H.getSnapshot=I,f(H)&&T({inst:H})},[x,O,I]),a(function(){f(H)&&T({inst:H});var N=function(){f(H)&&T({inst:H})};return x(N)},[x]),c(O),O}function f(x){var I=x.getSnapshot,A=x.value;try{var O=I();return!s(A,O)}catch{return!0}}function p(x,I,A){return I()}var m=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",v=!m,y=v?p:h,b=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y;fu.useSyncExternalStore=b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),fu}var Om;function Im(){return Om||(Om=1,process.env.NODE_ENV==="production"?va.exports=LI():va.exports=DI()),va.exports}/**
253
253
  * @license React
254
254
  * use-sync-external-store-shim/with-selector.production.min.js
255
255
  *
@@ -257,7 +257,7 @@ to {
257
257
  *
258
258
  * This source code is licensed under the MIT license found in the
259
259
  * LICENSE file in the root directory of this source tree.
260
- */var Rm;function ZI(){if(Rm)return fu;Rm=1;var e=_,t=Am();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,a=e.useMemo,l=e.useDebugValue;return fu.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var p=s(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function v(T){if(!b){if(b=!0,x=T,T=h(T),f!==void 0&&m.hasValue){var j=m.value;if(f(j,T))return I=j}return I=T}if(j=I,r(x,T))return j;var U=h(T);return f!==void 0&&f(j,U)?j:(x=T,I=U)}var b=!1,x,I,P=d===void 0?null:d;return[function(){return v(u())},P===null?void 0:function(){return v(P())}]},[u,d,h,f]);var y=i(c,p[0],p[1]);return o(function(){m.hasValue=!0,m.value=y},[y]),l(y),y},fu}var mu={};/**
260
+ */var Pm;function NI(){if(Pm)return uu;Pm=1;var e=_,t=Im();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,a=e.useMemo,l=e.useDebugValue;return uu.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var p=s(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function y(O){if(!b){if(b=!0,x=O,O=h(O),f!==void 0&&m.hasValue){var j=m.value;if(f(j,O))return I=j}return I=O}if(j=I,r(x,O))return j;var U=h(O);return f!==void 0&&f(j,U)?j:(x=O,I=U)}var b=!1,x,I,A=d===void 0?null:d;return[function(){return y(u())},A===null?void 0:function(){return y(A())}]},[u,d,h,f]);var v=i(c,p[0],p[1]);return o(function(){m.hasValue=!0,m.value=v},[v]),l(v),v},uu}var hu={};/**
261
261
  * @license React
262
262
  * use-sync-external-store-shim/with-selector.development.js
263
263
  *
@@ -265,28 +265,28 @@ to {
265
265
  *
266
266
  * This source code is licensed under the MIT license found in the
267
267
  * LICENSE file in the root directory of this source tree.
268
- */var $m;function WI(){return $m||($m=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=_,t=Am();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,a=e.useMemo,l=e.useDebugValue;function c(u,d,h,f,p){var m=s(null),y;m.current===null?(y={hasValue:!1,value:null},m.current=y):y=m.current;var v=a(function(){var P=!1,T,j,U=function(J){if(!P){P=!0,T=J;var q=f(J);if(p!==void 0&&y.hasValue){var W=y.value;if(p(W,q))return j=W,W}return j=q,q}var B=T,V=j;if(r(B,J))return V;var Y=f(J);return p!==void 0&&p(V,Y)?V:(T=J,j=Y,Y)},F=h===void 0?null:h,O=function(){return U(d())},N=F===null?void 0:function(){return U(F())};return[O,N]},[d,h,f,p]),b=v[0],x=v[1],I=i(u,b,x);return o(function(){y.hasValue=!0,y.value=I},[I]),l(I),I}mu.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),mu}process.env.NODE_ENV==="production"?du.exports=ZI():du.exports=WI();var HI=du.exports;const qI=ai(HI),{useSyncExternalStoreWithSelector:KI}=qI;let IF=!1;function JI(e,t=e.getState,n){const r=KI(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return _.useDebugValue(r),r}const Mm=e=>{const t=typeof e=="function"?BI(e):e,n=(r,i)=>JI(t,r,i);return Object.assign(n,t),n},GI=e=>e?Mm(e):Mm,gu=new Map,xa=e=>{const t=gu.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},YI=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=gu.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return gu.set(n.name,i),{type:"tracked",store:e,...i}},QI=(e,t={})=>(n,r,i)=>{const{enabled:s,anonymousActionType:o,store:a,...l}=t;let c;try{c=(s??!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return e(n,r,i);const{connection:u,...d}=YI(a,c,l);let h=!0;i.setState=(m,y,v)=>{const b=n(m,y);if(!h)return b;const x=v===void 0?{type:o||"anonymous"}:typeof v=="string"?{type:v}:v;return a===void 0?(u==null||u.send(x,r()),b):(u==null||u.send({...x,type:`${a}/${x.type}`},{...xa(l.name),[a]:i.getState()}),b)};const f=(...m)=>{const y=h;h=!1,n(...m),h=y},p=e(i.setState,r,i);if(d.type==="untracked"?u==null||u.init(p):(d.stores[d.store]=i,u==null||u.init(Object.fromEntries(Object.entries(d.stores).map(([m,y])=>[m,m===d.store?p:y.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let m=!1;const y=i.dispatch;i.dispatch=(...v)=>{y(...v)}}return u.subscribe(m=>{var y;switch(m.type){case"ACTION":if(typeof m.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return yu(m.payload,v=>{if(v.type==="__setState"){if(a===void 0){f(v.state);return}Object.keys(v.state).length!==1&&console.error(`
268
+ */var Am;function jI(){return Am||(Am=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=_,t=Im();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,a=e.useMemo,l=e.useDebugValue;function c(u,d,h,f,p){var m=s(null),v;m.current===null?(v={hasValue:!1,value:null},m.current=v):v=m.current;var y=a(function(){var A=!1,O,j,U=function(G){if(!A){A=!0,O=G;var W=f(G);if(p!==void 0&&v.hasValue){var q=v.value;if(p(q,W))return j=q,q}return j=W,W}var B=O,z=j;if(r(B,G))return z;var Y=f(G);return p!==void 0&&p(z,Y)?z:(O=G,j=Y,Y)},H=h===void 0?null:h,T=function(){return U(d())},N=H===null?void 0:function(){return U(H())};return[T,N]},[d,h,f,p]),b=y[0],x=y[1],I=i(u,b,x);return o(function(){v.hasValue=!0,v.value=I},[I]),l(I),I}hu.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),hu}process.env.NODE_ENV==="production"?cu.exports=NI():cu.exports=jI();var UI=cu.exports;const FI=ai(UI),{useSyncExternalStoreWithSelector:BI}=FI;let _F=!1;function VI(e,t=e.getState,n){const r=BI(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return _.useDebugValue(r),r}const Rm=e=>{const t=typeof e=="function"?MI(e):e,n=(r,i)=>VI(t,r,i);return Object.assign(n,t),n},zI=e=>e?Rm(e):Rm,pu=new Map,ba=e=>{const t=pu.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},ZI=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=pu.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return pu.set(n.name,i),{type:"tracked",store:e,...i}},WI=(e,t={})=>(n,r,i)=>{const{enabled:s,anonymousActionType:o,store:a,...l}=t;let c;try{c=(s??!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return e(n,r,i);const{connection:u,...d}=ZI(a,c,l);let h=!0;i.setState=(m,v,y)=>{const b=n(m,v);if(!h)return b;const x=y===void 0?{type:o||"anonymous"}:typeof y=="string"?{type:y}:y;return a===void 0?(u==null||u.send(x,r()),b):(u==null||u.send({...x,type:`${a}/${x.type}`},{...ba(l.name),[a]:i.getState()}),b)};const f=(...m)=>{const v=h;h=!1,n(...m),h=v},p=e(i.setState,r,i);if(d.type==="untracked"?u==null||u.init(p):(d.stores[d.store]=i,u==null||u.init(Object.fromEntries(Object.entries(d.stores).map(([m,v])=>[m,m===d.store?p:v.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let m=!1;const v=i.dispatch;i.dispatch=(...y)=>{v(...y)}}return u.subscribe(m=>{var v;switch(m.type){case"ACTION":if(typeof m.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return mu(m.payload,y=>{if(y.type==="__setState"){if(a===void 0){f(y.state);return}Object.keys(y.state).length!==1&&console.error(`
269
269
  [zustand devtools middleware] Unsupported __setState action format.
270
270
  When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
271
271
  and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
272
- `);const b=v.state[a];if(b==null)return;JSON.stringify(i.getState())!==JSON.stringify(b)&&f(b);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(v)});case"DISPATCH":switch(m.payload.type){case"RESET":return f(p),a===void 0?u==null?void 0:u.init(i.getState()):u==null?void 0:u.init(xa(l.name));case"COMMIT":if(a===void 0){u==null||u.init(i.getState());return}return u==null?void 0:u.init(xa(l.name));case"ROLLBACK":return yu(m.state,v=>{if(a===void 0){f(v),u==null||u.init(i.getState());return}f(v[a]),u==null||u.init(xa(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return yu(m.state,v=>{if(a===void 0){f(v);return}JSON.stringify(i.getState())!==JSON.stringify(v[a])&&f(v[a])});case"IMPORT_STATE":{const{nextLiftedState:v}=m.payload,b=(y=v.computedStates.slice(-1)[0])==null?void 0:y.state;if(!b)return;f(a===void 0?b:b[a]),u==null||u.send(null,v);return}case"PAUSE_RECORDING":return h=!h}return}}),p},yu=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function XI(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var s;const o=l=>l===null?null:JSON.parse(l,t==null?void 0:t.reviver),a=(s=n.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>n.setItem(i,JSON.stringify(s,t==null?void 0:t.replacer)),removeItem:i=>n.removeItem(i)}}const Vs=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Vs(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Vs(r)(n)}}}},eP=(e,t)=>(n,r,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,v)=>({...v,...y}),...t},o=!1;const a=new Set,l=new Set;let c;try{c=s.getStorage()}catch{}if(!c)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...y)},r,i);const u=Vs(s.serialize),d=()=>{const y=s.partialize({...r()});let v;const b=u({state:y,version:s.version}).then(x=>c.setItem(s.name,x)).catch(x=>{v=x});if(v)throw v;return b},h=i.setState;i.setState=(y,v)=>{h(y,v),d()};const f=e((...y)=>{n(...y),d()},r,i);let p;const m=()=>{var y;if(!c)return;o=!1,a.forEach(b=>b(r()));const v=((y=s.onRehydrateStorage)==null?void 0:y.call(s,r()))||void 0;return Vs(c.getItem.bind(c))(s.name).then(b=>{if(b)return s.deserialize(b)}).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==s.version){if(s.migrate)return s.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var x;return p=s.merge(b,(x=r())!=null?x:f),n(p,!0),d()}).then(()=>{v==null||v(p,void 0),o=!0,l.forEach(b=>b(p))}).catch(b=>{v==null||v(void 0,b)})};return i.persist={setOptions:y=>{s={...s,...y},y.getStorage&&(c=y.getStorage())},clearStorage:()=>{c==null||c.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:y=>(a.add(y),()=>{a.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},m(),p||f},tP=(e,t)=>(n,r,i)=>{let s={storage:XI(()=>localStorage),partialize:m=>m,version:0,merge:(m,y)=>({...y,...m}),...t},o=!1;const a=new Set,l=new Set;let c=s.storage;if(!c)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...m)},r,i);const u=()=>{const m=s.partialize({...r()});return c.setItem(s.name,{state:m,version:s.version})},d=i.setState;i.setState=(m,y)=>{d(m,y),u()};const h=e((...m)=>{n(...m),u()},r,i);let f;const p=()=>{var m,y;if(!c)return;o=!1,a.forEach(b=>{var x;return b((x=r())!=null?x:h)});const v=((y=s.onRehydrateStorage)==null?void 0:y.call(s,(m=r())!=null?m:h))||void 0;return Vs(c.getItem.bind(c))(s.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==s.version){if(s.migrate)return s.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var x;return f=s.merge(b,(x=r())!=null?x:h),n(f,!0),u()}).then(()=>{v==null||v(f,void 0),f=r(),o=!0,l.forEach(b=>b(f))}).catch(b=>{v==null||v(void 0,b)})};return i.persist={setOptions:m=>{s={...s,...m},m.storage&&(c=m.storage)},clearStorage:()=>{c==null||c.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>o,onHydrate:m=>(a.add(m),()=>{a.delete(m)}),onFinishHydration:m=>(l.add(m),()=>{l.delete(m)})},s.skipHydration||p(),f||h},nP=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?eP(e,t):tP(e,t),Hr=GI()(QI(nP((e,t)=>({messageHistory:{},addMessageToHistory:({userId:n,message:r})=>e(i=>({...i,messageHistory:{...i.messageHistory,[n]:[r,...(i.messageHistory[n]??[]).slice(0,100)]}})),clientMode:"",setClientMode:n=>{const{clearAll:r,clientMode:i}=t();i!==n&&r(),e(s=>({...s,clientMode:n}))},setUser:n=>e(r=>({...r,user:n})),setConversationId:n=>e(r=>({...r,conversationId:n})),clearAll:()=>{e(n=>({...n,messageHistory:{},user:void 0,conversationId:void 0}))}}),{name:"botpress-webchat"})));var Mn=function(){return Mn=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Mn.apply(this,arguments)};function Lm(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function rP(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function iP(){var e=_.useRef(!1),t=_.useCallback(function(){return e.current},[]);return _.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function sP(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=_.useRef(0),i=iP(),s=_.useState(n),o=s[0],a=s[1],l=_.useCallback(function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];var d=++r.current;return o.loading||a(function(h){return Mn(Mn({},h),{loading:!0})}),e.apply(void 0,c).then(function(h){return i()&&d===r.current&&a({value:h,loading:!1}),h},function(h){return i()&&d===r.current&&a({error:h,loading:!1}),h})},t);return[o,l]}function vu(e,t){t===void 0&&(t=[]);var n=sP(e,t,{loading:!0}),r=n[0],i=n[1];return _.useEffect(function(){i()},[i]),r}function oP(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function aP(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var lP=function(e){_.useEffect(e,[])};const bi=lP;var cP=function(e){bi(function(){e()})};const uP=cP;var dP=function(e){var t=_.useRef(e);t.current=e,bi(function(){return function(){return t.current()}})};const fP=dP;var hP=function(e){var t=_.useRef(0),n=_.useState(e),r=n[0],i=n[1],s=_.useCallback(function(o){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){i(o)})},[]);return fP(function(){cancelAnimationFrame(t.current)}),[r,s]};const pP=hP;var mP=function(e){process.env.NODE_ENV==="development"&&(typeof e!="object"||typeof e.current>"u")&&console.error("`useScroll` expects a single ref argument.");var t=pP({x:0,y:0}),n=t[0],r=t[1];return _.useEffect(function(){var i=function(){e.current&&r({x:e.current.scrollLeft,y:e.current.scrollTop})};return e.current&&oP(e.current,"scroll",i,{capture:!1,passive:!0}),function(){e.current&&aP(e.current,"scroll",i)}},[e]),n};const gP=mP,yP=e=>{const t=new Date;return e.getTime()-t.getTime()},vP=(e=yP)=>{const[t,n]=_.useState(0),[r,i]=_.useState(),s=()=>n(o=>o+1);return vu(async()=>{if(r){const o=setTimeout(s,e(r));return()=>{clearTimeout(o)}}},[r]),[t,i]};var Dm={},bu={},Nm={};Object.defineProperty(Nm,"__esModule",{value:!0});var _a={},bP=Me&&Me.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(_a,"__esModule",{value:!0}),_a.Emitter=void 0;let wP=class{constructor(){this.listeners={}}on(t,n,r=!1){const i=this.listeners[t];i?r?i.unshift(n):i.push(n):this.listeners[t]=[n]}emit(t,n){return bP(this,void 0,void 0,function*(){const r=this.listeners[t];if(r!=null&&r.length){for(const i of r)yield i(n);return!0}else return!1})}};_a.Emitter=wP;var jm={};Object.defineProperty(jm,"__esModule",{value:!0});var Um={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HealthEventType=void 0,function(t){t.Create="create",t.Configure="configure",t.Start="start",t.StartFailure="start-failure",t.Initialize="initialize",t.InitializeFailure="initialize-failure",t.Sleep="sleep",t.Delete="delete"}(e.HealthEventType||(e.HealthEventType={}))})(Um);var Fm={};Object.defineProperty(Fm,"__esModule",{value:!0});var Bm={};Object.defineProperty(Bm,"__esModule",{value:!0});var Vm={};Object.defineProperty(Vm,"__esModule",{value:!0});var zm={};Object.defineProperty(zm,"__esModule",{value:!0}),function(e){var t=Me&&Me.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=Me&&Me.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(Nm,e),n(_a,e),n(jm,e),n(Um,e),n(Fm,e),n(Bm,e),n(Vm,e),n(zm,e)}(bu);var ka={},Zm={},wu={exports:{}},Ca={},xu={},Ea={},zs={},Hi={},wi={},qi={},Ki={},er={};Object.defineProperty(er,"__esModule",{value:!0}),er.ERROR_PACKET=er.PACKET_TYPES_REVERSE=er.PACKET_TYPES=void 0;const tr=Object.create(null);er.PACKET_TYPES=tr,tr.open="0",tr.close="1",tr.ping="2",tr.pong="3",tr.message="4",tr.upgrade="5",tr.noop="6";const Wm=Object.create(null);er.PACKET_TYPES_REVERSE=Wm,Object.keys(tr).forEach(e=>{Wm[tr[e]]=e});const xP={type:"error",data:"parser error"};er.ERROR_PACKET=xP,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.encodePacket=Ki.encodePacketToBinary=void 0;const _P=er,Hm=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",qm=typeof ArrayBuffer=="function",Km=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Jm=({type:e,data:t},n,r)=>Hm&&t instanceof Blob?n?r(t):Gm(t,r):qm&&(t instanceof ArrayBuffer||Km(t))?n?r(t):Gm(new Blob([t]),r):r(_P.PACKET_TYPES[e]+(t||""));Ki.encodePacket=Jm;const Gm=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Ym(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let _u;function kP(e,t){if(Hm&&e.data instanceof Blob)return e.data.arrayBuffer().then(Ym).then(t);if(qm&&(e.data instanceof ArrayBuffer||Km(e.data)))return t(Ym(e.data));Jm(e,!1,n=>{_u||(_u=new TextEncoder),t(_u.encode(n))})}Ki.encodePacketToBinary=kP;var Sa={},Ji={};Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.decode=Ji.encode=void 0;const Gi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zs=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Gi.length;e++)Zs[Gi.charCodeAt(e)]=e;const CP=e=>{let t=new Uint8Array(e),n,r=t.length,i="";for(n=0;n<r;n+=3)i+=Gi[t[n]>>2],i+=Gi[(t[n]&3)<<4|t[n+1]>>4],i+=Gi[(t[n+1]&15)<<2|t[n+2]>>6],i+=Gi[t[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};Ji.encode=CP;const EP=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)s=Zs[e.charCodeAt(r)],o=Zs[e.charCodeAt(r+1)],a=Zs[e.charCodeAt(r+2)],l=Zs[e.charCodeAt(r+3)],u[i++]=s<<2|o>>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c};Ji.decode=EP,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.decodePacket=void 0;const Ta=er,SP=Ji,TP=typeof ArrayBuffer=="function",OP=(e,t)=>{if(typeof e!="string")return{type:"message",data:Qm(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:IP(e.substring(1),t)}:Ta.PACKET_TYPES_REVERSE[n]?e.length>1?{type:Ta.PACKET_TYPES_REVERSE[n],data:e.substring(1)}:{type:Ta.PACKET_TYPES_REVERSE[n]}:Ta.ERROR_PACKET};Sa.decodePacket=OP;const IP=(e,t)=>{if(TP){const n=(0,SP.decode)(e);return Qm(n,t)}else return{base64:!0,data:e}},Qm=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=e.createPacketDecoderStream=e.createPacketEncoderStream=void 0;const t=Ki;Object.defineProperty(e,"encodePacket",{enumerable:!0,get:function(){return t.encodePacket}});const n=Sa;Object.defineProperty(e,"decodePacket",{enumerable:!0,get:function(){return n.decodePacket}});const r=er,i=String.fromCharCode(30),s=(h,f)=>{const p=h.length,m=new Array(p);let y=0;h.forEach((v,b)=>{(0,t.encodePacket)(v,!1,x=>{m[b]=x,++y===p&&f(m.join(i))})})};e.encodePayload=s;const o=(h,f)=>{const p=h.split(i),m=[];for(let y=0;y<p.length;y++){const v=(0,n.decodePacket)(p[y],f);if(m.push(v),v.type==="error")break}return m};e.decodePayload=o;function a(){return new TransformStream({transform(h,f){(0,t.encodePacketToBinary)(h,p=>{const m=p.length;let y;if(m<126)y=new Uint8Array(1),new DataView(y.buffer).setUint8(0,m);else if(m<65536){y=new Uint8Array(3);const v=new DataView(y.buffer);v.setUint8(0,126),v.setUint16(1,m)}else{y=new Uint8Array(9);const v=new DataView(y.buffer);v.setUint8(0,127),v.setBigUint64(1,BigInt(m))}h.data&&typeof h.data!="string"&&(y[0]|=128),f.enqueue(y),f.enqueue(p)})}})}e.createPacketEncoderStream=a;let l;function c(h){return h.reduce((f,p)=>f+p.length,0)}function u(h,f){if(h[0].length===f)return h.shift();const p=new Uint8Array(f);let m=0;for(let y=0;y<f;y++)p[y]=h[0][m++],m===h[0].length&&(h.shift(),m=0);return h.length&&m<h[0].length&&(h[0]=h[0].slice(m)),p}function d(h,f){l||(l=new TextDecoder);const p=[];let m=0,y=-1,v=!1;return new TransformStream({transform(b,x){for(p.push(b);;){if(m===0){if(c(p)<1)break;const I=u(p,1);v=(I[0]&128)===128,y=I[0]&127,y<126?m=3:y===126?m=1:m=2}else if(m===1){if(c(p)<2)break;const I=u(p,2);y=new DataView(I.buffer,I.byteOffset,I.length).getUint16(0),m=3}else if(m===2){if(c(p)<8)break;const I=u(p,8),P=new DataView(I.buffer,I.byteOffset,I.length),T=P.getUint32(0);if(T>Math.pow(2,53-32)-1){x.enqueue(r.ERROR_PACKET);break}y=T*Math.pow(2,32)+P.getUint32(4),m=3}else{if(c(p)<y)break;const I=u(p,y);x.enqueue((0,n.decodePacket)(v?I:l.decode(I),f)),m=0}if(y===0||y>h){x.enqueue(r.ERROR_PACKET);break}}}})}e.createPacketDecoderStream=d,e.protocol=4})(qi);function pn(e){if(e)return PP(e)}function PP(e){for(var t in pn.prototype)e[t]=pn.prototype[t];return e}pn.prototype.on=pn.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},pn.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},pn.prototype.off=pn.prototype.removeListener=pn.prototype.removeAllListeners=pn.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this},pn.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},pn.prototype.emitReserved=pn.prototype.emit,pn.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},pn.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Yi=Ll(Object.freeze(Object.defineProperty({__proto__:null,Emitter:pn},Symbol.toStringTag,{value:"Module"})));var Ln={},xi={};Object.defineProperty(xi,"__esModule",{value:!0}),xi.globalThisShim=void 0,xi.globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.byteLength=Ln.installTimerFunctions=Ln.pick=void 0;const qr=xi;function AP(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}Ln.pick=AP;const RP=qr.globalThisShim.setTimeout,$P=qr.globalThisShim.clearTimeout;function MP(e,t){t.useNativeTimers?(e.setTimeoutFn=RP.bind(qr.globalThisShim),e.clearTimeoutFn=$P.bind(qr.globalThisShim)):(e.setTimeoutFn=qr.globalThisShim.setTimeout.bind(qr.globalThisShim),e.clearTimeoutFn=qr.globalThisShim.clearTimeout.bind(qr.globalThisShim))}Ln.installTimerFunctions=MP;const LP=1.33;function DP(e){return typeof e=="string"?NP(e):Math.ceil((e.byteLength||e.size)*LP)}Ln.byteLength=DP;function NP(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}var ku={exports:{}},Cu,Xm;function jP(){if(Xm)return Cu;Xm=1;var e=1e3,t=e*60,n=t*60,r=n*24,i=r*7,s=r*365.25;Cu=function(u,d){d=d||{};var h=typeof u;if(h==="string"&&u.length>0)return o(u);if(h==="number"&&isFinite(u))return d.long?l(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var h=parseFloat(d[1]),f=(d[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return h*s;case"weeks":case"week":case"w":return h*i;case"days":case"day":case"d":return h*r;case"hours":case"hour":case"hrs":case"hr":case"h":return h*n;case"minutes":case"minute":case"mins":case"min":case"m":return h*t;case"seconds":case"second":case"secs":case"sec":case"s":return h*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(u){var d=Math.abs(u);return d>=r?Math.round(u/r)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function l(u){var d=Math.abs(u);return d>=r?c(u,d,r,"day"):d>=n?c(u,d,n,"hour"):d>=t?c(u,d,t,"minute"):d>=e?c(u,d,e,"second"):u+" ms"}function c(u,d,h,f){var p=d>=h*1.5;return Math.round(u/h)+" "+f+(p?"s":"")}return Cu}function UP(e){n.debug=n,n.default=n,n.coerce=l,n.disable=s,n.enable=i,n.enabled=o,n.humanize=jP(),n.destroy=c,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let h=0;h<u.length;h++)d=(d<<5)-d+u.charCodeAt(h),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,h=null,f,p;function m(...y){if(!m.enabled)return;const v=m,b=Number(new Date),x=b-(d||b);v.diff=x,v.prev=d,v.curr=b,d=b,y[0]=n.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let I=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(T,j)=>{if(T==="%%")return"%";I++;const U=n.formatters[j];if(typeof U=="function"){const F=y[I];T=U.call(v,F),y.splice(I,1),I--}return T}),n.formatArgs.call(v,y),(v.log||n.log).apply(v,y)}return m.namespace=u,m.useColors=n.useColors(),m.color=n.selectColor(u),m.extend=r,m.destroy=n.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(f!==n.namespaces&&(f=n.namespaces,p=n.enabled(u)),p),set:y=>{h=y}}),typeof n.init=="function"&&n.init(m),m}function r(u,d){const h=n(this.namespace+(typeof d>"u"?":":d)+u);return h.log=this.log,h}function i(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const h=(typeof u=="string"?u:"").split(/[\s,]+/),f=h.length;for(d=0;d<f;d++)h[d]&&(u=h[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function s(){const u=[...n.names.map(a),...n.skips.map(a).map(d=>"-"+d)].join(",");return n.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let d,h;for(d=0,h=n.skips.length;d<h;d++)if(n.skips[d].test(u))return!1;for(d=0,h=n.names.length;d<h;d++)if(n.names[d].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){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 n.enable(n.load()),n}var FP=UP;(function(e,t){t.formatArgs=r,t.save=i,t.load=s,t.useColors=n,t.storage=o(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!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`."))}})(),t.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 n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1: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&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;l.splice(1,0,c,"color: inherit");let u=0,d=0;l[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(u++,h==="%c"&&(d=u))}),l.splice(d,0,c)}t.log=console.debug||console.log||(()=>{});function i(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function s(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=process.env.DEBUG),l}function o(){try{return localStorage}catch{}}e.exports=FP(t);const{formatters:a}=e.exports;a.j=function(l){try{return JSON.stringify(l)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}})(ku,ku.exports);var nr=ku.exports,_i={};Object.defineProperty(_i,"__esModule",{value:!0}),_i.decode=_i.encode=void 0;function BP(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}_i.encode=BP;function VP(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}_i.decode=VP;var zP=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wi,"__esModule",{value:!0}),wi.Transport=void 0;const ZP=qi,WP=Yi,HP=Ln,qP=zP(nr),KP=_i,JP=(0,qP.default)("engine.io-client:transport");class GP extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class YP extends WP.Emitter{constructor(t){super(),this.writable=!1,(0,HP.installTimerFunctions)(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new GP(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"?this.write(t):JP("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=(0,ZP.decodePacket)(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=(0,KP.encode)(t);return n.length?"?"+n:""}}wi.Transport=YP;var _r={};Object.defineProperty(_r,"__esModule",{value:!0}),_r.yeast=_r.decode=_r.encode=void 0;const eg="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Oa=64,tg={};let ng=0,Kr=0,rg;function Eu(e){let t="";do t=eg[e%Oa]+t,e=Math.floor(e/Oa);while(e>0);return t}_r.encode=Eu;function QP(e){let t=0;for(Kr=0;Kr<e.length;Kr++)t=t*Oa+tg[e.charAt(Kr)];return t}_r.decode=QP;function XP(){const e=Eu(+new Date);return e!==rg?(ng=0,rg=e):e+"."+Eu(ng++)}for(_r.yeast=XP;Kr<Oa;Kr++)tg[eg[Kr]]=Kr;var Qi={},Ia={};Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.hasCORS=void 0;let ig=!1;try{ig=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}Ia.hasCORS=ig,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.createCookieJar=Qi.XHR=void 0;const eA=Ia,tA=xi;function nA(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||eA.hasCORS))return new XMLHttpRequest}catch{}if(!t)try{return new tA.globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}Qi.XHR=nA;function rA(){}Qi.createCookieJar=rA;var iA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.Request=Hi.Polling=void 0;const sA=wi,oA=iA(nr),aA=_r,sg=qi,Su=Qi,lA=Yi,og=Ln,cA=xi,wn=(0,oA.default)("engine.io-client:polling");function uA(){}const dA=function(){return new Su.XHR({xdomain:!1}).responseType!=null}();class fA extends sA.Transport{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=dA&&!n,this.opts.withCredentials&&(this.cookieJar=(0,Su.createCookieJar)())}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{wn("paused"),this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(wn("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){wn("pre-pause polling complete"),--r||n()})),this.writable||(wn("we are currently writing - waiting to pause"),r++,this.once("drain",function(){wn("pre-pause writing complete"),--r||n()}))}else n()}poll(){wn("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){wn("polling got data %s",t);const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};(0,sg.decodePayload)(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this.poll():wn('ignoring poll - transport state "%s"',this.readyState))}doClose(){const t=()=>{wn("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(wn("transport open - closing"),t()):(wn("transport not open - deferring close"),this.once("open",t))}write(t){this.writable=!1,(0,sg.encodePayload)(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=(0,aA.yeast)()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Vn(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){wn("xhr poll");const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}Hi.Polling=fA;class Vn extends lA.Emitter{constructor(t,n){super(),(0,og.installTimerFunctions)(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=(0,og.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new Su.XHR(n);try{wn("xhr open %s: %s",this.method,this.uri),r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},wn("xhr data %s",this.data),r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Vn.requestsCount++,Vn.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=uA,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Vn.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(Hi.Request=Vn,Vn.requestsCount=0,Vn.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ag);else if(typeof addEventListener=="function"){const e="onpagehide"in cA.globalThisShim?"pagehide":"unload";addEventListener(e,ag,!1)}}function ag(){for(let e in Vn.requests)Vn.requests.hasOwnProperty(e)&&Vn.requests[e].abort()}var Pa={},Tn={};Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.defaultBinaryType=Tn.usingBrowserWebSocket=Tn.WebSocket=Tn.nextTick=void 0;const lg=xi;Tn.nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Tn.WebSocket=lg.globalThisShim.WebSocket||lg.globalThisShim.MozWebSocket,Tn.usingBrowserWebSocket=!0,Tn.defaultBinaryType="arraybuffer";var hA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.WS=void 0;const pA=wi,mA=_r,gA=Ln,Jr=Tn,yA=hA(nr),vA=qi,bA=(0,yA.default)("engine.io-client:websocket"),cg=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class wA extends pA.Transport{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=cg?{}:(0,gA.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=Jr.usingBrowserWebSocket&&!cg?n?new Jr.WebSocket(t,n):new Jr.WebSocket(t):new Jr.WebSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;(0,vA.encodePacket)(r,this.supportsBinary,s=>{const o={};Jr.usingBrowserWebSocket||(r.options&&(o.compress=r.options.compress),this.opts.perMessageDeflate&&(typeof s=="string"?Buffer.byteLength(s):s.length)<this.opts.perMessageDeflate.threshold&&(o.compress=!1));try{Jr.usingBrowserWebSocket?this.ws.send(s):this.ws.send(s,o)}catch{bA("websocket closed before onclose event")}i&&(0,Jr.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=(0,mA.yeast)()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!Jr.WebSocket}}Pa.WS=wA;var Aa={},xA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.WT=void 0;const _A=wi,kA=Tn,ug=qi,Ws=(0,xA(nr).default)("engine.io-client:webtransport");class CA extends _A.Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{Ws("transport closed gracefully"),this.onClose()}).catch(t=>{Ws("transport closed due to %s",t),this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=(0,ug.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=(0,ug.createPacketEncoderStream)();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{if(a){Ws("session is closed");return}Ws("received chunk: %o",l),this.onPacket(l),s()}).catch(a=>{Ws("an error occurred while reading: %s",a)})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&(0,kA.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}Aa.WT=CA,Object.defineProperty(zs,"__esModule",{value:!0}),zs.transports=void 0;const EA=Hi,SA=Pa,TA=Aa;zs.transports={websocket:SA.WS,webtransport:TA.WT,polling:EA.Polling};var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.parse=void 0;const OA=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,IA=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function PA(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=OA.exec(e||""),s={},o=14;for(;o--;)s[IA[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=AA(s,s.path),s.queryKey=RA(s,s.query),s}Hs.parse=PA;function AA(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function RA(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}var $A=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.Socket=void 0;const MA=zs,dg=Ln,LA=_i,fg=Hs,DA=$A(nr),NA=Yi,hg=qi,jA=Tn,Ct=(0,DA.default)("engine.io-client:socket");let pg=class vs extends NA.Emitter{constructor(t,n={}){super(),this.binaryType=jA.defaultBinaryType,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=(0,fg.parse)(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=(0,fg.parse)(n.host).host),(0,dg.installTimerFunctions)(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=(0,LA.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){Ct('creating transport "%s"',t);const n=Object.assign({},this.opts.query);n.EIO=hg.protocol,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return Ct("options: %j",r),new MA.transports[t](r)}open(){let t;if(this.opts.rememberUpgrade&&vs.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch(n){Ct("error while creating transport: %s",n),this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){Ct("setting transport %s",t.name),this.transport&&(Ct("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){Ct('probing transport "%s"',t);let n=this.createTransport(t),r=!1;vs.priorWebsocketSuccess=!1;const i=()=>{r||(Ct('probe transport "%s" opened',t),n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(Ct('probe transport "%s" pong',t),this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;vs.priorWebsocketSuccess=n.name==="websocket",Ct('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{r||this.readyState!=="closed"&&(Ct("changing transport and sending upgrade packet"),u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{Ct('probe transport "%s" failed',t);const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function s(){r||(r=!0,u(),n.close(),n=null)}const o=d=>{const h=new Error("probe error: "+d);h.transport=n.name,s(),Ct('probe transport "%s" failed because of error: %s',t,d),this.emitReserved("upgradeError",h)};function a(){o("transport closed")}function l(){o("socket closed")}function c(d){n&&d.name!==n.name&&(Ct('"%s" works - aborting "%s"',d.name,n.name),s())}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(Ct("socket open"),this.readyState="open",vs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){Ct("starting upgrade probes");let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(Ct('socket receive: type "%s", data "%s"',t.type,t.data),this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}else Ct('packet received with socket readyState "%s"',this.readyState)}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();Ct("flushing %d packets in socket",t.length),this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=(0,dg.byteLength)(i)),r>0&&n>this.maxPayload)return Ct("only send %d out of %d packets",r,this.writeBuffer.length),this.writeBuffer.slice(0,r);n+=2}return Ct("payload size is %d (max: %d)",n,this.maxPayload),this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),Ct("socket closing - telling transport to close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Ct("socket error %j",t),vs.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(Ct('socket close with reason: "%s"',t),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};Ea.Socket=pg,pg.protocol=hg.protocol,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.nextTick=e.parse=e.installTimerFunctions=e.transports=e.Transport=e.protocol=e.Socket=void 0;const t=Ea;Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return t.Socket}}),e.protocol=t.Socket.protocol;var n=wi;Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return n.Transport}});var r=zs;Object.defineProperty(e,"transports",{enumerable:!0,get:function(){return r.transports}});var i=Ln;Object.defineProperty(e,"installTimerFunctions",{enumerable:!0,get:function(){return i.installTimerFunctions}});var s=Hs;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return s.parse}});var o=Tn;Object.defineProperty(e,"nextTick",{enumerable:!0,get:function(){return o.nextTick}})}(xu);var UA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.url=void 0;const FA=xu,mg=UA(nr).default("socket.io-client:url");function BA(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(mg("protocol-less url %s",e),typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),mg("parse %s",e),r=FA.parse(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}Ca.url=BA;var Ra={},qs={},$a={},Xi={},ki={};Object.defineProperty(ki,"__esModule",{value:!0}),ki.hasBinary=ki.isBinary=void 0;const VA=typeof ArrayBuffer=="function",zA=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,gg=Object.prototype.toString,ZA=typeof Blob=="function"||typeof Blob<"u"&&gg.call(Blob)==="[object BlobConstructor]",WA=typeof File=="function"||typeof File<"u"&&gg.call(File)==="[object FileConstructor]";function yg(e){return VA&&(e instanceof ArrayBuffer||zA(e))||ZA&&e instanceof Blob||WA&&e instanceof File}ki.isBinary=yg;function Ma(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Ma(e[n]))return!0;return!1}if(yg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Ma(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Ma(e[n]))return!0;return!1}ki.hasBinary=Ma,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.reconstructPacket=Xi.deconstructPacket=void 0;const HA=ki;function qA(e){const t=[],n=e.data,r=e;return r.data=Tu(n,t),r.attachments=t.length,{packet:r,buffers:t}}Xi.deconstructPacket=qA;function Tu(e,t){if(!e)return e;if((0,HA.isBinary)(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Tu(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Tu(e[r],t));return n}return e}function KA(e,t){return e.data=Ou(e.data,t),delete e.attachments,e}Xi.reconstructPacket=KA;function Ou(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Ou(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Ou(e[n],t));return e}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const t=Yi,n=Xi,r=ki,s=(0,nr.default)("socket.io-parser"),o=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];e.protocol=5;var a;(function(h){h[h.CONNECT=0]="CONNECT",h[h.DISCONNECT=1]="DISCONNECT",h[h.EVENT=2]="EVENT",h[h.ACK=3]="ACK",h[h.CONNECT_ERROR=4]="CONNECT_ERROR",h[h.BINARY_EVENT=5]="BINARY_EVENT",h[h.BINARY_ACK=6]="BINARY_ACK"})(a=e.PacketType||(e.PacketType={}));class l{constructor(f){this.replacer=f}encode(f){return s("encoding packet %j",f),(f.type===a.EVENT||f.type===a.ACK)&&(0,r.hasBinary)(f)?this.encodeAsBinary({type:f.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,nsp:f.nsp,data:f.data,id:f.id}):[this.encodeAsString(f)]}encodeAsString(f){let p=""+f.type;return(f.type===a.BINARY_EVENT||f.type===a.BINARY_ACK)&&(p+=f.attachments+"-"),f.nsp&&f.nsp!=="/"&&(p+=f.nsp+","),f.id!=null&&(p+=f.id),f.data!=null&&(p+=JSON.stringify(f.data,this.replacer)),s("encoded %j as %s",f,p),p}encodeAsBinary(f){const p=(0,n.deconstructPacket)(f),m=this.encodeAsString(p.packet),y=p.buffers;return y.unshift(m),y}}e.Encoder=l;function c(h){return Object.prototype.toString.call(h)==="[object Object]"}class u extends t.Emitter{constructor(f){super(),this.reviver=f}add(f){let p;if(typeof f=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");p=this.decodeString(f);const m=p.type===a.BINARY_EVENT;m||p.type===a.BINARY_ACK?(p.type=m?a.EVENT:a.ACK,this.reconstructor=new d(p),p.attachments===0&&super.emitReserved("decoded",p)):super.emitReserved("decoded",p)}else if((0,r.isBinary)(f)||f.base64)if(this.reconstructor)p=this.reconstructor.takeBinaryData(f),p&&(this.reconstructor=null,super.emitReserved("decoded",p));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+f)}decodeString(f){let p=0;const m={type:Number(f.charAt(0))};if(a[m.type]===void 0)throw new Error("unknown packet type "+m.type);if(m.type===a.BINARY_EVENT||m.type===a.BINARY_ACK){const v=p+1;for(;f.charAt(++p)!=="-"&&p!=f.length;);const b=f.substring(v,p);if(b!=Number(b)||f.charAt(p)!=="-")throw new Error("Illegal attachments");m.attachments=Number(b)}if(f.charAt(p+1)==="/"){const v=p+1;for(;++p&&!(f.charAt(p)===","||p===f.length););m.nsp=f.substring(v,p)}else m.nsp="/";const y=f.charAt(p+1);if(y!==""&&Number(y)==y){const v=p+1;for(;++p;){const b=f.charAt(p);if(b==null||Number(b)!=b){--p;break}if(p===f.length)break}m.id=Number(f.substring(v,p+1))}if(f.charAt(++p)){const v=this.tryParse(f.substr(p));if(u.isPayloadValid(m.type,v))m.data=v;else throw new Error("invalid payload")}return s("decoded %s as %j",f,m),m}tryParse(f){try{return JSON.parse(f,this.reviver)}catch{return!1}}static isPayloadValid(f,p){switch(f){case a.CONNECT:return c(p);case a.DISCONNECT:return p===void 0;case a.CONNECT_ERROR:return typeof p=="string"||c(p);case a.EVENT:case a.BINARY_EVENT:return Array.isArray(p)&&(typeof p[0]=="number"||typeof p[0]=="string"&&o.indexOf(p[0])===-1);case a.ACK:case a.BINARY_ACK:return Array.isArray(p)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}e.Decoder=u;class d{constructor(f){this.packet=f,this.buffers=[],this.reconPack=f}takeBinaryData(f){if(this.buffers.push(f),this.buffers.length===this.reconPack.attachments){const p=(0,n.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),p}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}})($a);var Ks={};Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.on=void 0;function JA(e,t,n){return e.on(t,n),function(){e.off(t,n)}}Ks.on=JA;var GA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qs,"__esModule",{value:!0}),qs.Socket=void 0;const zn=$a,La=Ks,YA=Yi,Vt=GA(nr).default("socket.io-client:socket"),QA=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class XA extends YA.Emitter{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[La.on(t,"open",this.onopen.bind(this)),La.on(t,"packet",this.onpacket.bind(this)),La.on(t,"error",this.onerror.bind(this)),La.on(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(QA.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:zn.PacketType.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const o=this.ids++;Vt("emitting packet with ack id %d",o);const a=n.pop();this._registerAckCallback(o,a),r.id=o}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)?Vt("discard packet as the transport is not currently writable"):this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===t&&(Vt("removing packet with ack id %d from the buffer",t),this.sendBuffer.splice(o,1));Vt("event with ack id %d has timed out after %d ms",t,i),n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...o)=>{this.io.clearTimeoutFn(s),n.apply(this,[null,...o])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,s)=>{n.push((o,a)=>r?o?s(o):i(a):i(o)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(Vt("packet [%d] is discarded after %d tries",r.id,r.tryCount),this._queue.shift(),n&&n(i)):(Vt("packet [%d] was successfully sent",r.id),this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(Vt("draining queue"),!this.connected||this._queue.length===0)return;const n=this._queue[0];if(n.pending&&!t){Vt("packet [%d] has already been sent and is waiting for an ack",n.id);return}n.pending=!0,n.tryCount++,Vt("sending packet [%d] (try n°%d)",n.id,n.tryCount),this.flags=n.flags,this.emit.apply(this,n.args)}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){Vt("transport is open - connecting"),typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:zn.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){Vt("close (%s)",t),this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case zn.PacketType.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case zn.PacketType.EVENT:case zn.PacketType.BINARY_EVENT:this.onevent(t);break;case zn.PacketType.ACK:case zn.PacketType.BINARY_ACK:this.onack(t);break;case zn.PacketType.DISCONNECT:this.ondisconnect();break;case zn.PacketType.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];Vt("emitting event %j",n),t.id!=null&&(Vt("attaching ack callback to event"),n.push(this.ack(t.id))),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,Vt("sending ack %j",i),n.packet({type:zn.PacketType.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"?(Vt("calling ack %s with %j",t.id,t.data),n.apply(this,t.data),delete this.acks[t.id]):Vt("bad ack %s",t.id)}onconnect(t,n){Vt("socket connected with id %s",t),this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){Vt("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(Vt("performing disconnect (%s)",this.nsp),this.packet({type:zn.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}qs.Socket=XA;var Da={};Object.defineProperty(Da,"__esModule",{value:!0}),Da.Backoff=void 0;function es(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Da.Backoff=es,es.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},es.prototype.reset=function(){this.attempts=0},es.prototype.setMin=function(e){this.ms=e},es.prototype.setMax=function(e){this.max=e},es.prototype.setJitter=function(e){this.jitter=e};var eR=Me&&Me.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),tR=Me&&Me.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),nR=Me&&Me.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&eR(t,e,n);return tR(t,e),t},rR=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.Manager=void 0;const Iu=xu,iR=qs,sR=nR($a),Ci=Ks,oR=Da,aR=Yi,nn=rR(nr).default("socket.io-client:manager");class lR extends aR.Emitter{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Iu.installTimerFunctions(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new oR.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||sR;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(nn("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;nn("opening %s",this.uri),this.engine=new Iu.Socket(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Ci.on(n,"open",function(){r.onopen(),t&&t()}),s=a=>{nn("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Ci.on(n,"error",s);if(this._timeout!==!1){const a=this._timeout;nn("connect attempt will timeout after %d",a);const l=this.setTimeoutFn(()=>{nn("connect attempt timed out after %d",a),i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){nn("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Ci.on(t,"ping",this.onping.bind(this)),Ci.on(t,"data",this.ondata.bind(this)),Ci.on(t,"error",this.onerror.bind(this)),Ci.on(t,"close",this.onclose.bind(this)),Ci.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Iu.nextTick(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){nn("error",t),this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new iR.Socket(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active){nn("socket %s is still active, skipping close",r);return}this._close()}_packet(t){nn("writing packet %j",t);const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){nn("cleanup"),this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){nn("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){nn("closed due to %s",t),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)nn("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();nn("will wait %dms before reconnect attempt",n),this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(nn("attempting reconnect"),this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(nn("reconnect attempt error"),t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):(nn("reconnect success"),t.onreconnect())}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}Ra.Manager=lR,function(e,t){var n=Me&&Me.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const r=Ca,i=Ra;Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return i.Manager}});const s=qs;Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return s.Socket}});const a=n(nr).default("socket.io-client"),l={};function c(d,h){typeof d=="object"&&(h=d,d=void 0),h=h||{};const f=r.url(d,h.path||"/socket.io"),p=f.source,m=f.id,y=f.path,v=l[m]&&y in l[m].nsps,b=h.forceNew||h["force new connection"]||h.multiplex===!1||v;let x;return b?(a("ignoring socket cache for %s",p),x=new i.Manager(p,h)):(l[m]||(a("new io instance for %s",p),l[m]=new i.Manager(p,h)),x=l[m]),f.query&&!h.query&&(h.query=f.queryKey),x.socket(f.path,h)}t.io=c,t.connect=c,t.default=c,Object.assign(c,{Manager:i.Manager,Socket:s.Socket,io:c,connect:c});var u=$a;Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return u.protocol}}),e.exports=c}(wu,wu.exports);var cR=wu.exports;(function(e){var t=Me&&Me.__awaiter||function(l,c,u,d){function h(f){return f instanceof u?f:new u(function(p){p(f)})}return new(u||(u=Promise))(function(f,p){function m(b){try{v(d.next(b))}catch(x){p(x)}}function y(b){try{v(d.throw(b))}catch(x){p(x)}}function v(b){b.done?f(b.value):h(b.value).then(m,y)}v((d=d.apply(l,c||[])).next())})},n=Me&&Me.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.SocketComEmitter=e.SocketComEvents=e.SocketCom=void 0;const r=bu,i=n(cR);class s{constructor(c){this.url=c,this.pending={},this.emitter=new a,this.events=this.emitter}connect(c,u){return t(this,void 0,void 0,function*(){return new Promise((d,h)=>{this.disconnect(),this.socket=(0,i.default)(this.url,{transports:["websocket"],auth:c,autoConnect:!1,query:u});const f=setTimeout(()=>{h("connection timed out")},5e3);this.socket.on("login",p=>t(this,void 0,void 0,function*(){clearTimeout(f),d(p)})),this.socket.on("connect_error",p=>{var m;(m=this.socket)===null||m===void 0||m.close(),clearTimeout(f),h(p.message)}),this.socket.on("message",p=>t(this,void 0,void 0,function*(){var m;this.pending[p.request]&&(!((m=p.data)===null||m===void 0)&&m.error?this.pending[p.request].reject(new Error(p.data.message)):this.pending[p.request].resolve(p.data),delete this.pending[p.request]),yield this.emitter.emit(o.Message,p)})),this.socket.connect()})})}disconnect(){var c;this.socket&&!(!((c=this.socket)===null||c===void 0)&&c.disconnected)&&this.socket.disconnect()}request(c,u){var d;return t(this,void 0,void 0,function*(){if(!(!((d=this.socket)===null||d===void 0)&&d.connected))throw new Error("Client is disconnected");const h=this.random(32),f=new Promise((p,m)=>{this.pending[h]={resolve:p,reject:m}});return this.socket.send({request:h,type:c,data:u}),f})}random(c){const u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let d="";for(let h=0;h<c;h++)d+=u.charAt(Math.floor(Math.random()*u.length));return d}}e.SocketCom=s;var o;(function(l){l.Message="message"})(o=e.SocketComEvents||(e.SocketComEvents={}));class a extends r.Emitter{}e.SocketComEmitter=a})(Zm);var Na={},uR=Me&&Me.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Na,"__esModule",{value:!0}),Na.SocketEmitter=void 0;class dR{constructor(){this.listeners={}}on(t,n){const r=this.listeners[t];r?r.push(n):this.listeners[t]=[n]}removeListeners(t){this.listeners[t]=[]}emit(t,n){return uR(this,void 0,void 0,function*(){const r=this.listeners[t];if(r!=null&&r.length){for(const i of r)yield i(n);return!0}else return!1})}}Na.SocketEmitter=dR;var xn=Me&&Me.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(ka,"__esModule",{value:!0}),ka.MessagingSocket=void 0;const vg=Zm,fR=Na;class hR extends fR.SocketEmitter{constructor(t){super(),this.clientId=t.clientId,this.com=new vg.SocketCom(t.url),this.com.events.on(vg.SocketComEvents.Message,n=>xn(this,void 0,void 0,function*(){n.type==="message.new"&&(yield this.emit("message",n.data.message))}))}get creds(){return this._creds}get userId(){var t;return(t=this._creds)===null||t===void 0?void 0:t.userId}get conversationId(){return this._conversationId}connect(t,n){return xn(this,void 0,void 0,function*(){const r=n?{userData:JSON.stringify(n)}:void 0,i=yield this.com.connect({clientId:this.clientId,creds:t},r);return i.userId===(t==null?void 0:t.userId)&&!i.userToken&&(i.userToken=t.userToken),this._creds=i,yield this.emit("connect",this._creds),yield this.emit("user",this._creds.userId),i})}disconnect(){return xn(this,void 0,void 0,function*(){this.com.disconnect(),yield this.emit("disconnect",void 0)})}getUser(){return xn(this,void 0,void 0,function*(){return this.request("users.get",{})})}switchConversation(t){return xn(this,void 0,void 0,function*(){this._conversationId=t,yield this.emit("conversation",this._conversationId)})}createConversation(t){return xn(this,void 0,void 0,function*(){const n=yield this.request("conversations.create",{});return(t==null?void 0:t.switch)!==!1&&(yield this.switchConversation(n.id)),n})}startConversation(t){return xn(this,void 0,void 0,function*(){yield this.request("conversations.start",{id:t||this._conversationId})})}getConversation(t){return xn(this,void 0,void 0,function*(){return this.request("conversations.get",{id:t||this._conversationId})})}deleteConversation(t){return xn(this,void 0,void 0,function*(){const n=yield this.request("conversations.delete",{id:t||this._conversationId});return n&&(yield this.switchConversation(void 0)),n})}listConversations(t){return xn(this,void 0,void 0,function*(){return this.request("conversations.list",{limit:t||20})})}sendText(t){return xn(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:{type:"text",text:t}})})}sendPayload(t){return xn(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:t})})}listMessages(t){return xn(this,void 0,void 0,function*(){return this.request("messages.list",{conversationId:this._conversationId,limit:t||20})})}sendFeedback(t,n){return xn(this,void 0,void 0,function*(){yield this.request("messages.feedback",{messageId:t,feedback:n})})}request(t,n){return this.com.request(t,n)}}ka.MessagingSocket=hR,function(e){var t=Me&&Me.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=Me&&Me.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(bu,e),n(ka,e)}(Dm);var ja={},Pu={},rr={},Ua={},Js={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0;var t;(function(r){r.assertEqual=a=>a;function i(a){}r.assertIs=i;function s(a){throw new Error}r.assertNever=s,r.arrayToEnum=a=>{const l={};for(const c of a)l[c]=c;return l},r.getValidEnumValues=a=>{const l=r.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),c={};for(const u of l)c[u]=a[u];return r.objectValues(c)},r.objectValues=a=>r.objectKeys(a).map(function(l){return a[l]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const l=[];for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&l.push(c);return l},r.find=(a,l)=>{for(const c of a)if(l(c))return c},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function o(a,l=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}r.joinValues=o,r.jsonStringifyReplacer=(a,l)=>typeof l=="bigint"?l.toString():l})(t=e.util||(e.util={})),function(r){r.mergeShapes=(i,s)=>({...i,...s})}(e.objectUtil||(e.objectUtil={})),e.ZodParsedType=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const n=r=>{switch(typeof r){case"undefined":return e.ZodParsedType.undefined;case"string":return e.ZodParsedType.string;case"number":return isNaN(r)?e.ZodParsedType.nan:e.ZodParsedType.number;case"boolean":return e.ZodParsedType.boolean;case"function":return e.ZodParsedType.function;case"bigint":return e.ZodParsedType.bigint;case"symbol":return e.ZodParsedType.symbol;case"object":return Array.isArray(r)?e.ZodParsedType.array:r===null?e.ZodParsedType.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?e.ZodParsedType.promise:typeof Map<"u"&&r instanceof Map?e.ZodParsedType.map:typeof Set<"u"&&r instanceof Set?e.ZodParsedType.set:typeof Date<"u"&&r instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}};e.getParsedType=n})(Js);var ir={};Object.defineProperty(ir,"__esModule",{value:!0}),ir.ZodError=ir.quotelessJson=ir.ZodIssueCode=void 0;const bg=Js;ir.ZodIssueCode=bg.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);const pR=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");ir.quotelessJson=pR;let Au=class extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,bg.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};ir.ZodError=Au,Au.create=e=>new Au(e),Object.defineProperty(Ua,"__esModule",{value:!0});const Ei=Js,un=ir,mR=(e,t)=>{let n;switch(e.code){case un.ZodIssueCode.invalid_type:e.received===Ei.ZodParsedType.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case un.ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ei.util.jsonStringifyReplacer)}`;break;case un.ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ei.util.joinValues(e.keys,", ")}`;break;case un.ZodIssueCode.invalid_union:n="Invalid input";break;case un.ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ei.util.joinValues(e.options)}`;break;case un.ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${Ei.util.joinValues(e.options)}, received '${e.received}'`;break;case un.ZodIssueCode.invalid_arguments:n="Invalid function arguments";break;case un.ZodIssueCode.invalid_return_type:n="Invalid function return type";break;case un.ZodIssueCode.invalid_date:n="Invalid date";break;case un.ZodIssueCode.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ei.util.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case un.ZodIssueCode.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case un.ZodIssueCode.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case un.ZodIssueCode.custom:n="Invalid input";break;case un.ZodIssueCode.invalid_intersection_types:n="Intersection results could not be merged";break;case un.ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case un.ZodIssueCode.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ei.util.assertNever(e)}return{message:n}};Ua.default=mR;var gR=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rr,"__esModule",{value:!0}),rr.getErrorMap=rr.setErrorMap=rr.defaultErrorMap=void 0;const wg=gR(Ua);rr.defaultErrorMap=wg.default;let xg=wg.default;function yR(e){xg=e}rr.setErrorMap=yR;function vR(){return xg}rr.getErrorMap=vR;var Ru={};(function(e){var t=Me&&Me.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=e.isValid=e.isDirty=e.isAborted=e.OK=e.DIRTY=e.INVALID=e.ParseStatus=e.addIssueToContext=e.EMPTY_PATH=e.makeIssue=void 0;const n=rr,r=t(Ua),i=f=>{const{data:p,path:m,errorMaps:y,issueData:v}=f,b=[...m,...v.path||[]],x={...v,path:b};let I="";const P=y.filter(T=>!!T).slice().reverse();for(const T of P)I=T(x,{data:p,defaultError:I}).message;return{...v,path:b,message:v.message||I}};e.makeIssue=i,e.EMPTY_PATH=[];function s(f,p){const m=(0,e.makeIssue)({issueData:p,data:f.data,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,(0,n.getErrorMap)(),r.default].filter(y=>!!y)});f.common.issues.push(m)}e.addIssueToContext=s;class o{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(p,m){const y=[];for(const v of m){if(v.status==="aborted")return e.INVALID;v.status==="dirty"&&p.dirty(),y.push(v.value)}return{status:p.value,value:y}}static async mergeObjectAsync(p,m){const y=[];for(const v of m)y.push({key:await v.key,value:await v.value});return o.mergeObjectSync(p,y)}static mergeObjectSync(p,m){const y={};for(const v of m){const{key:b,value:x}=v;if(b.status==="aborted"||x.status==="aborted")return e.INVALID;b.status==="dirty"&&p.dirty(),x.status==="dirty"&&p.dirty(),b.value!=="__proto__"&&(typeof x.value<"u"||v.alwaysSet)&&(y[b.value]=x.value)}return{status:p.value,value:y}}}e.ParseStatus=o,e.INVALID=Object.freeze({status:"aborted"});const a=f=>({status:"dirty",value:f});e.DIRTY=a;const l=f=>({status:"valid",value:f});e.OK=l;const c=f=>f.status==="aborted";e.isAborted=c;const u=f=>f.status==="dirty";e.isDirty=u;const d=f=>f.status==="valid";e.isValid=d;const h=f=>typeof Promise<"u"&&f instanceof Promise;e.isAsync=h})(Ru);var _g={};Object.defineProperty(_g,"__esModule",{value:!0});var kg={},Cg={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorUtil=void 0,function(t){t.errToObj=n=>typeof n=="string"?{message:n}:n||{},t.toString=n=>typeof n=="string"?n:n==null?void 0:n.message}(e.errorUtil||(e.errorUtil={}))})(Cg),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.date=e.boolean=e.bigint=e.array=e.any=e.coerce=e.ZodFirstPartyTypeKind=e.late=e.ZodSchema=e.Schema=e.custom=e.ZodReadonly=e.ZodPipeline=e.ZodBranded=e.BRAND=e.ZodNaN=e.ZodCatch=e.ZodDefault=e.ZodNullable=e.ZodOptional=e.ZodTransformer=e.ZodEffects=e.ZodPromise=e.ZodNativeEnum=e.ZodEnum=e.ZodLiteral=e.ZodLazy=e.ZodFunction=e.ZodSet=e.ZodMap=e.ZodRecord=e.ZodTuple=e.ZodIntersection=e.ZodDiscriminatedUnion=e.ZodUnion=e.ZodObject=e.ZodArray=e.ZodVoid=e.ZodNever=e.ZodUnknown=e.ZodAny=e.ZodNull=e.ZodUndefined=e.ZodSymbol=e.ZodDate=e.ZodBoolean=e.ZodBigInt=e.ZodNumber=e.ZodString=e.ZodType=void 0,e.NEVER=e.void=e.unknown=e.union=e.undefined=e.tuple=e.transformer=e.symbol=e.string=e.strictObject=e.set=e.record=e.promise=e.preprocess=e.pipeline=e.ostring=e.optional=e.onumber=e.oboolean=e.object=e.number=e.nullable=e.null=e.never=e.nativeEnum=e.nan=e.map=e.literal=e.lazy=e.intersection=e.instanceof=e.function=e.enum=e.effect=e.discriminatedUnion=void 0;const t=rr,n=Cg,r=Ru,i=Js,s=ir;class o{constructor(g,w,C,L){this._cachedPath=[],this.parent=g,this.data=w,this._path=C,this._key=L}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const a=(A,g)=>{if((0,r.isValid)(g))return{success:!0,data:g.value};if(!A.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const w=new s.ZodError(A.common.issues);return this._error=w,this._error}}};function l(A){if(!A)return{};const{errorMap:g,invalid_type_error:w,required_error:C,description:L}=A;if(g&&(w||C))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return g?{errorMap:g,description:L}:{errorMap:(ye,fe)=>ye.code!=="invalid_type"?{message:fe.defaultError}:typeof fe.data>"u"?{message:C??fe.defaultError}:{message:w??fe.defaultError},description:L}}class c{constructor(g){this.spa=this.safeParseAsync,this._def=g,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(g){return(0,i.getParsedType)(g.data)}_getOrReturnCtx(g,w){return w||{common:g.parent.common,data:g.data,parsedType:(0,i.getParsedType)(g.data),schemaErrorMap:this._def.errorMap,path:g.path,parent:g.parent}}_processInputParams(g){return{status:new r.ParseStatus,ctx:{common:g.parent.common,data:g.data,parsedType:(0,i.getParsedType)(g.data),schemaErrorMap:this._def.errorMap,path:g.path,parent:g.parent}}}_parseSync(g){const w=this._parse(g);if((0,r.isAsync)(w))throw new Error("Synchronous parse encountered promise.");return w}_parseAsync(g){const w=this._parse(g);return Promise.resolve(w)}parse(g,w){const C=this.safeParse(g,w);if(C.success)return C.data;throw C.error}safeParse(g,w){var C;const L={common:{issues:[],async:(C=w==null?void 0:w.async)!==null&&C!==void 0?C:!1,contextualErrorMap:w==null?void 0:w.errorMap},path:(w==null?void 0:w.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:g,parsedType:(0,i.getParsedType)(g)},$=this._parseSync({data:g,path:L.path,parent:L});return a(L,$)}async parseAsync(g,w){const C=await this.safeParseAsync(g,w);if(C.success)return C.data;throw C.error}async safeParseAsync(g,w){const C={common:{issues:[],contextualErrorMap:w==null?void 0:w.errorMap,async:!0},path:(w==null?void 0:w.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:g,parsedType:(0,i.getParsedType)(g)},L=this._parse({data:g,path:C.path,parent:C}),$=await((0,r.isAsync)(L)?L:Promise.resolve(L));return a(C,$)}refine(g,w){const C=L=>typeof w=="string"||typeof w>"u"?{message:w}:typeof w=="function"?w(L):w;return this._refinement((L,$)=>{const ye=g(L),fe=()=>$.addIssue({code:s.ZodIssueCode.custom,...C(L)});return typeof Promise<"u"&&ye instanceof Promise?ye.then(We=>We?!0:(fe(),!1)):ye?!0:(fe(),!1)})}refinement(g,w){return this._refinement((C,L)=>g(C)?!0:(L.addIssue(typeof w=="function"?w(C,L):w),!1))}_refinement(g){return new ne({schema:this,typeName:G.ZodEffects,effect:{type:"refinement",refinement:g}})}superRefine(g){return this._refinement(g)}optional(){return me.create(this,this._def)}nullable(){return he.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return K.create(this,this._def)}promise(){return D.create(this,this._def)}or(g){return ee.create([this,g],this._def)}and(g){return Ne.create(this,g,this._def)}transform(g){return new ne({...l(this._def),schema:this,typeName:G.ZodEffects,effect:{type:"transform",transform:g}})}default(g){const w=typeof g=="function"?g:()=>g;return new Le({...l(this._def),innerType:this,defaultValue:w,typeName:G.ZodDefault})}brand(){return new ot({typeName:G.ZodBranded,type:this,...l(this._def)})}catch(g){const w=typeof g=="function"?g:()=>g;return new Pe({...l(this._def),innerType:this,catchValue:w,typeName:G.ZodCatch})}describe(g){const w=this.constructor;return new w({...this._def,description:g})}pipe(g){return Ze.create(this,g)}readonly(){return Z.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}e.ZodType=c,e.Schema=c,e.ZodSchema=c;const u=/^c[^\s-]{8,}$/i,d=/^[a-z][a-z0-9]*$/,h=/^[0-9A-HJKMNP-TV-Z]{26}$/,f=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,p=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,m="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let y;const v=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,b=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,x=A=>A.precision?A.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${A.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${A.precision}}Z$`):A.precision===0?A.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):A.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function I(A,g){return!!((g==="v4"||!g)&&v.test(A)||(g==="v6"||!g)&&b.test(A))}class P extends c{_parse(g){if(this._def.coerce&&(g.data=String(g.data)),this._getType(g)!==i.ZodParsedType.string){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.string,received:$.parsedType}),r.INVALID}const C=new r.ParseStatus;let L;for(const $ of this._def.checks)if($.kind==="min")g.data.length<$.value&&(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),C.dirty());else if($.kind==="max")g.data.length>$.value&&(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),C.dirty());else if($.kind==="length"){const ye=g.data.length>$.value,fe=g.data.length<$.value;(ye||fe)&&(L=this._getOrReturnCtx(g,L),ye?(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message}):fe&&(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message}),C.dirty())}else if($.kind==="email")p.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"email",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="emoji")y||(y=new RegExp(m,"u")),y.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"emoji",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="uuid")f.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"uuid",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="cuid")u.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"cuid",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="cuid2")d.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"cuid2",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="ulid")h.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"ulid",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="url")try{new URL(g.data)}catch{L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"url",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty()}else $.kind==="regex"?($.regex.lastIndex=0,$.regex.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"regex",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty())):$.kind==="trim"?g.data=g.data.trim():$.kind==="includes"?g.data.includes($.value,$.position)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.invalid_string,validation:{includes:$.value,position:$.position},message:$.message}),C.dirty()):$.kind==="toLowerCase"?g.data=g.data.toLowerCase():$.kind==="toUpperCase"?g.data=g.data.toUpperCase():$.kind==="startsWith"?g.data.startsWith($.value)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.invalid_string,validation:{startsWith:$.value},message:$.message}),C.dirty()):$.kind==="endsWith"?g.data.endsWith($.value)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.invalid_string,validation:{endsWith:$.value},message:$.message}),C.dirty()):$.kind==="datetime"?x($).test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.invalid_string,validation:"datetime",message:$.message}),C.dirty()):$.kind==="ip"?I(g.data,$.version)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"ip",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty()):i.util.assertNever($);return{status:C.value,value:g.data}}_regex(g,w,C){return this.refinement(L=>g.test(L),{validation:w,code:s.ZodIssueCode.invalid_string,...n.errorUtil.errToObj(C)})}_addCheck(g){return new P({...this._def,checks:[...this._def.checks,g]})}email(g){return this._addCheck({kind:"email",...n.errorUtil.errToObj(g)})}url(g){return this._addCheck({kind:"url",...n.errorUtil.errToObj(g)})}emoji(g){return this._addCheck({kind:"emoji",...n.errorUtil.errToObj(g)})}uuid(g){return this._addCheck({kind:"uuid",...n.errorUtil.errToObj(g)})}cuid(g){return this._addCheck({kind:"cuid",...n.errorUtil.errToObj(g)})}cuid2(g){return this._addCheck({kind:"cuid2",...n.errorUtil.errToObj(g)})}ulid(g){return this._addCheck({kind:"ulid",...n.errorUtil.errToObj(g)})}ip(g){return this._addCheck({kind:"ip",...n.errorUtil.errToObj(g)})}datetime(g){var w;return typeof g=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:g}):this._addCheck({kind:"datetime",precision:typeof(g==null?void 0:g.precision)>"u"?null:g==null?void 0:g.precision,offset:(w=g==null?void 0:g.offset)!==null&&w!==void 0?w:!1,...n.errorUtil.errToObj(g==null?void 0:g.message)})}regex(g,w){return this._addCheck({kind:"regex",regex:g,...n.errorUtil.errToObj(w)})}includes(g,w){return this._addCheck({kind:"includes",value:g,position:w==null?void 0:w.position,...n.errorUtil.errToObj(w==null?void 0:w.message)})}startsWith(g,w){return this._addCheck({kind:"startsWith",value:g,...n.errorUtil.errToObj(w)})}endsWith(g,w){return this._addCheck({kind:"endsWith",value:g,...n.errorUtil.errToObj(w)})}min(g,w){return this._addCheck({kind:"min",value:g,...n.errorUtil.errToObj(w)})}max(g,w){return this._addCheck({kind:"max",value:g,...n.errorUtil.errToObj(w)})}length(g,w){return this._addCheck({kind:"length",value:g,...n.errorUtil.errToObj(w)})}nonempty(g){return this.min(1,n.errorUtil.errToObj(g))}trim(){return new P({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new P({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new P({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(g=>g.kind==="datetime")}get isEmail(){return!!this._def.checks.find(g=>g.kind==="email")}get isURL(){return!!this._def.checks.find(g=>g.kind==="url")}get isEmoji(){return!!this._def.checks.find(g=>g.kind==="emoji")}get isUUID(){return!!this._def.checks.find(g=>g.kind==="uuid")}get isCUID(){return!!this._def.checks.find(g=>g.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(g=>g.kind==="cuid2")}get isULID(){return!!this._def.checks.find(g=>g.kind==="ulid")}get isIP(){return!!this._def.checks.find(g=>g.kind==="ip")}get minLength(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g}get maxLength(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g}}e.ZodString=P,P.create=A=>{var g;return new P({checks:[],typeName:G.ZodString,coerce:(g=A==null?void 0:A.coerce)!==null&&g!==void 0?g:!1,...l(A)})};function T(A,g){const w=(A.toString().split(".")[1]||"").length,C=(g.toString().split(".")[1]||"").length,L=w>C?w:C,$=parseInt(A.toFixed(L).replace(".","")),ye=parseInt(g.toFixed(L).replace(".",""));return $%ye/Math.pow(10,L)}class j extends c{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(g){if(this._def.coerce&&(g.data=Number(g.data)),this._getType(g)!==i.ZodParsedType.number){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.number,received:$.parsedType}),r.INVALID}let C;const L=new r.ParseStatus;for(const $ of this._def.checks)$.kind==="int"?i.util.isInteger(g.data)||(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:$.message}),L.dirty()):$.kind==="min"?($.inclusive?g.data<$.value:g.data<=$.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,minimum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),L.dirty()):$.kind==="max"?($.inclusive?g.data>$.value:g.data>=$.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,maximum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),L.dirty()):$.kind==="multipleOf"?T(g.data,$.value)!==0&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.not_multiple_of,multipleOf:$.value,message:$.message}),L.dirty()):$.kind==="finite"?Number.isFinite(g.data)||(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.not_finite,message:$.message}),L.dirty()):i.util.assertNever($);return{status:L.value,value:g.data}}gte(g,w){return this.setLimit("min",g,!0,n.errorUtil.toString(w))}gt(g,w){return this.setLimit("min",g,!1,n.errorUtil.toString(w))}lte(g,w){return this.setLimit("max",g,!0,n.errorUtil.toString(w))}lt(g,w){return this.setLimit("max",g,!1,n.errorUtil.toString(w))}setLimit(g,w,C,L){return new j({...this._def,checks:[...this._def.checks,{kind:g,value:w,inclusive:C,message:n.errorUtil.toString(L)}]})}_addCheck(g){return new j({...this._def,checks:[...this._def.checks,g]})}int(g){return this._addCheck({kind:"int",message:n.errorUtil.toString(g)})}positive(g){return this._addCheck({kind:"min",value:0,inclusive:!1,message:n.errorUtil.toString(g)})}negative(g){return this._addCheck({kind:"max",value:0,inclusive:!1,message:n.errorUtil.toString(g)})}nonpositive(g){return this._addCheck({kind:"max",value:0,inclusive:!0,message:n.errorUtil.toString(g)})}nonnegative(g){return this._addCheck({kind:"min",value:0,inclusive:!0,message:n.errorUtil.toString(g)})}multipleOf(g,w){return this._addCheck({kind:"multipleOf",value:g,message:n.errorUtil.toString(w)})}finite(g){return this._addCheck({kind:"finite",message:n.errorUtil.toString(g)})}safe(g){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:n.errorUtil.toString(g)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:n.errorUtil.toString(g)})}get minValue(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g}get maxValue(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g}get isInt(){return!!this._def.checks.find(g=>g.kind==="int"||g.kind==="multipleOf"&&i.util.isInteger(g.value))}get isFinite(){let g=null,w=null;for(const C of this._def.checks){if(C.kind==="finite"||C.kind==="int"||C.kind==="multipleOf")return!0;C.kind==="min"?(w===null||C.value>w)&&(w=C.value):C.kind==="max"&&(g===null||C.value<g)&&(g=C.value)}return Number.isFinite(w)&&Number.isFinite(g)}}e.ZodNumber=j,j.create=A=>new j({checks:[],typeName:G.ZodNumber,coerce:(A==null?void 0:A.coerce)||!1,...l(A)});class U extends c{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(g){if(this._def.coerce&&(g.data=BigInt(g.data)),this._getType(g)!==i.ZodParsedType.bigint){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.bigint,received:$.parsedType}),r.INVALID}let C;const L=new r.ParseStatus;for(const $ of this._def.checks)$.kind==="min"?($.inclusive?g.data<$.value:g.data<=$.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,type:"bigint",minimum:$.value,inclusive:$.inclusive,message:$.message}),L.dirty()):$.kind==="max"?($.inclusive?g.data>$.value:g.data>=$.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,type:"bigint",maximum:$.value,inclusive:$.inclusive,message:$.message}),L.dirty()):$.kind==="multipleOf"?g.data%$.value!==BigInt(0)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.not_multiple_of,multipleOf:$.value,message:$.message}),L.dirty()):i.util.assertNever($);return{status:L.value,value:g.data}}gte(g,w){return this.setLimit("min",g,!0,n.errorUtil.toString(w))}gt(g,w){return this.setLimit("min",g,!1,n.errorUtil.toString(w))}lte(g,w){return this.setLimit("max",g,!0,n.errorUtil.toString(w))}lt(g,w){return this.setLimit("max",g,!1,n.errorUtil.toString(w))}setLimit(g,w,C,L){return new U({...this._def,checks:[...this._def.checks,{kind:g,value:w,inclusive:C,message:n.errorUtil.toString(L)}]})}_addCheck(g){return new U({...this._def,checks:[...this._def.checks,g]})}positive(g){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:n.errorUtil.toString(g)})}negative(g){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:n.errorUtil.toString(g)})}nonpositive(g){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:n.errorUtil.toString(g)})}nonnegative(g){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:n.errorUtil.toString(g)})}multipleOf(g,w){return this._addCheck({kind:"multipleOf",value:g,message:n.errorUtil.toString(w)})}get minValue(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g}get maxValue(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g}}e.ZodBigInt=U,U.create=A=>{var g;return new U({checks:[],typeName:G.ZodBigInt,coerce:(g=A==null?void 0:A.coerce)!==null&&g!==void 0?g:!1,...l(A)})};class F extends c{_parse(g){if(this._def.coerce&&(g.data=!!g.data),this._getType(g)!==i.ZodParsedType.boolean){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.boolean,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodBoolean=F,F.create=A=>new F({typeName:G.ZodBoolean,coerce:(A==null?void 0:A.coerce)||!1,...l(A)});class O extends c{_parse(g){if(this._def.coerce&&(g.data=new Date(g.data)),this._getType(g)!==i.ZodParsedType.date){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.date,received:$.parsedType}),r.INVALID}if(isNaN(g.data.getTime())){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_date}),r.INVALID}const C=new r.ParseStatus;let L;for(const $ of this._def.checks)$.kind==="min"?g.data.getTime()<$.value&&(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_small,message:$.message,inclusive:!0,exact:!1,minimum:$.value,type:"date"}),C.dirty()):$.kind==="max"?g.data.getTime()>$.value&&(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_big,message:$.message,inclusive:!0,exact:!1,maximum:$.value,type:"date"}),C.dirty()):i.util.assertNever($);return{status:C.value,value:new Date(g.data.getTime())}}_addCheck(g){return new O({...this._def,checks:[...this._def.checks,g]})}min(g,w){return this._addCheck({kind:"min",value:g.getTime(),message:n.errorUtil.toString(w)})}max(g,w){return this._addCheck({kind:"max",value:g.getTime(),message:n.errorUtil.toString(w)})}get minDate(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g!=null?new Date(g):null}get maxDate(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g!=null?new Date(g):null}}e.ZodDate=O,O.create=A=>new O({checks:[],coerce:(A==null?void 0:A.coerce)||!1,typeName:G.ZodDate,...l(A)});class N extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.symbol){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.symbol,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodSymbol=N,N.create=A=>new N({typeName:G.ZodSymbol,...l(A)});class J extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.undefined){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.undefined,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodUndefined=J,J.create=A=>new J({typeName:G.ZodUndefined,...l(A)});class q extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.null){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.null,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodNull=q,q.create=A=>new q({typeName:G.ZodNull,...l(A)});class W extends c{constructor(){super(...arguments),this._any=!0}_parse(g){return(0,r.OK)(g.data)}}e.ZodAny=W,W.create=A=>new W({typeName:G.ZodAny,...l(A)});class B extends c{constructor(){super(...arguments),this._unknown=!0}_parse(g){return(0,r.OK)(g.data)}}e.ZodUnknown=B,B.create=A=>new B({typeName:G.ZodUnknown,...l(A)});class V extends c{_parse(g){const w=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.never,received:w.parsedType}),r.INVALID}}e.ZodNever=V,V.create=A=>new V({typeName:G.ZodNever,...l(A)});class Y extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.undefined){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.void,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodVoid=Y,Y.create=A=>new Y({typeName:G.ZodVoid,...l(A)});class K extends c{_parse(g){const{ctx:w,status:C}=this._processInputParams(g),L=this._def;if(w.parsedType!==i.ZodParsedType.array)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.array,received:w.parsedType}),r.INVALID;if(L.exactLength!==null){const ye=w.data.length>L.exactLength.value,fe=w.data.length<L.exactLength.value;(ye||fe)&&((0,r.addIssueToContext)(w,{code:ye?s.ZodIssueCode.too_big:s.ZodIssueCode.too_small,minimum:fe?L.exactLength.value:void 0,maximum:ye?L.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:L.exactLength.message}),C.dirty())}if(L.minLength!==null&&w.data.length<L.minLength.value&&((0,r.addIssueToContext)(w,{code:s.ZodIssueCode.too_small,minimum:L.minLength.value,type:"array",inclusive:!0,exact:!1,message:L.minLength.message}),C.dirty()),L.maxLength!==null&&w.data.length>L.maxLength.value&&((0,r.addIssueToContext)(w,{code:s.ZodIssueCode.too_big,maximum:L.maxLength.value,type:"array",inclusive:!0,exact:!1,message:L.maxLength.message}),C.dirty()),w.common.async)return Promise.all([...w.data].map((ye,fe)=>L.type._parseAsync(new o(w,ye,w.path,fe)))).then(ye=>r.ParseStatus.mergeArray(C,ye));const $=[...w.data].map((ye,fe)=>L.type._parseSync(new o(w,ye,w.path,fe)));return r.ParseStatus.mergeArray(C,$)}get element(){return this._def.type}min(g,w){return new K({...this._def,minLength:{value:g,message:n.errorUtil.toString(w)}})}max(g,w){return new K({...this._def,maxLength:{value:g,message:n.errorUtil.toString(w)}})}length(g,w){return new K({...this._def,exactLength:{value:g,message:n.errorUtil.toString(w)}})}nonempty(g){return this.min(1,g)}}e.ZodArray=K,K.create=(A,g)=>new K({type:A,minLength:null,maxLength:null,exactLength:null,typeName:G.ZodArray,...l(g)});function pe(A){if(A instanceof k){const g={};for(const w in A.shape){const C=A.shape[w];g[w]=me.create(pe(C))}return new k({...A._def,shape:()=>g})}else return A instanceof K?new K({...A._def,type:pe(A.element)}):A instanceof me?me.create(pe(A.unwrap())):A instanceof he?he.create(pe(A.unwrap())):A instanceof Ie?Ie.create(A.items.map(g=>pe(g))):A}class k extends c{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const g=this._def.shape(),w=i.util.objectKeys(g);return this._cached={shape:g,keys:w}}_parse(g){if(this._getType(g)!==i.ZodParsedType.object){const Fe=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(Fe,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:Fe.parsedType}),r.INVALID}const{status:C,ctx:L}=this._processInputParams(g),{shape:$,keys:ye}=this._getCached(),fe=[];if(!(this._def.catchall instanceof V&&this._def.unknownKeys==="strip"))for(const Fe in L.data)ye.includes(Fe)||fe.push(Fe);const We=[];for(const Fe of ye){const lt=$[Fe],Un=L.data[Fe];We.push({key:{status:"valid",value:Fe},value:lt._parse(new o(L,Un,L.path,Fe)),alwaysSet:Fe in L.data})}if(this._def.catchall instanceof V){const Fe=this._def.unknownKeys;if(Fe==="passthrough")for(const lt of fe)We.push({key:{status:"valid",value:lt},value:{status:"valid",value:L.data[lt]}});else if(Fe==="strict")fe.length>0&&((0,r.addIssueToContext)(L,{code:s.ZodIssueCode.unrecognized_keys,keys:fe}),C.dirty());else if(Fe!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const Fe=this._def.catchall;for(const lt of fe){const Un=L.data[lt];We.push({key:{status:"valid",value:lt},value:Fe._parse(new o(L,Un,L.path,lt)),alwaysSet:lt in L.data})}}return L.common.async?Promise.resolve().then(async()=>{const Fe=[];for(const lt of We){const Un=await lt.key;Fe.push({key:Un,value:await lt.value,alwaysSet:lt.alwaysSet})}return Fe}).then(Fe=>r.ParseStatus.mergeObjectSync(C,Fe)):r.ParseStatus.mergeObjectSync(C,We)}get shape(){return this._def.shape()}strict(g){return n.errorUtil.errToObj,new k({...this._def,unknownKeys:"strict",...g!==void 0?{errorMap:(w,C)=>{var L,$,ye,fe;const We=(ye=($=(L=this._def).errorMap)===null||$===void 0?void 0:$.call(L,w,C).message)!==null&&ye!==void 0?ye:C.defaultError;return w.code==="unrecognized_keys"?{message:(fe=n.errorUtil.errToObj(g).message)!==null&&fe!==void 0?fe:We}:{message:We}}}:{}})}strip(){return new k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(g){return new k({...this._def,shape:()=>({...this._def.shape(),...g})})}merge(g){return new k({unknownKeys:g._def.unknownKeys,catchall:g._def.catchall,shape:()=>({...this._def.shape(),...g._def.shape()}),typeName:G.ZodObject})}setKey(g,w){return this.augment({[g]:w})}catchall(g){return new k({...this._def,catchall:g})}pick(g){const w={};return i.util.objectKeys(g).forEach(C=>{g[C]&&this.shape[C]&&(w[C]=this.shape[C])}),new k({...this._def,shape:()=>w})}omit(g){const w={};return i.util.objectKeys(this.shape).forEach(C=>{g[C]||(w[C]=this.shape[C])}),new k({...this._def,shape:()=>w})}deepPartial(){return pe(this)}partial(g){const w={};return i.util.objectKeys(this.shape).forEach(C=>{const L=this.shape[C];g&&!g[C]?w[C]=L:w[C]=L.optional()}),new k({...this._def,shape:()=>w})}required(g){const w={};return i.util.objectKeys(this.shape).forEach(C=>{if(g&&!g[C])w[C]=this.shape[C];else{let $=this.shape[C];for(;$ instanceof me;)$=$._def.innerType;w[C]=$}}),new k({...this._def,shape:()=>w})}keyof(){return Ce(i.util.objectKeys(this.shape))}}e.ZodObject=k,k.create=(A,g)=>new k({shape:()=>A,unknownKeys:"strip",catchall:V.create(),typeName:G.ZodObject,...l(g)}),k.strictCreate=(A,g)=>new k({shape:()=>A,unknownKeys:"strict",catchall:V.create(),typeName:G.ZodObject,...l(g)}),k.lazycreate=(A,g)=>new k({shape:A,unknownKeys:"strip",catchall:V.create(),typeName:G.ZodObject,...l(g)});class ee extends c{_parse(g){const{ctx:w}=this._processInputParams(g),C=this._def.options;function L($){for(const fe of $)if(fe.result.status==="valid")return fe.result;for(const fe of $)if(fe.result.status==="dirty")return w.common.issues.push(...fe.ctx.common.issues),fe.result;const ye=$.map(fe=>new s.ZodError(fe.ctx.common.issues));return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_union,unionErrors:ye}),r.INVALID}if(w.common.async)return Promise.all(C.map(async $=>{const ye={...w,common:{...w.common,issues:[]},parent:null};return{result:await $._parseAsync({data:w.data,path:w.path,parent:ye}),ctx:ye}})).then(L);{let $;const ye=[];for(const We of C){const Fe={...w,common:{...w.common,issues:[]},parent:null},lt=We._parseSync({data:w.data,path:w.path,parent:Fe});if(lt.status==="valid")return lt;lt.status==="dirty"&&!$&&($={result:lt,ctx:Fe}),Fe.common.issues.length&&ye.push(Fe.common.issues)}if($)return w.common.issues.push(...$.ctx.common.issues),$.result;const fe=ye.map(We=>new s.ZodError(We));return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_union,unionErrors:fe}),r.INVALID}}get options(){return this._def.options}}e.ZodUnion=ee,ee.create=(A,g)=>new ee({options:A,typeName:G.ZodUnion,...l(g)});const xe=A=>A instanceof ve?xe(A.schema):A instanceof ne?xe(A.innerType()):A instanceof ke?[A.value]:A instanceof Re?A.options:A instanceof qe?Object.keys(A.enum):A instanceof Le?xe(A._def.innerType):A instanceof J?[void 0]:A instanceof q?[null]:null;class S extends c{_parse(g){const{ctx:w}=this._processInputParams(g);if(w.parsedType!==i.ZodParsedType.object)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:w.parsedType}),r.INVALID;const C=this.discriminator,L=w.data[C],$=this.optionsMap.get(L);return $?w.common.async?$._parseAsync({data:w.data,path:w.path,parent:w}):$._parseSync({data:w.data,path:w.path,parent:w}):((0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[C]}),r.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(g,w,C){const L=new Map;for(const $ of w){const ye=xe($.shape[g]);if(!ye)throw new Error(`A discriminator value for key \`${g}\` could not be extracted from all schema options`);for(const fe of ye){if(L.has(fe))throw new Error(`Discriminator property ${String(g)} has duplicate value ${String(fe)}`);L.set(fe,$)}}return new S({typeName:G.ZodDiscriminatedUnion,discriminator:g,options:w,optionsMap:L,...l(C)})}}e.ZodDiscriminatedUnion=S;function Te(A,g){const w=(0,i.getParsedType)(A),C=(0,i.getParsedType)(g);if(A===g)return{valid:!0,data:A};if(w===i.ZodParsedType.object&&C===i.ZodParsedType.object){const L=i.util.objectKeys(g),$=i.util.objectKeys(A).filter(fe=>L.indexOf(fe)!==-1),ye={...A,...g};for(const fe of $){const We=Te(A[fe],g[fe]);if(!We.valid)return{valid:!1};ye[fe]=We.data}return{valid:!0,data:ye}}else if(w===i.ZodParsedType.array&&C===i.ZodParsedType.array){if(A.length!==g.length)return{valid:!1};const L=[];for(let $=0;$<A.length;$++){const ye=A[$],fe=g[$],We=Te(ye,fe);if(!We.valid)return{valid:!1};L.push(We.data)}return{valid:!0,data:L}}else return w===i.ZodParsedType.date&&C===i.ZodParsedType.date&&+A==+g?{valid:!0,data:A}:{valid:!1}}class Ne extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g),L=($,ye)=>{if((0,r.isAborted)($)||(0,r.isAborted)(ye))return r.INVALID;const fe=Te($.value,ye.value);return fe.valid?(((0,r.isDirty)($)||(0,r.isDirty)(ye))&&w.dirty(),{status:w.value,value:fe.data}):((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_intersection_types}),r.INVALID)};return C.common.async?Promise.all([this._def.left._parseAsync({data:C.data,path:C.path,parent:C}),this._def.right._parseAsync({data:C.data,path:C.path,parent:C})]).then(([$,ye])=>L($,ye)):L(this._def.left._parseSync({data:C.data,path:C.path,parent:C}),this._def.right._parseSync({data:C.data,path:C.path,parent:C}))}}e.ZodIntersection=Ne,Ne.create=(A,g,w)=>new Ne({left:A,right:g,typeName:G.ZodIntersection,...l(w)});class Ie extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.array)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.array,received:C.parsedType}),r.INVALID;if(C.data.length<this._def.items.length)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.INVALID;!this._def.rest&&C.data.length>this._def.items.length&&((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),w.dirty());const $=[...C.data].map((ye,fe)=>{const We=this._def.items[fe]||this._def.rest;return We?We._parse(new o(C,ye,C.path,fe)):null}).filter(ye=>!!ye);return C.common.async?Promise.all($).then(ye=>r.ParseStatus.mergeArray(w,ye)):r.ParseStatus.mergeArray(w,$)}get items(){return this._def.items}rest(g){return new Ie({...this._def,rest:g})}}e.ZodTuple=Ie,Ie.create=(A,g)=>{if(!Array.isArray(A))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ie({items:A,typeName:G.ZodTuple,rest:null,...l(g)})};class je extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.object)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:C.parsedType}),r.INVALID;const L=[],$=this._def.keyType,ye=this._def.valueType;for(const fe in C.data)L.push({key:$._parse(new o(C,fe,C.path,fe)),value:ye._parse(new o(C,C.data[fe],C.path,fe))});return C.common.async?r.ParseStatus.mergeObjectAsync(w,L):r.ParseStatus.mergeObjectSync(w,L)}get element(){return this._def.valueType}static create(g,w,C){return w instanceof c?new je({keyType:g,valueType:w,typeName:G.ZodRecord,...l(C)}):new je({keyType:P.create(),valueType:g,typeName:G.ZodRecord,...l(w)})}}e.ZodRecord=je;class De extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.map)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.map,received:C.parsedType}),r.INVALID;const L=this._def.keyType,$=this._def.valueType,ye=[...C.data.entries()].map(([fe,We],Fe)=>({key:L._parse(new o(C,fe,C.path,[Fe,"key"])),value:$._parse(new o(C,We,C.path,[Fe,"value"]))}));if(C.common.async){const fe=new Map;return Promise.resolve().then(async()=>{for(const We of ye){const Fe=await We.key,lt=await We.value;if(Fe.status==="aborted"||lt.status==="aborted")return r.INVALID;(Fe.status==="dirty"||lt.status==="dirty")&&w.dirty(),fe.set(Fe.value,lt.value)}return{status:w.value,value:fe}})}else{const fe=new Map;for(const We of ye){const Fe=We.key,lt=We.value;if(Fe.status==="aborted"||lt.status==="aborted")return r.INVALID;(Fe.status==="dirty"||lt.status==="dirty")&&w.dirty(),fe.set(Fe.value,lt.value)}return{status:w.value,value:fe}}}}e.ZodMap=De,De.create=(A,g,w)=>new De({valueType:g,keyType:A,typeName:G.ZodMap,...l(w)});class Ue extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.set)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.set,received:C.parsedType}),r.INVALID;const L=this._def;L.minSize!==null&&C.data.size<L.minSize.value&&((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,minimum:L.minSize.value,type:"set",inclusive:!0,exact:!1,message:L.minSize.message}),w.dirty()),L.maxSize!==null&&C.data.size>L.maxSize.value&&((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,maximum:L.maxSize.value,type:"set",inclusive:!0,exact:!1,message:L.maxSize.message}),w.dirty());const $=this._def.valueType;function ye(We){const Fe=new Set;for(const lt of We){if(lt.status==="aborted")return r.INVALID;lt.status==="dirty"&&w.dirty(),Fe.add(lt.value)}return{status:w.value,value:Fe}}const fe=[...C.data.values()].map((We,Fe)=>$._parse(new o(C,We,C.path,Fe)));return C.common.async?Promise.all(fe).then(We=>ye(We)):ye(fe)}min(g,w){return new Ue({...this._def,minSize:{value:g,message:n.errorUtil.toString(w)}})}max(g,w){return new Ue({...this._def,maxSize:{value:g,message:n.errorUtil.toString(w)}})}size(g,w){return this.min(g,w).max(g,w)}nonempty(g){return this.min(1,g)}}e.ZodSet=Ue,Ue.create=(A,g)=>new Ue({valueType:A,minSize:null,maxSize:null,typeName:G.ZodSet,...l(g)});class _e extends c{constructor(){super(...arguments),this.validate=this.implement}_parse(g){const{ctx:w}=this._processInputParams(g);if(w.parsedType!==i.ZodParsedType.function)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.function,received:w.parsedType}),r.INVALID;function C(fe,We){return(0,r.makeIssue)({data:fe,path:w.path,errorMaps:[w.common.contextualErrorMap,w.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter(Fe=>!!Fe),issueData:{code:s.ZodIssueCode.invalid_arguments,argumentsError:We}})}function L(fe,We){return(0,r.makeIssue)({data:fe,path:w.path,errorMaps:[w.common.contextualErrorMap,w.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter(Fe=>!!Fe),issueData:{code:s.ZodIssueCode.invalid_return_type,returnTypeError:We}})}const $={errorMap:w.common.contextualErrorMap},ye=w.data;if(this._def.returns instanceof D){const fe=this;return(0,r.OK)(async function(...We){const Fe=new s.ZodError([]),lt=await fe._def.args.parseAsync(We,$).catch(Vd=>{throw Fe.addIssue(C(We,Vd)),Fe}),Un=await Reflect.apply(ye,this,lt);return await fe._def.returns._def.type.parseAsync(Un,$).catch(Vd=>{throw Fe.addIssue(L(Un,Vd)),Fe})})}else{const fe=this;return(0,r.OK)(function(...We){const Fe=fe._def.args.safeParse(We,$);if(!Fe.success)throw new s.ZodError([C(We,Fe.error)]);const lt=Reflect.apply(ye,this,Fe.data),Un=fe._def.returns.safeParse(lt,$);if(!Un.success)throw new s.ZodError([L(lt,Un.error)]);return Un.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...g){return new _e({...this._def,args:Ie.create(g).rest(B.create())})}returns(g){return new _e({...this._def,returns:g})}implement(g){return this.parse(g)}strictImplement(g){return this.parse(g)}static create(g,w,C){return new _e({args:g||Ie.create([]).rest(B.create()),returns:w||B.create(),typeName:G.ZodFunction,...l(C)})}}e.ZodFunction=_e;class ve extends c{get schema(){return this._def.getter()}_parse(g){const{ctx:w}=this._processInputParams(g);return this._def.getter()._parse({data:w.data,path:w.path,parent:w})}}e.ZodLazy=ve,ve.create=(A,g)=>new ve({getter:A,typeName:G.ZodLazy,...l(g)});class ke extends c{_parse(g){if(g.data!==this._def.value){const w=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(w,{received:w.data,code:s.ZodIssueCode.invalid_literal,expected:this._def.value}),r.INVALID}return{status:"valid",value:g.data}}get value(){return this._def.value}}e.ZodLiteral=ke,ke.create=(A,g)=>new ke({value:A,typeName:G.ZodLiteral,...l(g)});function Ce(A,g){return new Re({values:A,typeName:G.ZodEnum,...l(g)})}class Re extends c{_parse(g){if(typeof g.data!="string"){const w=this._getOrReturnCtx(g),C=this._def.values;return(0,r.addIssueToContext)(w,{expected:i.util.joinValues(C),received:w.parsedType,code:s.ZodIssueCode.invalid_type}),r.INVALID}if(this._def.values.indexOf(g.data)===-1){const w=this._getOrReturnCtx(g),C=this._def.values;return(0,r.addIssueToContext)(w,{received:w.data,code:s.ZodIssueCode.invalid_enum_value,options:C}),r.INVALID}return(0,r.OK)(g.data)}get options(){return this._def.values}get enum(){const g={};for(const w of this._def.values)g[w]=w;return g}get Values(){const g={};for(const w of this._def.values)g[w]=w;return g}get Enum(){const g={};for(const w of this._def.values)g[w]=w;return g}extract(g){return Re.create(g)}exclude(g){return Re.create(this.options.filter(w=>!g.includes(w)))}}e.ZodEnum=Re,Re.create=Ce;class qe extends c{_parse(g){const w=i.util.getValidEnumValues(this._def.values),C=this._getOrReturnCtx(g);if(C.parsedType!==i.ZodParsedType.string&&C.parsedType!==i.ZodParsedType.number){const L=i.util.objectValues(w);return(0,r.addIssueToContext)(C,{expected:i.util.joinValues(L),received:C.parsedType,code:s.ZodIssueCode.invalid_type}),r.INVALID}if(w.indexOf(g.data)===-1){const L=i.util.objectValues(w);return(0,r.addIssueToContext)(C,{received:C.data,code:s.ZodIssueCode.invalid_enum_value,options:L}),r.INVALID}return(0,r.OK)(g.data)}get enum(){return this._def.values}}e.ZodNativeEnum=qe,qe.create=(A,g)=>new qe({values:A,typeName:G.ZodNativeEnum,...l(g)});class D extends c{unwrap(){return this._def.type}_parse(g){const{ctx:w}=this._processInputParams(g);if(w.parsedType!==i.ZodParsedType.promise&&w.common.async===!1)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.promise,received:w.parsedType}),r.INVALID;const C=w.parsedType===i.ZodParsedType.promise?w.data:Promise.resolve(w.data);return(0,r.OK)(C.then(L=>this._def.type.parseAsync(L,{path:w.path,errorMap:w.common.contextualErrorMap})))}}e.ZodPromise=D,D.create=(A,g)=>new D({type:A,typeName:G.ZodPromise,...l(g)});class ne extends c{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===G.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(g){const{status:w,ctx:C}=this._processInputParams(g),L=this._def.effect||null,$={addIssue:ye=>{(0,r.addIssueToContext)(C,ye),ye.fatal?w.abort():w.dirty()},get path(){return C.path}};if($.addIssue=$.addIssue.bind($),L.type==="preprocess"){const ye=L.transform(C.data,$);return C.common.issues.length?{status:"dirty",value:C.data}:C.common.async?Promise.resolve(ye).then(fe=>this._def.schema._parseAsync({data:fe,path:C.path,parent:C})):this._def.schema._parseSync({data:ye,path:C.path,parent:C})}if(L.type==="refinement"){const ye=fe=>{const We=L.refinement(fe,$);if(C.common.async)return Promise.resolve(We);if(We instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return fe};if(C.common.async===!1){const fe=this._def.schema._parseSync({data:C.data,path:C.path,parent:C});return fe.status==="aborted"?r.INVALID:(fe.status==="dirty"&&w.dirty(),ye(fe.value),{status:w.value,value:fe.value})}else return this._def.schema._parseAsync({data:C.data,path:C.path,parent:C}).then(fe=>fe.status==="aborted"?r.INVALID:(fe.status==="dirty"&&w.dirty(),ye(fe.value).then(()=>({status:w.value,value:fe.value}))))}if(L.type==="transform")if(C.common.async===!1){const ye=this._def.schema._parseSync({data:C.data,path:C.path,parent:C});if(!(0,r.isValid)(ye))return ye;const fe=L.transform(ye.value,$);if(fe instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:w.value,value:fe}}else return this._def.schema._parseAsync({data:C.data,path:C.path,parent:C}).then(ye=>(0,r.isValid)(ye)?Promise.resolve(L.transform(ye.value,$)).then(fe=>({status:w.value,value:fe})):ye);i.util.assertNever(L)}}e.ZodEffects=ne,e.ZodTransformer=ne,ne.create=(A,g,w)=>new ne({schema:A,typeName:G.ZodEffects,effect:g,...l(w)}),ne.createWithPreprocess=(A,g,w)=>new ne({schema:g,effect:{type:"preprocess",transform:A},typeName:G.ZodEffects,...l(w)});class me extends c{_parse(g){return this._getType(g)===i.ZodParsedType.undefined?(0,r.OK)(void 0):this._def.innerType._parse(g)}unwrap(){return this._def.innerType}}e.ZodOptional=me,me.create=(A,g)=>new me({innerType:A,typeName:G.ZodOptional,...l(g)});class he extends c{_parse(g){return this._getType(g)===i.ZodParsedType.null?(0,r.OK)(null):this._def.innerType._parse(g)}unwrap(){return this._def.innerType}}e.ZodNullable=he,he.create=(A,g)=>new he({innerType:A,typeName:G.ZodNullable,...l(g)});class Le extends c{_parse(g){const{ctx:w}=this._processInputParams(g);let C=w.data;return w.parsedType===i.ZodParsedType.undefined&&(C=this._def.defaultValue()),this._def.innerType._parse({data:C,path:w.path,parent:w})}removeDefault(){return this._def.innerType}}e.ZodDefault=Le,Le.create=(A,g)=>new Le({innerType:A,typeName:G.ZodDefault,defaultValue:typeof g.default=="function"?g.default:()=>g.default,...l(g)});class Pe extends c{_parse(g){const{ctx:w}=this._processInputParams(g),C={...w,common:{...w.common,issues:[]}},L=this._def.innerType._parse({data:C.data,path:C.path,parent:{...C}});return(0,r.isAsync)(L)?L.then($=>({status:"valid",value:$.status==="valid"?$.value:this._def.catchValue({get error(){return new s.ZodError(C.common.issues)},input:C.data})})):{status:"valid",value:L.status==="valid"?L.value:this._def.catchValue({get error(){return new s.ZodError(C.common.issues)},input:C.data})}}removeCatch(){return this._def.innerType}}e.ZodCatch=Pe,Pe.create=(A,g)=>new Pe({innerType:A,typeName:G.ZodCatch,catchValue:typeof g.catch=="function"?g.catch:()=>g.catch,...l(g)});class Be extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.nan){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.nan,received:C.parsedType}),r.INVALID}return{status:"valid",value:g.data}}}e.ZodNaN=Be,Be.create=A=>new Be({typeName:G.ZodNaN,...l(A)}),e.BRAND=Symbol("zod_brand");class ot extends c{_parse(g){const{ctx:w}=this._processInputParams(g),C=w.data;return this._def.type._parse({data:C,path:w.path,parent:w})}unwrap(){return this._def.type}}e.ZodBranded=ot;class Ze extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.common.async)return(async()=>{const $=await this._def.in._parseAsync({data:C.data,path:C.path,parent:C});return $.status==="aborted"?r.INVALID:$.status==="dirty"?(w.dirty(),(0,r.DIRTY)($.value)):this._def.out._parseAsync({data:$.value,path:C.path,parent:C})})();{const L=this._def.in._parseSync({data:C.data,path:C.path,parent:C});return L.status==="aborted"?r.INVALID:L.status==="dirty"?(w.dirty(),{status:"dirty",value:L.value}):this._def.out._parseSync({data:L.value,path:C.path,parent:C})}}static create(g,w){return new Ze({in:g,out:w,typeName:G.ZodPipeline})}}e.ZodPipeline=Ze;class Z extends c{_parse(g){const w=this._def.innerType._parse(g);return(0,r.isValid)(w)&&(w.value=Object.freeze(w.value)),w}}e.ZodReadonly=Z,Z.create=(A,g)=>new Z({innerType:A,typeName:G.ZodReadonly,...l(g)});const Q=(A,g={},w)=>A?W.create().superRefine((C,L)=>{var $,ye;if(!A(C)){const fe=typeof g=="function"?g(C):typeof g=="string"?{message:g}:g,We=(ye=($=fe.fatal)!==null&&$!==void 0?$:w)!==null&&ye!==void 0?ye:!0,Fe=typeof fe=="string"?{message:fe}:fe;L.addIssue({code:"custom",...Fe,fatal:We})}}):W.create();e.custom=Q,e.late={object:k.lazycreate};var G;(function(A){A.ZodString="ZodString",A.ZodNumber="ZodNumber",A.ZodNaN="ZodNaN",A.ZodBigInt="ZodBigInt",A.ZodBoolean="ZodBoolean",A.ZodDate="ZodDate",A.ZodSymbol="ZodSymbol",A.ZodUndefined="ZodUndefined",A.ZodNull="ZodNull",A.ZodAny="ZodAny",A.ZodUnknown="ZodUnknown",A.ZodNever="ZodNever",A.ZodVoid="ZodVoid",A.ZodArray="ZodArray",A.ZodObject="ZodObject",A.ZodUnion="ZodUnion",A.ZodDiscriminatedUnion="ZodDiscriminatedUnion",A.ZodIntersection="ZodIntersection",A.ZodTuple="ZodTuple",A.ZodRecord="ZodRecord",A.ZodMap="ZodMap",A.ZodSet="ZodSet",A.ZodFunction="ZodFunction",A.ZodLazy="ZodLazy",A.ZodLiteral="ZodLiteral",A.ZodEnum="ZodEnum",A.ZodEffects="ZodEffects",A.ZodNativeEnum="ZodNativeEnum",A.ZodOptional="ZodOptional",A.ZodNullable="ZodNullable",A.ZodDefault="ZodDefault",A.ZodCatch="ZodCatch",A.ZodPromise="ZodPromise",A.ZodBranded="ZodBranded",A.ZodPipeline="ZodPipeline",A.ZodReadonly="ZodReadonly"})(G=e.ZodFirstPartyTypeKind||(e.ZodFirstPartyTypeKind={}));const $e=(A,g={message:`Input not instance of ${A.name}`})=>(0,e.custom)(w=>w instanceof A,g);e.instanceof=$e;const Ge=P.create;e.string=Ge;const St=j.create;e.number=St;const bt=Be.create;e.nan=bt;const gt=U.create;e.bigint=gt;const At=F.create;e.boolean=At;const fn=O.create;e.date=fn;const Rt=N.create;e.symbol=Rt;const Ft=J.create;e.undefined=Ft;const Qt=q.create;e.null=Qt;const Gt=W.create;e.any=Gt;const Rr=B.create;e.unknown=Rr;const jn=V.create;e.never=jn;const fr=Y.create;e.void=fr;const Ri=K.create;e.array=Ri;const si=k.create;e.object=si;const oi=k.strictCreate;e.strictObject=oi;const $r=ee.create;e.union=$r;const Tt=S.create;e.discriminatedUnion=Tt;const Ot=Ne.create;e.intersection=Ot;const Xt=Ie.create;e.tuple=Xt;const en=je.create;e.record=en;const Yt=De.create;e.map=Yt;const Lt=Ue.create;e.set=Lt;const _n=_e.create;e.function=_n;const In=ve.create;e.lazy=In;const hr=ke.create;e.literal=hr;const Fd=Re.create;e.enum=Fd;const Bd=qe.create;e.nativeEnum=Bd;const M=D.create;e.promise=M;const ge=ne.create;e.effect=ge,e.transformer=ge;const Se=me.create;e.optional=Se;const Ke=he.create;e.nullable=Ke;const ft=ne.createWithPreprocess;e.preprocess=ft;const yt=Ze.create;e.pipeline=yt;const at=()=>Ge().optional();e.ostring=at;const it=()=>St().optional();e.onumber=it;const sn=()=>At().optional();e.oboolean=sn,e.coerce={string:A=>P.create({...A,coerce:!0}),number:A=>j.create({...A,coerce:!0}),boolean:A=>F.create({...A,coerce:!0}),bigint:A=>U.create({...A,coerce:!0}),date:A=>O.create({...A,coerce:!0})},e.NEVER=r.INVALID}(kg),function(e){var t=Me&&Me.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=Me&&Me.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(rr,e),n(Ru,e),n(_g,e),n(Js,e),n(kg,e),n(ir,e)}(Pu),function(e){var t=Me&&Me.__createBinding||(Object.create?function(o,a,l,c){c===void 0&&(c=l),Object.defineProperty(o,c,{enumerable:!0,get:function(){return a[l]}})}:function(o,a,l,c){c===void 0&&(c=l),o[c]=a[l]}),n=Me&&Me.__setModuleDefault||(Object.create?function(o,a){Object.defineProperty(o,"default",{enumerable:!0,value:a})}:function(o,a){o.default=a}),r=Me&&Me.__importStar||function(o){if(o&&o.__esModule)return o;var a={};if(o!=null)for(var l in o)l!=="default"&&Object.prototype.hasOwnProperty.call(o,l)&&t(a,o,l);return n(a,o),a},i=Me&&Me.__exportStar||function(o,a){for(var l in o)l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&t(a,o,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.z=void 0;const s=r(Pu);e.z=s,i(Pu,e),e.default=s}(ja);const $u={},Eg=Ll(Object.freeze(Object.defineProperty({__proto__:null,default:$u},Symbol.toStringTag,{value:"Module"})));function Sg(e,t){return function(){return e.apply(t,arguments)}}const{toString:bR}=Object.prototype,{getPrototypeOf:Mu}=Object,Fa=(e=>t=>{const n=bR.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),sr=e=>(e=e.toLowerCase(),t=>Fa(t)===e),Ba=e=>t=>typeof t===e,{isArray:ts}=Array,Gs=Ba("undefined");function wR(e){return e!==null&&!Gs(e)&&e.constructor!==null&&!Gs(e.constructor)&&Dn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Tg=sr("ArrayBuffer");function xR(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Tg(e.buffer),t}const _R=Ba("string"),Dn=Ba("function"),Og=Ba("number"),Va=e=>e!==null&&typeof e=="object",kR=e=>e===!0||e===!1,za=e=>{if(Fa(e)!=="object")return!1;const t=Mu(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},CR=sr("Date"),ER=sr("File"),SR=sr("Blob"),TR=sr("FileList"),OR=e=>Va(e)&&Dn(e.pipe),IR=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Dn(e.append)&&((t=Fa(e))==="formdata"||t==="object"&&Dn(e.toString)&&e.toString()==="[object FormData]"))},PR=sr("URLSearchParams"),AR=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ys(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),ts(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(r=0;r<o;r++)a=s[r],t.call(null,e[a],a,e)}}function Ig(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Pg=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Ag=e=>!Gs(e)&&e!==Pg;function Lu(){const{caseless:e}=Ag(this)&&this||{},t={},n=(r,i)=>{const s=e&&Ig(t,i)||i;za(t[s])&&za(r)?t[s]=Lu(t[s],r):za(r)?t[s]=Lu({},r):ts(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Ys(arguments[r],n);return t}const RR=(e,t,n,{allOwnKeys:r}={})=>(Ys(t,(i,s)=>{n&&Dn(i)?e[s]=Sg(i,n):e[s]=i},{allOwnKeys:r}),e),$R=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),MR=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},LR=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&Mu(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},DR=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},NR=e=>{if(!e)return null;if(ts(e))return e;let t=e.length;if(!Og(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},jR=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Mu(Uint8Array)),UR=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},FR=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},BR=sr("HTMLFormElement"),VR=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Rg=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),zR=sr("RegExp"),$g=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ys(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},ZR=e=>{$g(e,(t,n)=>{if(Dn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Dn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},WR=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return ts(e)?r(e):r(String(e).split(t)),n},HR=()=>{},qR=(e,t)=>(e=+e,Number.isFinite(e)?e:t),Du="abcdefghijklmnopqrstuvwxyz",Mg="0123456789",Lg={DIGIT:Mg,ALPHA:Du,ALPHA_DIGIT:Du+Du.toUpperCase()+Mg},KR=(e=16,t=Lg.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function JR(e){return!!(e&&Dn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const GR=e=>{const t=new Array(10),n=(r,i)=>{if(Va(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=ts(r)?[]:{};return Ys(r,(o,a)=>{const l=n(o,i+1);!Gs(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},YR=sr("AsyncFunction"),re={isArray:ts,isArrayBuffer:Tg,isBuffer:wR,isFormData:IR,isArrayBufferView:xR,isString:_R,isNumber:Og,isBoolean:kR,isObject:Va,isPlainObject:za,isUndefined:Gs,isDate:CR,isFile:ER,isBlob:SR,isRegExp:zR,isFunction:Dn,isStream:OR,isURLSearchParams:PR,isTypedArray:jR,isFileList:TR,forEach:Ys,merge:Lu,extend:RR,trim:AR,stripBOM:$R,inherits:MR,toFlatObject:LR,kindOf:Fa,kindOfTest:sr,endsWith:DR,toArray:NR,forEachEntry:UR,matchAll:FR,isHTMLForm:BR,hasOwnProperty:Rg,hasOwnProp:Rg,reduceDescriptors:$g,freezeMethods:ZR,toObjectSet:WR,toCamelCase:VR,noop:HR,toFiniteNumber:qR,findKey:Ig,global:Pg,isContextDefined:Ag,ALPHABET:Lg,generateString:KR,isSpecCompliantForm:JR,toJSONObject:GR,isAsyncFn:YR,isThenable:e=>e&&(Va(e)||Dn(e))&&Dn(e.then)&&Dn(e.catch)};function ut(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}re.inherits(ut,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:re.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Dg=ut.prototype,Ng={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ng[e]={value:e}}),Object.defineProperties(ut,Ng),Object.defineProperty(Dg,"isAxiosError",{value:!0}),ut.from=(e,t,n,r,i,s)=>{const o=Object.create(Dg);return re.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),ut.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const QR=null;function Nu(e){return re.isPlainObject(e)||re.isArray(e)}function jg(e){return re.endsWith(e,"[]")?e.slice(0,-2):e}function Ug(e,t,n){return e?e.concat(t).map(function(i,s){return i=jg(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function XR(e){return re.isArray(e)&&!e.some(Nu)}const e$=re.toFlatObject(re,{},null,function(t){return/^is[A-Z]/.test(t)});function Za(e,t,n){if(!re.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=re.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!re.isUndefined(y[m])});const r=n.metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&re.isSpecCompliantForm(t);if(!re.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(re.isDate(p))return p.toISOString();if(!l&&re.isBlob(p))throw new ut("Blob is not supported. Use a Buffer instead.");return re.isArrayBuffer(p)||re.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,y){let v=p;if(p&&!y&&typeof p=="object"){if(re.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(re.isArray(p)&&XR(p)||(re.isFileList(p)||re.endsWith(m,"[]"))&&(v=re.toArray(p)))return m=jg(m),v.forEach(function(x,I){!(re.isUndefined(x)||x===null)&&t.append(o===!0?Ug([m],I,s):o===null?m:m+"[]",c(x))}),!1}return Nu(p)?!0:(t.append(Ug(y,m,s),c(p)),!1)}const d=[],h=Object.assign(e$,{defaultVisitor:u,convertValue:c,isVisitable:Nu});function f(p,m){if(!re.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),re.forEach(p,function(v,b){(!(re.isUndefined(v)||v===null)&&i.call(t,v,re.isString(b)?b.trim():b,m,h))===!0&&f(v,m?m.concat(b):[b])}),d.pop()}}if(!re.isObject(e))throw new TypeError("data must be an object");return f(e),t}function Fg(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ju(e,t){this._pairs=[],e&&Za(e,this,t)}const Bg=ju.prototype;Bg.append=function(t,n){this._pairs.push([t,n])},Bg.toString=function(t){const n=t?function(r){return t.call(this,r,Fg)}:Fg;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function t$(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vg(e,t,n){if(!t)return e;const r=n&&n.encode||t$,i=n&&n.serialize;let s;if(i?s=i(t,n):s=re.isURLSearchParams(t)?t.toString():new ju(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}const zg=class{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){re.forEach(this.handlers,function(r){r!==null&&t(r)})}},Zg={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},n$={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ju,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Wg=typeof window<"u"&&typeof document<"u",r$=(e=>Wg&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),i$=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),or={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Wg,hasStandardBrowserEnv:r$,hasStandardBrowserWebWorkerEnv:i$},Symbol.toStringTag,{value:"Module"})),...n$};function s$(e,t){return Za(e,new or.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return or.isNode&&re.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function o$(e){return re.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function a$(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function Hg(e){function t(n,r,i,s){let o=n[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=s>=n.length;return o=!o&&re.isArray(i)?i.length:o,l?(re.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!re.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&re.isArray(i[o])&&(i[o]=a$(i[o])),!a)}if(re.isFormData(e)&&re.isFunction(e.entries)){const n={};return re.forEachEntry(e,(r,i)=>{t(o$(r),i,n,0)}),n}return null}function l$(e,t,n){if(re.isString(e))try{return(t||JSON.parse)(e),re.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Uu={transitional:Zg,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=re.isObject(t);if(s&&re.isHTMLForm(t)&&(t=new FormData(t)),re.isFormData(t))return i?JSON.stringify(Hg(t)):t;if(re.isArrayBuffer(t)||re.isBuffer(t)||re.isStream(t)||re.isFile(t)||re.isBlob(t))return t;if(re.isArrayBufferView(t))return t.buffer;if(re.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return s$(t,this.formSerializer).toString();if((a=re.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Za(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),l$(t)):t}],transformResponse:[function(t){const n=this.transitional||Uu.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(t&&re.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?ut.from(a,ut.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:or.classes.FormData,Blob:or.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};re.forEach(["delete","get","head","post","put","patch"],e=>{Uu.headers[e]={}});const Fu=Uu,c$=re.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),u$=e=>{const t={};let n,r,i;return e&&e.split(`
273
- `).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&c$[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},qg=Symbol("internals");function Qs(e){return e&&String(e).trim().toLowerCase()}function Wa(e){return e===!1||e==null?e:re.isArray(e)?e.map(Wa):String(e)}function d$(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const f$=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Bu(e,t,n,r,i){if(re.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!re.isString(t)){if(re.isString(r))return t.indexOf(r)!==-1;if(re.isRegExp(r))return r.test(t)}}function h$(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function p$(e,t){const n=re.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}let Ha=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,c){const u=Qs(l);if(!u)throw new Error("header name must be a non-empty string");const d=re.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=Wa(a))}const o=(a,l)=>re.forEach(a,(c,u)=>s(c,u,l));return re.isPlainObject(t)||t instanceof this.constructor?o(t,n):re.isString(t)&&(t=t.trim())&&!f$(t)?o(u$(t),n):t!=null&&s(n,t,r),this}get(t,n){if(t=Qs(t),t){const r=re.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return d$(i);if(re.isFunction(n))return n.call(this,i,r);if(re.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Qs(t),t){const r=re.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Bu(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=Qs(o),o){const a=re.findKey(r,o);a&&(!n||Bu(r,r[a],a,n))&&(delete r[a],i=!0)}}return re.isArray(t)?t.forEach(s):s(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!t||Bu(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return re.forEach(this,(i,s)=>{const o=re.findKey(r,s);if(o){n[o]=Wa(i),delete n[s];return}const a=t?h$(s):String(s).trim();a!==s&&delete n[s],n[a]=Wa(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return re.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&re.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
274
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[qg]=this[qg]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=Qs(o);r[a]||(p$(i,o),r[a]=!0)}return re.isArray(t)?t.forEach(s):s(t),this}};Ha.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),re.reduceDescriptors(Ha.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),re.freezeMethods(Ha);const kr=Ha;function Vu(e,t){const n=this||Fu,r=t||n,i=kr.from(r.headers);let s=r.data;return re.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Kg(e){return!!(e&&e.__CANCEL__)}function Xs(e,t,n){ut.call(this,e??"canceled",ut.ERR_CANCELED,t,n),this.name="CanceledError"}re.inherits(Xs,ut,{__CANCEL__:!0});function m$(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ut("Request failed with status code "+n.status,[ut.ERR_BAD_REQUEST,ut.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const g$=or.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];re.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),re.isString(r)&&o.push("path="+r),re.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function y$(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function v$(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Jg(e,t){return e&&!y$(t)?v$(e,t):t}const b$=or.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let o=s;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(o){const a=re.isString(o)?i(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function w$(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function x$(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[s];o||(o=c),n[i]=l,r[i]=c;let d=s,h=0;for(;d!==i;)h+=n[d++],d=d%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function Gg(e,t){let n=0;const r=x$(50,250);return i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-n,l=r(a),c=s<=o;n=s;const u={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&c?(o-s)/l:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}const zu={http:QR,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let i=e.data;const s=kr.from(e.headers).normalize();let{responseType:o,withXSRFToken:a}=e,l;function c(){e.cancelToken&&e.cancelToken.unsubscribe(l),e.signal&&e.signal.removeEventListener("abort",l)}let u;if(re.isFormData(i)){if(or.hasStandardBrowserEnv||or.hasStandardBrowserWebWorkerEnv)s.setContentType(!1);else if((u=s.getContentType())!==!1){const[m,...y]=u?u.split(";").map(v=>v.trim()).filter(Boolean):[];s.setContentType([m||"multipart/form-data",...y].join("; "))}}let d=new XMLHttpRequest;if(e.auth){const m=e.auth.username||"",y=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(m+":"+y))}const h=Jg(e.baseURL,e.url);d.open(e.method.toUpperCase(),Vg(h,e.params,e.paramsSerializer),!0),d.timeout=e.timeout;function f(){if(!d)return;const m=kr.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),v={data:!o||o==="text"||o==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:m,config:e,request:d};m$(function(x){n(x),c()},function(x){r(x),c()},v),d=null}if("onloadend"in d?d.onloadend=f:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(f)},d.onabort=function(){d&&(r(new ut("Request aborted",ut.ECONNABORTED,e,d)),d=null)},d.onerror=function(){r(new ut("Network Error",ut.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let y=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const v=e.transitional||Zg;e.timeoutErrorMessage&&(y=e.timeoutErrorMessage),r(new ut(y,v.clarifyTimeoutError?ut.ETIMEDOUT:ut.ECONNABORTED,e,d)),d=null},or.hasStandardBrowserEnv&&(a&&re.isFunction(a)&&(a=a(e)),a||a!==!1&&b$(h))){const m=e.xsrfHeaderName&&e.xsrfCookieName&&g$.read(e.xsrfCookieName);m&&s.set(e.xsrfHeaderName,m)}i===void 0&&s.setContentType(null),"setRequestHeader"in d&&re.forEach(s.toJSON(),function(y,v){d.setRequestHeader(v,y)}),re.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),o&&o!=="json"&&(d.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&d.addEventListener("progress",Gg(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",Gg(e.onUploadProgress)),(e.cancelToken||e.signal)&&(l=m=>{d&&(r(!m||m.type?new Xs(null,e,d):m),d.abort(),d=null)},e.cancelToken&&e.cancelToken.subscribe(l),e.signal&&(e.signal.aborted?l():e.signal.addEventListener("abort",l)));const p=w$(h);if(p&&or.protocols.indexOf(p)===-1){r(new ut("Unsupported protocol "+p+":",ut.ERR_BAD_REQUEST,e));return}d.send(i||null)})}};re.forEach(zu,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Yg=e=>`- ${e}`,_$=e=>re.isFunction(e)||e===null||e===!1,Qg={getAdapter:e=>{e=re.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let s=0;s<t;s++){n=e[s];let o;if(r=n,!_$(n)&&(r=zu[(o=String(n)).toLowerCase()],r===void 0))throw new ut(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+s]=r}if(!r){const s=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since :
275
- `+s.map(Yg).join(`
276
- `):" "+Yg(s[0]):"as no adapter specified";throw new ut("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:zu};function Zu(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Xs(null,e)}function Xg(e){return Zu(e),e.headers=kr.from(e.headers),e.data=Vu.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Qg.getAdapter(e.adapter||Fu.adapter)(e).then(function(r){return Zu(e),r.data=Vu.call(e,e.transformResponse,r),r.headers=kr.from(r.headers),r},function(r){return Kg(r)||(Zu(e),r&&r.response&&(r.response.data=Vu.call(e,e.transformResponse,r.response),r.response.headers=kr.from(r.response.headers))),Promise.reject(r)})}const ey=e=>e instanceof kr?{...e}:e;function ns(e,t){t=t||{};const n={};function r(c,u,d){return re.isPlainObject(c)&&re.isPlainObject(u)?re.merge.call({caseless:d},c,u):re.isPlainObject(u)?re.merge({},u):re.isArray(u)?u.slice():u}function i(c,u,d){if(re.isUndefined(u)){if(!re.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function s(c,u){if(!re.isUndefined(u))return r(void 0,u)}function o(c,u){if(re.isUndefined(u)){if(!re.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u)=>i(ey(c),ey(u),!0)};return re.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=l[u]||i,h=d(e[u],t[u],u);re.isUndefined(h)&&d!==a||(n[u]=h)}),n}const ty="1.6.8",Wu={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wu[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ny={};Wu.transitional=function(t,n,r){function i(s,o){return"[Axios v"+ty+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new ut(i(o," has been removed"+(n?" in "+n:"")),ut.ERR_DEPRECATED);return n&&!ny[o]&&(ny[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,a):!0}};function k$(e,t,n){if(typeof e!="object")throw new ut("options must be an object",ut.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new ut("option "+s+" must be "+l,ut.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ut("Unknown option "+s,ut.ERR_BAD_OPTION)}}const Hu={assertOptions:k$,validators:Wu},Gr=Hu.validators;let qa=class{constructor(t){this.defaults=t,this.interceptors={request:new zg,response:new zg}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
277
- `+s):r.stack=s}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ns(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Hu.assertOptions(r,{silentJSONParsing:Gr.transitional(Gr.boolean),forcedJSONParsing:Gr.transitional(Gr.boolean),clarifyTimeoutError:Gr.transitional(Gr.boolean)},!1),i!=null&&(re.isFunction(i)?n.paramsSerializer={serialize:i}:Hu.assertOptions(i,{encode:Gr.function,serialize:Gr.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&re.merge(s.common,s[n.method]);s&&re.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=kr.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const p=[Xg.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(d=0;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(y){m.call(this,y);break}}try{u=Xg.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=ns(this.defaults,t);const n=Jg(t.baseURL,t.url);return Vg(n,t.params,t.paramsSerializer)}};re.forEach(["delete","get","head","options"],function(t){qa.prototype[t]=function(n,r){return this.request(ns(r||{},{method:t,url:n,data:(r||{}).data}))}}),re.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(ns(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}qa.prototype[t]=n(),qa.prototype[t+"Form"]=n(!0)});const Ka=qa,C$=class Nw{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new Xs(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Nw(function(i){t=i}),cancel:t}}};function E$(e){return function(n){return e.apply(null,n)}}function S$(e){return re.isObject(e)&&e.isAxiosError===!0}const qu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(qu).forEach(([e,t])=>{qu[t]=e});const T$=qu;function ry(e){const t=new Ka(e),n=Sg(Ka.prototype.request,t);return re.extend(n,Ka.prototype,t,{allOwnKeys:!0}),re.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return ry(ns(e,i))},n}const Nt=ry(Fu);Nt.Axios=Ka,Nt.CanceledError=Xs,Nt.CancelToken=C$,Nt.isCancel=Kg,Nt.VERSION=ty,Nt.toFormData=Za,Nt.AxiosError=ut,Nt.Cancel=Nt.CanceledError,Nt.all=function(t){return Promise.all(t)},Nt.spread=E$,Nt.isAxiosError=S$,Nt.mergeConfig=ns,Nt.AxiosHeaders=kr,Nt.formToJSON=e=>Hg(re.isHTMLForm(e)?new FormData(e):e),Nt.getAdapter=Qg.getAdapter,Nt.HttpStatusCode=T$,Nt.default=Nt;const X=Nt,{Axios:O$,AxiosError:I$,CanceledError:P$,isCancel:A$,CancelToken:R$,VERSION:$$,all:M$,Cancel:L$,isAxiosError:D$,spread:N$,toFormData:j$,AxiosHeaders:U$,HttpStatusCode:F$,formToJSON:B$,getAdapter:V$,mergeConfig:z$}=X,Z$=Object.freeze(Object.defineProperty({__proto__:null,Axios:O$,AxiosError:I$,AxiosHeaders:U$,Cancel:L$,CancelToken:R$,CanceledError:P$,HttpStatusCode:F$,VERSION:$$,all:M$,default:X,formToJSON:B$,getAdapter:V$,isAxiosError:D$,isCancel:A$,mergeConfig:z$,spread:N$,toFormData:j$},Symbol.toStringTag,{value:"Module"}));var rs={};Object.defineProperty(rs,"__esModule",{value:!0});var W$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H$=typeof window<"u"&&typeof window.document<"u",q$=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,K$=(typeof self>"u"?"undefined":W$(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",J$=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),G$=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",iy=rs.isBrowser=H$;rs.isWebWorker=K$;var Ku=rs.isNode=q$;rs.isJsDom=J$,rs.isDeno=G$;var Y$=Object.create,sy=Object.defineProperty,Q$=Object.getOwnPropertyDescriptor,X$=Object.getOwnPropertyNames,eM=Object.getPrototypeOf,tM=Object.prototype.hasOwnProperty,oy=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),nM=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of X$(t))!tM.call(e,i)&&i!==n&&sy(e,i,{get:()=>t[i],enumerable:!(r=Q$(t,i))||r.enumerable});return e},ay=(e,t,n)=>(n=e!=null?Y$(eM(e)):{},nM(t||!e||!e.__esModule?sy(n,"default",{value:e,enumerable:!0}):n,e)),rM=oy(()=>{}),iM=oy(()=>{}),sM=ay(rM()),oM=ay(iM()),aM="https://api.botpress.cloud",lM=6e4,cM="BP_API_URL",uM="BP_BOT_ID",dM="BP_INTEGRATION_ID",fM="BP_WORKSPACE_ID",hM="BP_TOKEN";function pM(e){let t=mM(e),n={};t.workspaceId&&(n["x-workspace-id"]=t.workspaceId),t.botId&&(n["x-bot-id"]=t.botId),t.integrationId&&(n["x-integration-id"]=t.integrationId),t.token&&(n.Authorization=`Bearer ${t.token}`),n={...n,...t.headers};let r=t.apiUrl??aM,i=t.timeout??lM;return{apiUrl:r,timeout:i,withCredentials:iy,headers:n}}function mM(e){return iy?e:Ku?gM(e):e}function gM(e){let t={...e,apiUrl:e.apiUrl??process.env[cM],botId:e.botId??process.env[uM],integrationId:e.integrationId??process.env[dM],workspaceId:e.workspaceId??process.env[fM]},n=t.token??process.env[hM];return n&&(t.token=n),t}var ie="https://api.botpress.cloud".replace(/\/+$/,""),yM=class{constructor(t,n=ie,r=X){E(this,"configuration");this.basePath=n,this.axios=r,t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}},vM=class extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}},se="https://example.com",de=function(e,t,n){if(n==null)throw new vM(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function Ju(e,t,n=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>Ju(e,r,n)):Object.keys(t).forEach(r=>Ju(e,t[r],`${n}${n!==""?".":""}${r}`)):e.has(n)?e.append(n,t):e.set(n,t))}var oe=function(e,...t){let n=new URLSearchParams(e.search);Ju(n,t),e.search=n.toString()},Je=function(e,t,n){let r=typeof e!="string";return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},ae=function(e){return e.pathname+e.search+e.hash},le=function(e,t,n,r){return(i=t,s=n)=>{let o={...e.options,url:((r==null?void 0:r.basePath)||s)+e.url};return i.request(o)}},bM=function(e){return{addParticipant:async(t,n,r={})=>{de("addParticipant","id",t);let i="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},breakDownWorkspaceUsageByBot:async(t,n,r,i={})=>{de("breakDownWorkspaceUsageByBot","id",t),de("breakDownWorkspaceUsageByBot","type",n);let s="/v1/admin/workspaces/{id}/usages/by-bot".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.type=n),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},callAction:async(t,n={})=>{let r="/v1/chat/actions",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},changeAISpendQuota:async(t,n={})=>{let r="/v1/admin/quotas/ai-spend",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"PUT",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},changeWorkspacePlan:async(t,n,r={})=>{de("changeWorkspacePlan","id",t);let i="/v1/admin/workspaces/{id}/change-plan".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},chargeWorkspaceUnpaidInvoices:async(t,n,r={})=>{de("chargeWorkspaceUnpaidInvoices","id",t);let i="/v1/admin/workspaces/{id}/billing/invoices/charge-unpaid".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},checkHandleAvailability:async(t,n={})=>{let r="/v1/admin/workspaces/handle-availability",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"PUT",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},configureIntegration:async(t,n={})=>{let r="/v1/chat/integrations/configure",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createBot:async(t,n={})=>{let r="/v1/admin/bots",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createConversation:async(t,n={})=>{let r="/v1/chat/conversations",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createEvent:async(t,n={})=>{let r="/v1/chat/events",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createFile:async(t,n,r,i,s,o,a,l={})=>{de("createFile","xName",t);let c="/v1/files",u=new URL(c,se),d;e&&(d=e.baseOptions);let h={method:"POST",...d,...l},f={},p={};t!=null&&(f["x-name"]=String(t)),n!=null&&(f["x-tags"]=String(n)),r!=null&&(f["x-access-policies"]=String(r)),i!=null&&(f["x-index"]=String(i)),s!=null&&(f["Content-Type"]=String(s)),o!=null&&(f["Content-Length"]=String(o)),f["Content-Type"]="application/json",oe(u,p);let m=d&&d.headers?d.headers:{};return h.headers={...f,...m,...l.headers},h.data=Je(a,h,e),{url:ae(u),options:h}},createIntegration:async(t,n={})=>{let r="/v1/admin/integrations",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createMessage:async(t,n={})=>{let r="/v1/chat/messages",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createPersonalAccessToken:async(t,n={})=>{let r="/v1/admin/account/pats",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createTable:async(t,n={})=>{let r="/v1/tables",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createTableRows:async(t,n,r={})=>{de("createTableRows","table",t);let i="/v1/tables/{table}/rows".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},createTask:async(t,n={})=>{let r="/v1/chat/tasks",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createUser:async(t,n={})=>{let r="/v1/chat/users",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createWorkspace:async(t,n={})=>{let r="/v1/admin/workspaces",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createWorkspaceMember:async(t,n={})=>{let r="/v1/admin/workspace-members",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},deleteBot:async(t,n={})=>{de("deleteBot","id",t);let r="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteBotIssue:async(t,n,r={})=>{de("deleteBotIssue","id",t),de("deleteBotIssue","issueId",n);let i="/v1/admin/bots/{id}/issues/{issueId}".replace("{id}",encodeURIComponent(String(t))).replace("{issueId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"DELETE",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},deleteConversation:async(t,n={})=>{de("deleteConversation","id",t);let r="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteFile:async(t,n={})=>{de("deleteFile","id",t);let r="/v1/files/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteIntegration:async(t,n={})=>{de("deleteIntegration","id",t);let r="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteMessage:async(t,n={})=>{de("deleteMessage","id",t);let r="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deletePersonalAccessToken:async(t,n={})=>{de("deletePersonalAccessToken","id",t);let r="/v1/admin/account/pats/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteTable:async(t,n={})=>{de("deleteTable","table",t);let r="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteTableRows:async(t,n,r={})=>{de("deleteTableRows","table",t);let i="/v1/tables/{table}/rows/delete".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},deleteTask:async(t,n={})=>{de("deleteTask","id",t);let r="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteUser:async(t,n={})=>{de("deleteUser","id",t);let r="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteWorkspace:async(t,n={})=>{de("deleteWorkspace","id",t);let r="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteWorkspaceMember:async(t,n={})=>{de("deleteWorkspaceMember","id",t);let r="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},findTableRows:async(t,n,r={})=>{de("findTableRows","table",t);let i="/v1/tables/{table}/rows/find".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},getAccount:async(t={})=>{let n="/v1/admin/account/me",r=new URL(n,se),i;e&&(i=e.baseOptions);let s={method:"GET",...i,...t},o={};oe(r,{});let a=i&&i.headers?i.headers:{};return s.headers={...o,...a,...t.headers},{url:ae(r),options:s}},getAccountPreference:async(t,n={})=>{de("getAccountPreference","key",t);let r="/v1/admin/account/preferences/{key}".replace("{key}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getAllWorkspaceQuotaCompletion:async(t={})=>{let n="/v1/admin/workspaces/usages/quota-completion",r=new URL(n,se),i;e&&(i=e.baseOptions);let s={method:"GET",...i,...t},o={};oe(r,{});let a=i&&i.headers?i.headers:{};return s.headers={...o,...a,...t.headers},{url:ae(r),options:s}},getAuditRecords:async(t,n,r={})=>{de("getAuditRecords","id",t);let i="/v1/admin/workspaces/{id}/audit-records".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},getBot:async(t,n={})=>{de("getBot","id",t);let r="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getBotAnalytics:async(t,n,r,i={})=>{de("getBotAnalytics","id",t),de("getBotAnalytics","startDate",n),de("getBotAnalytics","endDate",r);let s="/v1/admin/bots/{id}/analytics".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.startDate=n),r!==void 0&&(u.endDate=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},getBotLogs:async(t,n,r,i,s={})=>{de("getBotLogs","id",t),de("getBotLogs","timeStart",n),de("getBotLogs","timeEnd",r);let o="/v1/admin/bots/{id}/logs".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};n!==void 0&&(d.timeStart=n),r!==void 0&&(d.timeEnd=r),i!==void 0&&(d.nextToken=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},getBotWebchat:async(t,n,r={})=>{de("getBotWebchat","id",t),de("getBotWebchat","type",n);let i="/v1/admin/bots/{id}/webchat".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.type=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},getConversation:async(t,n={})=>{de("getConversation","id",t);let r="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getEvent:async(t,n={})=>{de("getEvent","id",t);let r="/v1/chat/events/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getFileContent:async(t,n={})=>{de("getFileContent","id",t);let r="/v1/files/{id}/content".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getFileMetadata:async(t,n={})=>{de("getFileMetadata","id",t);let r="/v1/files/{id}/metadata".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getIntegration:async(t,n={})=>{de("getIntegration","id",t);let r="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getIntegrationByName:async(t,n,r={})=>{de("getIntegrationByName","name",t),de("getIntegrationByName","version",n);let i="/v1/admin/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(t))).replace("{version}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},getIntegrationLogs:async(t,n,r,i,s={})=>{de("getIntegrationLogs","id",t),de("getIntegrationLogs","timeStart",n),de("getIntegrationLogs","timeEnd",r);let o="/v1/admin/integrations/{id}/logs".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};n!==void 0&&(d.timeStart=n),r!==void 0&&(d.timeEnd=r),i!==void 0&&(d.nextToken=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},getMessage:async(t,n={})=>{de("getMessage","id",t);let r="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getOrCreateConversation:async(t,n={})=>{let r="/v1/chat/conversations/get-or-create",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},getOrCreateMessage:async(t,n={})=>{let r="/v1/chat/messages/get-or-create",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},getOrCreateUser:async(t,n={})=>{let r="/v1/chat/users/get-or-create",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},getOrSetState:async(t,n,r,i,s={})=>{de("getOrSetState","type",t),de("getOrSetState","id",n),de("getOrSetState","name",r);let o="/v1/chat/states/{type}/{id}/{name}/get-or-set".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"POST",...l,...s},u={},d={};u["Content-Type"]="application/json",oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},c.data=Je(i,c,e),{url:ae(a),options:c}},getParticipant:async(t,n,r={})=>{de("getParticipant","id",t),de("getParticipant","userId",n);let i="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(t))).replace("{userId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},getPublicIntegration:async(t,n,r={})=>{de("getPublicIntegration","name",t),de("getPublicIntegration","version",n);let i="/v1/admin/hub/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(t))).replace("{version}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},getPublicIntegrationById:async(t,n={})=>{de("getPublicIntegrationById","id",t);let r="/v1/admin/hub/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getPublicWorkspace:async(t,n={})=>{de("getPublicWorkspace","id",t);let r="/v1/admin/workspaces/{id}/public".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getState:async(t,n,r,i={})=>{de("getState","type",t),de("getState","id",n),de("getState","name",r);let s="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={};oe(o,{});let u=a&&a.headers?a.headers:{};return l.headers={...c,...u,...i.headers},{url:ae(o),options:l}},getTable:async(t,n={})=>{de("getTable","table",t);let r="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getTableRow:async(t,n,r={})=>{de("getTableRow","table",t),de("getTableRow","id",n);let i="/v1/tables/{table}/row".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.id=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},getTask:async(t,n={})=>{de("getTask","id",t);let r="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getUpcomingInvoice:async(t,n={})=>{de("getUpcomingInvoice","id",t);let r="/v1/admin/workspaces/{id}/billing/upcoming-invoice".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getUsage:async(t,n,r,i={})=>{de("getUsage","type",t),de("getUsage","id",n);let s="/v1/admin/usages/{id}".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.type=t),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},getUser:async(t,n={})=>{de("getUser","id",t);let r="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getWorkspace:async(t,n={})=>{de("getWorkspace","id",t);let r="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getWorkspaceBillingDetails:async(t,n={})=>{de("getWorkspaceBillingDetails","id",t);let r="/v1/admin/workspaces/{id}/billing/details".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getWorkspaceQuota:async(t,n,r,i={})=>{de("getWorkspaceQuota","id",t),de("getWorkspaceQuota","type",n);let s="/v1/admin/workspaces/{id}/quota".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.type=n),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},introspect:async(t,n={})=>{let r="/v1/admin/introspect",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},listActivities:async(t,n,r,i={})=>{de("listActivities","taskId",t),de("listActivities","botId",n);let s="/v1/admin/activities",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};r!==void 0&&(u.nextToken=r),t!==void 0&&(u.taskId=t),n!==void 0&&(u.botId=n),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listBotIssueEvents:async(t,n,r={})=>{de("listBotIssueEvents","id",t),de("listBotIssueEvents","issueId",n);let i="/v1/admin/bots/{id}/issues/{issueId}/events".replace("{id}",encodeURIComponent(String(t))).replace("{issueId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},listBotIssues:async(t,n,r={})=>{de("listBotIssues","id",t);let i="/v1/admin/bots/{id}/issues".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listBots:async(t,n,r={})=>{let i="/v1/admin/bots",s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};t!==void 0&&(c.dev=t),n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listConversations:async(t,n,r,i={})=>{let s="/v1/chat/conversations",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.tags=n),r&&(u.participantIds=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listEvents:async(t,n,r,i,s,o={})=>{let a="/v1/chat/events",l=new URL(a,se),c;e&&(c=e.baseOptions);let u={method:"GET",...c,...o},d={},h={};t!==void 0&&(h.nextToken=t),n!==void 0&&(h.type=n),r!==void 0&&(h.conversationId=r),i!==void 0&&(h.userId=i),s!==void 0&&(h.messageId=s),oe(l,h);let f=c&&c.headers?c.headers:{};return u.headers={...d,...f,...o.headers},{url:ae(l),options:u}},listFiles:async(t,n,r,i={})=>{de("listFiles","botId",t);let s="/v1/files/bot/{botId}".replace("{botId}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.nextToken=n),r!==void 0&&(u.tags=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listIntegrations:async(t,n,r,i,s={})=>{let o="/v1/admin/integrations",a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};t!==void 0&&(d.nextToken=t),n!==void 0&&(d.name=n),r!==void 0&&(d.version=r),i!==void 0&&(d.dev=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},listMessages:async(t,n,r,i={})=>{let s="/v1/chat/messages",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.conversationId=n),r!==void 0&&(u.tags=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listParticipants:async(t,n,r={})=>{de("listParticipants","id",t);let i="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listPersonalAccessTokens:async(t={})=>{let n="/v1/admin/account/pats",r=new URL(n,se),i;e&&(i=e.baseOptions);let s={method:"GET",...i,...t},o={};oe(r,{});let a=i&&i.headers?i.headers:{};return s.headers={...o,...a,...t.headers},{url:ae(r),options:s}},listPublicIntegrations:async(t,n,r,i={})=>{let s="/v1/admin/hub/integrations",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.name=n),r!==void 0&&(u.version=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listTables:async(t,n={})=>{let r="/v1/tables",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={},l={};t!==void 0&&(l.tags=t),oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:ae(i),options:o}},listTasks:async(t,n,r,i,s,o,a,l={})=>{let c="/v1/chat/tasks",u=new URL(c,se),d;e&&(d=e.baseOptions);let h={method:"GET",...d,...l},f={},p={};t!==void 0&&(p.nextToken=t),n!==void 0&&(p.tags=n),r!==void 0&&(p.conversationId=r),i!==void 0&&(p.userId=i),s!==void 0&&(p.parentTaskId=s),o&&(p.status=o),a!==void 0&&(p.type=a),oe(u,p);let m=d&&d.headers?d.headers:{};return h.headers={...f,...m,...l.headers},{url:ae(u),options:h}},listUsageHistory:async(t,n,r={})=>{de("listUsageHistory","type",t),de("listUsageHistory","id",n);let i="/v1/admin/usages/{id}/history".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};t!==void 0&&(c.type=t),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listUsers:async(t,n,r,i={})=>{let s="/v1/chat/users",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.conversationId=n),r!==void 0&&(u.tags=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listWorkspaceInvoices:async(t,n={})=>{de("listWorkspaceInvoices","id",t);let r="/v1/admin/workspaces/{id}/billing/invoices".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},listWorkspaceMembers:async(t,n={})=>{let r="/v1/admin/workspace-members",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={},l={};t!==void 0&&(l.nextToken=t),oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:ae(i),options:o}},listWorkspaceQuotas:async(t,n,r={})=>{de("listWorkspaceQuotas","id",t);let i="/v1/admin/workspaces/{id}/quotas".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.period=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listWorkspaceUsages:async(t,n,r,i={})=>{de("listWorkspaceUsages","id",t),de("listWorkspaceUsages","type",n);let s="/v1/admin/workspaces/{id}/usages".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.type=n),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listWorkspaces:async(t,n={})=>{let r="/v1/admin/workspaces",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={},l={};t!==void 0&&(l.nextToken=t),oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:ae(i),options:o}},patchState:async(t,n,r,i,s={})=>{de("patchState","type",t),de("patchState","id",n),de("patchState","name",r);let o="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"PATCH",...l,...s},u={},d={};u["Content-Type"]="application/json",oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},c.data=Je(i,c,e),{url:ae(a),options:c}},removeParticipant:async(t,n,r={})=>{de("removeParticipant","id",t),de("removeParticipant","userId",n);let i="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(t))).replace("{userId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"DELETE",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},renameTableColumn:async(t,n,r={})=>{de("renameTableColumn","table",t);let i="/v1/tables/{table}/column".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},runVrl:async(t,n={})=>{let r="/v1/admin/helper/vrl",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},searchFiles:async(t,n,r,i,s={})=>{de("searchFiles","botId",t),de("searchFiles","query",n);let o="/v1/files/bot/{botId}/search".replace("{botId}",encodeURIComponent(String(t))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};r!==void 0&&(d.tags=r),n!==void 0&&(d.query=n),i!==void 0&&(d.limit=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},setAccountPreference:async(t,n,r={})=>{de("setAccountPreference","key",t);let i="/v1/admin/account/preferences/{key}".replace("{key}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},setState:async(t,n,r,i,s={})=>{de("setState","type",t),de("setState","id",n),de("setState","name",r);let o="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"POST",...l,...s},u={},d={};u["Content-Type"]="application/json",oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},c.data=Je(i,c,e),{url:ae(a),options:c}},setWorkspacePaymentMethod:async(t,n,r={})=>{de("setWorkspacePaymentMethod","id",t);let i="/v1/admin/workspaces/{id}/billing/payment-method".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},transferBot:async(t,n,r={})=>{de("transferBot","id",t);let i="/v1/admin/bots/{id}/transfer".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateAccount:async(t,n={})=>{let r="/v1/admin/account/me",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"PUT",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},updateBot:async(t,n,r={})=>{de("updateBot","id",t);let i="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateConversation:async(t,n,r={})=>{de("updateConversation","id",t);let i="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateFileMetadata:async(t,n,r={})=>{de("updateFileMetadata","id",t);let i="/v1/files/{id}/metadata".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateIntegration:async(t,n,r={})=>{de("updateIntegration","id",t);let i="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateMessage:async(t,n,r={})=>{de("updateMessage","id",t);let i="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateTable:async(t,n,r={})=>{de("updateTable","table",t);let i="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateTableRows:async(t,n,r={})=>{de("updateTableRows","table",t);let i="/v1/tables/{table}/rows".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateTask:async(t,n,r={})=>{de("updateTask","id",t);let i="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateUser:async(t,n,r={})=>{de("updateUser","id",t);let i="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateWorkspace:async(t,n,r={})=>{de("updateWorkspace","id",t);let i="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateWorkspaceMember:async(t,n,r={})=>{de("updateWorkspaceMember","id",t);let i="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},upsertTableRows:async(t,n,r={})=>{de("upsertTableRows","table",t);let i="/v1/tables/{table}/rows/upsert".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}}}},ce=function(e){let t=bM(e);return{async addParticipant(n,r,i){let s=await t.addParticipant(n,r,i);return le(s,X,ie,e)},async breakDownWorkspaceUsageByBot(n,r,i,s){let o=await t.breakDownWorkspaceUsageByBot(n,r,i,s);return le(o,X,ie,e)},async callAction(n,r){let i=await t.callAction(n,r);return le(i,X,ie,e)},async changeAISpendQuota(n,r){let i=await t.changeAISpendQuota(n,r);return le(i,X,ie,e)},async changeWorkspacePlan(n,r,i){let s=await t.changeWorkspacePlan(n,r,i);return le(s,X,ie,e)},async chargeWorkspaceUnpaidInvoices(n,r,i){let s=await t.chargeWorkspaceUnpaidInvoices(n,r,i);return le(s,X,ie,e)},async checkHandleAvailability(n,r){let i=await t.checkHandleAvailability(n,r);return le(i,X,ie,e)},async configureIntegration(n,r){let i=await t.configureIntegration(n,r);return le(i,X,ie,e)},async createBot(n,r){let i=await t.createBot(n,r);return le(i,X,ie,e)},async createConversation(n,r){let i=await t.createConversation(n,r);return le(i,X,ie,e)},async createEvent(n,r){let i=await t.createEvent(n,r);return le(i,X,ie,e)},async createFile(n,r,i,s,o,a,l,c){let u=await t.createFile(n,r,i,s,o,a,l,c);return le(u,X,ie,e)},async createIntegration(n,r){let i=await t.createIntegration(n,r);return le(i,X,ie,e)},async createMessage(n,r){let i=await t.createMessage(n,r);return le(i,X,ie,e)},async createPersonalAccessToken(n,r){let i=await t.createPersonalAccessToken(n,r);return le(i,X,ie,e)},async createTable(n,r){let i=await t.createTable(n,r);return le(i,X,ie,e)},async createTableRows(n,r,i){let s=await t.createTableRows(n,r,i);return le(s,X,ie,e)},async createTask(n,r){let i=await t.createTask(n,r);return le(i,X,ie,e)},async createUser(n,r){let i=await t.createUser(n,r);return le(i,X,ie,e)},async createWorkspace(n,r){let i=await t.createWorkspace(n,r);return le(i,X,ie,e)},async createWorkspaceMember(n,r){let i=await t.createWorkspaceMember(n,r);return le(i,X,ie,e)},async deleteBot(n,r){let i=await t.deleteBot(n,r);return le(i,X,ie,e)},async deleteBotIssue(n,r,i){let s=await t.deleteBotIssue(n,r,i);return le(s,X,ie,e)},async deleteConversation(n,r){let i=await t.deleteConversation(n,r);return le(i,X,ie,e)},async deleteFile(n,r){let i=await t.deleteFile(n,r);return le(i,X,ie,e)},async deleteIntegration(n,r){let i=await t.deleteIntegration(n,r);return le(i,X,ie,e)},async deleteMessage(n,r){let i=await t.deleteMessage(n,r);return le(i,X,ie,e)},async deletePersonalAccessToken(n,r){let i=await t.deletePersonalAccessToken(n,r);return le(i,X,ie,e)},async deleteTable(n,r){let i=await t.deleteTable(n,r);return le(i,X,ie,e)},async deleteTableRows(n,r,i){let s=await t.deleteTableRows(n,r,i);return le(s,X,ie,e)},async deleteTask(n,r){let i=await t.deleteTask(n,r);return le(i,X,ie,e)},async deleteUser(n,r){let i=await t.deleteUser(n,r);return le(i,X,ie,e)},async deleteWorkspace(n,r){let i=await t.deleteWorkspace(n,r);return le(i,X,ie,e)},async deleteWorkspaceMember(n,r){let i=await t.deleteWorkspaceMember(n,r);return le(i,X,ie,e)},async findTableRows(n,r,i){let s=await t.findTableRows(n,r,i);return le(s,X,ie,e)},async getAccount(n){let r=await t.getAccount(n);return le(r,X,ie,e)},async getAccountPreference(n,r){let i=await t.getAccountPreference(n,r);return le(i,X,ie,e)},async getAllWorkspaceQuotaCompletion(n){let r=await t.getAllWorkspaceQuotaCompletion(n);return le(r,X,ie,e)},async getAuditRecords(n,r,i){let s=await t.getAuditRecords(n,r,i);return le(s,X,ie,e)},async getBot(n,r){let i=await t.getBot(n,r);return le(i,X,ie,e)},async getBotAnalytics(n,r,i,s){let o=await t.getBotAnalytics(n,r,i,s);return le(o,X,ie,e)},async getBotLogs(n,r,i,s,o){let a=await t.getBotLogs(n,r,i,s,o);return le(a,X,ie,e)},async getBotWebchat(n,r,i){let s=await t.getBotWebchat(n,r,i);return le(s,X,ie,e)},async getConversation(n,r){let i=await t.getConversation(n,r);return le(i,X,ie,e)},async getEvent(n,r){let i=await t.getEvent(n,r);return le(i,X,ie,e)},async getFileContent(n,r){let i=await t.getFileContent(n,r);return le(i,X,ie,e)},async getFileMetadata(n,r){let i=await t.getFileMetadata(n,r);return le(i,X,ie,e)},async getIntegration(n,r){let i=await t.getIntegration(n,r);return le(i,X,ie,e)},async getIntegrationByName(n,r,i){let s=await t.getIntegrationByName(n,r,i);return le(s,X,ie,e)},async getIntegrationLogs(n,r,i,s,o){let a=await t.getIntegrationLogs(n,r,i,s,o);return le(a,X,ie,e)},async getMessage(n,r){let i=await t.getMessage(n,r);return le(i,X,ie,e)},async getOrCreateConversation(n,r){let i=await t.getOrCreateConversation(n,r);return le(i,X,ie,e)},async getOrCreateMessage(n,r){let i=await t.getOrCreateMessage(n,r);return le(i,X,ie,e)},async getOrCreateUser(n,r){let i=await t.getOrCreateUser(n,r);return le(i,X,ie,e)},async getOrSetState(n,r,i,s,o){let a=await t.getOrSetState(n,r,i,s,o);return le(a,X,ie,e)},async getParticipant(n,r,i){let s=await t.getParticipant(n,r,i);return le(s,X,ie,e)},async getPublicIntegration(n,r,i){let s=await t.getPublicIntegration(n,r,i);return le(s,X,ie,e)},async getPublicIntegrationById(n,r){let i=await t.getPublicIntegrationById(n,r);return le(i,X,ie,e)},async getPublicWorkspace(n,r){let i=await t.getPublicWorkspace(n,r);return le(i,X,ie,e)},async getState(n,r,i,s){let o=await t.getState(n,r,i,s);return le(o,X,ie,e)},async getTable(n,r){let i=await t.getTable(n,r);return le(i,X,ie,e)},async getTableRow(n,r,i){let s=await t.getTableRow(n,r,i);return le(s,X,ie,e)},async getTask(n,r){let i=await t.getTask(n,r);return le(i,X,ie,e)},async getUpcomingInvoice(n,r){let i=await t.getUpcomingInvoice(n,r);return le(i,X,ie,e)},async getUsage(n,r,i,s){let o=await t.getUsage(n,r,i,s);return le(o,X,ie,e)},async getUser(n,r){let i=await t.getUser(n,r);return le(i,X,ie,e)},async getWorkspace(n,r){let i=await t.getWorkspace(n,r);return le(i,X,ie,e)},async getWorkspaceBillingDetails(n,r){let i=await t.getWorkspaceBillingDetails(n,r);return le(i,X,ie,e)},async getWorkspaceQuota(n,r,i,s){let o=await t.getWorkspaceQuota(n,r,i,s);return le(o,X,ie,e)},async introspect(n,r){let i=await t.introspect(n,r);return le(i,X,ie,e)},async listActivities(n,r,i,s){let o=await t.listActivities(n,r,i,s);return le(o,X,ie,e)},async listBotIssueEvents(n,r,i){let s=await t.listBotIssueEvents(n,r,i);return le(s,X,ie,e)},async listBotIssues(n,r,i){let s=await t.listBotIssues(n,r,i);return le(s,X,ie,e)},async listBots(n,r,i){let s=await t.listBots(n,r,i);return le(s,X,ie,e)},async listConversations(n,r,i,s){let o=await t.listConversations(n,r,i,s);return le(o,X,ie,e)},async listEvents(n,r,i,s,o,a){let l=await t.listEvents(n,r,i,s,o,a);return le(l,X,ie,e)},async listFiles(n,r,i,s){let o=await t.listFiles(n,r,i,s);return le(o,X,ie,e)},async listIntegrations(n,r,i,s,o){let a=await t.listIntegrations(n,r,i,s,o);return le(a,X,ie,e)},async listMessages(n,r,i,s){let o=await t.listMessages(n,r,i,s);return le(o,X,ie,e)},async listParticipants(n,r,i){let s=await t.listParticipants(n,r,i);return le(s,X,ie,e)},async listPersonalAccessTokens(n){let r=await t.listPersonalAccessTokens(n);return le(r,X,ie,e)},async listPublicIntegrations(n,r,i,s){let o=await t.listPublicIntegrations(n,r,i,s);return le(o,X,ie,e)},async listTables(n,r){let i=await t.listTables(n,r);return le(i,X,ie,e)},async listTasks(n,r,i,s,o,a,l,c){let u=await t.listTasks(n,r,i,s,o,a,l,c);return le(u,X,ie,e)},async listUsageHistory(n,r,i){let s=await t.listUsageHistory(n,r,i);return le(s,X,ie,e)},async listUsers(n,r,i,s){let o=await t.listUsers(n,r,i,s);return le(o,X,ie,e)},async listWorkspaceInvoices(n,r){let i=await t.listWorkspaceInvoices(n,r);return le(i,X,ie,e)},async listWorkspaceMembers(n,r){let i=await t.listWorkspaceMembers(n,r);return le(i,X,ie,e)},async listWorkspaceQuotas(n,r,i){let s=await t.listWorkspaceQuotas(n,r,i);return le(s,X,ie,e)},async listWorkspaceUsages(n,r,i,s){let o=await t.listWorkspaceUsages(n,r,i,s);return le(o,X,ie,e)},async listWorkspaces(n,r){let i=await t.listWorkspaces(n,r);return le(i,X,ie,e)},async patchState(n,r,i,s,o){let a=await t.patchState(n,r,i,s,o);return le(a,X,ie,e)},async removeParticipant(n,r,i){let s=await t.removeParticipant(n,r,i);return le(s,X,ie,e)},async renameTableColumn(n,r,i){let s=await t.renameTableColumn(n,r,i);return le(s,X,ie,e)},async runVrl(n,r){let i=await t.runVrl(n,r);return le(i,X,ie,e)},async searchFiles(n,r,i,s,o){let a=await t.searchFiles(n,r,i,s,o);return le(a,X,ie,e)},async setAccountPreference(n,r,i){let s=await t.setAccountPreference(n,r,i);return le(s,X,ie,e)},async setState(n,r,i,s,o){let a=await t.setState(n,r,i,s,o);return le(a,X,ie,e)},async setWorkspacePaymentMethod(n,r,i){let s=await t.setWorkspacePaymentMethod(n,r,i);return le(s,X,ie,e)},async transferBot(n,r,i){let s=await t.transferBot(n,r,i);return le(s,X,ie,e)},async updateAccount(n,r){let i=await t.updateAccount(n,r);return le(i,X,ie,e)},async updateBot(n,r,i){let s=await t.updateBot(n,r,i);return le(s,X,ie,e)},async updateConversation(n,r,i){let s=await t.updateConversation(n,r,i);return le(s,X,ie,e)},async updateFileMetadata(n,r,i){let s=await t.updateFileMetadata(n,r,i);return le(s,X,ie,e)},async updateIntegration(n,r,i){let s=await t.updateIntegration(n,r,i);return le(s,X,ie,e)},async updateMessage(n,r,i){let s=await t.updateMessage(n,r,i);return le(s,X,ie,e)},async updateTable(n,r,i){let s=await t.updateTable(n,r,i);return le(s,X,ie,e)},async updateTableRows(n,r,i){let s=await t.updateTableRows(n,r,i);return le(s,X,ie,e)},async updateTask(n,r,i){let s=await t.updateTask(n,r,i);return le(s,X,ie,e)},async updateUser(n,r,i){let s=await t.updateUser(n,r,i);return le(s,X,ie,e)},async updateWorkspace(n,r,i){let s=await t.updateWorkspace(n,r,i);return le(s,X,ie,e)},async updateWorkspaceMember(n,r,i){let s=await t.updateWorkspaceMember(n,r,i);return le(s,X,ie,e)},async upsertTableRows(n,r,i){let s=await t.upsertTableRows(n,r,i);return le(s,X,ie,e)}}},wM=class extends yM{addParticipant(t,n){return ce(this.configuration).addParticipant(t.id,t.addParticipantBody,n).then(r=>r(this.axios,this.basePath))}breakDownWorkspaceUsageByBot(t,n){return ce(this.configuration).breakDownWorkspaceUsageByBot(t.id,t.type,t.period,n).then(r=>r(this.axios,this.basePath))}callAction(t={},n){return ce(this.configuration).callAction(t.callActionBody,n).then(r=>r(this.axios,this.basePath))}changeAISpendQuota(t={},n){return ce(this.configuration).changeAISpendQuota(t.changeAISpendQuotaBody,n).then(r=>r(this.axios,this.basePath))}changeWorkspacePlan(t,n){return ce(this.configuration).changeWorkspacePlan(t.id,t.changeWorkspacePlanBody,n).then(r=>r(this.axios,this.basePath))}chargeWorkspaceUnpaidInvoices(t,n){return ce(this.configuration).chargeWorkspaceUnpaidInvoices(t.id,t.chargeWorkspaceUnpaidInvoicesBody,n).then(r=>r(this.axios,this.basePath))}checkHandleAvailability(t={},n){return ce(this.configuration).checkHandleAvailability(t.checkHandleAvailabilityBody,n).then(r=>r(this.axios,this.basePath))}configureIntegration(t={},n){return ce(this.configuration).configureIntegration(t.configureIntegrationBody,n).then(r=>r(this.axios,this.basePath))}createBot(t={},n){return ce(this.configuration).createBot(t.createBotBody,n).then(r=>r(this.axios,this.basePath))}createConversation(t={},n){return ce(this.configuration).createConversation(t.createConversationBody,n).then(r=>r(this.axios,this.basePath))}createEvent(t={},n){return ce(this.configuration).createEvent(t.createEventBody,n).then(r=>r(this.axios,this.basePath))}createFile(t,n){return ce(this.configuration).createFile(t.xName,t.xTags,t.xAccessPolicies,t.xIndex,t.contentType,t.contentLength,t.createFileBody,n).then(r=>r(this.axios,this.basePath))}createIntegration(t={},n){return ce(this.configuration).createIntegration(t.createIntegrationBody,n).then(r=>r(this.axios,this.basePath))}createMessage(t={},n){return ce(this.configuration).createMessage(t.createMessageBody,n).then(r=>r(this.axios,this.basePath))}createPersonalAccessToken(t={},n){return ce(this.configuration).createPersonalAccessToken(t.createPersonalAccessTokenBody,n).then(r=>r(this.axios,this.basePath))}createTable(t={},n){return ce(this.configuration).createTable(t.createTableBody,n).then(r=>r(this.axios,this.basePath))}createTableRows(t,n){return ce(this.configuration).createTableRows(t.table,t.createTableRowsBody,n).then(r=>r(this.axios,this.basePath))}createTask(t={},n){return ce(this.configuration).createTask(t.createTaskBody,n).then(r=>r(this.axios,this.basePath))}createUser(t={},n){return ce(this.configuration).createUser(t.createUserBody,n).then(r=>r(this.axios,this.basePath))}createWorkspace(t={},n){return ce(this.configuration).createWorkspace(t.createWorkspaceBody,n).then(r=>r(this.axios,this.basePath))}createWorkspaceMember(t={},n){return ce(this.configuration).createWorkspaceMember(t.createWorkspaceMemberBody,n).then(r=>r(this.axios,this.basePath))}deleteBot(t,n){return ce(this.configuration).deleteBot(t.id,n).then(r=>r(this.axios,this.basePath))}deleteBotIssue(t,n){return ce(this.configuration).deleteBotIssue(t.id,t.issueId,n).then(r=>r(this.axios,this.basePath))}deleteConversation(t,n){return ce(this.configuration).deleteConversation(t.id,n).then(r=>r(this.axios,this.basePath))}deleteFile(t,n){return ce(this.configuration).deleteFile(t.id,n).then(r=>r(this.axios,this.basePath))}deleteIntegration(t,n){return ce(this.configuration).deleteIntegration(t.id,n).then(r=>r(this.axios,this.basePath))}deleteMessage(t,n){return ce(this.configuration).deleteMessage(t.id,n).then(r=>r(this.axios,this.basePath))}deletePersonalAccessToken(t,n){return ce(this.configuration).deletePersonalAccessToken(t.id,n).then(r=>r(this.axios,this.basePath))}deleteTable(t,n){return ce(this.configuration).deleteTable(t.table,n).then(r=>r(this.axios,this.basePath))}deleteTableRows(t,n){return ce(this.configuration).deleteTableRows(t.table,t.deleteTableRowsBody,n).then(r=>r(this.axios,this.basePath))}deleteTask(t,n){return ce(this.configuration).deleteTask(t.id,n).then(r=>r(this.axios,this.basePath))}deleteUser(t,n){return ce(this.configuration).deleteUser(t.id,n).then(r=>r(this.axios,this.basePath))}deleteWorkspace(t,n){return ce(this.configuration).deleteWorkspace(t.id,n).then(r=>r(this.axios,this.basePath))}deleteWorkspaceMember(t,n){return ce(this.configuration).deleteWorkspaceMember(t.id,n).then(r=>r(this.axios,this.basePath))}findTableRows(t,n){return ce(this.configuration).findTableRows(t.table,t.findTableRowsBody,n).then(r=>r(this.axios,this.basePath))}getAccount(t){return ce(this.configuration).getAccount(t).then(n=>n(this.axios,this.basePath))}getAccountPreference(t,n){return ce(this.configuration).getAccountPreference(t.key,n).then(r=>r(this.axios,this.basePath))}getAllWorkspaceQuotaCompletion(t){return ce(this.configuration).getAllWorkspaceQuotaCompletion(t).then(n=>n(this.axios,this.basePath))}getAuditRecords(t,n){return ce(this.configuration).getAuditRecords(t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}getBot(t,n){return ce(this.configuration).getBot(t.id,n).then(r=>r(this.axios,this.basePath))}getBotAnalytics(t,n){return ce(this.configuration).getBotAnalytics(t.id,t.startDate,t.endDate,n).then(r=>r(this.axios,this.basePath))}getBotLogs(t,n){return ce(this.configuration).getBotLogs(t.id,t.timeStart,t.timeEnd,t.nextToken,n).then(r=>r(this.axios,this.basePath))}getBotWebchat(t,n){return ce(this.configuration).getBotWebchat(t.id,t.type,n).then(r=>r(this.axios,this.basePath))}getConversation(t,n){return ce(this.configuration).getConversation(t.id,n).then(r=>r(this.axios,this.basePath))}getEvent(t,n){return ce(this.configuration).getEvent(t.id,n).then(r=>r(this.axios,this.basePath))}getFileContent(t,n){return ce(this.configuration).getFileContent(t.id,n).then(r=>r(this.axios,this.basePath))}getFileMetadata(t,n){return ce(this.configuration).getFileMetadata(t.id,n).then(r=>r(this.axios,this.basePath))}getIntegration(t,n){return ce(this.configuration).getIntegration(t.id,n).then(r=>r(this.axios,this.basePath))}getIntegrationByName(t,n){return ce(this.configuration).getIntegrationByName(t.name,t.version,n).then(r=>r(this.axios,this.basePath))}getIntegrationLogs(t,n){return ce(this.configuration).getIntegrationLogs(t.id,t.timeStart,t.timeEnd,t.nextToken,n).then(r=>r(this.axios,this.basePath))}getMessage(t,n){return ce(this.configuration).getMessage(t.id,n).then(r=>r(this.axios,this.basePath))}getOrCreateConversation(t={},n){return ce(this.configuration).getOrCreateConversation(t.getOrCreateConversationBody,n).then(r=>r(this.axios,this.basePath))}getOrCreateMessage(t={},n){return ce(this.configuration).getOrCreateMessage(t.getOrCreateMessageBody,n).then(r=>r(this.axios,this.basePath))}getOrCreateUser(t={},n){return ce(this.configuration).getOrCreateUser(t.getOrCreateUserBody,n).then(r=>r(this.axios,this.basePath))}getOrSetState(t,n){return ce(this.configuration).getOrSetState(t.type,t.id,t.name,t.getOrSetStateBody,n).then(r=>r(this.axios,this.basePath))}getParticipant(t,n){return ce(this.configuration).getParticipant(t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}getPublicIntegration(t,n){return ce(this.configuration).getPublicIntegration(t.name,t.version,n).then(r=>r(this.axios,this.basePath))}getPublicIntegrationById(t,n){return ce(this.configuration).getPublicIntegrationById(t.id,n).then(r=>r(this.axios,this.basePath))}getPublicWorkspace(t,n){return ce(this.configuration).getPublicWorkspace(t.id,n).then(r=>r(this.axios,this.basePath))}getState(t,n){return ce(this.configuration).getState(t.type,t.id,t.name,n).then(r=>r(this.axios,this.basePath))}getTable(t,n){return ce(this.configuration).getTable(t.table,n).then(r=>r(this.axios,this.basePath))}getTableRow(t,n){return ce(this.configuration).getTableRow(t.table,t.id,n).then(r=>r(this.axios,this.basePath))}getTask(t,n){return ce(this.configuration).getTask(t.id,n).then(r=>r(this.axios,this.basePath))}getUpcomingInvoice(t,n){return ce(this.configuration).getUpcomingInvoice(t.id,n).then(r=>r(this.axios,this.basePath))}getUsage(t,n){return ce(this.configuration).getUsage(t.type,t.id,t.period,n).then(r=>r(this.axios,this.basePath))}getUser(t,n){return ce(this.configuration).getUser(t.id,n).then(r=>r(this.axios,this.basePath))}getWorkspace(t,n){return ce(this.configuration).getWorkspace(t.id,n).then(r=>r(this.axios,this.basePath))}getWorkspaceBillingDetails(t,n){return ce(this.configuration).getWorkspaceBillingDetails(t.id,n).then(r=>r(this.axios,this.basePath))}getWorkspaceQuota(t,n){return ce(this.configuration).getWorkspaceQuota(t.id,t.type,t.period,n).then(r=>r(this.axios,this.basePath))}introspect(t={},n){return ce(this.configuration).introspect(t.introspectBody,n).then(r=>r(this.axios,this.basePath))}listActivities(t,n){return ce(this.configuration).listActivities(t.taskId,t.botId,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listBotIssueEvents(t,n){return ce(this.configuration).listBotIssueEvents(t.id,t.issueId,n).then(r=>r(this.axios,this.basePath))}listBotIssues(t,n){return ce(this.configuration).listBotIssues(t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listBots(t={},n){return ce(this.configuration).listBots(t.dev,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listConversations(t={},n){return ce(this.configuration).listConversations(t.nextToken,t.tags,t.participantIds,n).then(r=>r(this.axios,this.basePath))}listEvents(t={},n){return ce(this.configuration).listEvents(t.nextToken,t.type,t.conversationId,t.userId,t.messageId,n).then(r=>r(this.axios,this.basePath))}listFiles(t,n){return ce(this.configuration).listFiles(t.botId,t.nextToken,t.tags,n).then(r=>r(this.axios,this.basePath))}listIntegrations(t={},n){return ce(this.configuration).listIntegrations(t.nextToken,t.name,t.version,t.dev,n).then(r=>r(this.axios,this.basePath))}listMessages(t={},n){return ce(this.configuration).listMessages(t.nextToken,t.conversationId,t.tags,n).then(r=>r(this.axios,this.basePath))}listParticipants(t,n){return ce(this.configuration).listParticipants(t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listPersonalAccessTokens(t){return ce(this.configuration).listPersonalAccessTokens(t).then(n=>n(this.axios,this.basePath))}listPublicIntegrations(t={},n){return ce(this.configuration).listPublicIntegrations(t.nextToken,t.name,t.version,n).then(r=>r(this.axios,this.basePath))}listTables(t={},n){return ce(this.configuration).listTables(t.tags,n).then(r=>r(this.axios,this.basePath))}listTasks(t={},n){return ce(this.configuration).listTasks(t.nextToken,t.tags,t.conversationId,t.userId,t.parentTaskId,t.status,t.type,n).then(r=>r(this.axios,this.basePath))}listUsageHistory(t,n){return ce(this.configuration).listUsageHistory(t.type,t.id,n).then(r=>r(this.axios,this.basePath))}listUsers(t={},n){return ce(this.configuration).listUsers(t.nextToken,t.conversationId,t.tags,n).then(r=>r(this.axios,this.basePath))}listWorkspaceInvoices(t,n){return ce(this.configuration).listWorkspaceInvoices(t.id,n).then(r=>r(this.axios,this.basePath))}listWorkspaceMembers(t={},n){return ce(this.configuration).listWorkspaceMembers(t.nextToken,n).then(r=>r(this.axios,this.basePath))}listWorkspaceQuotas(t,n){return ce(this.configuration).listWorkspaceQuotas(t.id,t.period,n).then(r=>r(this.axios,this.basePath))}listWorkspaceUsages(t,n){return ce(this.configuration).listWorkspaceUsages(t.id,t.type,t.period,n).then(r=>r(this.axios,this.basePath))}listWorkspaces(t={},n){return ce(this.configuration).listWorkspaces(t.nextToken,n).then(r=>r(this.axios,this.basePath))}patchState(t,n){return ce(this.configuration).patchState(t.type,t.id,t.name,t.patchStateBody,n).then(r=>r(this.axios,this.basePath))}removeParticipant(t,n){return ce(this.configuration).removeParticipant(t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}renameTableColumn(t,n){return ce(this.configuration).renameTableColumn(t.table,t.renameTableColumnBody,n).then(r=>r(this.axios,this.basePath))}runVrl(t={},n){return ce(this.configuration).runVrl(t.runVrlBody,n).then(r=>r(this.axios,this.basePath))}searchFiles(t,n){return ce(this.configuration).searchFiles(t.botId,t.query,t.tags,t.limit,n).then(r=>r(this.axios,this.basePath))}setAccountPreference(t,n){return ce(this.configuration).setAccountPreference(t.key,t.setAccountPreferenceBody,n).then(r=>r(this.axios,this.basePath))}setState(t,n){return ce(this.configuration).setState(t.type,t.id,t.name,t.setStateBody,n).then(r=>r(this.axios,this.basePath))}setWorkspacePaymentMethod(t,n){return ce(this.configuration).setWorkspacePaymentMethod(t.id,t.setWorkspacePaymentMethodBody,n).then(r=>r(this.axios,this.basePath))}transferBot(t,n){return ce(this.configuration).transferBot(t.id,t.transferBotBody,n).then(r=>r(this.axios,this.basePath))}updateAccount(t={},n){return ce(this.configuration).updateAccount(t.updateAccountBody,n).then(r=>r(this.axios,this.basePath))}updateBot(t,n){return ce(this.configuration).updateBot(t.id,t.updateBotBody,n).then(r=>r(this.axios,this.basePath))}updateConversation(t,n){return ce(this.configuration).updateConversation(t.id,t.updateConversationBody,n).then(r=>r(this.axios,this.basePath))}updateFileMetadata(t,n){return ce(this.configuration).updateFileMetadata(t.id,t.updateFileMetadataBody,n).then(r=>r(this.axios,this.basePath))}updateIntegration(t,n){return ce(this.configuration).updateIntegration(t.id,t.updateIntegrationBody,n).then(r=>r(this.axios,this.basePath))}updateMessage(t,n){return ce(this.configuration).updateMessage(t.id,t.updateMessageBody,n).then(r=>r(this.axios,this.basePath))}updateTable(t,n){return ce(this.configuration).updateTable(t.table,t.updateTableBody,n).then(r=>r(this.axios,this.basePath))}updateTableRows(t,n){return ce(this.configuration).updateTableRows(t.table,t.updateTableRowsBody,n).then(r=>r(this.axios,this.basePath))}updateTask(t,n){return ce(this.configuration).updateTask(t.id,t.updateTaskBody,n).then(r=>r(this.axios,this.basePath))}updateUser(t,n){return ce(this.configuration).updateUser(t.id,t.updateUserBody,n).then(r=>r(this.axios,this.basePath))}updateWorkspace(t,n){return ce(this.configuration).updateWorkspace(t.id,t.updateWorkspaceBody,n).then(r=>r(this.axios,this.basePath))}updateWorkspaceMember(t,n){return ce(this.configuration).updateWorkspaceMember(t.id,t.updateWorkspaceMemberBody,n).then(r=>r(this.axios,this.basePath))}upsertTableRows(t,n){return ce(this.configuration).upsertTableRows(t.table,t.upsertTableRowsBody,n).then(r=>r(this.axios,this.basePath))}},xM={getRandomValues:e=>new Uint8Array(e.map(()=>Math.floor(Math.random()*256)))},Gu=typeof window<"u"&&typeof window.document<"u"?window.crypto:$u;Gu.getRandomValues||(Gu=xM);var kt=class extends Error{constructor(n,r,i,s,o,a){super(s);E(this,"isApiError",!0);this.code=n,this.description=r,this.type=i,this.message=s,this.error=o,this.id=a,this.id||(this.id=kt.generateId())}format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){let n=this.getPrefix(),r=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],i=4,s=Array.from(Gu.getRandomValues(new Uint8Array(i))).map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase();return`${n}_${r}x${s}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}},_M=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,ly=e=>e instanceof kt||_M(e)&&e.isApiError===!0,is=class extends kt{constructor(e,t,n){super(500,"An unknown error occurred","Unknown",e,t,n)}},cy=class extends kt{constructor(t,n,r){super(500,"An internal error occurred","Internal",t,n,r)}},uy=class extends kt{constructor(e,t,n){super(401,"The request requires to be authenticated.","Unauthorized",e,t,n)}},dy=class extends kt{constructor(t,n,r){super(403,"The requested action can't be peform by this resource.","Forbidden",t,n,r)}},fy=class extends kt{constructor(t,n,r){super(413,"The request payload is too large.","PayloadTooLarge",t,n,r)}},hy=class extends kt{constructor(t,n,r){super(400,"The request payload is invalid.","InvalidPayload",t,n,r)}},py=class extends kt{constructor(t,n,r){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,n,r)}},my=class extends kt{constructor(t,n,r){super(405,"The requested method does not exist.","MethodNotFound",t,n,r)}},gy=class extends kt{constructor(t,n,r){super(404,"The requested resource does not exist.","ResourceNotFound",t,n,r)}},yy=class extends kt{constructor(t,n,r){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,n,r)}},vy=class extends kt{constructor(t,n,r){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,n,r)}},by=class extends kt{constructor(t,n,r){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",t,n,r)}},wy=class extends kt{constructor(e,t,n){super(409,"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together.","RelationConflict",e,t,n)}},xy=class extends kt{constructor(t,n,r){super(409,"The resource cannot be deleted because it's referenced by another resource","ReferenceConstraint",t,n,r)}},_y=class extends kt{constructor(t,n,r){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,n,r)}},ky=class extends kt{constructor(t,n,r){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,n,r)}},Cy=class extends kt{constructor(t,n,r){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,n,r)}},Ey=class extends kt{constructor(t,n,r){super(409,"The record attempted to be created already exists.","AlreadyExists",t,n,r)}},Sy=class extends kt{constructor(t,n,r){super(429,"The request has been rate limited.","RateLimited",t,n,r)}},Ty=class extends kt{constructor(t,n,r){super(402,"A payment is required to perform this request.","PaymentRequired",t,n,r)}},Oy=class extends kt{constructor(t,n,r){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",t,n,r)}},Iy=class extends kt{constructor(t,n,r){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",t,n,r)}},kM={Unknown:is,Internal:cy,Unauthorized:uy,Forbidden:dy,PayloadTooLarge:fy,InvalidPayload:hy,UnsupportedMediaType:py,MethodNotFound:my,ResourceNotFound:gy,InvalidJsonSchema:yy,InvalidDataFormat:vy,InvalidIdentifier:by,RelationConflict:wy,ReferenceConstraint:xy,ReferenceNotFound:_y,InvalidQuery:ky,Runtime:Cy,AlreadyExists:Ey,RateLimited:Sy,PaymentRequired:Ty,QuotaExceeded:Oy,LimitExceeded:Iy},eo=e=>ly(e)?e:e instanceof Error?new is(e.message,e):typeof e=="string"?new is(e):CM(e);function CM(e){if(typeof e=="object"&&"code"in e&&"type"in e&&"id"in e&&"message"in e&&typeof e.type=="string"&&typeof e.message=="string"){let t=kM[e.type];return t?new t(e.message,void 0,e.id||"UNKNOWN"):new is(`An unclassified API error occurred: ${e.message} (Type: ${e.type}, Code: ${e.code})`)}return new is("An invalid error occurred: "+JSON.stringify(e))}var EM=class{constructor(t,n,r){E(this,"_innerClient");E(this,"createConversation",t=>this._innerClient.createConversation({createConversationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getConversation",t=>this._innerClient.getConversation(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listConversations",t=>this._innerClient.listConversations(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getOrCreateConversation",t=>this._innerClient.getOrCreateConversation({getOrCreateConversationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateConversation",({id:t,...n})=>this._innerClient.updateConversation({id:t,updateConversationBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteConversation",t=>this._innerClient.deleteConversation(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listParticipants",t=>this._innerClient.listParticipants(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"addParticipant",({id:t,...n})=>this._innerClient.addParticipant({id:t,addParticipantBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"getParticipant",t=>this._innerClient.getParticipant(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"removeParticipant",t=>this._innerClient.removeParticipant(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createEvent",t=>this._innerClient.createEvent({createEventBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getEvent",t=>this._innerClient.getEvent(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listEvents",t=>this._innerClient.listEvents(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createMessage",t=>this._innerClient.createMessage({createMessageBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getOrCreateMessage",t=>this._innerClient.getOrCreateMessage({getOrCreateMessageBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getMessage",t=>this._innerClient.getMessage(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateMessage",({id:t,...n})=>this._innerClient.updateMessage({id:t,updateMessageBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listMessages",t=>this._innerClient.listMessages(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteMessage",t=>this._innerClient.deleteMessage(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createUser",t=>this._innerClient.createUser({createUserBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getUser",t=>this._innerClient.getUser(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listUsers",t=>this._innerClient.listUsers(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getOrCreateUser",t=>this._innerClient.getOrCreateUser({getOrCreateUserBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateUser",({id:t,...n})=>this._innerClient.updateUser({id:t,updateUserBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteUser",t=>this._innerClient.deleteUser(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getState",t=>this._innerClient.getState(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"setState",({type:t,id:n,name:r,...i})=>this._innerClient.setState({type:t,id:n,name:r,setStateBody:i}).then(s=>s.data).catch(s=>{throw ue(s)}));E(this,"getOrSetState",({type:t,id:n,name:r,...i})=>this._innerClient.getOrSetState({type:t,id:n,name:r,getOrSetStateBody:i}).then(s=>s.data).catch(s=>{throw ue(s)}));E(this,"patchState",({type:t,id:n,name:r,...i})=>this._innerClient.patchState({type:t,id:n,name:r,patchStateBody:i}).then(s=>s.data).catch(s=>{throw ue(s)}));E(this,"callAction",t=>this._innerClient.callAction({callActionBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"configureIntegration",t=>this._innerClient.configureIntegration({configureIntegrationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getTask",t=>this._innerClient.getTask(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createTask",t=>this._innerClient.createTask({createTaskBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateTask",({id:t,...n})=>this._innerClient.updateTask({id:t,updateTaskBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteTask",t=>this._innerClient.deleteTask(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listTasks",t=>this._innerClient.listTasks(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"runVrl",t=>this._innerClient.runVrl({runVrlBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getAccount",()=>this._innerClient.getAccount().then(t=>t.data).catch(t=>{throw ue(t)}));E(this,"updateAccount",t=>this._innerClient.updateAccount({updateAccountBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listPersonalAccessTokens",()=>this._innerClient.listPersonalAccessTokens().then(t=>t.data).catch(t=>{throw ue(t)}));E(this,"createPersonalAccessToken",t=>this._innerClient.createPersonalAccessToken({createPersonalAccessTokenBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deletePersonalAccessToken",t=>this._innerClient.deletePersonalAccessToken(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"setAccountPreference",({key:t,...n})=>this._innerClient.setAccountPreference({key:t,setAccountPreferenceBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"getAccountPreference",t=>this._innerClient.getAccountPreference(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listPublicIntegrations",t=>this._innerClient.listPublicIntegrations(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getPublicIntegrationById",t=>this._innerClient.getPublicIntegrationById(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getPublicIntegration",t=>this._innerClient.getPublicIntegration(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createBot",t=>this._innerClient.createBot({createBotBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateBot",({id:t,...n})=>this._innerClient.updateBot({id:t,updateBotBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"transferBot",({id:t,...n})=>this._innerClient.transferBot({id:t,transferBotBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listBots",t=>this._innerClient.listBots(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBot",t=>this._innerClient.getBot(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteBot",t=>this._innerClient.deleteBot(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBotLogs",t=>this._innerClient.getBotLogs(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBotWebchat",t=>this._innerClient.getBotWebchat(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBotAnalytics",t=>this._innerClient.getBotAnalytics(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listBotIssues",t=>this._innerClient.listBotIssues(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteBotIssue",t=>this._innerClient.deleteBotIssue(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listBotIssueEvents",t=>this._innerClient.listBotIssueEvents(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getWorkspaceBillingDetails",t=>this._innerClient.getWorkspaceBillingDetails(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"setWorkspacePaymentMethod",({id:t,...n})=>this._innerClient.setWorkspacePaymentMethod({id:t,setWorkspacePaymentMethodBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listWorkspaceInvoices",t=>this._innerClient.listWorkspaceInvoices(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getUpcomingInvoice",t=>this._innerClient.getUpcomingInvoice(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"chargeWorkspaceUnpaidInvoices",({id:t,...n})=>this._innerClient.chargeWorkspaceUnpaidInvoices({id:t,chargeWorkspaceUnpaidInvoicesBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"createWorkspace",t=>this._innerClient.createWorkspace({createWorkspaceBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getPublicWorkspace",t=>this._innerClient.getPublicWorkspace(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getWorkspace",t=>this._innerClient.getWorkspace(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaceUsages",t=>this._innerClient.listWorkspaceUsages(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"breakDownWorkspaceUsageByBot",t=>this._innerClient.breakDownWorkspaceUsageByBot(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getAllWorkspaceQuotaCompletion",()=>this._innerClient.getAllWorkspaceQuotaCompletion().then(t=>t.data).catch(t=>{throw ue(t)}));E(this,"getWorkspaceQuota",t=>this._innerClient.getWorkspaceQuota(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaceQuotas",t=>this._innerClient.listWorkspaceQuotas(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateWorkspace",({id:t,...n})=>this._innerClient.updateWorkspace({id:t,updateWorkspaceBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"checkHandleAvailability",t=>this._innerClient.checkHandleAvailability({checkHandleAvailabilityBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaces",t=>this._innerClient.listWorkspaces(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"changeWorkspacePlan",({id:t,...n})=>this._innerClient.changeWorkspacePlan({id:t,changeWorkspacePlanBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteWorkspace",t=>this._innerClient.deleteWorkspace(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getAuditRecords",t=>this._innerClient.getAuditRecords(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaceMembers",t=>this._innerClient.listWorkspaceMembers(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteWorkspaceMember",t=>this._innerClient.deleteWorkspaceMember(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createWorkspaceMember",t=>this._innerClient.createWorkspaceMember({createWorkspaceMemberBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateWorkspaceMember",({id:t,...n})=>this._innerClient.updateWorkspaceMember({id:t,updateWorkspaceMemberBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"createIntegration",t=>this._innerClient.createIntegration({createIntegrationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateIntegration",({id:t,...n})=>this._innerClient.updateIntegration({id:t,updateIntegrationBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listIntegrations",t=>this._innerClient.listIntegrations(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getIntegration",t=>this._innerClient.getIntegration(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getIntegrationLogs",t=>this._innerClient.getIntegrationLogs(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getIntegrationByName",t=>this._innerClient.getIntegrationByName(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteIntegration",t=>this._innerClient.deleteIntegration(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getUsage",t=>this._innerClient.getUsage(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listUsageHistory",t=>this._innerClient.listUsageHistory(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"changeAISpendQuota",t=>this._innerClient.changeAISpendQuota({changeAISpendQuotaBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listActivities",t=>this._innerClient.listActivities(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"introspect",t=>this._innerClient.introspect({introspectBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createFile",({xName:t,xTags:n,xAccessPolicies:r,xIndex:i,contentType:s,contentLength:o,...a})=>this._innerClient.createFile({xName:t,xTags:n,xAccessPolicies:r,xIndex:i,contentType:s,contentLength:o,createFileBody:a}).then(l=>l.data).catch(l=>{throw ue(l)}));E(this,"deleteFile",t=>this._innerClient.deleteFile(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listFiles",t=>this._innerClient.listFiles(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getFileMetadata",t=>this._innerClient.getFileMetadata(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getFileContent",t=>this._innerClient.getFileContent(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateFileMetadata",({id:t,...n})=>this._innerClient.updateFileMetadata({id:t,updateFileMetadataBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"searchFiles",t=>this._innerClient.searchFiles(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listTables",t=>this._innerClient.listTables(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getTable",t=>this._innerClient.getTable(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createTable",t=>this._innerClient.createTable({createTableBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateTable",({table:t,...n})=>this._innerClient.updateTable({table:t,updateTableBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"renameTableColumn",({table:t,...n})=>this._innerClient.renameTableColumn({table:t,renameTableColumnBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteTable",t=>this._innerClient.deleteTable(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getTableRow",t=>this._innerClient.getTableRow(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"findTableRows",({table:t,...n})=>this._innerClient.findTableRows({table:t,findTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"createTableRows",({table:t,...n})=>this._innerClient.createTableRows({table:t,createTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteTableRows",({table:t,...n})=>this._innerClient.deleteTableRows({table:t,deleteTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"updateTableRows",({table:t,...n})=>this._innerClient.updateTableRows({table:t,updateTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"upsertTableRows",({table:t,...n})=>this._innerClient.upsertTableRows({table:t,upsertTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));this._innerClient=new wM(t,n,r)}};function ue(e){var t;return X.isAxiosError(e)&&((t=e.response)!=null&&t.data)?eo(e.response.data):eo(e)}var Py=100*1024*1024,SM=Py,TM=Py,OM=class extends EM{constructor(n={}){let r=pM(n),i=IM(r);super(void 0,r.apiUrl,i);E(this,"config");E(this,"axiosClient");E(this,"createFile",async({name:n,data:r,index:i,tags:s,contentType:o,contentLength:a,accessPolicies:l})=>{let c={...this.config.headers,"x-name":n,"x-tags":s?JSON.stringify(s):void 0,"x-index":i?"true":"false","x-access-policies":(l==null?void 0:l.join(","))??void 0,"content-type":o??!1,"content-length":a};return(await this.axiosClient.post("/v1/files",r,{headers:c,baseURL:this.config.apiUrl}).catch(u=>{throw PM(u)})).data});this.axiosClient=i,this.config=r}};function IM(e){let{headers:t,withCredentials:n,timeout:r}=e;return X.create({headers:t,withCredentials:n,timeout:r,maxBodyLength:SM,maxContentLength:TM,httpAgent:Ku?new sM.default.Agent({keepAlive:!0}):void 0,httpsAgent:Ku?new oM.default.Agent({keepAlive:!0}):void 0})}function PM(e){var t;return X.isAxiosError(e)&&((t=e.response)!=null&&t.data)?eo(e.response.data):eo(e)}const Ay=Ll(Object.freeze(Object.defineProperty({__proto__:null,AlreadyExistsError:Ey,Client:OM,ForbiddenError:dy,InternalError:cy,InvalidDataFormatError:vy,InvalidIdentifierError:by,InvalidJsonSchemaError:yy,InvalidPayloadError:hy,InvalidQueryError:ky,LimitExceededError:Iy,MethodNotFoundError:my,PayloadTooLargeError:fy,PaymentRequiredError:Ty,QuotaExceededError:Oy,RateLimitedError:Sy,ReferenceConstraintError:xy,ReferenceNotFoundError:_y,RelationConflictError:wy,ResourceNotFoundError:gy,RuntimeError:Cy,UnauthorizedError:uy,UnknownError:is,UnsupportedMediaTypeError:py,axios:Z$,errorFrom:eo,isApiError:ly},Symbol.toStringTag,{value:"Module"})));var AM=Object.create,Ja=Object.defineProperty,RM=Object.getOwnPropertyDescriptor,$M=Object.getOwnPropertyNames,MM=Object.getPrototypeOf,LM=Object.prototype.hasOwnProperty,Ry=(e,t)=>{for(var n in t)Ja(e,n,{get:t[n],enumerable:!0})},$y=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $M(t))!LM.call(e,i)&&i!==n&&Ja(e,i,{get:()=>t[i],enumerable:!(r=RM(t,i))||r.enumerable});return e},My=(e,t,n)=>(n=e!=null?AM(MM(e)):{},$y(t||!e||!e.__esModule?Ja(n,"default",{value:e,enumerable:!0}):n,e)),DM=e=>$y(Ja({},"__esModule",{value:!0}),e),Ly={};Ry(Ly,{Bot:()=>_L,BotSpecificClient:()=>Hy,Integration:()=>fL,IntegrationDefinition:()=>tL,IntegrationSpecificClient:()=>Zy,botIdHeader:()=>Yu,botUserIdHeader:()=>Uy,configurationHeader:()=>Qu,integrationIdHeader:()=>Fy,messages:()=>Dy,operationHeader:()=>Xu,parseBody:()=>Cr,serve:()=>ed,typeHeader:()=>Vy,webhookIdHeader:()=>By});var NM=DM(Ly),Dy={};Ry(Dy,{defaults:()=>HM});var Mt=ja,mn=Mt.z.string().min(1),jM=Mt.z.object({text:mn}),UM=Mt.z.object({markdown:mn}),FM=Mt.z.object({imageUrl:mn}),BM=Mt.z.object({audioUrl:mn}),VM=Mt.z.object({videoUrl:mn}),zM=Mt.z.object({fileUrl:mn,title:mn.optional()}),ZM=Mt.z.object({latitude:Mt.z.number(),longitude:Mt.z.number(),address:Mt.z.string().optional(),title:Mt.z.string().optional()}),Ny=Mt.z.object({title:mn,subtitle:mn.optional(),imageUrl:mn.optional(),actions:Mt.z.array(Mt.z.object({action:Mt.z.enum(["postback","url","say"]),label:mn,value:mn}))}),jy=Mt.z.object({text:mn,options:Mt.z.array(Mt.z.object({label:mn,value:mn}))}),WM=Mt.z.object({items:Mt.z.array(Ny)}),HM={text:{schema:jM},markdown:{schema:UM},image:{schema:FM},audio:{schema:BM},video:{schema:VM},file:{schema:zM},location:{schema:ZM},carousel:{schema:WM},card:{schema:Ny},dropdown:{schema:jy},choice:{schema:jy}},Yu="x-bot-id",Uy="x-bot-user-id",Fy="x-integration-id",By="x-webhook-id",Qu="x-bp-configuration",Xu="x-bp-operation",Vy="x-bp-type",qM=Eg,Ga=console;function Cr(e){if(!e.body)throw new Error("Missing body");return JSON.parse(e.body)}async function ed(e,t=8072,n=YM){let r=(0,qM.createServer)(async(i,s)=>{try{let o=await KM(i);if(o.path==="/health"){s.writeHead(200).end("ok");return}let a=await e(o);s.writeHead((a==null?void 0:a.status)??200,(a==null?void 0:a.headers)??{}).end((a==null?void 0:a.body)??"{}")}catch(o){Ga.error("Error while handling request",{error:(o==null?void 0:o.message)??"Internal error occured"}),s.writeHead(500).end(JSON.stringify({error:(o==null?void 0:o.message)??"Internal error occured"}))}});return r.listen(t,()=>n(t)),r}async function KM(e){var i;let t=await GM(e),n={};for(let s=0;s<e.rawHeaders.length;s+=2){let o=e.rawHeaders[s].toLowerCase(),a=e.rawHeaders[s+1];n[o]=a}let r=new URL(e.url??"",e.headers.host?`http://${e.headers.host}`:"http://botpress.cloud");return{body:t,path:r.pathname,query:JM(r.search,"?"),headers:n,method:((i=e.method)==null?void 0:i.toUpperCase())??"GET"}}function JM(e,t){return e.indexOf(t)===0?e.slice(t.length):e}async function GM(e){return new Promise((t,n)=>{if(e.method!=="POST"&&e.method!=="PUT"&&e.method!=="PATCH")return t(void 0);let r="";e.on("data",i=>r+=i.toString()),e.on("error",i=>n(i)),e.on("end",()=>t(r))})}function YM(e){Ga.info(`Listening on port ${e}`)}var QM=ja,XM=QM.z.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),eL=e=>{let t=e[Yu],n=e[Uy],r=e[Fy],i=e[By],s=e[Qu],o=XM.parse(e[Xu]);if(!t)throw new Error("Missing bot headers");if(!n)throw new Error("Missing bot user headers");if(!r)throw new Error("Missing integration headers");if(!i)throw new Error("Missing webhook headers");if(!s)throw new Error("Missing configuration headers");if(!o)throw new Error("Missing operation headers");return{botId:t,botUserId:n,integrationId:r,webhookId:i,operation:o,configuration:s?JSON.parse(Buffer.from(s,"base64").toString("utf-8")):{}}},tL=class{constructor(e){E(this,"name");E(this,"version");E(this,"title");E(this,"description");E(this,"icon");E(this,"readme");E(this,"configuration");E(this,"events");E(this,"actions");E(this,"channels");E(this,"states");E(this,"user");E(this,"secrets");E(this,"identifier");E(this,"entities");this.props=e,this.name=e.name,this.version=e.version,this.icon=e.icon,this.readme=e.readme,this.title=e.title,this.identifier=e.identifier,this.description=e.description,this.configuration=e.configuration,this.events=e.events,this.actions=e.actions,this.channels=e.channels,this.states=e.states,this.user=e.user,this.secrets=e.secrets,this.entities=e.entities}},zy=Ay,Zy=class{constructor(e){E(this,"createConversation",e=>this.client.createConversation(e));E(this,"getConversation",e=>this.client.getConversation(e));E(this,"listConversations",e=>this.client.listConversations(e));E(this,"getOrCreateConversation",e=>this.client.getOrCreateConversation(e));E(this,"updateConversation",e=>this.client.updateConversation(e));E(this,"deleteConversation",e=>this.client.deleteConversation(e));E(this,"listParticipants",e=>this.client.listParticipants(e));E(this,"addParticipant",e=>this.client.addParticipant(e));E(this,"getParticipant",e=>this.client.getParticipant(e));E(this,"removeParticipant",e=>this.client.removeParticipant(e));E(this,"createEvent",e=>this.client.createEvent(e));E(this,"getEvent",e=>this.client.getEvent(e));E(this,"listEvents",e=>this.client.listEvents(e));E(this,"createMessage",e=>this.client.createMessage(e));E(this,"getOrCreateMessage",e=>this.client.getOrCreateMessage(e));E(this,"getMessage",e=>this.client.getMessage(e));E(this,"updateMessage",e=>this.client.updateMessage(e));E(this,"listMessages",e=>this.client.listMessages(e));E(this,"deleteMessage",e=>this.client.deleteMessage(e));E(this,"createUser",e=>this.client.createUser(e));E(this,"getUser",e=>this.client.getUser(e));E(this,"listUsers",e=>this.client.listUsers(e));E(this,"getOrCreateUser",e=>this.client.getOrCreateUser(e));E(this,"updateUser",e=>this.client.updateUser(e));E(this,"deleteUser",e=>this.client.deleteUser(e));E(this,"getState",e=>this.client.getState(e));E(this,"setState",e=>this.client.setState(e));E(this,"getOrSetState",e=>this.client.getOrSetState(e));E(this,"patchState",e=>this.client.patchState(e));E(this,"configureIntegration",e=>this.client.configureIntegration(e));this.client=e}},Wy=My(Eg),Ya=e=>{if(process.env.BP_LOG_FORMAT==="json")return JSON.stringify({msg:Wy.default.format(...e),visible_to_bot_owner:!0});{let[t,...n]=e;return Wy.default.format(`[For Bot Owner] ${t}`,...n)}},nL={forBot:()=>({info:(...e)=>{console.info(Ya(e))},warn:(...e)=>{console.warn(Ya(e))},error:(...e)=>{console.error(Ya(e))},debug:(...e)=>{console.debug(Ya(e))}})},rL=e=>async t=>{let n=eL(t.headers),r=new Zy(new zy.Client({botId:n.botId,integrationId:n.integrationId})),i={ctx:n,req:t,client:r,logger:nL,instance:e};try{let s;switch(n.operation){case"webhook_received":s=await sL(i);break;case"register":s=await oL(i);break;case"unregister":s=await aL(i);break;case"message_created":s=await uL(i);break;case"action_triggered":s=await dL(i);break;case"ping":s=await iL(i);break;case"create_user":s=await lL(i);break;case"create_conversation":s=await cL(i);break;default:throw new Error(`Unknown operation ${n.operation}`)}return s?{...s,status:s.status??200}:{status:200}}catch(s){if(s instanceof zy.RuntimeError)return{status:s.code,body:JSON.stringify(s.toJSON())};throw s}},iL=async e=>{},sL=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{let{req:s}=Cr(n);return i.webhook({client:e,ctx:t,req:s,logger:r})},oL=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.register)return;let{webhookUrl:s}=Cr(n);await i.register({client:e,ctx:t,webhookUrl:s,logger:r})},aL=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.unregister)return;let{webhookUrl:s}=Cr(n);await i.unregister({ctx:t,webhookUrl:s,client:e,logger:r})},lL=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.createUser)return;let{tags:s}=Cr(n);return await i.createUser({ctx:t,client:e,tags:s,logger:r})},cL=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.createConversation)return;let{channel:s,tags:o}=Cr(n);return await i.createConversation({ctx:t,client:e,channel:s,tags:o,logger:r})},uL=async({ctx:e,req:t,client:n,logger:r,instance:i})=>{let{conversation:s,user:o,type:a,payload:l,message:c}=Cr(t),u=i.channels[s.channel];if(!u)throw new Error(`Channel ${s.channel} not found`);let d=u.messages[a];if(!d)throw new Error(`Message of type ${a} not found in channel ${s.channel}`);await d({ctx:e,conversation:s,message:c,user:o,type:a,client:n,payload:l,ack:async({tags:h})=>{await n.updateMessage({id:c.id,tags:h})},logger:r})},dL=async({req:e,ctx:t,client:n,logger:r,instance:i})=>{let{input:s,type:o}=Cr(e);if(!o)throw new Error("Missing action type");let a=i.actions[o];if(!a)throw new Error(`Action ${o} not found`);let l=await a({ctx:t,input:s,client:n,type:o,logger:r});return{body:JSON.stringify({output:l})}},fL=class{constructor(e){E(this,"props");E(this,"actions");E(this,"channels");E(this,"register");E(this,"unregister");E(this,"createUser");E(this,"createConversation");E(this,"webhook");E(this,"handler",rL(this));E(this,"start",e=>ed(this.handler,e));this.props=e,this.actions=e.actions,this.channels=e.channels,this.register=e.register,this.unregister=e.unregister,this.createUser=e.createUser,this.createConversation=e.createConversation,this.webhook=e.handler}},hL=My(Ay),Hy=class{constructor(e){E(this,"getConversation",e=>this.client.getConversation(e));E(this,"listConversations",e=>this.client.listConversations(e));E(this,"updateConversation",e=>this.client.updateConversation(e));E(this,"deleteConversation",e=>this.client.deleteConversation(e));E(this,"listParticipants",e=>this.client.listParticipants(e));E(this,"addParticipant",e=>this.client.addParticipant(e));E(this,"getParticipant",e=>this.client.getParticipant(e));E(this,"removeParticipant",e=>this.client.removeParticipant(e));E(this,"getEvent",e=>this.client.getEvent(e));E(this,"listEvents",e=>this.client.listEvents(e));E(this,"createMessage",e=>this.client.createMessage(e));E(this,"getOrCreateMessage",e=>this.client.getOrCreateMessage(e));E(this,"getMessage",e=>this.client.getMessage(e));E(this,"updateMessage",e=>this.client.updateMessage(e));E(this,"listMessages",e=>this.client.listMessages(e));E(this,"deleteMessage",e=>this.client.deleteMessage(e));E(this,"getUser",e=>this.client.getUser(e));E(this,"listUsers",e=>this.client.listUsers(e));E(this,"updateUser",e=>this.client.updateUser(e));E(this,"deleteUser",e=>this.client.deleteUser(e));E(this,"getState",e=>this.client.getState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"setState",e=>this.client.setState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"getOrSetState",e=>this.client.getOrSetState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"patchState",e=>this.client.patchState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"callAction",e=>this.client.callAction(e));E(this,"createConversation",e=>this.client.createConversation(e));E(this,"getOrCreateConversation",e=>this.client.getOrCreateConversation(e));E(this,"createUser",e=>this.client.createUser(e));E(this,"getOrCreateUser",e=>this.client.getOrCreateUser(e));this.client=e}},pL=ja,mL=pL.z.enum(["event_received","register","unregister","ping","action_triggered"]),gL=e=>{let t=e[Yu],n=e[Qu],r=e[Vy],i=mL.parse(e[Xu]);if(!t)throw new Error("Missing bot headers");if(!r)throw new Error("Missing type headers");if(!n)throw new Error("Missing configuration headers");if(!i)throw new Error("Missing operation headers");return{botId:t,operation:i,type:r,configuration:n?JSON.parse(Buffer.from(n,"base64").toString("utf-8")):{}}},yL=e=>async t=>{let n=gL(t.headers);n.operation!=="ping"&&Ga.info(`Received ${n.operation} operation for bot ${n.botId} of type ${n.type}`);let r=new Hy(new hL.Client({botId:n.botId})),i={req:t,ctx:n,client:r,instance:e};switch(n.operation){case"action_triggered":throw new Error(`Operation ${n.operation} not supported yet`);case"event_received":await xL(i);break;case"register":await bL();break;case"unregister":await wL();break;case"ping":await vL();break;default:throw new Error(`Unknown operation ${n.operation}`)}return{status:200}},vL=async e=>{},bL=async e=>{},wL=async e=>{},xL=async({ctx:e,req:t,client:n,instance:r})=>{Ga.debug(`Received event ${e.type}`);let i=Cr(t),s=i.event;switch(e.type){case"message_created":let o={user:s.payload.user,conversation:s.payload.conversation,message:s.payload.message,states:s.payload.states,event:s};await Promise.all(r.messageHandlers.map(c=>c({client:n,ctx:e,...o})));break;case"state_expired":let a={state:s.payload.state};await Promise.all(r.stateExpiredHandlers.map(c=>c({client:n,ctx:e,...a})));break;default:let l={event:i.event};await Promise.all(r.eventHandlers.map(c=>c({client:n,ctx:e,...l})))}},_L=class{constructor(e){E(this,"_state",{messageHandlers:[],eventHandlers:[],stateExpiredHandlers:[]});E(this,"props");E(this,"message",e=>{this._state.messageHandlers.push(e)});E(this,"event",e=>{this._state.eventHandlers.push(e)});E(this,"stateExpired",e=>{this._state.stateExpiredHandlers.push(e)});E(this,"handler",yL(this._state));E(this,"start",e=>ed(this.handler,e));this.props=e}},ht;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(const o of i)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(ht||(ht={}));var td;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(td||(td={}));const Oe=ht.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Yr=e=>{switch(typeof e){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return isNaN(e)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(e)?Oe.array:e===null?Oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Oe.promise:typeof Map<"u"&&e instanceof Map?Oe.map:typeof Set<"u"&&e instanceof Set?Oe.set:typeof Date<"u"&&e instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},we=ht.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),kL=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Zn extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,ht.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Zn.create=e=>new Zn(e);const to=(e,t)=>{let n;switch(e.code){case we.invalid_type:e.received===Oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case we.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ht.jsonStringifyReplacer)}`;break;case we.unrecognized_keys:n=`Unrecognized key(s) in object: ${ht.joinValues(e.keys,", ")}`;break;case we.invalid_union:n="Invalid input";break;case we.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ht.joinValues(e.options)}`;break;case we.invalid_enum_value:n=`Invalid enum value. Expected ${ht.joinValues(e.options)}, received '${e.received}'`;break;case we.invalid_arguments:n="Invalid function arguments";break;case we.invalid_return_type:n="Invalid function return type";break;case we.invalid_date:n="Invalid date";break;case we.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ht.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case we.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case we.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case we.custom:n="Invalid input";break;case we.invalid_intersection_types:n="Intersection results could not be merged";break;case we.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case we.not_finite:n="Number must be finite";break;default:n=t.defaultError,ht.assertNever(e)}return{message:n}};let qy=to;function CL(e){qy=e}function Qa(){return qy}const Xa=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],o={...i,path:s};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(o,{data:t,defaultError:a}).message;return{...i,path:s,message:i.message||a}},EL=[];function Ae(e,t){const n=Xa({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Qa(),to].filter(r=>!!r)});e.common.issues.push(n)}class dn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Qe;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return dn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Qe;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:t.value,value:r}}}const Qe=Object.freeze({status:"aborted"}),Ky=e=>({status:"dirty",value:e}),gn=e=>({status:"valid",value:e}),nd=e=>e.status==="aborted",rd=e=>e.status==="dirty",no=e=>e.status==="valid",el=e=>typeof Promise<"u"&&e instanceof Promise;var Ve;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ve||(Ve={}));class ar{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Jy=(e,t)=>{if(no(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Zn(e.common.issues);return this._error=n,this._error}}};function Xe(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class tt{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Yr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Yr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new dn,ctx:{common:t.parent.common,data:t.data,parsedType:Yr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(el(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Yr(t)},s=this._parseSync({data:t,path:i.path,parent:i});return Jy(i,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Yr(t)},i=this._parse({data:t,path:r.path,parent:r}),s=await(el(i)?i:Promise.resolve(i));return Jy(r,s)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=t(i),a=()=>s.addIssue({code:we.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new qn({schema:this,typeName:He.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Sr.create(this,this._def)}nullable(){return Ii.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Hn.create(this,this._def)}promise(){return ls.create(this,this._def)}or(t){return oo.create([this,t],this._def)}and(t){return ao.create(this,t,this._def)}transform(t){return new qn({...Xe(this._def),schema:this,typeName:He.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new ho({...Xe(this._def),innerType:this,defaultValue:n,typeName:He.ZodDefault})}brand(){return new Yy({typeName:He.ZodBranded,type:this,...Xe(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new ol({...Xe(this._def),innerType:this,catchValue:n,typeName:He.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return po.create(this,t)}readonly(){return ll.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const SL=/^c[^\s-]{8,}$/i,TL=/^[a-z][a-z0-9]*$/,OL=/^[0-9A-HJKMNP-TV-Z]{26}$/,IL=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,PL=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,AL="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let id;const RL=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,$L=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ML=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function LL(e,t){return!!((t==="v4"||!t)&&RL.test(e)||(t==="v6"||!t)&&$L.test(e))}class Wn extends tt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Oe.string){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_type,expected:Oe.string,received:s.parsedType}),Qe}const r=new dn;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,a=t.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(t,i),o?Ae(i,{code:we.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&Ae(i,{code:we.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")PL.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"email",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")id||(id=new RegExp(AL,"u")),id.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"emoji",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")IL.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"uuid",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")SL.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"cuid",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")TL.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"cuid2",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")OL.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"ulid",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Ae(i,{validation:"url",code:we.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"regex",code:we.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?ML(s).test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="ip"?LL(t.data,s.version)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"ip",code:we.invalid_string,message:s.message}),r.dirty()):ht.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:we.invalid_string,...Ve.errToObj(r)})}_addCheck(t){return new Wn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ve.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ve.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ve.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ve.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ve.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ve.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ve.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ve.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...Ve.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ve.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ve.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ve.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ve.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ve.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ve.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ve.errToObj(n)})}nonempty(t){return this.min(1,Ve.errToObj(t))}trim(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Wn.create=e=>{var t;return new Wn({checks:[],typeName:He.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Xe(e)})};function DL(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class Qr extends tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Oe.number){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_type,expected:Oe.number,received:s.parsedType}),Qe}let r;const i=new dn;for(const s of this._def.checks)s.kind==="int"?ht.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?DL(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.not_finite,message:s.message}),i.dirty()):ht.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ve.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ve.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ve.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ve.toString(n))}setLimit(t,n,r,i){return new Qr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ve.toString(i)}]})}_addCheck(t){return new Qr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ve.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ve.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ve.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ve.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ve.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ve.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ht.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Qr.create=e=>new Qr({checks:[],typeName:He.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Xe(e)});class Xr extends tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Oe.bigint){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_type,expected:Oe.bigint,received:s.parsedType}),Qe}let r;const i=new dn;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):ht.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ve.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ve.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ve.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ve.toString(n))}setLimit(t,n,r,i){return new Xr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ve.toString(i)}]})}_addCheck(t){return new Xr({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ve.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ve.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Xr.create=e=>{var t;return new Xr({checks:[],typeName:He.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Xe(e)})};class ro extends tt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Oe.boolean){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.boolean,received:r.parsedType}),Qe}return gn(t.data)}}ro.create=e=>new ro({typeName:He.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Xe(e)});class Si extends tt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Oe.date){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_type,expected:Oe.date,received:s.parsedType}),Qe}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_date}),Qe}const r=new dn;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ht.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Si({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ve.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ve.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Si.create=e=>new Si({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:He.ZodDate,...Xe(e)});class tl extends tt{_parse(t){if(this._getType(t)!==Oe.symbol){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.symbol,received:r.parsedType}),Qe}return gn(t.data)}}tl.create=e=>new tl({typeName:He.ZodSymbol,...Xe(e)});class io extends tt{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.undefined,received:r.parsedType}),Qe}return gn(t.data)}}io.create=e=>new io({typeName:He.ZodUndefined,...Xe(e)});class so extends tt{_parse(t){if(this._getType(t)!==Oe.null){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.null,received:r.parsedType}),Qe}return gn(t.data)}}so.create=e=>new so({typeName:He.ZodNull,...Xe(e)});class ss extends tt{constructor(){super(...arguments),this._any=!0}_parse(t){return gn(t.data)}}ss.create=e=>new ss({typeName:He.ZodAny,...Xe(e)});class Ti extends tt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return gn(t.data)}}Ti.create=e=>new Ti({typeName:He.ZodUnknown,...Xe(e)});class Er extends tt{_parse(t){const n=this._getOrReturnCtx(t);return Ae(n,{code:we.invalid_type,expected:Oe.never,received:n.parsedType}),Qe}}Er.create=e=>new Er({typeName:He.ZodNever,...Xe(e)});class nl extends tt{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.void,received:r.parsedType}),Qe}return gn(t.data)}}nl.create=e=>new nl({typeName:He.ZodVoid,...Xe(e)});class Hn extends tt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Oe.array)return Ae(n,{code:we.invalid_type,expected:Oe.array,received:n.parsedType}),Qe;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(Ae(n,{code:o?we.too_big:we.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ae(n,{code:we.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ae(n,{code:we.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new ar(n,o,n.path,a)))).then(o=>dn.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new ar(n,o,n.path,a)));return dn.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new Hn({...this._def,minLength:{value:t,message:Ve.toString(n)}})}max(t,n){return new Hn({...this._def,maxLength:{value:t,message:Ve.toString(n)}})}length(t,n){return new Hn({...this._def,exactLength:{value:t,message:Ve.toString(n)}})}nonempty(t){return this.min(1,t)}}Hn.create=(e,t)=>new Hn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:He.ZodArray,...Xe(t)});function os(e){if(e instanceof Et){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Sr.create(os(r))}return new Et({...e._def,shape:()=>t})}else return e instanceof Hn?new Hn({...e._def,type:os(e.element)}):e instanceof Sr?Sr.create(os(e.unwrap())):e instanceof Ii?Ii.create(os(e.unwrap())):e instanceof lr?lr.create(e.items.map(t=>os(t))):e}class Et extends tt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=ht.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Oe.object){const c=this._getOrReturnCtx(t);return Ae(c,{code:we.invalid_type,expected:Oe.object,received:c.parsedType}),Qe}const{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Er&&this._def.unknownKeys==="strip"))for(const c in i.data)o.includes(c)||a.push(c);const l=[];for(const c of o){const u=s[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new ar(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Er){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(Ae(i,{code:we.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new ar(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key;c.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>dn.mergeObjectSync(r,c)):dn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Ve.errToObj,new Et({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,s,o,a;const l=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ve.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Et({...this._def,unknownKeys:"strip"})}passthrough(){return new Et({...this._def,unknownKeys:"passthrough"})}extend(t){return new Et({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Et({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:He.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Et({...this._def,catchall:t})}pick(t){const n={};return ht.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Et({...this._def,shape:()=>n})}omit(t){const n={};return ht.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Et({...this._def,shape:()=>n})}deepPartial(){return os(this)}partial(t){const n={};return ht.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Et({...this._def,shape:()=>n})}required(t){const n={};return ht.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Sr;)s=s._def.innerType;n[r]=s}}),new Et({...this._def,shape:()=>n})}keyof(){return Gy(ht.objectKeys(this.shape))}}Et.create=(e,t)=>new Et({shape:()=>e,unknownKeys:"strip",catchall:Er.create(),typeName:He.ZodObject,...Xe(t)}),Et.strictCreate=(e,t)=>new Et({shape:()=>e,unknownKeys:"strict",catchall:Er.create(),typeName:He.ZodObject,...Xe(t)}),Et.lazycreate=(e,t)=>new Et({shape:e,unknownKeys:"strip",catchall:Er.create(),typeName:He.ZodObject,...Xe(t)});class oo extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Zn(a.ctx.common.issues));return Ae(n,{code:we.invalid_union,unionErrors:o}),Qe}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Zn(l));return Ae(n,{code:we.invalid_union,unionErrors:a}),Qe}}get options(){return this._def.options}}oo.create=(e,t)=>new oo({options:e,typeName:He.ZodUnion,...Xe(t)});const rl=e=>e instanceof co?rl(e.schema):e instanceof qn?rl(e.innerType()):e instanceof uo?[e.value]:e instanceof ei?e.options:e instanceof fo?Object.keys(e.enum):e instanceof ho?rl(e._def.innerType):e instanceof io?[void 0]:e instanceof so?[null]:null;class il extends tt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.object)return Ae(n,{code:we.invalid_type,expected:Oe.object,received:n.parsedType}),Qe;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Ae(n,{code:we.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Qe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const s of n){const o=rl(s.shape[t]);if(!o)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,s)}}return new il({typeName:He.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Xe(r)})}}function sd(e,t){const n=Yr(e),r=Yr(t);if(e===t)return{valid:!0,data:e};if(n===Oe.object&&r===Oe.object){const i=ht.objectKeys(t),s=ht.objectKeys(e).filter(a=>i.indexOf(a)!==-1),o={...e,...t};for(const a of s){const l=sd(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(n===Oe.array&&r===Oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s<e.length;s++){const o=e[s],a=t[s],l=sd(o,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Oe.date&&r===Oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ao extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(s,o)=>{if(nd(s)||nd(o))return Qe;const a=sd(s.value,o.value);return a.valid?((rd(s)||rd(o))&&n.dirty(),{status:n.value,value:a.data}):(Ae(r,{code:we.invalid_intersection_types}),Qe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ao.create=(e,t,n)=>new ao({left:e,right:t,typeName:He.ZodIntersection,...Xe(n)});class lr extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.array)return Ae(r,{code:we.invalid_type,expected:Oe.array,received:r.parsedType}),Qe;if(r.data.length<this._def.items.length)return Ae(r,{code:we.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Qe;!this._def.rest&&r.data.length>this._def.items.length&&(Ae(r,{code:we.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new ar(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>dn.mergeArray(n,o)):dn.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new lr({...this._def,rest:t})}}lr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new lr({items:e,typeName:He.ZodTuple,rest:null,...Xe(t)})};class lo extends tt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.object)return Ae(r,{code:we.invalid_type,expected:Oe.object,received:r.parsedType}),Qe;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new ar(r,a,r.path,a)),value:o._parse(new ar(r,r.data[a],r.path,a))});return r.common.async?dn.mergeObjectAsync(n,i):dn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof tt?new lo({keyType:t,valueType:n,typeName:He.ZodRecord,...Xe(r)}):new lo({keyType:Wn.create(),valueType:t,typeName:He.ZodRecord,...Xe(n)})}}class sl extends tt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.map)return Ae(r,{code:we.invalid_type,expected:Oe.map,received:r.parsedType}),Qe;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new ar(r,a,r.path,[c,"key"])),value:s._parse(new ar(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Qe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Qe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}sl.create=(e,t,n)=>new sl({valueType:t,keyType:e,typeName:He.ZodMap,...Xe(n)});class Oi extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.set)return Ae(r,{code:we.invalid_type,expected:Oe.set,received:r.parsedType}),Qe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ae(r,{code:we.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ae(r,{code:we.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Qe;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>s._parse(new ar(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,n){return new Oi({...this._def,minSize:{value:t,message:Ve.toString(n)}})}max(t,n){return new Oi({...this._def,maxSize:{value:t,message:Ve.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Oi.create=(e,t)=>new Oi({valueType:e,minSize:null,maxSize:null,typeName:He.ZodSet,...Xe(t)});class as extends tt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.function)return Ae(n,{code:we.invalid_type,expected:Oe.function,received:n.parsedType}),Qe;function r(a,l){return Xa({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Qa(),to].filter(c=>!!c),issueData:{code:we.invalid_arguments,argumentsError:l}})}function i(a,l){return Xa({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Qa(),to].filter(c=>!!c),issueData:{code:we.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof ls){const a=this;return gn(async function(...l){const c=new Zn([]),u=await a._def.args.parseAsync(l,s).catch(f=>{throw c.addIssue(r(l,f)),c}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw c.addIssue(i(d,f)),c})})}else{const a=this;return gn(function(...l){const c=a._def.args.safeParse(l,s);if(!c.success)throw new Zn([r(l,c.error)]);const u=Reflect.apply(o,this,c.data),d=a._def.returns.safeParse(u,s);if(!d.success)throw new Zn([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new as({...this._def,args:lr.create(t).rest(Ti.create())})}returns(t){return new as({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new as({args:t||lr.create([]).rest(Ti.create()),returns:n||Ti.create(),typeName:He.ZodFunction,...Xe(r)})}}class co extends tt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}co.create=(e,t)=>new co({getter:e,typeName:He.ZodLazy,...Xe(t)});class uo extends tt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ae(n,{received:n.data,code:we.invalid_literal,expected:this._def.value}),Qe}return{status:"valid",value:t.data}}get value(){return this._def.value}}uo.create=(e,t)=>new uo({value:e,typeName:He.ZodLiteral,...Xe(t)});function Gy(e,t){return new ei({values:e,typeName:He.ZodEnum,...Xe(t)})}class ei extends tt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ae(n,{expected:ht.joinValues(r),received:n.parsedType,code:we.invalid_type}),Qe}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Ae(n,{received:n.data,code:we.invalid_enum_value,options:r}),Qe}return gn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return ei.create(t)}exclude(t){return ei.create(this.options.filter(n=>!t.includes(n)))}}ei.create=Gy;class fo extends tt{_parse(t){const n=ht.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const i=ht.objectValues(n);return Ae(r,{expected:ht.joinValues(i),received:r.parsedType,code:we.invalid_type}),Qe}if(n.indexOf(t.data)===-1){const i=ht.objectValues(n);return Ae(r,{received:r.data,code:we.invalid_enum_value,options:i}),Qe}return gn(t.data)}get enum(){return this._def.values}}fo.create=(e,t)=>new fo({values:e,typeName:He.ZodNativeEnum,...Xe(t)});class ls extends tt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.promise&&n.common.async===!1)return Ae(n,{code:we.invalid_type,expected:Oe.promise,received:n.parsedType}),Qe;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return gn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ls.create=(e,t)=>new ls({type:e,typeName:He.ZodPromise,...Xe(t)});class qn extends tt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===He.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o=>{Ae(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:o,path:r.path,parent:r})}if(i.type==="refinement"){const o=a=>{const l=i.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Qe:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Qe:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!no(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>no(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);ht.assertNever(i)}}qn.create=(e,t,n)=>new qn({schema:e,typeName:He.ZodEffects,effect:t,...Xe(n)}),qn.createWithPreprocess=(e,t,n)=>new qn({schema:t,effect:{type:"preprocess",transform:e},typeName:He.ZodEffects,...Xe(n)});class Sr extends tt{_parse(t){return this._getType(t)===Oe.undefined?gn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Sr.create=(e,t)=>new Sr({innerType:e,typeName:He.ZodOptional,...Xe(t)});class Ii extends tt{_parse(t){return this._getType(t)===Oe.null?gn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ii.create=(e,t)=>new Ii({innerType:e,typeName:He.ZodNullable,...Xe(t)});class ho extends tt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ho.create=(e,t)=>new ho({innerType:e,typeName:He.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Xe(t)});class ol extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return el(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Zn(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Zn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ol.create=(e,t)=>new ol({innerType:e,typeName:He.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Xe(t)});class al extends tt{_parse(t){if(this._getType(t)!==Oe.nan){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.nan,received:r.parsedType}),Qe}return{status:"valid",value:t.data}}}al.create=e=>new al({typeName:He.ZodNaN,...Xe(e)});const NL=Symbol("zod_brand");class Yy extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class po extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Qe:s.status==="dirty"?(n.dirty(),Ky(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Qe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new po({in:t,out:n,typeName:He.ZodPipeline})}}class ll extends tt{_parse(t){const n=this._def.innerType._parse(t);return no(n)&&(n.value=Object.freeze(n.value)),n}}ll.create=(e,t)=>new ll({innerType:e,typeName:He.ZodReadonly,...Xe(t)});const Qy=(e,t={},n)=>e?ss.create().superRefine((r,i)=>{var s,o;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:l})}}):ss.create(),jL={object:Et.lazycreate};var He;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(He||(He={}));const UL=(e,t={message:`Input not instance of ${e.name}`})=>Qy(n=>n instanceof e,t),rt=Wn.create,mo=Qr.create,FL=al.create,BL=Xr.create,Tr=ro.create,VL=Si.create,zL=tl.create,ZL=io.create,WL=so.create,go=ss.create,HL=Ti.create,qL=Er.create,KL=nl.create,cs=Hn.create,jt=Et.create,JL=Et.strictCreate,ti=oo.create,GL=il.create,YL=ao.create,QL=lr.create,yo=lo.create,XL=sl.create,eD=Oi.create,tD=as.create,nD=co.create,nt=uo.create,rD=ei.create,iD=fo.create,sD=ls.create,Xy=qn.create,oD=Sr.create,aD=Ii.create,lD=qn.createWithPreprocess,cD=po.create;var H=Object.freeze({__proto__:null,defaultErrorMap:to,setErrorMap:CL,getErrorMap:Qa,makeIssue:Xa,EMPTY_PATH:EL,addIssueToContext:Ae,ParseStatus:dn,INVALID:Qe,DIRTY:Ky,OK:gn,isAborted:nd,isDirty:rd,isValid:no,isAsync:el,get util(){return ht},get objectUtil(){return td},ZodParsedType:Oe,getParsedType:Yr,ZodType:tt,ZodString:Wn,ZodNumber:Qr,ZodBigInt:Xr,ZodBoolean:ro,ZodDate:Si,ZodSymbol:tl,ZodUndefined:io,ZodNull:so,ZodAny:ss,ZodUnknown:Ti,ZodNever:Er,ZodVoid:nl,ZodArray:Hn,ZodObject:Et,ZodUnion:oo,ZodDiscriminatedUnion:il,ZodIntersection:ao,ZodTuple:lr,ZodRecord:lo,ZodMap:sl,ZodSet:Oi,ZodFunction:as,ZodLazy:co,ZodLiteral:uo,ZodEnum:ei,ZodNativeEnum:fo,ZodPromise:ls,ZodEffects:qn,ZodTransformer:qn,ZodOptional:Sr,ZodNullable:Ii,ZodDefault:ho,ZodCatch:ol,ZodNaN:al,BRAND:NL,ZodBranded:Yy,ZodPipeline:po,ZodReadonly:ll,custom:Qy,Schema:tt,ZodSchema:tt,late:jL,get ZodFirstPartyTypeKind(){return He},coerce:{string:e=>Wn.create({...e,coerce:!0}),number:e=>Qr.create({...e,coerce:!0}),boolean:e=>ro.create({...e,coerce:!0}),bigint:e=>Xr.create({...e,coerce:!0}),date:e=>Si.create({...e,coerce:!0})},any:go,array:cs,bigint:BL,boolean:Tr,date:VL,discriminatedUnion:GL,effect:Xy,enum:rD,function:tD,instanceof:UL,intersection:YL,lazy:nD,literal:nt,map:XL,nan:FL,nativeEnum:iD,never:qL,null:WL,nullable:aD,number:mo,object:jt,oboolean:()=>Tr().optional(),onumber:()=>mo().optional(),optional:oD,ostring:()=>rt().optional(),pipeline:cD,preprocess:lD,promise:sD,record:yo,set:eD,strictObject:JL,string:rt,symbol:zL,transformer:Xy,tuple:QL,undefined:ZL,union:ti,unknown:HL,void:KL,NEVER:Qe,ZodIssueCode:we,quotelessJson:kL,ZodError:Zn});const{defaults:cr}=NM.messages,Kn={className:rt().describe("CSS className to apply to the message").optional()},ev=cr.audio.schema.extend({...Kn,type:nt("audio")}),od=cr.card.schema.extend({type:nt("card"),subtitle:rt().optional(),imageUrl:rt().optional(),...Kn}),uD=od.omit({type:!0}),tv=jt({items:cs(uD),...Kn,type:nt("carousel")}),nv=cr.choice.schema.extend({text:rt(),...Kn,type:nt("choice"),disableFreeText:Tr().optional()}),rv=cr.dropdown.schema.extend({text:rt(),...Kn,type:nt("dropdown")}),iv=cr.file.schema.extend({...Kn,type:nt("file")}),sv=cr.image.schema.extend({...Kn,type:nt("image")}),ov=cr.location.schema.extend({...Kn,type:nt("location")}),av=cr.markdown.schema.extend({...Kn,type:nt("markdown")}),lv=cr.text.schema.extend({...Kn,type:nt("text")}),cv=cr.video.schema.extend({...Kn,type:nt("video")}),uv=ti([ev,od,tv,nv,rv,iv,sv,ov,av,lv,cv]),dv=jt({type:nt("webchat_visibility"),data:jt({visibility:ti([nt("show"),nt("hide"),nt("toggle")])})}),fv=jt({type:nt("webchat_config"),data:jt({config:yo(go())})}),hv=jt({type:nt("custom"),data:jt({event:yo(go())})}),pv=ti([dv,fv,hv]),dD=pv,fD=jt({type:nt("message_created"),data:uv}),hD=Object.freeze(Object.defineProperty({__proto__:null,audioSchema:ev,cardSchema:od,carouselSchema:tv,choiceSchema:nv,customSchema:hv,dropdownSchema:rv,fileSchema:iv,imageSchema:sv,locationSchema:ov,markdownSchema:av,messageCreatedSchema:fD,messageSchema:uv,textSchema:lv,triggerSchema:pv,triggerSignalSchema:dD,videoSchema:cv,webchatConfigSchema:fv,webchatVisibilitySchema:dv},Symbol.toStringTag,{value:"Module"})),ur=jt({className:rt().optional(),avatarUrl:rt().url().optional()}),mv=ur.extend({type:nt("audio"),audio:rt(),title:rt().optional()}),pD=ti([jt({title:rt(),action:nt("Say something"),text:rt()}),jt({title:rt(),action:nt("Open URL"),url:rt()}),jt({title:rt(),action:nt("Postback"),payload:rt()})]),ad=ur.extend({type:nt("card"),title:rt(),subtitle:rt().optional(),image:rt().optional(),actions:cs(pD)}),gv=ur.extend({type:nt("carousel"),items:cs(ad)}),yv=ur.extend({type:nt("dropdown"),message:rt().optional(),options:cs(jt({label:rt(),value:rt()})),allowCreation:Tr().optional(),placeholderText:rt().optional(),allowMultiple:Tr().optional(),buttonText:rt().optional(),width:mo().optional(),displayInKeyboard:Tr().optional(),markdown:Tr().optional(),text:rt().optional()}),vv=ur.extend({type:nt("file"),file:rt(),title:rt().optional()}),bv=ur.extend({type:nt("image"),image:rt()}),wv=ur.extend({type:nt("location"),latitude:mo(),longitude:mo(),address:rt().optional(),title:rt().optional()}),xv=ur.extend({type:nt("single-choice"),text:rt(),disableFreeText:Tr().optional(),choices:cs(jt({title:rt(),value:rt()}))}),_v=ur.extend({type:nt("text"),text:rt(),markdown:Tr().optional()}),kv=ur.extend({type:nt("video"),video:rt(),title:rt().optional()}),Cv=jt({type:nt("quick_reply"),text:rt(),payload:rt().optional()}),cl=ti([mv,ad,gv,yv,vv,bv,wv,xv,_v,kv,Cv]),Ev=jt({type:nt("webchat-visibility"),visibility:ti([nt("show"),nt("hide"),nt("toggle")])}),Sv=jt({type:nt("webchat-config"),config:yo(go())}),Tv=jt({type:nt("custom-event"),event:yo(go())}),Ov=ti([Ev,Sv,Tv]),mD=jt({type:nt("trigger"),trigger:Ov}),gD=Object.freeze(Object.defineProperty({__proto__:null,audioSchema:mv,cardSchema:ad,carouselSchame:gv,customEventSchema:Tv,dropdownSchema:yv,fileSchema:vv,imageSchema:bv,locationSchema:wv,messageSchema:cl,messageSignalSchema:cl,quickReplySchema:Cv,singleChoiceSchema:xv,textSchema:_v,triggerSchema:Ov,triggerSignalSchema:mD,videoSchema:kv,webchatConfigSchema:Sv,webchatVisibilitySchema:Ev},Symbol.toStringTag,{value:"Module"})),Iv=e=>({type:"card",title:e.title,subtitle:e.subtitle,image:e.imageUrl,actions:e.actions.map(yD)}),yD=e=>{switch(e.action){case"postback":return{title:e.label,action:"Postback",payload:e.value};case"url":return{title:e.label,action:"Open URL",url:e.value};case"say":return{title:e.label,action:"Say something",text:e.value};default:throw new Error(`Unknown action type ${e.action}`)}},Pv=e=>({...e,type:"audio",audio:e.audioUrl}),Av=e=>Iv(e),Rv=e=>({...e,type:"carousel",items:e.items.map(Iv)}),$v=e=>({...e,type:"single-choice",text:e.text,choices:e.options.map(t=>({title:t.label,value:t.value})),disableFreeText:e.disableFreeText}),Mv=e=>({...e,type:"dropdown",message:e.text,options:e.options.map(t=>({label:t.label,value:t.value}))}),Lv=e=>({...e,type:"file",file:e.fileUrl,title:e.title}),Dv=e=>({...e,type:"image",image:e.imageUrl}),Nv=e=>({...e,type:"location",latitude:e.latitude,longitude:e.longitude}),jv=e=>({...e,type:"text",text:e.markdown,markdown:!0}),Uv=e=>({...e,type:"text",text:e.text,markdown:!0}),Fv=e=>({...e,type:"video",video:e.videoUrl}),vD=e=>{switch(e.type){case"audio":return Pv(e);case"card":return Av(e);case"carousel":return Rv(e);case"choice":return $v(e);case"dropdown":return Mv(e);case"file":return Lv(e);case"image":return Dv(e);case"location":return Nv(e);case"markdown":return jv(e);case"text":return Uv(e);case"video":return Fv(e);default:throw new Error("Unsuported message type")}},Bv=e=>({type:"webchat-visibility",visibility:e.data.visibility}),Vv=e=>({type:"webchat-config",config:e.data.config}),zv=e=>({type:"custom-event",event:e.data.event}),bD=Object.freeze(Object.defineProperty({__proto__:null,audioAdapter:Pv,cardAdapter:Av,carouselAdapter:Rv,choiceAdapter:$v,customAdapter:zv,dropdownAdapter:Mv,fileAdapter:Lv,imageAdapter:Dv,locationAdapter:Nv,markdownAdapter:jv,messageAdapter:vD,textAdapter:Uv,triggerAdapter:e=>{switch(e.type){case"webchat_visibility":return Bv(e);case"webchat_config":return Vv(e);case"custom":return zv(e);default:throw new Error("unknown trigger type")}},videoAdapter:Fv,webchatConfigAdapter:Vv,webchatVisibilityAdapter:Bv},Symbol.toStringTag,{value:"Module"})),Zv=e=>({type:"card",title:e.title,subtitle:e.subtitle,imageUrl:e.image,actions:e.actions.map(wD)}),wD=e=>{switch(e.action){case"Postback":return{label:e.title,action:"postback",value:e.payload};case"Open URL":return{label:e.title,action:"url",value:e.url};case"Say something":return{label:e.title,action:"say",value:e.text};default:throw new Error("Unknown action type")}},xD=e=>({...e,type:"audio",audioUrl:e.audio}),_D=e=>Zv(e),kD=e=>({...e,type:"carousel",items:e.items.map(Zv)}),CD=e=>({...e,type:"dropdown",text:e.message??"",options:e.options.map(t=>({label:t.label,value:t.value}))}),ED=e=>({...e,type:"file",fileUrl:e.file,title:e.title}),SD=e=>({...e,type:"image",imageUrl:e.image}),TD=e=>({...e,type:"location",latitude:e.latitude,longitude:e.longitude}),OD=e=>({...e,type:"choice",text:e.text,options:e.choices.map(t=>({label:t.title,value:t.value})),disableFreeText:e.disableFreeText}),ID=e=>({...e,type:"text",text:e.text}),PD=e=>({...e,type:"video",videoUrl:e.video}),AD=e=>({...e,type:"text",text:e.payload??e.text}),RD=Object.freeze(Object.defineProperty({__proto__:null,messaging:gD,messagingToWebChat:Object.freeze(Object.defineProperty({__proto__:null,messageAdapter:e=>{switch(e.type){case"audio":return xD(e);case"card":return _D(e);case"carousel":return kD(e);case"dropdown":return CD(e);case"file":return ED(e);case"image":return SD(e);case"location":return TD(e);case"single-choice":return OD(e);case"text":return ID(e);case"video":return PD(e);case"quick_reply":return AD(e);default:throw new Error("Unsuported message type")}}},Symbol.toStringTag,{value:"Module"})),webchat:hD,webchatToMessaging:bD},Symbol.toStringTag,{value:"Module"}));let ul;const $D=new Uint8Array(16);function MD(){if(!ul&&(ul=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ul))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ul($D)}const rn=[];for(let e=0;e<256;++e)rn.push((e+256).toString(16).slice(1));function LD(e,t=0){return rn[e[t+0]]+rn[e[t+1]]+rn[e[t+2]]+rn[e[t+3]]+"-"+rn[e[t+4]]+rn[e[t+5]]+"-"+rn[e[t+6]]+rn[e[t+7]]+"-"+rn[e[t+8]]+rn[e[t+9]]+"-"+rn[e[t+10]]+rn[e[t+11]]+rn[e[t+12]]+rn[e[t+13]]+rn[e[t+14]]+rn[e[t+15]]}const Wv={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function DD(e,t,n){if(Wv.randomUUID&&!t&&!e)return Wv.randomUUID();e=e||{};const r=e.random||(e.rng||MD)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return LD(r)}const dl=e=>({block:e,type:"bubble"}),ND=e=>e.action==="Say something"?{type:"button",variant:"action",text:e.title,buttonValue:e.text,reusable:!0}:e.action==="Open URL"?{type:"button",variant:"link",text:e.title,buttonValue:e.url,reusable:!0}:{type:"button",variant:"action",text:e.title,buttonValue:e.payload,reusable:!0},Hv=({title:e,image:t,actions:n,subtitle:r})=>{const i=[];return t&&i.push({type:"image",url:t}),e&&i.push({type:"text",text:`## ${e}`}),r&&i.push({type:"text",text:r}),n.length>0&&i.push({type:"row",blocks:n.map(ND)}),{type:"column",horizontalAlignment:"center",blocks:[...i]}},jD=({choices:e,text:t})=>{const n=DD(),r=dl({type:"text",text:t});return e.length===0?r:{type:"column",horizontalAlignment:"left",blocks:[r,{type:"row",blocks:e.map(({title:i,value:s})=>({type:"button",variant:"action",text:i,buttonValue:s,groupId:n}))}]}},UD=({options:e,text:t})=>{const n=[{type:"dropdown",label:t??"Select an option",options:e}];return t&&n.unshift({type:"text",text:t}),{type:"column",blocks:n}},qv=({type:e,audio:t})=>({type:e,url:t}),Kv=e=>dl(Hv(e)),Jv=({items:e})=>({type:"carousel",blocks:e.map(Hv)}),Gv=e=>jD(e),Yv=e=>dl(UD(e)),Qv=({file:e,...t})=>({url:e,...t}),Xv=({type:e,image:t})=>({type:e,url:t}),eb=({type:e,latitude:t,longitude:n,title:r,address:i})=>({type:e,latitude:t,longitude:n,title:r??i??"View on map"}),ld=({type:e,text:t})=>dl({type:e,text:t}),tb=({type:e,video:t})=>({type:e,url:t}),nb=e=>{switch(e.type){case"audio":return qv(e);case"card":return Kv(e);case"carousel":return Jv(e);case"single-choice":return Gv(e);case"dropdown":return Yv(e);case"file":return Qv(e);case"image":return Xv(e);case"location":return eb(e);case"text":return ld(e);case"video":return tb(e);default:throw new Error("Unsuported message type")}},{webchatToMessaging:Jn}=RD,FD=e=>{const t=Jn.audioAdapter(e);return qv(t)},BD=e=>{const t=Jn.cardAdapter(e);return Kv(t)},VD=e=>{const t=Jn.carouselAdapter(e);return Jv(t)},zD=e=>{const t=Jn.choiceAdapter(e);return Gv(t)},ZD=e=>{const t=Jn.dropdownAdapter(e);return Yv(t)},WD=e=>{const t=Jn.fileAdapter(e);return Qv(t)},HD=e=>{const t=Jn.imageAdapter(e);return Xv(t)},qD=e=>{const t=Jn.locationAdapter(e);return eb(t)},KD=e=>{const t=Jn.markdownAdapter(e);return ld(t)},JD=e=>{const t=Jn.textAdapter(e);return ld(t)},GD=e=>{const t=Jn.videoAdapter(e);return tb(t)},YD=e=>{switch(e.type){case"audio":return FD(e);case"card":return BD(e);case"carousel":return VD(e);case"choice":return zD(e);case"dropdown":return ZD(e);case"file":return WD(e);case"image":return HD(e);case"location":return qD(e);case"markdown":return KD(e);case"text":return JD(e);case"video":return GD(e);default:throw new Error("Unsuported message type")}};class rb{constructor(t){E(this,"socket");E(this,"clientId");E(this,"userId");E(this,"conversationId");E(this,"userToken");E(this,"connected",!1);E(this,"emitter");E(this,"on");E(this,"mode","messaging");this.socket=new Dm.MessagingSocket(t),this.emitter=new Fl,this.clientId=t.clientId,this.on=this.emitter.on.bind(this.emitter),this.socket.on("message",n=>{const r=n.payload;if(r.type==="trigger")switch(r.trigger.type){case"webchat-visibility":this.emitter.emit("webchatVisibility",r.trigger.visibility);break;case"webchat-config":this.emitter.emit("webchatConfig",r.trigger.config);break;case"custom-event":this.emitter.emit("customEvent",r.trigger.event);break}else{const i=cl.parse(r),s=nb(i);this.emitter.emit("message",{...n,payload:s})}}),this.socket.on("conversation",n=>{this.emitter.emit("conversation",n)})}async connect(t,n){if(this.connected)return;this.connected=!0;const r=await this.socket.connect(t,n).catch(i=>{throw this.connected=!1,i});return this.userId=r.userId,this.userToken=r.userToken,r}async disconnect(){await this.socket.disconnect(),this.connected=!1}async sendMessage(t){this.conversationId||await this.newConversation(),await this.socket.sendText(t),this.emitter.emit("messageSent",t)}async sendEvent(t){this.conversationId||await this.newConversation(),await this.socket.sendPayload({type:"trigger",payload:t})}async switchConversation(t){await this.socket.switchConversation(t),this.conversationId=t}async conversationExists(t){return(await this.socket.listConversations()).some(r=>r.id===t)}async newConversation(){const{id:t}=await this.socket.createConversation();await this.socket.startConversation(),this.conversationId=t}async listMessages(t){return(await this.socket.listMessages(t)).map(r=>{const i=cl.parse(r.payload),s=nb(i);return{...r,payload:s}})}}function ib(e,t){return function(){return e.apply(t,arguments)}}const{toString:sb}=Object.prototype,{getPrototypeOf:cd}=Object,ud=(e=>t=>{const n=sb.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Or=e=>(e=e.toLowerCase(),t=>ud(t)===e),fl=e=>t=>typeof t===e,{isArray:us}=Array,vo=fl("undefined");function QD(e){return e!==null&&!vo(e)&&e.constructor!==null&&!vo(e.constructor)&&Pi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ob=Or("ArrayBuffer");function XD(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ob(e.buffer),t}const eN=fl("string"),Pi=fl("function"),ab=fl("number"),dd=e=>e!==null&&typeof e=="object",tN=e=>e===!0||e===!1,hl=e=>{if(ud(e)!=="object")return!1;const t=cd(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},nN=Or("Date"),rN=Or("File"),iN=Or("Blob"),sN=Or("FileList"),oN=e=>dd(e)&&Pi(e.pipe),aN=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||sb.call(e)===t||Pi(e.toString)&&e.toString()===t)},lN=Or("URLSearchParams"),cN=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function bo(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),us(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(r=0;r<o;r++)a=s[r],t.call(null,e[a],a,e)}}function lb(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const cb=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),ub=e=>!vo(e)&&e!==cb;function fd(){const{caseless:e}=ub(this)&&this||{},t={},n=(r,i)=>{const s=e&&lb(t,i)||i;hl(t[s])&&hl(r)?t[s]=fd(t[s],r):hl(r)?t[s]=fd({},r):us(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&bo(arguments[r],n);return t}const uN=(e,t,n,{allOwnKeys:r}={})=>(bo(t,(i,s)=>{n&&Pi(i)?e[s]=ib(i,n):e[s]=i},{allOwnKeys:r}),e),dN=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),fN=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},hN=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&cd(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},pN=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},mN=e=>{if(!e)return null;if(us(e))return e;let t=e.length;if(!ab(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},gN=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&cd(Uint8Array)),yN=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},vN=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},bN=Or("HTMLFormElement"),wN=e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),db=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),xN=Or("RegExp"),fb=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};bo(n,(i,s)=>{t(i,s,e)!==!1&&(r[s]=i)}),Object.defineProperties(e,r)},te={isArray:us,isArrayBuffer:ob,isBuffer:QD,isFormData:aN,isArrayBufferView:XD,isString:eN,isNumber:ab,isBoolean:tN,isObject:dd,isPlainObject:hl,isUndefined:vo,isDate:nN,isFile:rN,isBlob:iN,isRegExp:xN,isFunction:Pi,isStream:oN,isURLSearchParams:lN,isTypedArray:gN,isFileList:sN,forEach:bo,merge:fd,extend:uN,trim:cN,stripBOM:dN,inherits:fN,toFlatObject:hN,kindOf:ud,kindOfTest:Or,endsWith:pN,toArray:mN,forEachEntry:yN,matchAll:vN,isHTMLForm:bN,hasOwnProperty:db,hasOwnProp:db,reduceDescriptors:fb,freezeMethods:e=>{fb(e,(t,n)=>{if(Pi(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Pi(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return us(e)?r(e):r(String(e).split(t)),n},toCamelCase:wN,noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:lb,global:cb,isContextDefined:ub,toJSONObject:e=>{const t=new Array(10),n=(r,i)=>{if(dd(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=us(r)?[]:{};return bo(r,(o,a)=>{const l=n(o,i+1);!vo(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)}};function dt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}te.inherits(dt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:te.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const hb=dt.prototype,pb={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{pb[e]={value:e}}),Object.defineProperties(dt,pb),Object.defineProperty(hb,"isAxiosError",{value:!0}),dt.from=(e,t,n,r,i,s)=>{const o=Object.create(hb);return te.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),dt.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};var _N=typeof self=="object"?self.FormData:window.FormData;const kN=ai(_N);function hd(e){return te.isPlainObject(e)||te.isArray(e)}function mb(e){return te.endsWith(e,"[]")?e.slice(0,-2):e}function gb(e,t,n){return e?e.concat(t).map(function(i,s){return i=mb(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function CN(e){return te.isArray(e)&&!e.some(hd)}const EN=te.toFlatObject(te,{},null,function(t){return/^is[A-Z]/.test(t)});function SN(e){return e&&te.isFunction(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator]}function pl(e,t,n){if(!te.isObject(e))throw new TypeError("target must be an object");t=t||new(kN||FormData),n=te.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!te.isUndefined(y[m])});const r=n.metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&SN(t);if(!te.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(te.isDate(p))return p.toISOString();if(!l&&te.isBlob(p))throw new dt("Blob is not supported. Use a Buffer instead.");return te.isArrayBuffer(p)||te.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,y){let v=p;if(p&&!y&&typeof p=="object"){if(te.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(te.isArray(p)&&CN(p)||te.isFileList(p)||te.endsWith(m,"[]")&&(v=te.toArray(p)))return m=mb(m),v.forEach(function(x,I){!(te.isUndefined(x)||x===null)&&t.append(o===!0?gb([m],I,s):o===null?m:m+"[]",c(x))}),!1}return hd(p)?!0:(t.append(gb(y,m,s),c(p)),!1)}const d=[],h=Object.assign(EN,{defaultVisitor:u,convertValue:c,isVisitable:hd});function f(p,m){if(!te.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),te.forEach(p,function(v,b){(!(te.isUndefined(v)||v===null)&&i.call(t,v,te.isString(b)?b.trim():b,m,h))===!0&&f(v,m?m.concat(b):[b])}),d.pop()}}if(!te.isObject(e))throw new TypeError("data must be an object");return f(e),t}function yb(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function pd(e,t){this._pairs=[],e&&pl(e,this,t)}const vb=pd.prototype;vb.append=function(t,n){this._pairs.push([t,n])},vb.toString=function(t){const n=t?function(r){return t.call(this,r,yb)}:yb;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function TN(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function bb(e,t,n){if(!t)return e;const r=n&&n.encode||TN,i=n&&n.serialize;let s;if(i?s=i(t,n):s=te.isURLSearchParams(t)?t.toString():new pd(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class ON{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){te.forEach(this.handlers,function(r){r!==null&&t(r)})}}const wb=ON,xb={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},IN=typeof URLSearchParams<"u"?URLSearchParams:pd,PN=FormData,AN=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),RN=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),dr={isBrowser:!0,classes:{URLSearchParams:IN,FormData:PN,Blob},isStandardBrowserEnv:AN,isStandardBrowserWebWorkerEnv:RN,protocols:["http","https","file","blob","url","data"]};function $N(e,t){return pl(e,new dr.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return dr.isNode&&te.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function MN(e){return te.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function LN(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function _b(e){function t(n,r,i,s){let o=n[s++];const a=Number.isFinite(+o),l=s>=n.length;return o=!o&&te.isArray(i)?i.length:o,l?(te.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!te.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&te.isArray(i[o])&&(i[o]=LN(i[o])),!a)}if(te.isFormData(e)&&te.isFunction(e.entries)){const n={};return te.forEachEntry(e,(r,i)=>{t(MN(r),i,n,0)}),n}return null}const DN={"Content-Type":void 0};function NN(e,t,n){if(te.isString(e))try{return(t||JSON.parse)(e),te.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ml={transitional:xb,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=te.isObject(t);if(s&&te.isHTMLForm(t)&&(t=new FormData(t)),te.isFormData(t))return i&&i?JSON.stringify(_b(t)):t;if(te.isArrayBuffer(t)||te.isBuffer(t)||te.isStream(t)||te.isFile(t)||te.isBlob(t))return t;if(te.isArrayBufferView(t))return t.buffer;if(te.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return $N(t,this.formSerializer).toString();if((a=te.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return pl(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),NN(t)):t}],transformResponse:[function(t){const n=this.transitional||ml.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(t&&te.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?dt.from(a,dt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:dr.classes.FormData,Blob:dr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};te.forEach(["delete","get","head"],function(t){ml.headers[t]={}}),te.forEach(["post","put","patch"],function(t){ml.headers[t]=te.merge(DN)});const md=ml,jN=te.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),UN=e=>{const t={};let n,r,i;return e&&e.split(`
278
- `).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&jN[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},kb=Symbol("internals");function wo(e){return e&&String(e).trim().toLowerCase()}function gl(e){return e===!1||e==null?e:te.isArray(e)?e.map(gl):String(e)}function FN(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}function BN(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function Cb(e,t,n,r){if(te.isFunction(r))return r.call(this,t,n);if(te.isString(t)){if(te.isString(r))return t.indexOf(r)!==-1;if(te.isRegExp(r))return r.test(t)}}function VN(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function zN(e,t){const n=te.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}class yl{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,c){const u=wo(l);if(!u)throw new Error("header name must be a non-empty string");const d=te.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=gl(a))}const o=(a,l)=>te.forEach(a,(c,u)=>s(c,u,l));return te.isPlainObject(t)||t instanceof this.constructor?o(t,n):te.isString(t)&&(t=t.trim())&&!BN(t)?o(UN(t),n):t!=null&&s(n,t,r),this}get(t,n){if(t=wo(t),t){const r=te.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return FN(i);if(te.isFunction(n))return n.call(this,i,r);if(te.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=wo(t),t){const r=te.findKey(this,t);return!!(r&&(!n||Cb(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=wo(o),o){const a=te.findKey(r,o);a&&(!n||Cb(r,r[a],a,n))&&(delete r[a],i=!0)}}return te.isArray(t)?t.forEach(s):s(t),i}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(t){const n=this,r={};return te.forEach(this,(i,s)=>{const o=te.findKey(r,s);if(o){n[o]=gl(i),delete n[s];return}const a=t?VN(s):String(s).trim();a!==s&&delete n[s],n[a]=gl(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return te.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&te.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
279
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[kb]=this[kb]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=wo(o);r[a]||(zN(i,o),r[a]=!0)}return te.isArray(t)?t.forEach(s):s(t),this}}yl.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),te.freezeMethods(yl.prototype),te.freezeMethods(yl);const Ir=yl;function gd(e,t){const n=this||md,r=t||n,i=Ir.from(r.headers);let s=r.data;return te.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Eb(e){return!!(e&&e.__CANCEL__)}function xo(e,t,n){dt.call(this,e??"canceled",dt.ERR_CANCELED,t,n),this.name="CanceledError"}te.inherits(xo,dt,{__CANCEL__:!0});const ZN=null;function WN(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new dt("Request failed with status code "+n.status,[dt.ERR_BAD_REQUEST,dt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const HN=dr.isStandardBrowserEnv?function(){return{write:function(n,r,i,s,o,a){const l=[];l.push(n+"="+encodeURIComponent(r)),te.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),te.isString(s)&&l.push("path="+s),te.isString(o)&&l.push("domain="+o),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function qN(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function KN(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Sb(e,t){return e&&!qN(t)?KN(e,t):t}const JN=dr.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let o=s;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(o){const a=te.isString(o)?i(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function GN(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function YN(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[s];o||(o=c),n[i]=l,r[i]=c;let d=s,h=0;for(;d!==i;)h+=n[d++],d=d%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function Tb(e,t){let n=0;const r=YN(50,250);return i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-n,l=r(a),c=s<=o;n=s;const u={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&c?(o-s)/l:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}const vl={http:ZN,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let i=e.data;const s=Ir.from(e.headers).normalize(),o=e.responseType;let a;function l(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}te.isFormData(i)&&(dr.isStandardBrowserEnv||dr.isStandardBrowserWebWorkerEnv)&&s.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const f=e.auth.username||"",p=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(f+":"+p))}const u=Sb(e.baseURL,e.url);c.open(e.method.toUpperCase(),bb(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function d(){if(!c)return;const f=Ir.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),m={data:!o||o==="text"||o==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:f,config:e,request:c};WN(function(v){n(v),l()},function(v){r(v),l()},m),c=null}if("onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(d)},c.onabort=function(){c&&(r(new dt("Request aborted",dt.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new dt("Network Error",dt.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let p=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const m=e.transitional||xb;e.timeoutErrorMessage&&(p=e.timeoutErrorMessage),r(new dt(p,m.clarifyTimeoutError?dt.ETIMEDOUT:dt.ECONNABORTED,e,c)),c=null},dr.isStandardBrowserEnv){const f=(e.withCredentials||JN(u))&&e.xsrfCookieName&&HN.read(e.xsrfCookieName);f&&s.set(e.xsrfHeaderName,f)}i===void 0&&s.setContentType(null),"setRequestHeader"in c&&te.forEach(s.toJSON(),function(p,m){c.setRequestHeader(m,p)}),te.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&o!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",Tb(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",Tb(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=f=>{c&&(r(!f||f.type?new xo(null,e,c):f),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const h=GN(u);if(h&&dr.protocols.indexOf(h)===-1){r(new dt("Unsupported protocol "+h+":",dt.ERR_BAD_REQUEST,e));return}c.send(i||null)})}};te.forEach(vl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const QN={getAdapter:e=>{e=te.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=te.isString(n)?vl[n.toLowerCase()]:n));i++);if(!r)throw r===!1?new dt(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(te.hasOwnProp(vl,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!te.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:vl};function yd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xo(null,e)}function Ob(e){return yd(e),e.headers=Ir.from(e.headers),e.data=gd.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),QN.getAdapter(e.adapter||md.adapter)(e).then(function(r){return yd(e),r.data=gd.call(e,e.transformResponse,r),r.headers=Ir.from(r.headers),r},function(r){return Eb(r)||(yd(e),r&&r.response&&(r.response.data=gd.call(e,e.transformResponse,r.response),r.response.headers=Ir.from(r.response.headers))),Promise.reject(r)})}const Ib=e=>e instanceof Ir?e.toJSON():e;function ds(e,t){t=t||{};const n={};function r(c,u,d){return te.isPlainObject(c)&&te.isPlainObject(u)?te.merge.call({caseless:d},c,u):te.isPlainObject(u)?te.merge({},u):te.isArray(u)?u.slice():u}function i(c,u,d){if(te.isUndefined(u)){if(!te.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function s(c,u){if(!te.isUndefined(u))return r(void 0,u)}function o(c,u){if(te.isUndefined(u)){if(!te.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u)=>i(Ib(c),Ib(u),!0)};return te.forEach(Object.keys(e).concat(Object.keys(t)),function(u){const d=l[u]||i,h=d(e[u],t[u],u);te.isUndefined(h)&&d!==a||(n[u]=h)}),n}const Pb="1.2.5",vd={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{vd[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ab={};vd.transitional=function(t,n,r){function i(s,o){return"[Axios v"+Pb+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new dt(i(o," has been removed"+(n?" in "+n:"")),dt.ERR_DEPRECATED);return n&&!Ab[o]&&(Ab[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,a):!0}};function XN(e,t,n){if(typeof e!="object")throw new dt("options must be an object",dt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new dt("option "+s+" must be "+l,dt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new dt("Unknown option "+s,dt.ERR_BAD_OPTION)}}const bd={assertOptions:XN,validators:vd},ni=bd.validators;class bl{constructor(t){this.defaults=t,this.interceptors={request:new wb,response:new wb}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ds(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&bd.assertOptions(r,{silentJSONParsing:ni.transitional(ni.boolean),forcedJSONParsing:ni.transitional(ni.boolean),clarifyTimeoutError:ni.transitional(ni.boolean)},!1),i!==void 0&&bd.assertOptions(i,{encode:ni.function,serialize:ni.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o;o=s&&te.merge(s.common,s[n.method]),o&&te.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=Ir.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const p=[Ob.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(d=0;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(y){m.call(this,y);break}}try{u=Ob.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=ds(this.defaults,t);const n=Sb(t.baseURL,t.url);return bb(n,t.params,t.paramsSerializer)}}te.forEach(["delete","get","head","options"],function(t){bl.prototype[t]=function(n,r){return this.request(ds(r||{},{method:t,url:n,data:(r||{}).data}))}}),te.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(ds(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}bl.prototype[t]=n(),bl.prototype[t+"Form"]=n(!0)});const wl=bl;class wd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new xo(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new wd(function(i){t=i}),cancel:t}}}const e2=wd;function t2(e){return function(n){return e.apply(null,n)}}function n2(e){return te.isObject(e)&&e.isAxiosError===!0}const xd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(xd).forEach(([e,t])=>{xd[t]=e});const r2=xd;function Rb(e){const t=new wl(e),n=ib(wl.prototype.request,t);return te.extend(n,wl.prototype,t,{allOwnKeys:!0}),te.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Rb(ds(e,i))},n}const zt=Rb(md);zt.Axios=wl,zt.CanceledError=xo,zt.CancelToken=e2,zt.isCancel=Eb,zt.VERSION=Pb,zt.toFormData=pl,zt.AxiosError=dt,zt.Cancel=zt.CanceledError,zt.all=function(t){return Promise.all(t)},zt.spread=t2,zt.isAxiosError=n2,zt.mergeConfig=ds,zt.AxiosHeaders=Ir,zt.formToJSON=e=>_b(te.isHTMLForm(e)?new FormData(e):e),zt.HttpStatusCode=r2,zt.default=zt;const Pt=zt,Ut="https://webchat.botpress.cloud".replace(/\/+$/,"");class i2{constructor(t,n=Ut,r=Pt){E(this,"configuration");this.basePath=n,this.axios=r,t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}}class s2 extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}}const Zt="https://example.com",pt=function(e,t,n){if(n==null)throw new s2(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function _d(e,t,n=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>_d(e,r,n)):Object.keys(t).forEach(r=>_d(e,t[r],`${n}${n!==""?".":""}${r}`)):e.has(n)?e.append(n,t):e.set(n,t))}const Wt=function(e,...t){const n=new URLSearchParams(e.search);_d(n,t),e.search=n.toString()},fs=function(e,t,n){const r=typeof e!="string";return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},Ht=function(e){return e.pathname+e.search+e.hash},qt=function(e,t,n,r){return(i=t,s=n)=>{const o={...e.options,url:((r==null?void 0:r.basePath)||s)+e.url};return i.request(o)}},o2=function(e){return{addParticipant:async(t,n,r,i={})=>{pt("addParticipant","xUserKey",t),pt("addParticipant","id",n);const s="/v1/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...i},c={},u={};t!=null&&(c["x-user-key"]=String(t)),c["Content-Type"]="application/json",Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},l.data=fs(r,l,e),{url:Ht(o),options:l}},createConversation:async(t,n,r={})=>{pt("createConversation","xUserKey",t);const i="/v1/conversations",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"POST",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=fs(n,a,e),{url:Ht(s),options:a}},createEvent:async(t,n,r={})=>{pt("createEvent","xUserKey",t);const i="/v1/events",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"POST",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=fs(n,a,e),{url:Ht(s),options:a}},createMessage:async(t,n,r={})=>{pt("createMessage","xUserKey",t);const i="/v1/messages",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"POST",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=fs(n,a,e),{url:Ht(s),options:a}},createUser:async(t,n={})=>{const r="/v1/users",i=new URL(r,Zt);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",Wt(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=fs(t,o,e),{url:Ht(i),options:o}},deleteConversation:async(t,n,r={})=>{pt("deleteConversation","xUserKey",t),pt("deleteConversation","id",n);const i="/v1/conversations/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"DELETE",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},deleteMessage:async(t,n,r={})=>{pt("deleteMessage","xUserKey",t),pt("deleteMessage","id",n);const i="/v1/messages/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"DELETE",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},deleteUser:async(t,n={})=>{pt("deleteUser","xUserKey",t);const r="/v1/users/me",i=new URL(r,Zt);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...n},a={},l={};t!=null&&(a["x-user-key"]=String(t)),Wt(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:Ht(i),options:o}},getConversation:async(t,n,r={})=>{pt("getConversation","xUserKey",t),pt("getConversation","id",n);const i="/v1/conversations/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},getEvent:async(t,n,r={})=>{pt("getEvent","xUserKey",t),pt("getEvent","id",n);const i="/v1/events/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},getMessage:async(t,n,r={})=>{pt("getMessage","xUserKey",t),pt("getMessage","id",n);const i="/v1/messages/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},getParticipant:async(t,n,r,i={})=>{pt("getParticipant","xUserKey",t),pt("getParticipant","id",n),pt("getParticipant","userId",r);const s="/v1/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(n))).replace("{userId}",encodeURIComponent(String(r))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"GET",...a,...i},c={},u={};t!=null&&(c["x-user-key"]=String(t)),Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:Ht(o),options:l}},getUser:async(t,n={})=>{pt("getUser","xUserKey",t);const r="/v1/users/me",i=new URL(r,Zt);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...n},a={},l={};t!=null&&(a["x-user-key"]=String(t)),Wt(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:Ht(i),options:o}},listConversationMessages:async(t,n,r,i={})=>{pt("listConversationMessages","xUserKey",t),pt("listConversationMessages","id",n);const s="/v1/conversations/{id}/messages".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"GET",...a,...i},c={},u={};r!==void 0&&(u.nextToken=r),t!=null&&(c["x-user-key"]=String(t)),Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:Ht(o),options:l}},listConversations:async(t,n,r={})=>{pt("listConversations","xUserKey",t);const i="/v1/conversations",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},listParticipants:async(t,n,r,i={})=>{pt("listParticipants","xUserKey",t),pt("listParticipants","id",n);const s="/v1/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"GET",...a,...i},c={},u={};r!==void 0&&(u.nextToken=r),t!=null&&(c["x-user-key"]=String(t)),Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:Ht(o),options:l}},listenConversation:async(t,n,r={})=>{pt("listenConversation","xUserKey",t),pt("listenConversation","id",n);const i="/v1/conversations/{id}/listen".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},removeParticipant:async(t,n,r,i={})=>{pt("removeParticipant","xUserKey",t),pt("removeParticipant","id",n),pt("removeParticipant","userId",r);const s="/v1/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(n))).replace("{userId}",encodeURIComponent(String(r))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"DELETE",...a,...i},c={},u={};t!=null&&(c["x-user-key"]=String(t)),Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:Ht(o),options:l}},updateUser:async(t,n,r={})=>{pt("updateUser","xUserKey",t);const i="/v1/users/me",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"PUT",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=fs(n,a,e),{url:Ht(s),options:a}}}},Kt=function(e){const t=o2(e);return{async addParticipant(n,r,i,s){const o=await t.addParticipant(n,r,i,s);return qt(o,Pt,Ut,e)},async createConversation(n,r,i){const s=await t.createConversation(n,r,i);return qt(s,Pt,Ut,e)},async createEvent(n,r,i){const s=await t.createEvent(n,r,i);return qt(s,Pt,Ut,e)},async createMessage(n,r,i){const s=await t.createMessage(n,r,i);return qt(s,Pt,Ut,e)},async createUser(n,r){const i=await t.createUser(n,r);return qt(i,Pt,Ut,e)},async deleteConversation(n,r,i){const s=await t.deleteConversation(n,r,i);return qt(s,Pt,Ut,e)},async deleteMessage(n,r,i){const s=await t.deleteMessage(n,r,i);return qt(s,Pt,Ut,e)},async deleteUser(n,r){const i=await t.deleteUser(n,r);return qt(i,Pt,Ut,e)},async getConversation(n,r,i){const s=await t.getConversation(n,r,i);return qt(s,Pt,Ut,e)},async getEvent(n,r,i){const s=await t.getEvent(n,r,i);return qt(s,Pt,Ut,e)},async getMessage(n,r,i){const s=await t.getMessage(n,r,i);return qt(s,Pt,Ut,e)},async getParticipant(n,r,i,s){const o=await t.getParticipant(n,r,i,s);return qt(o,Pt,Ut,e)},async getUser(n,r){const i=await t.getUser(n,r);return qt(i,Pt,Ut,e)},async listConversationMessages(n,r,i,s){const o=await t.listConversationMessages(n,r,i,s);return qt(o,Pt,Ut,e)},async listConversations(n,r,i){const s=await t.listConversations(n,r,i);return qt(s,Pt,Ut,e)},async listParticipants(n,r,i,s){const o=await t.listParticipants(n,r,i,s);return qt(o,Pt,Ut,e)},async listenConversation(n,r,i){const s=await t.listenConversation(n,r,i);return qt(s,Pt,Ut,e)},async removeParticipant(n,r,i,s){const o=await t.removeParticipant(n,r,i,s);return qt(o,Pt,Ut,e)},async updateUser(n,r,i){const s=await t.updateUser(n,r,i);return qt(s,Pt,Ut,e)}}};class a2 extends i2{addParticipant(t,n){return Kt(this.configuration).addParticipant(t.xUserKey,t.id,t.addParticipantBody,n).then(r=>r(this.axios,this.basePath))}createConversation(t,n){return Kt(this.configuration).createConversation(t.xUserKey,t.createConversationBody,n).then(r=>r(this.axios,this.basePath))}createEvent(t,n){return Kt(this.configuration).createEvent(t.xUserKey,t.createEventBody,n).then(r=>r(this.axios,this.basePath))}createMessage(t,n){return Kt(this.configuration).createMessage(t.xUserKey,t.createMessageBody,n).then(r=>r(this.axios,this.basePath))}createUser(t={},n){return Kt(this.configuration).createUser(t.createUserBody,n).then(r=>r(this.axios,this.basePath))}deleteConversation(t,n){return Kt(this.configuration).deleteConversation(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}deleteMessage(t,n){return Kt(this.configuration).deleteMessage(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}deleteUser(t,n){return Kt(this.configuration).deleteUser(t.xUserKey,n).then(r=>r(this.axios,this.basePath))}getConversation(t,n){return Kt(this.configuration).getConversation(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}getEvent(t,n){return Kt(this.configuration).getEvent(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}getMessage(t,n){return Kt(this.configuration).getMessage(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}getParticipant(t,n){return Kt(this.configuration).getParticipant(t.xUserKey,t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}getUser(t,n){return Kt(this.configuration).getUser(t.xUserKey,n).then(r=>r(this.axios,this.basePath))}listConversationMessages(t,n){return Kt(this.configuration).listConversationMessages(t.xUserKey,t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listConversations(t,n){return Kt(this.configuration).listConversations(t.xUserKey,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listParticipants(t,n){return Kt(this.configuration).listParticipants(t.xUserKey,t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listenConversation(t,n){return Kt(this.configuration).listenConversation(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}removeParticipant(t,n){return Kt(this.configuration).removeParticipant(t.xUserKey,t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}updateUser(t,n){return Kt(this.configuration).updateUser(t.xUserKey,t.updateUserBody,n).then(r=>r(this.axios,this.basePath))}}const l2={getRandomValues:e=>new Uint8Array(e.map(()=>Math.floor(Math.random()*256)))};let kd=typeof window<"u"&&typeof window.document<"u"?window.crypto:$u;kd.getRandomValues||(kd=l2);class wt extends Error{constructor(n,r,i,s,o,a){super(s);E(this,"isApiError",!0);this.code=n,this.description=r,this.type=i,this.message=s,this.error=o,this.id=a,this.id||(this.id=wt.generateId())}format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){const n=this.getPrefix(),r=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],i=4,s=Array.from(kd.getRandomValues(new Uint8Array(i))).map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase();return`${n}_${r}x${s}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}}const c2=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,Cd=e=>e instanceof wt||c2(e)&&e.isApiError===!0;class _o extends wt{constructor(t,n,r){super(500,"An unknown error occurred","Unknown",t,n,r)}}class u2 extends wt{constructor(t,n,r){super(500,"An internal error occurred","Internal",t,n,r)}}class d2 extends wt{constructor(t,n,r){super(401,"The request requires to be authenticated.","Unauthorized",t,n,r)}}class f2 extends wt{constructor(t,n,r){super(403,"The requested action can't be peform by this resource.","Forbidden",t,n,r)}}class h2 extends wt{constructor(t,n,r){super(413,"The request payload is too large.","PayloadTooLarge",t,n,r)}}class p2 extends wt{constructor(t,n,r){super(400,"The request payload is invalid.","InvalidPayload",t,n,r)}}class m2 extends wt{constructor(t,n,r){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,n,r)}}class g2 extends wt{constructor(t,n,r){super(405,"The requested method does not exist.","MethodNotFound",t,n,r)}}class y2 extends wt{constructor(t,n,r){super(404,"The requested resource does not exist.","ResourceNotFound",t,n,r)}}class v2 extends wt{constructor(t,n,r){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,n,r)}}class b2 extends wt{constructor(t,n,r){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,n,r)}}class w2 extends wt{constructor(t,n,r){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",t,n,r)}}class x2 extends wt{constructor(t,n,r){super(409,"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together.","RelationConflict",t,n,r)}}class _2 extends wt{constructor(t,n,r){super(409,"The resource cannot be deleted because it's referenced by another resource","ReferenceConstraint",t,n,r)}}class k2 extends wt{constructor(t,n,r){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,n,r)}}class C2 extends wt{constructor(t,n,r){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,n,r)}}class E2 extends wt{constructor(t,n,r){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,n,r)}}class S2 extends wt{constructor(t,n,r){super(409,"The record attempted to be created already exists.","AlreadyExists",t,n,r)}}class T2 extends wt{constructor(t,n,r){super(429,"The request has been rate limited.","RateLimited",t,n,r)}}class O2 extends wt{constructor(t,n,r){super(402,"A payment is required to perform this request.","PaymentRequired",t,n,r)}}class I2 extends wt{constructor(t,n,r){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",t,n,r)}}class P2 extends wt{constructor(t,n,r){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",t,n,r)}}class A2 extends wt{constructor(t,n,r){super(400,"Request payload contains breaking changes which is not allowed for this resource without a version increment.","BreakingChanges",t,n,r)}}const R2={Unknown:_o,Internal:u2,Unauthorized:d2,Forbidden:f2,PayloadTooLarge:h2,InvalidPayload:p2,UnsupportedMediaType:m2,MethodNotFound:g2,ResourceNotFound:y2,InvalidJsonSchema:v2,InvalidDataFormat:b2,InvalidIdentifier:w2,RelationConflict:x2,ReferenceConstraint:_2,ReferenceNotFound:k2,InvalidQuery:C2,Runtime:E2,AlreadyExists:S2,RateLimited:T2,PaymentRequired:O2,QuotaExceeded:I2,LimitExceeded:P2,BreakingChanges:A2},$b=e=>Cd(e)?e:e instanceof Error?new _o(e.message,e):typeof e=="string"?new _o(e):$2(e);function $2(e){if(typeof e=="object"&&"code"in e&&"type"in e&&"id"in e&&"message"in e&&typeof e.type=="string"&&typeof e.message=="string"){const t=R2[e.type];return t?new t(e.message,void 0,e.id||"UNKNOWN"):new _o(`An unclassified API error occurred: ${e.message} (Type: ${e.type}, Code: ${e.code})`)}return new _o("An invalid error occurred: "+JSON.stringify(e))}class M2{constructor(t,n,r){E(this,"_innerClient");E(this,"addParticipant",({id:t,xUserKey:n,...r})=>this._innerClient.addParticipant({id:t,xUserKey:n,addParticipantBody:r}).then(i=>i.data).catch(i=>{throw Jt(i)}));E(this,"createConversation",({xUserKey:t,...n})=>this._innerClient.createConversation({xUserKey:t,createConversationBody:n}).then(r=>r.data).catch(r=>{throw Jt(r)}));E(this,"deleteConversation",t=>this._innerClient.deleteConversation(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"getConversation",t=>this._innerClient.getConversation(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"getParticipant",t=>this._innerClient.getParticipant(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"listConversationMessages",t=>this._innerClient.listConversationMessages(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"listConversations",t=>this._innerClient.listConversations(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"listParticipants",t=>this._innerClient.listParticipants(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"listenConversation",t=>this._innerClient.listenConversation(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"removeParticipant",t=>this._innerClient.removeParticipant(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"createMessage",({xUserKey:t,...n})=>this._innerClient.createMessage({xUserKey:t,createMessageBody:n}).then(r=>r.data).catch(r=>{throw Jt(r)}));E(this,"deleteMessage",t=>this._innerClient.deleteMessage(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"getMessage",t=>this._innerClient.getMessage(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"createUser",t=>this._innerClient.createUser({createUserBody:t}).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"deleteUser",t=>this._innerClient.deleteUser(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"getUser",t=>this._innerClient.getUser(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"updateUser",({xUserKey:t,...n})=>this._innerClient.updateUser({xUserKey:t,updateUserBody:n}).then(r=>r.data).catch(r=>{throw Jt(r)}));E(this,"createEvent",({xUserKey:t,...n})=>this._innerClient.createEvent({xUserKey:t,createEventBody:n}).then(r=>r.data).catch(r=>{throw Jt(r)}));E(this,"getEvent",t=>this._innerClient.getEvent(t).then(n=>n.data).catch(n=>{throw Jt(n)}));this._innerClient=new a2(t,n,r)}}function Jt(e){var t;return Pt.isAxiosError(e)&&((t=e.response)!=null&&t.data)?$b(e.response.data):$b(e)}class Mb{constructor(){E(this,"listeners",{})}emit(t,n){const r=this.listeners[t];if(r)for(const i of[...r])i(n)}onceOrMore(t,n){const r=i=>{n(i)==="stop-listening"&&this.off(t,r)};this.on(t,r)}once(t,n){const r=i=>{this.off(t,r),n(i)};this.on(t,r)}on(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}off(t,n){const r=this.listeners[t];if(!r)return;const i=r.indexOf(n);i!==-1&&r.splice(i,1)}cleanup(){this.listeners={}}}var Ed={exports:{}};/** @license
272
+ `);const b=y.state[a];if(b==null)return;JSON.stringify(i.getState())!==JSON.stringify(b)&&f(b);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(y)});case"DISPATCH":switch(m.payload.type){case"RESET":return f(p),a===void 0?u==null?void 0:u.init(i.getState()):u==null?void 0:u.init(ba(l.name));case"COMMIT":if(a===void 0){u==null||u.init(i.getState());return}return u==null?void 0:u.init(ba(l.name));case"ROLLBACK":return mu(m.state,y=>{if(a===void 0){f(y),u==null||u.init(i.getState());return}f(y[a]),u==null||u.init(ba(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return mu(m.state,y=>{if(a===void 0){f(y);return}JSON.stringify(i.getState())!==JSON.stringify(y[a])&&f(y[a])});case"IMPORT_STATE":{const{nextLiftedState:y}=m.payload,b=(v=y.computedStates.slice(-1)[0])==null?void 0:v.state;if(!b)return;f(a===void 0?b:b[a]),u==null||u.send(null,y);return}case"PAUSE_RECORDING":return h=!h}return}}),p},mu=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function HI(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var s;const o=l=>l===null?null:JSON.parse(l,t==null?void 0:t.reviver),a=(s=n.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>n.setItem(i,JSON.stringify(s,t==null?void 0:t.replacer)),removeItem:i=>n.removeItem(i)}}const Vs=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Vs(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Vs(r)(n)}}}},qI=(e,t)=>(n,r,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:v=>v,version:0,merge:(v,y)=>({...y,...v}),...t},o=!1;const a=new Set,l=new Set;let c;try{c=s.getStorage()}catch{}if(!c)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...v)},r,i);const u=Vs(s.serialize),d=()=>{const v=s.partialize({...r()});let y;const b=u({state:v,version:s.version}).then(x=>c.setItem(s.name,x)).catch(x=>{y=x});if(y)throw y;return b},h=i.setState;i.setState=(v,y)=>{h(v,y),d()};const f=e((...v)=>{n(...v),d()},r,i);let p;const m=()=>{var v;if(!c)return;o=!1,a.forEach(b=>b(r()));const y=((v=s.onRehydrateStorage)==null?void 0:v.call(s,r()))||void 0;return Vs(c.getItem.bind(c))(s.name).then(b=>{if(b)return s.deserialize(b)}).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==s.version){if(s.migrate)return s.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var x;return p=s.merge(b,(x=r())!=null?x:f),n(p,!0),d()}).then(()=>{y==null||y(p,void 0),o=!0,l.forEach(b=>b(p))}).catch(b=>{y==null||y(void 0,b)})};return i.persist={setOptions:v=>{s={...s,...v},v.getStorage&&(c=v.getStorage())},clearStorage:()=>{c==null||c.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},m(),p||f},KI=(e,t)=>(n,r,i)=>{let s={storage:HI(()=>localStorage),partialize:m=>m,version:0,merge:(m,v)=>({...v,...m}),...t},o=!1;const a=new Set,l=new Set;let c=s.storage;if(!c)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...m)},r,i);const u=()=>{const m=s.partialize({...r()});return c.setItem(s.name,{state:m,version:s.version})},d=i.setState;i.setState=(m,v)=>{d(m,v),u()};const h=e((...m)=>{n(...m),u()},r,i);let f;const p=()=>{var m,v;if(!c)return;o=!1,a.forEach(b=>{var x;return b((x=r())!=null?x:h)});const y=((v=s.onRehydrateStorage)==null?void 0:v.call(s,(m=r())!=null?m:h))||void 0;return Vs(c.getItem.bind(c))(s.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==s.version){if(s.migrate)return s.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var x;return f=s.merge(b,(x=r())!=null?x:h),n(f,!0),u()}).then(()=>{y==null||y(f,void 0),f=r(),o=!0,l.forEach(b=>b(f))}).catch(b=>{y==null||y(void 0,b)})};return i.persist={setOptions:m=>{s={...s,...m},m.storage&&(c=m.storage)},clearStorage:()=>{c==null||c.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>o,onHydrate:m=>(a.add(m),()=>{a.delete(m)}),onFinishHydration:m=>(l.add(m),()=>{l.delete(m)})},s.skipHydration||p(),f||h},JI=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?qI(e,t):KI(e,t),Hr=zI()(WI(JI((e,t)=>({messageHistory:{},addMessageToHistory:({userId:n,message:r})=>e(i=>({...i,messageHistory:{...i.messageHistory,[n]:[r,...(i.messageHistory[n]??[]).slice(0,100)]}})),clientMode:"",setClientMode:n=>{const{clearAll:r,clientMode:i}=t();i!==n&&r(),e(s=>({...s,clientMode:n}))},setUser:n=>e(r=>({...r,user:n})),setConversationId:n=>e(r=>({...r,conversationId:n})),clearAll:()=>{e(n=>({...n,messageHistory:{},user:void 0,conversationId:void 0}))}}),{name:"botpress-webchat"})));var Mn=function(){return Mn=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Mn.apply(this,arguments)};function $m(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function GI(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function YI(){var e=_.useRef(!1),t=_.useCallback(function(){return e.current},[]);return _.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function QI(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=_.useRef(0),i=YI(),s=_.useState(n),o=s[0],a=s[1],l=_.useCallback(function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];var d=++r.current;return o.loading||a(function(h){return Mn(Mn({},h),{loading:!0})}),e.apply(void 0,c).then(function(h){return i()&&d===r.current&&a({value:h,loading:!1}),h},function(h){return i()&&d===r.current&&a({error:h,loading:!1}),h})},t);return[o,l]}function gu(e,t){t===void 0&&(t=[]);var n=QI(e,t,{loading:!0}),r=n[0],i=n[1];return _.useEffect(function(){i()},[i]),r}function XI(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function eP(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var tP=function(e){_.useEffect(e,[])};const vi=tP;var nP=function(e){vi(function(){e()})};const rP=nP;var iP=function(e){var t=_.useRef(e);t.current=e,vi(function(){return function(){return t.current()}})};const sP=iP;var oP=function(e){var t=_.useRef(0),n=_.useState(e),r=n[0],i=n[1],s=_.useCallback(function(o){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){i(o)})},[]);return sP(function(){cancelAnimationFrame(t.current)}),[r,s]};const aP=oP;var lP=function(e){process.env.NODE_ENV==="development"&&(typeof e!="object"||typeof e.current>"u")&&console.error("`useScroll` expects a single ref argument.");var t=aP({x:0,y:0}),n=t[0],r=t[1];return _.useEffect(function(){var i=function(){e.current&&r({x:e.current.scrollLeft,y:e.current.scrollTop})};return e.current&&XI(e.current,"scroll",i,{capture:!1,passive:!0}),function(){e.current&&eP(e.current,"scroll",i)}},[e]),n};const cP=lP,uP=e=>{const t=new Date;return e.getTime()-t.getTime()},dP=(e=uP)=>{const[t,n]=_.useState(0),[r,i]=_.useState(),s=()=>n(o=>o+1);return gu(async()=>{if(r){const o=setTimeout(s,e(r));return()=>{clearTimeout(o)}}},[r]),[t,i]};var Mm={},yu={},Lm={};Object.defineProperty(Lm,"__esModule",{value:!0});var wa={},fP=Me&&Me.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(wa,"__esModule",{value:!0}),wa.Emitter=void 0;let hP=class{constructor(){this.listeners={}}on(t,n,r=!1){const i=this.listeners[t];i?r?i.unshift(n):i.push(n):this.listeners[t]=[n]}emit(t,n){return fP(this,void 0,void 0,function*(){const r=this.listeners[t];if(r!=null&&r.length){for(const i of r)yield i(n);return!0}else return!1})}};wa.Emitter=hP;var Dm={};Object.defineProperty(Dm,"__esModule",{value:!0});var Nm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HealthEventType=void 0,function(t){t.Create="create",t.Configure="configure",t.Start="start",t.StartFailure="start-failure",t.Initialize="initialize",t.InitializeFailure="initialize-failure",t.Sleep="sleep",t.Delete="delete"}(e.HealthEventType||(e.HealthEventType={}))})(Nm);var jm={};Object.defineProperty(jm,"__esModule",{value:!0});var Um={};Object.defineProperty(Um,"__esModule",{value:!0});var Fm={};Object.defineProperty(Fm,"__esModule",{value:!0});var Bm={};Object.defineProperty(Bm,"__esModule",{value:!0}),function(e){var t=Me&&Me.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=Me&&Me.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(Lm,e),n(wa,e),n(Dm,e),n(Nm,e),n(jm,e),n(Um,e),n(Fm,e),n(Bm,e)}(yu);var xa={},Vm={},vu={exports:{}},_a={},bu={},ka={},zs={},Hi={},bi={},qi={},Ki={},er={};Object.defineProperty(er,"__esModule",{value:!0}),er.ERROR_PACKET=er.PACKET_TYPES_REVERSE=er.PACKET_TYPES=void 0;const tr=Object.create(null);er.PACKET_TYPES=tr,tr.open="0",tr.close="1",tr.ping="2",tr.pong="3",tr.message="4",tr.upgrade="5",tr.noop="6";const zm=Object.create(null);er.PACKET_TYPES_REVERSE=zm,Object.keys(tr).forEach(e=>{zm[tr[e]]=e});const pP={type:"error",data:"parser error"};er.ERROR_PACKET=pP,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.encodePacket=Ki.encodePacketToBinary=void 0;const mP=er,Zm=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Wm=typeof ArrayBuffer=="function",Hm=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,qm=({type:e,data:t},n,r)=>Zm&&t instanceof Blob?n?r(t):Km(t,r):Wm&&(t instanceof ArrayBuffer||Hm(t))?n?r(t):Km(new Blob([t]),r):r(mP.PACKET_TYPES[e]+(t||""));Ki.encodePacket=qm;const Km=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Jm(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let wu;function gP(e,t){if(Zm&&e.data instanceof Blob)return e.data.arrayBuffer().then(Jm).then(t);if(Wm&&(e.data instanceof ArrayBuffer||Hm(e.data)))return t(Jm(e.data));qm(e,!1,n=>{wu||(wu=new TextEncoder),t(wu.encode(n))})}Ki.encodePacketToBinary=gP;var Ca={},Ji={};Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.decode=Ji.encode=void 0;const Gi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zs=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Gi.length;e++)Zs[Gi.charCodeAt(e)]=e;const yP=e=>{let t=new Uint8Array(e),n,r=t.length,i="";for(n=0;n<r;n+=3)i+=Gi[t[n]>>2],i+=Gi[(t[n]&3)<<4|t[n+1]>>4],i+=Gi[(t[n+1]&15)<<2|t[n+2]>>6],i+=Gi[t[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};Ji.encode=yP;const vP=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)s=Zs[e.charCodeAt(r)],o=Zs[e.charCodeAt(r+1)],a=Zs[e.charCodeAt(r+2)],l=Zs[e.charCodeAt(r+3)],u[i++]=s<<2|o>>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c};Ji.decode=vP,Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.decodePacket=void 0;const Ea=er,bP=Ji,wP=typeof ArrayBuffer=="function",xP=(e,t)=>{if(typeof e!="string")return{type:"message",data:Gm(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:_P(e.substring(1),t)}:Ea.PACKET_TYPES_REVERSE[n]?e.length>1?{type:Ea.PACKET_TYPES_REVERSE[n],data:e.substring(1)}:{type:Ea.PACKET_TYPES_REVERSE[n]}:Ea.ERROR_PACKET};Ca.decodePacket=xP;const _P=(e,t)=>{if(wP){const n=(0,bP.decode)(e);return Gm(n,t)}else return{base64:!0,data:e}},Gm=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=e.createPacketDecoderStream=e.createPacketEncoderStream=void 0;const t=Ki;Object.defineProperty(e,"encodePacket",{enumerable:!0,get:function(){return t.encodePacket}});const n=Ca;Object.defineProperty(e,"decodePacket",{enumerable:!0,get:function(){return n.decodePacket}});const r=er,i=String.fromCharCode(30),s=(h,f)=>{const p=h.length,m=new Array(p);let v=0;h.forEach((y,b)=>{(0,t.encodePacket)(y,!1,x=>{m[b]=x,++v===p&&f(m.join(i))})})};e.encodePayload=s;const o=(h,f)=>{const p=h.split(i),m=[];for(let v=0;v<p.length;v++){const y=(0,n.decodePacket)(p[v],f);if(m.push(y),y.type==="error")break}return m};e.decodePayload=o;function a(){return new TransformStream({transform(h,f){(0,t.encodePacketToBinary)(h,p=>{const m=p.length;let v;if(m<126)v=new Uint8Array(1),new DataView(v.buffer).setUint8(0,m);else if(m<65536){v=new Uint8Array(3);const y=new DataView(v.buffer);y.setUint8(0,126),y.setUint16(1,m)}else{v=new Uint8Array(9);const y=new DataView(v.buffer);y.setUint8(0,127),y.setBigUint64(1,BigInt(m))}h.data&&typeof h.data!="string"&&(v[0]|=128),f.enqueue(v),f.enqueue(p)})}})}e.createPacketEncoderStream=a;let l;function c(h){return h.reduce((f,p)=>f+p.length,0)}function u(h,f){if(h[0].length===f)return h.shift();const p=new Uint8Array(f);let m=0;for(let v=0;v<f;v++)p[v]=h[0][m++],m===h[0].length&&(h.shift(),m=0);return h.length&&m<h[0].length&&(h[0]=h[0].slice(m)),p}function d(h,f){l||(l=new TextDecoder);const p=[];let m=0,v=-1,y=!1;return new TransformStream({transform(b,x){for(p.push(b);;){if(m===0){if(c(p)<1)break;const I=u(p,1);y=(I[0]&128)===128,v=I[0]&127,v<126?m=3:v===126?m=1:m=2}else if(m===1){if(c(p)<2)break;const I=u(p,2);v=new DataView(I.buffer,I.byteOffset,I.length).getUint16(0),m=3}else if(m===2){if(c(p)<8)break;const I=u(p,8),A=new DataView(I.buffer,I.byteOffset,I.length),O=A.getUint32(0);if(O>Math.pow(2,53-32)-1){x.enqueue(r.ERROR_PACKET);break}v=O*Math.pow(2,32)+A.getUint32(4),m=3}else{if(c(p)<v)break;const I=u(p,v);x.enqueue((0,n.decodePacket)(y?I:l.decode(I),f)),m=0}if(v===0||v>h){x.enqueue(r.ERROR_PACKET);break}}}})}e.createPacketDecoderStream=d,e.protocol=4})(qi);function pn(e){if(e)return kP(e)}function kP(e){for(var t in pn.prototype)e[t]=pn.prototype[t];return e}pn.prototype.on=pn.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},pn.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},pn.prototype.off=pn.prototype.removeListener=pn.prototype.removeAllListeners=pn.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this},pn.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},pn.prototype.emitReserved=pn.prototype.emit,pn.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},pn.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Yi=$l(Object.freeze(Object.defineProperty({__proto__:null,Emitter:pn},Symbol.toStringTag,{value:"Module"})));var Ln={},wi={};Object.defineProperty(wi,"__esModule",{value:!0}),wi.globalThisShim=void 0,wi.globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.byteLength=Ln.installTimerFunctions=Ln.pick=void 0;const qr=wi;function CP(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}Ln.pick=CP;const EP=qr.globalThisShim.setTimeout,SP=qr.globalThisShim.clearTimeout;function TP(e,t){t.useNativeTimers?(e.setTimeoutFn=EP.bind(qr.globalThisShim),e.clearTimeoutFn=SP.bind(qr.globalThisShim)):(e.setTimeoutFn=qr.globalThisShim.setTimeout.bind(qr.globalThisShim),e.clearTimeoutFn=qr.globalThisShim.clearTimeout.bind(qr.globalThisShim))}Ln.installTimerFunctions=TP;const OP=1.33;function IP(e){return typeof e=="string"?PP(e):Math.ceil((e.byteLength||e.size)*OP)}Ln.byteLength=IP;function PP(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}var xu={exports:{}},_u,Ym;function AP(){if(Ym)return _u;Ym=1;var e=1e3,t=e*60,n=t*60,r=n*24,i=r*7,s=r*365.25;_u=function(u,d){d=d||{};var h=typeof u;if(h==="string"&&u.length>0)return o(u);if(h==="number"&&isFinite(u))return d.long?l(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var h=parseFloat(d[1]),f=(d[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return h*s;case"weeks":case"week":case"w":return h*i;case"days":case"day":case"d":return h*r;case"hours":case"hour":case"hrs":case"hr":case"h":return h*n;case"minutes":case"minute":case"mins":case"min":case"m":return h*t;case"seconds":case"second":case"secs":case"sec":case"s":return h*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(u){var d=Math.abs(u);return d>=r?Math.round(u/r)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function l(u){var d=Math.abs(u);return d>=r?c(u,d,r,"day"):d>=n?c(u,d,n,"hour"):d>=t?c(u,d,t,"minute"):d>=e?c(u,d,e,"second"):u+" ms"}function c(u,d,h,f){var p=d>=h*1.5;return Math.round(u/h)+" "+f+(p?"s":"")}return _u}function RP(e){n.debug=n,n.default=n,n.coerce=l,n.disable=s,n.enable=i,n.enabled=o,n.humanize=AP(),n.destroy=c,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let h=0;h<u.length;h++)d=(d<<5)-d+u.charCodeAt(h),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,h=null,f,p;function m(...v){if(!m.enabled)return;const y=m,b=Number(new Date),x=b-(d||b);y.diff=x,y.prev=d,y.curr=b,d=b,v[0]=n.coerce(v[0]),typeof v[0]!="string"&&v.unshift("%O");let I=0;v[0]=v[0].replace(/%([a-zA-Z%])/g,(O,j)=>{if(O==="%%")return"%";I++;const U=n.formatters[j];if(typeof U=="function"){const H=v[I];O=U.call(y,H),v.splice(I,1),I--}return O}),n.formatArgs.call(y,v),(y.log||n.log).apply(y,v)}return m.namespace=u,m.useColors=n.useColors(),m.color=n.selectColor(u),m.extend=r,m.destroy=n.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(f!==n.namespaces&&(f=n.namespaces,p=n.enabled(u)),p),set:v=>{h=v}}),typeof n.init=="function"&&n.init(m),m}function r(u,d){const h=n(this.namespace+(typeof d>"u"?":":d)+u);return h.log=this.log,h}function i(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const h=(typeof u=="string"?u:"").split(/[\s,]+/),f=h.length;for(d=0;d<f;d++)h[d]&&(u=h[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function s(){const u=[...n.names.map(a),...n.skips.map(a).map(d=>"-"+d)].join(",");return n.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let d,h;for(d=0,h=n.skips.length;d<h;d++)if(n.skips[d].test(u))return!1;for(d=0,h=n.names.length;d<h;d++)if(n.names[d].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){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 n.enable(n.load()),n}var $P=RP;(function(e,t){t.formatArgs=r,t.save=i,t.load=s,t.useColors=n,t.storage=o(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!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`."))}})(),t.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 n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1: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&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;l.splice(1,0,c,"color: inherit");let u=0,d=0;l[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(u++,h==="%c"&&(d=u))}),l.splice(d,0,c)}t.log=console.debug||console.log||(()=>{});function i(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function s(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=process.env.DEBUG),l}function o(){try{return localStorage}catch{}}e.exports=$P(t);const{formatters:a}=e.exports;a.j=function(l){try{return JSON.stringify(l)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}})(xu,xu.exports);var nr=xu.exports,xi={};Object.defineProperty(xi,"__esModule",{value:!0}),xi.decode=xi.encode=void 0;function MP(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}xi.encode=MP;function LP(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}xi.decode=LP;var DP=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bi,"__esModule",{value:!0}),bi.Transport=void 0;const NP=qi,jP=Yi,UP=Ln,FP=DP(nr),BP=xi,VP=(0,FP.default)("engine.io-client:transport");class zP extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class ZP extends jP.Emitter{constructor(t){super(),this.writable=!1,(0,UP.installTimerFunctions)(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new zP(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"?this.write(t):VP("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=(0,NP.decodePacket)(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=(0,BP.encode)(t);return n.length?"?"+n:""}}bi.Transport=ZP;var _r={};Object.defineProperty(_r,"__esModule",{value:!0}),_r.yeast=_r.decode=_r.encode=void 0;const Qm="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Sa=64,Xm={};let eg=0,Kr=0,tg;function ku(e){let t="";do t=Qm[e%Sa]+t,e=Math.floor(e/Sa);while(e>0);return t}_r.encode=ku;function WP(e){let t=0;for(Kr=0;Kr<e.length;Kr++)t=t*Sa+Xm[e.charAt(Kr)];return t}_r.decode=WP;function HP(){const e=ku(+new Date);return e!==tg?(eg=0,tg=e):e+"."+ku(eg++)}for(_r.yeast=HP;Kr<Sa;Kr++)Xm[Qm[Kr]]=Kr;var Qi={},Ta={};Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.hasCORS=void 0;let ng=!1;try{ng=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}Ta.hasCORS=ng,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.createCookieJar=Qi.XHR=void 0;const qP=Ta,KP=wi;function JP(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||qP.hasCORS))return new XMLHttpRequest}catch{}if(!t)try{return new KP.globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}Qi.XHR=JP;function GP(){}Qi.createCookieJar=GP;var YP=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.Request=Hi.Polling=void 0;const QP=bi,XP=YP(nr),eA=_r,rg=qi,Cu=Qi,tA=Yi,ig=Ln,nA=wi,wn=(0,XP.default)("engine.io-client:polling");function rA(){}const iA=function(){return new Cu.XHR({xdomain:!1}).responseType!=null}();class sA extends QP.Transport{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=iA&&!n,this.opts.withCredentials&&(this.cookieJar=(0,Cu.createCookieJar)())}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{wn("paused"),this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(wn("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){wn("pre-pause polling complete"),--r||n()})),this.writable||(wn("we are currently writing - waiting to pause"),r++,this.once("drain",function(){wn("pre-pause writing complete"),--r||n()}))}else n()}poll(){wn("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){wn("polling got data %s",t);const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};(0,rg.decodePayload)(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this.poll():wn('ignoring poll - transport state "%s"',this.readyState))}doClose(){const t=()=>{wn("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(wn("transport open - closing"),t()):(wn("transport not open - deferring close"),this.once("open",t))}write(t){this.writable=!1,(0,rg.encodePayload)(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=(0,eA.yeast)()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Vn(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){wn("xhr poll");const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}Hi.Polling=sA;class Vn extends tA.Emitter{constructor(t,n){super(),(0,ig.installTimerFunctions)(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=(0,ig.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new Cu.XHR(n);try{wn("xhr open %s: %s",this.method,this.uri),r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},wn("xhr data %s",this.data),r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Vn.requestsCount++,Vn.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=rA,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Vn.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(Hi.Request=Vn,Vn.requestsCount=0,Vn.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",sg);else if(typeof addEventListener=="function"){const e="onpagehide"in nA.globalThisShim?"pagehide":"unload";addEventListener(e,sg,!1)}}function sg(){for(let e in Vn.requests)Vn.requests.hasOwnProperty(e)&&Vn.requests[e].abort()}var Oa={},On={};Object.defineProperty(On,"__esModule",{value:!0}),On.defaultBinaryType=On.usingBrowserWebSocket=On.WebSocket=On.nextTick=void 0;const og=wi;On.nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),On.WebSocket=og.globalThisShim.WebSocket||og.globalThisShim.MozWebSocket,On.usingBrowserWebSocket=!0,On.defaultBinaryType="arraybuffer";var oA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.WS=void 0;const aA=bi,lA=_r,cA=Ln,Jr=On,uA=oA(nr),dA=qi,fA=(0,uA.default)("engine.io-client:websocket"),ag=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class hA extends aA.Transport{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=ag?{}:(0,cA.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=Jr.usingBrowserWebSocket&&!ag?n?new Jr.WebSocket(t,n):new Jr.WebSocket(t):new Jr.WebSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;(0,dA.encodePacket)(r,this.supportsBinary,s=>{const o={};Jr.usingBrowserWebSocket||(r.options&&(o.compress=r.options.compress),this.opts.perMessageDeflate&&(typeof s=="string"?Buffer.byteLength(s):s.length)<this.opts.perMessageDeflate.threshold&&(o.compress=!1));try{Jr.usingBrowserWebSocket?this.ws.send(s):this.ws.send(s,o)}catch{fA("websocket closed before onclose event")}i&&(0,Jr.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=(0,lA.yeast)()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!Jr.WebSocket}}Oa.WS=hA;var Ia={},pA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.WT=void 0;const mA=bi,gA=On,lg=qi,Ws=(0,pA(nr).default)("engine.io-client:webtransport");class yA extends mA.Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{Ws("transport closed gracefully"),this.onClose()}).catch(t=>{Ws("transport closed due to %s",t),this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=(0,lg.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=(0,lg.createPacketEncoderStream)();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{if(a){Ws("session is closed");return}Ws("received chunk: %o",l),this.onPacket(l),s()}).catch(a=>{Ws("an error occurred while reading: %s",a)})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&(0,gA.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}Ia.WT=yA,Object.defineProperty(zs,"__esModule",{value:!0}),zs.transports=void 0;const vA=Hi,bA=Oa,wA=Ia;zs.transports={websocket:bA.WS,webtransport:wA.WT,polling:vA.Polling};var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.parse=void 0;const xA=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,_A=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function kA(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=xA.exec(e||""),s={},o=14;for(;o--;)s[_A[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=CA(s,s.path),s.queryKey=EA(s,s.query),s}Hs.parse=kA;function CA(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function EA(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}var SA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ka,"__esModule",{value:!0}),ka.Socket=void 0;const TA=zs,cg=Ln,OA=xi,ug=Hs,IA=SA(nr),PA=Yi,dg=qi,AA=On,Ct=(0,IA.default)("engine.io-client:socket");let fg=class vs extends PA.Emitter{constructor(t,n={}){super(),this.binaryType=AA.defaultBinaryType,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=(0,ug.parse)(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=(0,ug.parse)(n.host).host),(0,cg.installTimerFunctions)(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=(0,OA.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){Ct('creating transport "%s"',t);const n=Object.assign({},this.opts.query);n.EIO=dg.protocol,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return Ct("options: %j",r),new TA.transports[t](r)}open(){let t;if(this.opts.rememberUpgrade&&vs.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch(n){Ct("error while creating transport: %s",n),this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){Ct("setting transport %s",t.name),this.transport&&(Ct("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){Ct('probing transport "%s"',t);let n=this.createTransport(t),r=!1;vs.priorWebsocketSuccess=!1;const i=()=>{r||(Ct('probe transport "%s" opened',t),n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(Ct('probe transport "%s" pong',t),this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;vs.priorWebsocketSuccess=n.name==="websocket",Ct('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{r||this.readyState!=="closed"&&(Ct("changing transport and sending upgrade packet"),u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{Ct('probe transport "%s" failed',t);const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function s(){r||(r=!0,u(),n.close(),n=null)}const o=d=>{const h=new Error("probe error: "+d);h.transport=n.name,s(),Ct('probe transport "%s" failed because of error: %s',t,d),this.emitReserved("upgradeError",h)};function a(){o("transport closed")}function l(){o("socket closed")}function c(d){n&&d.name!==n.name&&(Ct('"%s" works - aborting "%s"',d.name,n.name),s())}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(Ct("socket open"),this.readyState="open",vs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){Ct("starting upgrade probes");let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(Ct('socket receive: type "%s", data "%s"',t.type,t.data),this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}else Ct('packet received with socket readyState "%s"',this.readyState)}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();Ct("flushing %d packets in socket",t.length),this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=(0,cg.byteLength)(i)),r>0&&n>this.maxPayload)return Ct("only send %d out of %d packets",r,this.writeBuffer.length),this.writeBuffer.slice(0,r);n+=2}return Ct("payload size is %d (max: %d)",n,this.maxPayload),this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),Ct("socket closing - telling transport to close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Ct("socket error %j",t),vs.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(Ct('socket close with reason: "%s"',t),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};ka.Socket=fg,fg.protocol=dg.protocol,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.nextTick=e.parse=e.installTimerFunctions=e.transports=e.Transport=e.protocol=e.Socket=void 0;const t=ka;Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return t.Socket}}),e.protocol=t.Socket.protocol;var n=bi;Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return n.Transport}});var r=zs;Object.defineProperty(e,"transports",{enumerable:!0,get:function(){return r.transports}});var i=Ln;Object.defineProperty(e,"installTimerFunctions",{enumerable:!0,get:function(){return i.installTimerFunctions}});var s=Hs;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return s.parse}});var o=On;Object.defineProperty(e,"nextTick",{enumerable:!0,get:function(){return o.nextTick}})}(bu);var RA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_a,"__esModule",{value:!0}),_a.url=void 0;const $A=bu,hg=RA(nr).default("socket.io-client:url");function MA(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(hg("protocol-less url %s",e),typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),hg("parse %s",e),r=$A.parse(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}_a.url=MA;var Pa={},qs={},Aa={},Xi={},_i={};Object.defineProperty(_i,"__esModule",{value:!0}),_i.hasBinary=_i.isBinary=void 0;const LA=typeof ArrayBuffer=="function",DA=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,pg=Object.prototype.toString,NA=typeof Blob=="function"||typeof Blob<"u"&&pg.call(Blob)==="[object BlobConstructor]",jA=typeof File=="function"||typeof File<"u"&&pg.call(File)==="[object FileConstructor]";function mg(e){return LA&&(e instanceof ArrayBuffer||DA(e))||NA&&e instanceof Blob||jA&&e instanceof File}_i.isBinary=mg;function Ra(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Ra(e[n]))return!0;return!1}if(mg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Ra(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Ra(e[n]))return!0;return!1}_i.hasBinary=Ra,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.reconstructPacket=Xi.deconstructPacket=void 0;const UA=_i;function FA(e){const t=[],n=e.data,r=e;return r.data=Eu(n,t),r.attachments=t.length,{packet:r,buffers:t}}Xi.deconstructPacket=FA;function Eu(e,t){if(!e)return e;if((0,UA.isBinary)(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Eu(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Eu(e[r],t));return n}return e}function BA(e,t){return e.data=Su(e.data,t),delete e.attachments,e}Xi.reconstructPacket=BA;function Su(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Su(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Su(e[n],t));return e}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const t=Yi,n=Xi,r=_i,s=(0,nr.default)("socket.io-parser"),o=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];e.protocol=5;var a;(function(h){h[h.CONNECT=0]="CONNECT",h[h.DISCONNECT=1]="DISCONNECT",h[h.EVENT=2]="EVENT",h[h.ACK=3]="ACK",h[h.CONNECT_ERROR=4]="CONNECT_ERROR",h[h.BINARY_EVENT=5]="BINARY_EVENT",h[h.BINARY_ACK=6]="BINARY_ACK"})(a=e.PacketType||(e.PacketType={}));class l{constructor(f){this.replacer=f}encode(f){return s("encoding packet %j",f),(f.type===a.EVENT||f.type===a.ACK)&&(0,r.hasBinary)(f)?this.encodeAsBinary({type:f.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,nsp:f.nsp,data:f.data,id:f.id}):[this.encodeAsString(f)]}encodeAsString(f){let p=""+f.type;return(f.type===a.BINARY_EVENT||f.type===a.BINARY_ACK)&&(p+=f.attachments+"-"),f.nsp&&f.nsp!=="/"&&(p+=f.nsp+","),f.id!=null&&(p+=f.id),f.data!=null&&(p+=JSON.stringify(f.data,this.replacer)),s("encoded %j as %s",f,p),p}encodeAsBinary(f){const p=(0,n.deconstructPacket)(f),m=this.encodeAsString(p.packet),v=p.buffers;return v.unshift(m),v}}e.Encoder=l;function c(h){return Object.prototype.toString.call(h)==="[object Object]"}class u extends t.Emitter{constructor(f){super(),this.reviver=f}add(f){let p;if(typeof f=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");p=this.decodeString(f);const m=p.type===a.BINARY_EVENT;m||p.type===a.BINARY_ACK?(p.type=m?a.EVENT:a.ACK,this.reconstructor=new d(p),p.attachments===0&&super.emitReserved("decoded",p)):super.emitReserved("decoded",p)}else if((0,r.isBinary)(f)||f.base64)if(this.reconstructor)p=this.reconstructor.takeBinaryData(f),p&&(this.reconstructor=null,super.emitReserved("decoded",p));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+f)}decodeString(f){let p=0;const m={type:Number(f.charAt(0))};if(a[m.type]===void 0)throw new Error("unknown packet type "+m.type);if(m.type===a.BINARY_EVENT||m.type===a.BINARY_ACK){const y=p+1;for(;f.charAt(++p)!=="-"&&p!=f.length;);const b=f.substring(y,p);if(b!=Number(b)||f.charAt(p)!=="-")throw new Error("Illegal attachments");m.attachments=Number(b)}if(f.charAt(p+1)==="/"){const y=p+1;for(;++p&&!(f.charAt(p)===","||p===f.length););m.nsp=f.substring(y,p)}else m.nsp="/";const v=f.charAt(p+1);if(v!==""&&Number(v)==v){const y=p+1;for(;++p;){const b=f.charAt(p);if(b==null||Number(b)!=b){--p;break}if(p===f.length)break}m.id=Number(f.substring(y,p+1))}if(f.charAt(++p)){const y=this.tryParse(f.substr(p));if(u.isPayloadValid(m.type,y))m.data=y;else throw new Error("invalid payload")}return s("decoded %s as %j",f,m),m}tryParse(f){try{return JSON.parse(f,this.reviver)}catch{return!1}}static isPayloadValid(f,p){switch(f){case a.CONNECT:return c(p);case a.DISCONNECT:return p===void 0;case a.CONNECT_ERROR:return typeof p=="string"||c(p);case a.EVENT:case a.BINARY_EVENT:return Array.isArray(p)&&(typeof p[0]=="number"||typeof p[0]=="string"&&o.indexOf(p[0])===-1);case a.ACK:case a.BINARY_ACK:return Array.isArray(p)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}e.Decoder=u;class d{constructor(f){this.packet=f,this.buffers=[],this.reconPack=f}takeBinaryData(f){if(this.buffers.push(f),this.buffers.length===this.reconPack.attachments){const p=(0,n.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),p}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}})(Aa);var Ks={};Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.on=void 0;function VA(e,t,n){return e.on(t,n),function(){e.off(t,n)}}Ks.on=VA;var zA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qs,"__esModule",{value:!0}),qs.Socket=void 0;const zn=Aa,$a=Ks,ZA=Yi,Vt=zA(nr).default("socket.io-client:socket"),WA=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class HA extends ZA.Emitter{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[$a.on(t,"open",this.onopen.bind(this)),$a.on(t,"packet",this.onpacket.bind(this)),$a.on(t,"error",this.onerror.bind(this)),$a.on(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(WA.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:zn.PacketType.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const o=this.ids++;Vt("emitting packet with ack id %d",o);const a=n.pop();this._registerAckCallback(o,a),r.id=o}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)?Vt("discard packet as the transport is not currently writable"):this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===t&&(Vt("removing packet with ack id %d from the buffer",t),this.sendBuffer.splice(o,1));Vt("event with ack id %d has timed out after %d ms",t,i),n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...o)=>{this.io.clearTimeoutFn(s),n.apply(this,[null,...o])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,s)=>{n.push((o,a)=>r?o?s(o):i(a):i(o)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(Vt("packet [%d] is discarded after %d tries",r.id,r.tryCount),this._queue.shift(),n&&n(i)):(Vt("packet [%d] was successfully sent",r.id),this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(Vt("draining queue"),!this.connected||this._queue.length===0)return;const n=this._queue[0];if(n.pending&&!t){Vt("packet [%d] has already been sent and is waiting for an ack",n.id);return}n.pending=!0,n.tryCount++,Vt("sending packet [%d] (try n°%d)",n.id,n.tryCount),this.flags=n.flags,this.emit.apply(this,n.args)}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){Vt("transport is open - connecting"),typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:zn.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){Vt("close (%s)",t),this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case zn.PacketType.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case zn.PacketType.EVENT:case zn.PacketType.BINARY_EVENT:this.onevent(t);break;case zn.PacketType.ACK:case zn.PacketType.BINARY_ACK:this.onack(t);break;case zn.PacketType.DISCONNECT:this.ondisconnect();break;case zn.PacketType.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];Vt("emitting event %j",n),t.id!=null&&(Vt("attaching ack callback to event"),n.push(this.ack(t.id))),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,Vt("sending ack %j",i),n.packet({type:zn.PacketType.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"?(Vt("calling ack %s with %j",t.id,t.data),n.apply(this,t.data),delete this.acks[t.id]):Vt("bad ack %s",t.id)}onconnect(t,n){Vt("socket connected with id %s",t),this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){Vt("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(Vt("performing disconnect (%s)",this.nsp),this.packet({type:zn.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}qs.Socket=HA;var Ma={};Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.Backoff=void 0;function es(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ma.Backoff=es,es.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},es.prototype.reset=function(){this.attempts=0},es.prototype.setMin=function(e){this.ms=e},es.prototype.setMax=function(e){this.max=e},es.prototype.setJitter=function(e){this.jitter=e};var qA=Me&&Me.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),KA=Me&&Me.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),JA=Me&&Me.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&qA(t,e,n);return KA(t,e),t},GA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.Manager=void 0;const Tu=bu,YA=qs,QA=JA(Aa),ki=Ks,XA=Ma,eR=Yi,nn=GA(nr).default("socket.io-client:manager");class tR extends eR.Emitter{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Tu.installTimerFunctions(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new XA.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||QA;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(nn("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;nn("opening %s",this.uri),this.engine=new Tu.Socket(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=ki.on(n,"open",function(){r.onopen(),t&&t()}),s=a=>{nn("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=ki.on(n,"error",s);if(this._timeout!==!1){const a=this._timeout;nn("connect attempt will timeout after %d",a);const l=this.setTimeoutFn(()=>{nn("connect attempt timed out after %d",a),i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){nn("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ki.on(t,"ping",this.onping.bind(this)),ki.on(t,"data",this.ondata.bind(this)),ki.on(t,"error",this.onerror.bind(this)),ki.on(t,"close",this.onclose.bind(this)),ki.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Tu.nextTick(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){nn("error",t),this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new YA.Socket(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active){nn("socket %s is still active, skipping close",r);return}this._close()}_packet(t){nn("writing packet %j",t);const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){nn("cleanup"),this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){nn("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){nn("closed due to %s",t),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)nn("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();nn("will wait %dms before reconnect attempt",n),this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(nn("attempting reconnect"),this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(nn("reconnect attempt error"),t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):(nn("reconnect success"),t.onreconnect())}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}Pa.Manager=tR,function(e,t){var n=Me&&Me.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const r=_a,i=Pa;Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return i.Manager}});const s=qs;Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return s.Socket}});const a=n(nr).default("socket.io-client"),l={};function c(d,h){typeof d=="object"&&(h=d,d=void 0),h=h||{};const f=r.url(d,h.path||"/socket.io"),p=f.source,m=f.id,v=f.path,y=l[m]&&v in l[m].nsps,b=h.forceNew||h["force new connection"]||h.multiplex===!1||y;let x;return b?(a("ignoring socket cache for %s",p),x=new i.Manager(p,h)):(l[m]||(a("new io instance for %s",p),l[m]=new i.Manager(p,h)),x=l[m]),f.query&&!h.query&&(h.query=f.queryKey),x.socket(f.path,h)}t.io=c,t.connect=c,t.default=c,Object.assign(c,{Manager:i.Manager,Socket:s.Socket,io:c,connect:c});var u=Aa;Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return u.protocol}}),e.exports=c}(vu,vu.exports);var nR=vu.exports;(function(e){var t=Me&&Me.__awaiter||function(l,c,u,d){function h(f){return f instanceof u?f:new u(function(p){p(f)})}return new(u||(u=Promise))(function(f,p){function m(b){try{y(d.next(b))}catch(x){p(x)}}function v(b){try{y(d.throw(b))}catch(x){p(x)}}function y(b){b.done?f(b.value):h(b.value).then(m,v)}y((d=d.apply(l,c||[])).next())})},n=Me&&Me.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.SocketComEmitter=e.SocketComEvents=e.SocketCom=void 0;const r=yu,i=n(nR);class s{constructor(c){this.url=c,this.pending={},this.emitter=new a,this.events=this.emitter}connect(c,u){return t(this,void 0,void 0,function*(){return new Promise((d,h)=>{this.disconnect(),this.socket=(0,i.default)(this.url,{transports:["websocket"],auth:c,autoConnect:!1,query:u});const f=setTimeout(()=>{h("connection timed out")},5e3);this.socket.on("login",p=>t(this,void 0,void 0,function*(){clearTimeout(f),d(p)})),this.socket.on("connect_error",p=>{var m;(m=this.socket)===null||m===void 0||m.close(),clearTimeout(f),h(p.message)}),this.socket.on("message",p=>t(this,void 0,void 0,function*(){var m;this.pending[p.request]&&(!((m=p.data)===null||m===void 0)&&m.error?this.pending[p.request].reject(new Error(p.data.message)):this.pending[p.request].resolve(p.data),delete this.pending[p.request]),yield this.emitter.emit(o.Message,p)})),this.socket.connect()})})}disconnect(){var c;this.socket&&!(!((c=this.socket)===null||c===void 0)&&c.disconnected)&&this.socket.disconnect()}request(c,u){var d;return t(this,void 0,void 0,function*(){if(!(!((d=this.socket)===null||d===void 0)&&d.connected))throw new Error("Client is disconnected");const h=this.random(32),f=new Promise((p,m)=>{this.pending[h]={resolve:p,reject:m}});return this.socket.send({request:h,type:c,data:u}),f})}random(c){const u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let d="";for(let h=0;h<c;h++)d+=u.charAt(Math.floor(Math.random()*u.length));return d}}e.SocketCom=s;var o;(function(l){l.Message="message"})(o=e.SocketComEvents||(e.SocketComEvents={}));class a extends r.Emitter{}e.SocketComEmitter=a})(Vm);var La={},rR=Me&&Me.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(La,"__esModule",{value:!0}),La.SocketEmitter=void 0;class iR{constructor(){this.listeners={}}on(t,n){const r=this.listeners[t];r?r.push(n):this.listeners[t]=[n]}removeListeners(t){this.listeners[t]=[]}emit(t,n){return rR(this,void 0,void 0,function*(){const r=this.listeners[t];if(r!=null&&r.length){for(const i of r)yield i(n);return!0}else return!1})}}La.SocketEmitter=iR;var xn=Me&&Me.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(xa,"__esModule",{value:!0}),xa.MessagingSocket=void 0;const gg=Vm,sR=La;class oR extends sR.SocketEmitter{constructor(t){super(),this.clientId=t.clientId,this.com=new gg.SocketCom(t.url),this.com.events.on(gg.SocketComEvents.Message,n=>xn(this,void 0,void 0,function*(){n.type==="message.new"&&(yield this.emit("message",n.data.message))}))}get creds(){return this._creds}get userId(){var t;return(t=this._creds)===null||t===void 0?void 0:t.userId}get conversationId(){return this._conversationId}connect(t,n){return xn(this,void 0,void 0,function*(){const r=n?{userData:JSON.stringify(n)}:void 0,i=yield this.com.connect({clientId:this.clientId,creds:t},r);return i.userId===(t==null?void 0:t.userId)&&!i.userToken&&(i.userToken=t.userToken),this._creds=i,yield this.emit("connect",this._creds),yield this.emit("user",this._creds.userId),i})}disconnect(){return xn(this,void 0,void 0,function*(){this.com.disconnect(),yield this.emit("disconnect",void 0)})}getUser(){return xn(this,void 0,void 0,function*(){return this.request("users.get",{})})}switchConversation(t){return xn(this,void 0,void 0,function*(){this._conversationId=t,yield this.emit("conversation",this._conversationId)})}createConversation(t){return xn(this,void 0,void 0,function*(){const n=yield this.request("conversations.create",{});return(t==null?void 0:t.switch)!==!1&&(yield this.switchConversation(n.id)),n})}startConversation(t){return xn(this,void 0,void 0,function*(){yield this.request("conversations.start",{id:t||this._conversationId})})}getConversation(t){return xn(this,void 0,void 0,function*(){return this.request("conversations.get",{id:t||this._conversationId})})}deleteConversation(t){return xn(this,void 0,void 0,function*(){const n=yield this.request("conversations.delete",{id:t||this._conversationId});return n&&(yield this.switchConversation(void 0)),n})}listConversations(t){return xn(this,void 0,void 0,function*(){return this.request("conversations.list",{limit:t||20})})}sendText(t){return xn(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:{type:"text",text:t}})})}sendPayload(t){return xn(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:t})})}listMessages(t){return xn(this,void 0,void 0,function*(){return this.request("messages.list",{conversationId:this._conversationId,limit:t||20})})}sendFeedback(t,n){return xn(this,void 0,void 0,function*(){yield this.request("messages.feedback",{messageId:t,feedback:n})})}request(t,n){return this.com.request(t,n)}}xa.MessagingSocket=oR,function(e){var t=Me&&Me.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=Me&&Me.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(yu,e),n(xa,e)}(Mm);var Da={},Ou={},rr={},Na={},Js={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0;var t;(function(r){r.assertEqual=a=>a;function i(a){}r.assertIs=i;function s(a){throw new Error}r.assertNever=s,r.arrayToEnum=a=>{const l={};for(const c of a)l[c]=c;return l},r.getValidEnumValues=a=>{const l=r.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),c={};for(const u of l)c[u]=a[u];return r.objectValues(c)},r.objectValues=a=>r.objectKeys(a).map(function(l){return a[l]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const l=[];for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&l.push(c);return l},r.find=(a,l)=>{for(const c of a)if(l(c))return c},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function o(a,l=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}r.joinValues=o,r.jsonStringifyReplacer=(a,l)=>typeof l=="bigint"?l.toString():l})(t=e.util||(e.util={})),function(r){r.mergeShapes=(i,s)=>({...i,...s})}(e.objectUtil||(e.objectUtil={})),e.ZodParsedType=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const n=r=>{switch(typeof r){case"undefined":return e.ZodParsedType.undefined;case"string":return e.ZodParsedType.string;case"number":return isNaN(r)?e.ZodParsedType.nan:e.ZodParsedType.number;case"boolean":return e.ZodParsedType.boolean;case"function":return e.ZodParsedType.function;case"bigint":return e.ZodParsedType.bigint;case"symbol":return e.ZodParsedType.symbol;case"object":return Array.isArray(r)?e.ZodParsedType.array:r===null?e.ZodParsedType.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?e.ZodParsedType.promise:typeof Map<"u"&&r instanceof Map?e.ZodParsedType.map:typeof Set<"u"&&r instanceof Set?e.ZodParsedType.set:typeof Date<"u"&&r instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}};e.getParsedType=n})(Js);var ir={};Object.defineProperty(ir,"__esModule",{value:!0}),ir.ZodError=ir.quotelessJson=ir.ZodIssueCode=void 0;const yg=Js;ir.ZodIssueCode=yg.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);const aR=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");ir.quotelessJson=aR;let Iu=class extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,yg.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};ir.ZodError=Iu,Iu.create=e=>new Iu(e),Object.defineProperty(Na,"__esModule",{value:!0});const Ci=Js,un=ir,lR=(e,t)=>{let n;switch(e.code){case un.ZodIssueCode.invalid_type:e.received===Ci.ZodParsedType.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case un.ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ci.util.jsonStringifyReplacer)}`;break;case un.ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ci.util.joinValues(e.keys,", ")}`;break;case un.ZodIssueCode.invalid_union:n="Invalid input";break;case un.ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ci.util.joinValues(e.options)}`;break;case un.ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${Ci.util.joinValues(e.options)}, received '${e.received}'`;break;case un.ZodIssueCode.invalid_arguments:n="Invalid function arguments";break;case un.ZodIssueCode.invalid_return_type:n="Invalid function return type";break;case un.ZodIssueCode.invalid_date:n="Invalid date";break;case un.ZodIssueCode.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ci.util.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case un.ZodIssueCode.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case un.ZodIssueCode.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case un.ZodIssueCode.custom:n="Invalid input";break;case un.ZodIssueCode.invalid_intersection_types:n="Intersection results could not be merged";break;case un.ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case un.ZodIssueCode.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ci.util.assertNever(e)}return{message:n}};Na.default=lR;var cR=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rr,"__esModule",{value:!0}),rr.getErrorMap=rr.setErrorMap=rr.defaultErrorMap=void 0;const vg=cR(Na);rr.defaultErrorMap=vg.default;let bg=vg.default;function uR(e){bg=e}rr.setErrorMap=uR;function dR(){return bg}rr.getErrorMap=dR;var Pu={};(function(e){var t=Me&&Me.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=e.isValid=e.isDirty=e.isAborted=e.OK=e.DIRTY=e.INVALID=e.ParseStatus=e.addIssueToContext=e.EMPTY_PATH=e.makeIssue=void 0;const n=rr,r=t(Na),i=f=>{const{data:p,path:m,errorMaps:v,issueData:y}=f,b=[...m,...y.path||[]],x={...y,path:b};let I="";const A=v.filter(O=>!!O).slice().reverse();for(const O of A)I=O(x,{data:p,defaultError:I}).message;return{...y,path:b,message:y.message||I}};e.makeIssue=i,e.EMPTY_PATH=[];function s(f,p){const m=(0,e.makeIssue)({issueData:p,data:f.data,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,(0,n.getErrorMap)(),r.default].filter(v=>!!v)});f.common.issues.push(m)}e.addIssueToContext=s;class o{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(p,m){const v=[];for(const y of m){if(y.status==="aborted")return e.INVALID;y.status==="dirty"&&p.dirty(),v.push(y.value)}return{status:p.value,value:v}}static async mergeObjectAsync(p,m){const v=[];for(const y of m)v.push({key:await y.key,value:await y.value});return o.mergeObjectSync(p,v)}static mergeObjectSync(p,m){const v={};for(const y of m){const{key:b,value:x}=y;if(b.status==="aborted"||x.status==="aborted")return e.INVALID;b.status==="dirty"&&p.dirty(),x.status==="dirty"&&p.dirty(),b.value!=="__proto__"&&(typeof x.value<"u"||y.alwaysSet)&&(v[b.value]=x.value)}return{status:p.value,value:v}}}e.ParseStatus=o,e.INVALID=Object.freeze({status:"aborted"});const a=f=>({status:"dirty",value:f});e.DIRTY=a;const l=f=>({status:"valid",value:f});e.OK=l;const c=f=>f.status==="aborted";e.isAborted=c;const u=f=>f.status==="dirty";e.isDirty=u;const d=f=>f.status==="valid";e.isValid=d;const h=f=>typeof Promise<"u"&&f instanceof Promise;e.isAsync=h})(Pu);var wg={};Object.defineProperty(wg,"__esModule",{value:!0});var xg={},_g={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorUtil=void 0,function(t){t.errToObj=n=>typeof n=="string"?{message:n}:n||{},t.toString=n=>typeof n=="string"?n:n==null?void 0:n.message}(e.errorUtil||(e.errorUtil={}))})(_g),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.date=e.boolean=e.bigint=e.array=e.any=e.coerce=e.ZodFirstPartyTypeKind=e.late=e.ZodSchema=e.Schema=e.custom=e.ZodReadonly=e.ZodPipeline=e.ZodBranded=e.BRAND=e.ZodNaN=e.ZodCatch=e.ZodDefault=e.ZodNullable=e.ZodOptional=e.ZodTransformer=e.ZodEffects=e.ZodPromise=e.ZodNativeEnum=e.ZodEnum=e.ZodLiteral=e.ZodLazy=e.ZodFunction=e.ZodSet=e.ZodMap=e.ZodRecord=e.ZodTuple=e.ZodIntersection=e.ZodDiscriminatedUnion=e.ZodUnion=e.ZodObject=e.ZodArray=e.ZodVoid=e.ZodNever=e.ZodUnknown=e.ZodAny=e.ZodNull=e.ZodUndefined=e.ZodSymbol=e.ZodDate=e.ZodBoolean=e.ZodBigInt=e.ZodNumber=e.ZodString=e.ZodType=void 0,e.NEVER=e.void=e.unknown=e.union=e.undefined=e.tuple=e.transformer=e.symbol=e.string=e.strictObject=e.set=e.record=e.promise=e.preprocess=e.pipeline=e.ostring=e.optional=e.onumber=e.oboolean=e.object=e.number=e.nullable=e.null=e.never=e.nativeEnum=e.nan=e.map=e.literal=e.lazy=e.intersection=e.instanceof=e.function=e.enum=e.effect=e.discriminatedUnion=void 0;const t=rr,n=_g,r=Pu,i=Js,s=ir;class o{constructor(g,w,C,L){this._cachedPath=[],this.parent=g,this.data=w,this._path=C,this._key=L}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const a=(P,g)=>{if((0,r.isValid)(g))return{success:!0,data:g.value};if(!P.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const w=new s.ZodError(P.common.issues);return this._error=w,this._error}}};function l(P){if(!P)return{};const{errorMap:g,invalid_type_error:w,required_error:C,description:L}=P;if(g&&(w||C))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return g?{errorMap:g,description:L}:{errorMap:(ve,fe)=>ve.code!=="invalid_type"?{message:fe.defaultError}:typeof fe.data>"u"?{message:C??fe.defaultError}:{message:w??fe.defaultError},description:L}}class c{constructor(g){this.spa=this.safeParseAsync,this._def=g,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(g){return(0,i.getParsedType)(g.data)}_getOrReturnCtx(g,w){return w||{common:g.parent.common,data:g.data,parsedType:(0,i.getParsedType)(g.data),schemaErrorMap:this._def.errorMap,path:g.path,parent:g.parent}}_processInputParams(g){return{status:new r.ParseStatus,ctx:{common:g.parent.common,data:g.data,parsedType:(0,i.getParsedType)(g.data),schemaErrorMap:this._def.errorMap,path:g.path,parent:g.parent}}}_parseSync(g){const w=this._parse(g);if((0,r.isAsync)(w))throw new Error("Synchronous parse encountered promise.");return w}_parseAsync(g){const w=this._parse(g);return Promise.resolve(w)}parse(g,w){const C=this.safeParse(g,w);if(C.success)return C.data;throw C.error}safeParse(g,w){var C;const L={common:{issues:[],async:(C=w==null?void 0:w.async)!==null&&C!==void 0?C:!1,contextualErrorMap:w==null?void 0:w.errorMap},path:(w==null?void 0:w.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:g,parsedType:(0,i.getParsedType)(g)},$=this._parseSync({data:g,path:L.path,parent:L});return a(L,$)}async parseAsync(g,w){const C=await this.safeParseAsync(g,w);if(C.success)return C.data;throw C.error}async safeParseAsync(g,w){const C={common:{issues:[],contextualErrorMap:w==null?void 0:w.errorMap,async:!0},path:(w==null?void 0:w.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:g,parsedType:(0,i.getParsedType)(g)},L=this._parse({data:g,path:C.path,parent:C}),$=await((0,r.isAsync)(L)?L:Promise.resolve(L));return a(C,$)}refine(g,w){const C=L=>typeof w=="string"||typeof w>"u"?{message:w}:typeof w=="function"?w(L):w;return this._refinement((L,$)=>{const ve=g(L),fe=()=>$.addIssue({code:s.ZodIssueCode.custom,...C(L)});return typeof Promise<"u"&&ve instanceof Promise?ve.then(Ze=>Ze?!0:(fe(),!1)):ve?!0:(fe(),!1)})}refinement(g,w){return this._refinement((C,L)=>g(C)?!0:(L.addIssue(typeof w=="function"?w(C,L):w),!1))}_refinement(g){return new ne({schema:this,typeName:J.ZodEffects,effect:{type:"refinement",refinement:g}})}superRefine(g){return this._refinement(g)}optional(){return me.create(this,this._def)}nullable(){return he.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return K.create(this,this._def)}promise(){return D.create(this,this._def)}or(g){return ee.create([this,g],this._def)}and(g){return Ne.create(this,g,this._def)}transform(g){return new ne({...l(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:g}})}default(g){const w=typeof g=="function"?g:()=>g;return new Le({...l(this._def),innerType:this,defaultValue:w,typeName:J.ZodDefault})}brand(){return new ot({typeName:J.ZodBranded,type:this,...l(this._def)})}catch(g){const w=typeof g=="function"?g:()=>g;return new Pe({...l(this._def),innerType:this,catchValue:w,typeName:J.ZodCatch})}describe(g){const w=this.constructor;return new w({...this._def,description:g})}pipe(g){return ze.create(this,g)}readonly(){return V.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}e.ZodType=c,e.Schema=c,e.ZodSchema=c;const u=/^c[^\s-]{8,}$/i,d=/^[a-z][a-z0-9]*$/,h=/^[0-9A-HJKMNP-TV-Z]{26}$/,f=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,p=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,m="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let v;const y=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,b=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,x=P=>P.precision?P.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${P.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${P.precision}}Z$`):P.precision===0?P.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):P.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function I(P,g){return!!((g==="v4"||!g)&&y.test(P)||(g==="v6"||!g)&&b.test(P))}class A extends c{_parse(g){if(this._def.coerce&&(g.data=String(g.data)),this._getType(g)!==i.ZodParsedType.string){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.string,received:$.parsedType}),r.INVALID}const C=new r.ParseStatus;let L;for(const $ of this._def.checks)if($.kind==="min")g.data.length<$.value&&(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),C.dirty());else if($.kind==="max")g.data.length>$.value&&(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),C.dirty());else if($.kind==="length"){const ve=g.data.length>$.value,fe=g.data.length<$.value;(ve||fe)&&(L=this._getOrReturnCtx(g,L),ve?(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message}):fe&&(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message}),C.dirty())}else if($.kind==="email")p.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"email",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="emoji")v||(v=new RegExp(m,"u")),v.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"emoji",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="uuid")f.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"uuid",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="cuid")u.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"cuid",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="cuid2")d.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"cuid2",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="ulid")h.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"ulid",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="url")try{new URL(g.data)}catch{L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"url",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty()}else $.kind==="regex"?($.regex.lastIndex=0,$.regex.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"regex",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty())):$.kind==="trim"?g.data=g.data.trim():$.kind==="includes"?g.data.includes($.value,$.position)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.invalid_string,validation:{includes:$.value,position:$.position},message:$.message}),C.dirty()):$.kind==="toLowerCase"?g.data=g.data.toLowerCase():$.kind==="toUpperCase"?g.data=g.data.toUpperCase():$.kind==="startsWith"?g.data.startsWith($.value)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.invalid_string,validation:{startsWith:$.value},message:$.message}),C.dirty()):$.kind==="endsWith"?g.data.endsWith($.value)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.invalid_string,validation:{endsWith:$.value},message:$.message}),C.dirty()):$.kind==="datetime"?x($).test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.invalid_string,validation:"datetime",message:$.message}),C.dirty()):$.kind==="ip"?I(g.data,$.version)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"ip",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty()):i.util.assertNever($);return{status:C.value,value:g.data}}_regex(g,w,C){return this.refinement(L=>g.test(L),{validation:w,code:s.ZodIssueCode.invalid_string,...n.errorUtil.errToObj(C)})}_addCheck(g){return new A({...this._def,checks:[...this._def.checks,g]})}email(g){return this._addCheck({kind:"email",...n.errorUtil.errToObj(g)})}url(g){return this._addCheck({kind:"url",...n.errorUtil.errToObj(g)})}emoji(g){return this._addCheck({kind:"emoji",...n.errorUtil.errToObj(g)})}uuid(g){return this._addCheck({kind:"uuid",...n.errorUtil.errToObj(g)})}cuid(g){return this._addCheck({kind:"cuid",...n.errorUtil.errToObj(g)})}cuid2(g){return this._addCheck({kind:"cuid2",...n.errorUtil.errToObj(g)})}ulid(g){return this._addCheck({kind:"ulid",...n.errorUtil.errToObj(g)})}ip(g){return this._addCheck({kind:"ip",...n.errorUtil.errToObj(g)})}datetime(g){var w;return typeof g=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:g}):this._addCheck({kind:"datetime",precision:typeof(g==null?void 0:g.precision)>"u"?null:g==null?void 0:g.precision,offset:(w=g==null?void 0:g.offset)!==null&&w!==void 0?w:!1,...n.errorUtil.errToObj(g==null?void 0:g.message)})}regex(g,w){return this._addCheck({kind:"regex",regex:g,...n.errorUtil.errToObj(w)})}includes(g,w){return this._addCheck({kind:"includes",value:g,position:w==null?void 0:w.position,...n.errorUtil.errToObj(w==null?void 0:w.message)})}startsWith(g,w){return this._addCheck({kind:"startsWith",value:g,...n.errorUtil.errToObj(w)})}endsWith(g,w){return this._addCheck({kind:"endsWith",value:g,...n.errorUtil.errToObj(w)})}min(g,w){return this._addCheck({kind:"min",value:g,...n.errorUtil.errToObj(w)})}max(g,w){return this._addCheck({kind:"max",value:g,...n.errorUtil.errToObj(w)})}length(g,w){return this._addCheck({kind:"length",value:g,...n.errorUtil.errToObj(w)})}nonempty(g){return this.min(1,n.errorUtil.errToObj(g))}trim(){return new A({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(g=>g.kind==="datetime")}get isEmail(){return!!this._def.checks.find(g=>g.kind==="email")}get isURL(){return!!this._def.checks.find(g=>g.kind==="url")}get isEmoji(){return!!this._def.checks.find(g=>g.kind==="emoji")}get isUUID(){return!!this._def.checks.find(g=>g.kind==="uuid")}get isCUID(){return!!this._def.checks.find(g=>g.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(g=>g.kind==="cuid2")}get isULID(){return!!this._def.checks.find(g=>g.kind==="ulid")}get isIP(){return!!this._def.checks.find(g=>g.kind==="ip")}get minLength(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g}get maxLength(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g}}e.ZodString=A,A.create=P=>{var g;return new A({checks:[],typeName:J.ZodString,coerce:(g=P==null?void 0:P.coerce)!==null&&g!==void 0?g:!1,...l(P)})};function O(P,g){const w=(P.toString().split(".")[1]||"").length,C=(g.toString().split(".")[1]||"").length,L=w>C?w:C,$=parseInt(P.toFixed(L).replace(".","")),ve=parseInt(g.toFixed(L).replace(".",""));return $%ve/Math.pow(10,L)}class j extends c{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(g){if(this._def.coerce&&(g.data=Number(g.data)),this._getType(g)!==i.ZodParsedType.number){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.number,received:$.parsedType}),r.INVALID}let C;const L=new r.ParseStatus;for(const $ of this._def.checks)$.kind==="int"?i.util.isInteger(g.data)||(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:$.message}),L.dirty()):$.kind==="min"?($.inclusive?g.data<$.value:g.data<=$.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,minimum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),L.dirty()):$.kind==="max"?($.inclusive?g.data>$.value:g.data>=$.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,maximum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),L.dirty()):$.kind==="multipleOf"?O(g.data,$.value)!==0&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.not_multiple_of,multipleOf:$.value,message:$.message}),L.dirty()):$.kind==="finite"?Number.isFinite(g.data)||(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.not_finite,message:$.message}),L.dirty()):i.util.assertNever($);return{status:L.value,value:g.data}}gte(g,w){return this.setLimit("min",g,!0,n.errorUtil.toString(w))}gt(g,w){return this.setLimit("min",g,!1,n.errorUtil.toString(w))}lte(g,w){return this.setLimit("max",g,!0,n.errorUtil.toString(w))}lt(g,w){return this.setLimit("max",g,!1,n.errorUtil.toString(w))}setLimit(g,w,C,L){return new j({...this._def,checks:[...this._def.checks,{kind:g,value:w,inclusive:C,message:n.errorUtil.toString(L)}]})}_addCheck(g){return new j({...this._def,checks:[...this._def.checks,g]})}int(g){return this._addCheck({kind:"int",message:n.errorUtil.toString(g)})}positive(g){return this._addCheck({kind:"min",value:0,inclusive:!1,message:n.errorUtil.toString(g)})}negative(g){return this._addCheck({kind:"max",value:0,inclusive:!1,message:n.errorUtil.toString(g)})}nonpositive(g){return this._addCheck({kind:"max",value:0,inclusive:!0,message:n.errorUtil.toString(g)})}nonnegative(g){return this._addCheck({kind:"min",value:0,inclusive:!0,message:n.errorUtil.toString(g)})}multipleOf(g,w){return this._addCheck({kind:"multipleOf",value:g,message:n.errorUtil.toString(w)})}finite(g){return this._addCheck({kind:"finite",message:n.errorUtil.toString(g)})}safe(g){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:n.errorUtil.toString(g)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:n.errorUtil.toString(g)})}get minValue(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g}get maxValue(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g}get isInt(){return!!this._def.checks.find(g=>g.kind==="int"||g.kind==="multipleOf"&&i.util.isInteger(g.value))}get isFinite(){let g=null,w=null;for(const C of this._def.checks){if(C.kind==="finite"||C.kind==="int"||C.kind==="multipleOf")return!0;C.kind==="min"?(w===null||C.value>w)&&(w=C.value):C.kind==="max"&&(g===null||C.value<g)&&(g=C.value)}return Number.isFinite(w)&&Number.isFinite(g)}}e.ZodNumber=j,j.create=P=>new j({checks:[],typeName:J.ZodNumber,coerce:(P==null?void 0:P.coerce)||!1,...l(P)});class U extends c{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(g){if(this._def.coerce&&(g.data=BigInt(g.data)),this._getType(g)!==i.ZodParsedType.bigint){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.bigint,received:$.parsedType}),r.INVALID}let C;const L=new r.ParseStatus;for(const $ of this._def.checks)$.kind==="min"?($.inclusive?g.data<$.value:g.data<=$.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,type:"bigint",minimum:$.value,inclusive:$.inclusive,message:$.message}),L.dirty()):$.kind==="max"?($.inclusive?g.data>$.value:g.data>=$.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,type:"bigint",maximum:$.value,inclusive:$.inclusive,message:$.message}),L.dirty()):$.kind==="multipleOf"?g.data%$.value!==BigInt(0)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.not_multiple_of,multipleOf:$.value,message:$.message}),L.dirty()):i.util.assertNever($);return{status:L.value,value:g.data}}gte(g,w){return this.setLimit("min",g,!0,n.errorUtil.toString(w))}gt(g,w){return this.setLimit("min",g,!1,n.errorUtil.toString(w))}lte(g,w){return this.setLimit("max",g,!0,n.errorUtil.toString(w))}lt(g,w){return this.setLimit("max",g,!1,n.errorUtil.toString(w))}setLimit(g,w,C,L){return new U({...this._def,checks:[...this._def.checks,{kind:g,value:w,inclusive:C,message:n.errorUtil.toString(L)}]})}_addCheck(g){return new U({...this._def,checks:[...this._def.checks,g]})}positive(g){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:n.errorUtil.toString(g)})}negative(g){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:n.errorUtil.toString(g)})}nonpositive(g){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:n.errorUtil.toString(g)})}nonnegative(g){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:n.errorUtil.toString(g)})}multipleOf(g,w){return this._addCheck({kind:"multipleOf",value:g,message:n.errorUtil.toString(w)})}get minValue(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g}get maxValue(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g}}e.ZodBigInt=U,U.create=P=>{var g;return new U({checks:[],typeName:J.ZodBigInt,coerce:(g=P==null?void 0:P.coerce)!==null&&g!==void 0?g:!1,...l(P)})};class H extends c{_parse(g){if(this._def.coerce&&(g.data=!!g.data),this._getType(g)!==i.ZodParsedType.boolean){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.boolean,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodBoolean=H,H.create=P=>new H({typeName:J.ZodBoolean,coerce:(P==null?void 0:P.coerce)||!1,...l(P)});class T extends c{_parse(g){if(this._def.coerce&&(g.data=new Date(g.data)),this._getType(g)!==i.ZodParsedType.date){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.date,received:$.parsedType}),r.INVALID}if(isNaN(g.data.getTime())){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_date}),r.INVALID}const C=new r.ParseStatus;let L;for(const $ of this._def.checks)$.kind==="min"?g.data.getTime()<$.value&&(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_small,message:$.message,inclusive:!0,exact:!1,minimum:$.value,type:"date"}),C.dirty()):$.kind==="max"?g.data.getTime()>$.value&&(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_big,message:$.message,inclusive:!0,exact:!1,maximum:$.value,type:"date"}),C.dirty()):i.util.assertNever($);return{status:C.value,value:new Date(g.data.getTime())}}_addCheck(g){return new T({...this._def,checks:[...this._def.checks,g]})}min(g,w){return this._addCheck({kind:"min",value:g.getTime(),message:n.errorUtil.toString(w)})}max(g,w){return this._addCheck({kind:"max",value:g.getTime(),message:n.errorUtil.toString(w)})}get minDate(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g!=null?new Date(g):null}get maxDate(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g!=null?new Date(g):null}}e.ZodDate=T,T.create=P=>new T({checks:[],coerce:(P==null?void 0:P.coerce)||!1,typeName:J.ZodDate,...l(P)});class N extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.symbol){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.symbol,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodSymbol=N,N.create=P=>new N({typeName:J.ZodSymbol,...l(P)});class G extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.undefined){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.undefined,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodUndefined=G,G.create=P=>new G({typeName:J.ZodUndefined,...l(P)});class W extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.null){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.null,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodNull=W,W.create=P=>new W({typeName:J.ZodNull,...l(P)});class q extends c{constructor(){super(...arguments),this._any=!0}_parse(g){return(0,r.OK)(g.data)}}e.ZodAny=q,q.create=P=>new q({typeName:J.ZodAny,...l(P)});class B extends c{constructor(){super(...arguments),this._unknown=!0}_parse(g){return(0,r.OK)(g.data)}}e.ZodUnknown=B,B.create=P=>new B({typeName:J.ZodUnknown,...l(P)});class z extends c{_parse(g){const w=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.never,received:w.parsedType}),r.INVALID}}e.ZodNever=z,z.create=P=>new z({typeName:J.ZodNever,...l(P)});class Y extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.undefined){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.void,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodVoid=Y,Y.create=P=>new Y({typeName:J.ZodVoid,...l(P)});class K extends c{_parse(g){const{ctx:w,status:C}=this._processInputParams(g),L=this._def;if(w.parsedType!==i.ZodParsedType.array)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.array,received:w.parsedType}),r.INVALID;if(L.exactLength!==null){const ve=w.data.length>L.exactLength.value,fe=w.data.length<L.exactLength.value;(ve||fe)&&((0,r.addIssueToContext)(w,{code:ve?s.ZodIssueCode.too_big:s.ZodIssueCode.too_small,minimum:fe?L.exactLength.value:void 0,maximum:ve?L.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:L.exactLength.message}),C.dirty())}if(L.minLength!==null&&w.data.length<L.minLength.value&&((0,r.addIssueToContext)(w,{code:s.ZodIssueCode.too_small,minimum:L.minLength.value,type:"array",inclusive:!0,exact:!1,message:L.minLength.message}),C.dirty()),L.maxLength!==null&&w.data.length>L.maxLength.value&&((0,r.addIssueToContext)(w,{code:s.ZodIssueCode.too_big,maximum:L.maxLength.value,type:"array",inclusive:!0,exact:!1,message:L.maxLength.message}),C.dirty()),w.common.async)return Promise.all([...w.data].map((ve,fe)=>L.type._parseAsync(new o(w,ve,w.path,fe)))).then(ve=>r.ParseStatus.mergeArray(C,ve));const $=[...w.data].map((ve,fe)=>L.type._parseSync(new o(w,ve,w.path,fe)));return r.ParseStatus.mergeArray(C,$)}get element(){return this._def.type}min(g,w){return new K({...this._def,minLength:{value:g,message:n.errorUtil.toString(w)}})}max(g,w){return new K({...this._def,maxLength:{value:g,message:n.errorUtil.toString(w)}})}length(g,w){return new K({...this._def,exactLength:{value:g,message:n.errorUtil.toString(w)}})}nonempty(g){return this.min(1,g)}}e.ZodArray=K,K.create=(P,g)=>new K({type:P,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...l(g)});function pe(P){if(P instanceof k){const g={};for(const w in P.shape){const C=P.shape[w];g[w]=me.create(pe(C))}return new k({...P._def,shape:()=>g})}else return P instanceof K?new K({...P._def,type:pe(P.element)}):P instanceof me?me.create(pe(P.unwrap())):P instanceof he?he.create(pe(P.unwrap())):P instanceof Ie?Ie.create(P.items.map(g=>pe(g))):P}class k extends c{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const g=this._def.shape(),w=i.util.objectKeys(g);return this._cached={shape:g,keys:w}}_parse(g){if(this._getType(g)!==i.ZodParsedType.object){const Ue=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(Ue,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:Ue.parsedType}),r.INVALID}const{status:C,ctx:L}=this._processInputParams(g),{shape:$,keys:ve}=this._getCached(),fe=[];if(!(this._def.catchall instanceof z&&this._def.unknownKeys==="strip"))for(const Ue in L.data)ve.includes(Ue)||fe.push(Ue);const Ze=[];for(const Ue of ve){const lt=$[Ue],Un=L.data[Ue];Ze.push({key:{status:"valid",value:Ue},value:lt._parse(new o(L,Un,L.path,Ue)),alwaysSet:Ue in L.data})}if(this._def.catchall instanceof z){const Ue=this._def.unknownKeys;if(Ue==="passthrough")for(const lt of fe)Ze.push({key:{status:"valid",value:lt},value:{status:"valid",value:L.data[lt]}});else if(Ue==="strict")fe.length>0&&((0,r.addIssueToContext)(L,{code:s.ZodIssueCode.unrecognized_keys,keys:fe}),C.dirty());else if(Ue!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const Ue=this._def.catchall;for(const lt of fe){const Un=L.data[lt];Ze.push({key:{status:"valid",value:lt},value:Ue._parse(new o(L,Un,L.path,lt)),alwaysSet:lt in L.data})}}return L.common.async?Promise.resolve().then(async()=>{const Ue=[];for(const lt of Ze){const Un=await lt.key;Ue.push({key:Un,value:await lt.value,alwaysSet:lt.alwaysSet})}return Ue}).then(Ue=>r.ParseStatus.mergeObjectSync(C,Ue)):r.ParseStatus.mergeObjectSync(C,Ze)}get shape(){return this._def.shape()}strict(g){return n.errorUtil.errToObj,new k({...this._def,unknownKeys:"strict",...g!==void 0?{errorMap:(w,C)=>{var L,$,ve,fe;const Ze=(ve=($=(L=this._def).errorMap)===null||$===void 0?void 0:$.call(L,w,C).message)!==null&&ve!==void 0?ve:C.defaultError;return w.code==="unrecognized_keys"?{message:(fe=n.errorUtil.errToObj(g).message)!==null&&fe!==void 0?fe:Ze}:{message:Ze}}}:{}})}strip(){return new k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(g){return new k({...this._def,shape:()=>({...this._def.shape(),...g})})}merge(g){return new k({unknownKeys:g._def.unknownKeys,catchall:g._def.catchall,shape:()=>({...this._def.shape(),...g._def.shape()}),typeName:J.ZodObject})}setKey(g,w){return this.augment({[g]:w})}catchall(g){return new k({...this._def,catchall:g})}pick(g){const w={};return i.util.objectKeys(g).forEach(C=>{g[C]&&this.shape[C]&&(w[C]=this.shape[C])}),new k({...this._def,shape:()=>w})}omit(g){const w={};return i.util.objectKeys(this.shape).forEach(C=>{g[C]||(w[C]=this.shape[C])}),new k({...this._def,shape:()=>w})}deepPartial(){return pe(this)}partial(g){const w={};return i.util.objectKeys(this.shape).forEach(C=>{const L=this.shape[C];g&&!g[C]?w[C]=L:w[C]=L.optional()}),new k({...this._def,shape:()=>w})}required(g){const w={};return i.util.objectKeys(this.shape).forEach(C=>{if(g&&!g[C])w[C]=this.shape[C];else{let $=this.shape[C];for(;$ instanceof me;)$=$._def.innerType;w[C]=$}}),new k({...this._def,shape:()=>w})}keyof(){return ke(i.util.objectKeys(this.shape))}}e.ZodObject=k,k.create=(P,g)=>new k({shape:()=>P,unknownKeys:"strip",catchall:z.create(),typeName:J.ZodObject,...l(g)}),k.strictCreate=(P,g)=>new k({shape:()=>P,unknownKeys:"strict",catchall:z.create(),typeName:J.ZodObject,...l(g)}),k.lazycreate=(P,g)=>new k({shape:P,unknownKeys:"strip",catchall:z.create(),typeName:J.ZodObject,...l(g)});class ee extends c{_parse(g){const{ctx:w}=this._processInputParams(g),C=this._def.options;function L($){for(const fe of $)if(fe.result.status==="valid")return fe.result;for(const fe of $)if(fe.result.status==="dirty")return w.common.issues.push(...fe.ctx.common.issues),fe.result;const ve=$.map(fe=>new s.ZodError(fe.ctx.common.issues));return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_union,unionErrors:ve}),r.INVALID}if(w.common.async)return Promise.all(C.map(async $=>{const ve={...w,common:{...w.common,issues:[]},parent:null};return{result:await $._parseAsync({data:w.data,path:w.path,parent:ve}),ctx:ve}})).then(L);{let $;const ve=[];for(const Ze of C){const Ue={...w,common:{...w.common,issues:[]},parent:null},lt=Ze._parseSync({data:w.data,path:w.path,parent:Ue});if(lt.status==="valid")return lt;lt.status==="dirty"&&!$&&($={result:lt,ctx:Ue}),Ue.common.issues.length&&ve.push(Ue.common.issues)}if($)return w.common.issues.push(...$.ctx.common.issues),$.result;const fe=ve.map(Ze=>new s.ZodError(Ze));return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_union,unionErrors:fe}),r.INVALID}}get options(){return this._def.options}}e.ZodUnion=ee,ee.create=(P,g)=>new ee({options:P,typeName:J.ZodUnion,...l(g)});const _e=P=>P instanceof ye?_e(P.schema):P instanceof ne?_e(P.innerType()):P instanceof Te?[P.value]:P instanceof Re?P.options:P instanceof qe?Object.keys(P.enum):P instanceof Le?_e(P._def.innerType):P instanceof G?[void 0]:P instanceof W?[null]:null;class S extends c{_parse(g){const{ctx:w}=this._processInputParams(g);if(w.parsedType!==i.ZodParsedType.object)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:w.parsedType}),r.INVALID;const C=this.discriminator,L=w.data[C],$=this.optionsMap.get(L);return $?w.common.async?$._parseAsync({data:w.data,path:w.path,parent:w}):$._parseSync({data:w.data,path:w.path,parent:w}):((0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[C]}),r.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(g,w,C){const L=new Map;for(const $ of w){const ve=_e($.shape[g]);if(!ve)throw new Error(`A discriminator value for key \`${g}\` could not be extracted from all schema options`);for(const fe of ve){if(L.has(fe))throw new Error(`Discriminator property ${String(g)} has duplicate value ${String(fe)}`);L.set(fe,$)}}return new S({typeName:J.ZodDiscriminatedUnion,discriminator:g,options:w,optionsMap:L,...l(C)})}}e.ZodDiscriminatedUnion=S;function Se(P,g){const w=(0,i.getParsedType)(P),C=(0,i.getParsedType)(g);if(P===g)return{valid:!0,data:P};if(w===i.ZodParsedType.object&&C===i.ZodParsedType.object){const L=i.util.objectKeys(g),$=i.util.objectKeys(P).filter(fe=>L.indexOf(fe)!==-1),ve={...P,...g};for(const fe of $){const Ze=Se(P[fe],g[fe]);if(!Ze.valid)return{valid:!1};ve[fe]=Ze.data}return{valid:!0,data:ve}}else if(w===i.ZodParsedType.array&&C===i.ZodParsedType.array){if(P.length!==g.length)return{valid:!1};const L=[];for(let $=0;$<P.length;$++){const ve=P[$],fe=g[$],Ze=Se(ve,fe);if(!Ze.valid)return{valid:!1};L.push(Ze.data)}return{valid:!0,data:L}}else return w===i.ZodParsedType.date&&C===i.ZodParsedType.date&&+P==+g?{valid:!0,data:P}:{valid:!1}}class Ne extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g),L=($,ve)=>{if((0,r.isAborted)($)||(0,r.isAborted)(ve))return r.INVALID;const fe=Se($.value,ve.value);return fe.valid?(((0,r.isDirty)($)||(0,r.isDirty)(ve))&&w.dirty(),{status:w.value,value:fe.data}):((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_intersection_types}),r.INVALID)};return C.common.async?Promise.all([this._def.left._parseAsync({data:C.data,path:C.path,parent:C}),this._def.right._parseAsync({data:C.data,path:C.path,parent:C})]).then(([$,ve])=>L($,ve)):L(this._def.left._parseSync({data:C.data,path:C.path,parent:C}),this._def.right._parseSync({data:C.data,path:C.path,parent:C}))}}e.ZodIntersection=Ne,Ne.create=(P,g,w)=>new Ne({left:P,right:g,typeName:J.ZodIntersection,...l(w)});class Ie extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.array)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.array,received:C.parsedType}),r.INVALID;if(C.data.length<this._def.items.length)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.INVALID;!this._def.rest&&C.data.length>this._def.items.length&&((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),w.dirty());const $=[...C.data].map((ve,fe)=>{const Ze=this._def.items[fe]||this._def.rest;return Ze?Ze._parse(new o(C,ve,C.path,fe)):null}).filter(ve=>!!ve);return C.common.async?Promise.all($).then(ve=>r.ParseStatus.mergeArray(w,ve)):r.ParseStatus.mergeArray(w,$)}get items(){return this._def.items}rest(g){return new Ie({...this._def,rest:g})}}e.ZodTuple=Ie,Ie.create=(P,g)=>{if(!Array.isArray(P))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ie({items:P,typeName:J.ZodTuple,rest:null,...l(g)})};class je extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.object)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:C.parsedType}),r.INVALID;const L=[],$=this._def.keyType,ve=this._def.valueType;for(const fe in C.data)L.push({key:$._parse(new o(C,fe,C.path,fe)),value:ve._parse(new o(C,C.data[fe],C.path,fe))});return C.common.async?r.ParseStatus.mergeObjectAsync(w,L):r.ParseStatus.mergeObjectSync(w,L)}get element(){return this._def.valueType}static create(g,w,C){return w instanceof c?new je({keyType:g,valueType:w,typeName:J.ZodRecord,...l(C)}):new je({keyType:A.create(),valueType:g,typeName:J.ZodRecord,...l(w)})}}e.ZodRecord=je;class He extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.map)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.map,received:C.parsedType}),r.INVALID;const L=this._def.keyType,$=this._def.valueType,ve=[...C.data.entries()].map(([fe,Ze],Ue)=>({key:L._parse(new o(C,fe,C.path,[Ue,"key"])),value:$._parse(new o(C,Ze,C.path,[Ue,"value"]))}));if(C.common.async){const fe=new Map;return Promise.resolve().then(async()=>{for(const Ze of ve){const Ue=await Ze.key,lt=await Ze.value;if(Ue.status==="aborted"||lt.status==="aborted")return r.INVALID;(Ue.status==="dirty"||lt.status==="dirty")&&w.dirty(),fe.set(Ue.value,lt.value)}return{status:w.value,value:fe}})}else{const fe=new Map;for(const Ze of ve){const Ue=Ze.key,lt=Ze.value;if(Ue.status==="aborted"||lt.status==="aborted")return r.INVALID;(Ue.status==="dirty"||lt.status==="dirty")&&w.dirty(),fe.set(Ue.value,lt.value)}return{status:w.value,value:fe}}}}e.ZodMap=He,He.create=(P,g,w)=>new He({valueType:g,keyType:P,typeName:J.ZodMap,...l(w)});class De extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.set)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.set,received:C.parsedType}),r.INVALID;const L=this._def;L.minSize!==null&&C.data.size<L.minSize.value&&((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,minimum:L.minSize.value,type:"set",inclusive:!0,exact:!1,message:L.minSize.message}),w.dirty()),L.maxSize!==null&&C.data.size>L.maxSize.value&&((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,maximum:L.maxSize.value,type:"set",inclusive:!0,exact:!1,message:L.maxSize.message}),w.dirty());const $=this._def.valueType;function ve(Ze){const Ue=new Set;for(const lt of Ze){if(lt.status==="aborted")return r.INVALID;lt.status==="dirty"&&w.dirty(),Ue.add(lt.value)}return{status:w.value,value:Ue}}const fe=[...C.data.values()].map((Ze,Ue)=>$._parse(new o(C,Ze,C.path,Ue)));return C.common.async?Promise.all(fe).then(Ze=>ve(Ze)):ve(fe)}min(g,w){return new De({...this._def,minSize:{value:g,message:n.errorUtil.toString(w)}})}max(g,w){return new De({...this._def,maxSize:{value:g,message:n.errorUtil.toString(w)}})}size(g,w){return this.min(g,w).max(g,w)}nonempty(g){return this.min(1,g)}}e.ZodSet=De,De.create=(P,g)=>new De({valueType:P,minSize:null,maxSize:null,typeName:J.ZodSet,...l(g)});class we extends c{constructor(){super(...arguments),this.validate=this.implement}_parse(g){const{ctx:w}=this._processInputParams(g);if(w.parsedType!==i.ZodParsedType.function)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.function,received:w.parsedType}),r.INVALID;function C(fe,Ze){return(0,r.makeIssue)({data:fe,path:w.path,errorMaps:[w.common.contextualErrorMap,w.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter(Ue=>!!Ue),issueData:{code:s.ZodIssueCode.invalid_arguments,argumentsError:Ze}})}function L(fe,Ze){return(0,r.makeIssue)({data:fe,path:w.path,errorMaps:[w.common.contextualErrorMap,w.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter(Ue=>!!Ue),issueData:{code:s.ZodIssueCode.invalid_return_type,returnTypeError:Ze}})}const $={errorMap:w.common.contextualErrorMap},ve=w.data;if(this._def.returns instanceof D){const fe=this;return(0,r.OK)(async function(...Ze){const Ue=new s.ZodError([]),lt=await fe._def.args.parseAsync(Ze,$).catch(Fd=>{throw Ue.addIssue(C(Ze,Fd)),Ue}),Un=await Reflect.apply(ve,this,lt);return await fe._def.returns._def.type.parseAsync(Un,$).catch(Fd=>{throw Ue.addIssue(L(Un,Fd)),Ue})})}else{const fe=this;return(0,r.OK)(function(...Ze){const Ue=fe._def.args.safeParse(Ze,$);if(!Ue.success)throw new s.ZodError([C(Ze,Ue.error)]);const lt=Reflect.apply(ve,this,Ue.data),Un=fe._def.returns.safeParse(lt,$);if(!Un.success)throw new s.ZodError([L(lt,Un.error)]);return Un.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...g){return new we({...this._def,args:Ie.create(g).rest(B.create())})}returns(g){return new we({...this._def,returns:g})}implement(g){return this.parse(g)}strictImplement(g){return this.parse(g)}static create(g,w,C){return new we({args:g||Ie.create([]).rest(B.create()),returns:w||B.create(),typeName:J.ZodFunction,...l(C)})}}e.ZodFunction=we;class ye extends c{get schema(){return this._def.getter()}_parse(g){const{ctx:w}=this._processInputParams(g);return this._def.getter()._parse({data:w.data,path:w.path,parent:w})}}e.ZodLazy=ye,ye.create=(P,g)=>new ye({getter:P,typeName:J.ZodLazy,...l(g)});class Te extends c{_parse(g){if(g.data!==this._def.value){const w=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(w,{received:w.data,code:s.ZodIssueCode.invalid_literal,expected:this._def.value}),r.INVALID}return{status:"valid",value:g.data}}get value(){return this._def.value}}e.ZodLiteral=Te,Te.create=(P,g)=>new Te({value:P,typeName:J.ZodLiteral,...l(g)});function ke(P,g){return new Re({values:P,typeName:J.ZodEnum,...l(g)})}class Re extends c{_parse(g){if(typeof g.data!="string"){const w=this._getOrReturnCtx(g),C=this._def.values;return(0,r.addIssueToContext)(w,{expected:i.util.joinValues(C),received:w.parsedType,code:s.ZodIssueCode.invalid_type}),r.INVALID}if(this._def.values.indexOf(g.data)===-1){const w=this._getOrReturnCtx(g),C=this._def.values;return(0,r.addIssueToContext)(w,{received:w.data,code:s.ZodIssueCode.invalid_enum_value,options:C}),r.INVALID}return(0,r.OK)(g.data)}get options(){return this._def.values}get enum(){const g={};for(const w of this._def.values)g[w]=w;return g}get Values(){const g={};for(const w of this._def.values)g[w]=w;return g}get Enum(){const g={};for(const w of this._def.values)g[w]=w;return g}extract(g){return Re.create(g)}exclude(g){return Re.create(this.options.filter(w=>!g.includes(w)))}}e.ZodEnum=Re,Re.create=ke;class qe extends c{_parse(g){const w=i.util.getValidEnumValues(this._def.values),C=this._getOrReturnCtx(g);if(C.parsedType!==i.ZodParsedType.string&&C.parsedType!==i.ZodParsedType.number){const L=i.util.objectValues(w);return(0,r.addIssueToContext)(C,{expected:i.util.joinValues(L),received:C.parsedType,code:s.ZodIssueCode.invalid_type}),r.INVALID}if(w.indexOf(g.data)===-1){const L=i.util.objectValues(w);return(0,r.addIssueToContext)(C,{received:C.data,code:s.ZodIssueCode.invalid_enum_value,options:L}),r.INVALID}return(0,r.OK)(g.data)}get enum(){return this._def.values}}e.ZodNativeEnum=qe,qe.create=(P,g)=>new qe({values:P,typeName:J.ZodNativeEnum,...l(g)});class D extends c{unwrap(){return this._def.type}_parse(g){const{ctx:w}=this._processInputParams(g);if(w.parsedType!==i.ZodParsedType.promise&&w.common.async===!1)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.promise,received:w.parsedType}),r.INVALID;const C=w.parsedType===i.ZodParsedType.promise?w.data:Promise.resolve(w.data);return(0,r.OK)(C.then(L=>this._def.type.parseAsync(L,{path:w.path,errorMap:w.common.contextualErrorMap})))}}e.ZodPromise=D,D.create=(P,g)=>new D({type:P,typeName:J.ZodPromise,...l(g)});class ne extends c{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(g){const{status:w,ctx:C}=this._processInputParams(g),L=this._def.effect||null,$={addIssue:ve=>{(0,r.addIssueToContext)(C,ve),ve.fatal?w.abort():w.dirty()},get path(){return C.path}};if($.addIssue=$.addIssue.bind($),L.type==="preprocess"){const ve=L.transform(C.data,$);return C.common.issues.length?{status:"dirty",value:C.data}:C.common.async?Promise.resolve(ve).then(fe=>this._def.schema._parseAsync({data:fe,path:C.path,parent:C})):this._def.schema._parseSync({data:ve,path:C.path,parent:C})}if(L.type==="refinement"){const ve=fe=>{const Ze=L.refinement(fe,$);if(C.common.async)return Promise.resolve(Ze);if(Ze instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return fe};if(C.common.async===!1){const fe=this._def.schema._parseSync({data:C.data,path:C.path,parent:C});return fe.status==="aborted"?r.INVALID:(fe.status==="dirty"&&w.dirty(),ve(fe.value),{status:w.value,value:fe.value})}else return this._def.schema._parseAsync({data:C.data,path:C.path,parent:C}).then(fe=>fe.status==="aborted"?r.INVALID:(fe.status==="dirty"&&w.dirty(),ve(fe.value).then(()=>({status:w.value,value:fe.value}))))}if(L.type==="transform")if(C.common.async===!1){const ve=this._def.schema._parseSync({data:C.data,path:C.path,parent:C});if(!(0,r.isValid)(ve))return ve;const fe=L.transform(ve.value,$);if(fe instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:w.value,value:fe}}else return this._def.schema._parseAsync({data:C.data,path:C.path,parent:C}).then(ve=>(0,r.isValid)(ve)?Promise.resolve(L.transform(ve.value,$)).then(fe=>({status:w.value,value:fe})):ve);i.util.assertNever(L)}}e.ZodEffects=ne,e.ZodTransformer=ne,ne.create=(P,g,w)=>new ne({schema:P,typeName:J.ZodEffects,effect:g,...l(w)}),ne.createWithPreprocess=(P,g,w)=>new ne({schema:g,effect:{type:"preprocess",transform:P},typeName:J.ZodEffects,...l(w)});class me extends c{_parse(g){return this._getType(g)===i.ZodParsedType.undefined?(0,r.OK)(void 0):this._def.innerType._parse(g)}unwrap(){return this._def.innerType}}e.ZodOptional=me,me.create=(P,g)=>new me({innerType:P,typeName:J.ZodOptional,...l(g)});class he extends c{_parse(g){return this._getType(g)===i.ZodParsedType.null?(0,r.OK)(null):this._def.innerType._parse(g)}unwrap(){return this._def.innerType}}e.ZodNullable=he,he.create=(P,g)=>new he({innerType:P,typeName:J.ZodNullable,...l(g)});class Le extends c{_parse(g){const{ctx:w}=this._processInputParams(g);let C=w.data;return w.parsedType===i.ZodParsedType.undefined&&(C=this._def.defaultValue()),this._def.innerType._parse({data:C,path:w.path,parent:w})}removeDefault(){return this._def.innerType}}e.ZodDefault=Le,Le.create=(P,g)=>new Le({innerType:P,typeName:J.ZodDefault,defaultValue:typeof g.default=="function"?g.default:()=>g.default,...l(g)});class Pe extends c{_parse(g){const{ctx:w}=this._processInputParams(g),C={...w,common:{...w.common,issues:[]}},L=this._def.innerType._parse({data:C.data,path:C.path,parent:{...C}});return(0,r.isAsync)(L)?L.then($=>({status:"valid",value:$.status==="valid"?$.value:this._def.catchValue({get error(){return new s.ZodError(C.common.issues)},input:C.data})})):{status:"valid",value:L.status==="valid"?L.value:this._def.catchValue({get error(){return new s.ZodError(C.common.issues)},input:C.data})}}removeCatch(){return this._def.innerType}}e.ZodCatch=Pe,Pe.create=(P,g)=>new Pe({innerType:P,typeName:J.ZodCatch,catchValue:typeof g.catch=="function"?g.catch:()=>g.catch,...l(g)});class Fe extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.nan){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.nan,received:C.parsedType}),r.INVALID}return{status:"valid",value:g.data}}}e.ZodNaN=Fe,Fe.create=P=>new Fe({typeName:J.ZodNaN,...l(P)}),e.BRAND=Symbol("zod_brand");class ot extends c{_parse(g){const{ctx:w}=this._processInputParams(g),C=w.data;return this._def.type._parse({data:C,path:w.path,parent:w})}unwrap(){return this._def.type}}e.ZodBranded=ot;class ze extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.common.async)return(async()=>{const $=await this._def.in._parseAsync({data:C.data,path:C.path,parent:C});return $.status==="aborted"?r.INVALID:$.status==="dirty"?(w.dirty(),(0,r.DIRTY)($.value)):this._def.out._parseAsync({data:$.value,path:C.path,parent:C})})();{const L=this._def.in._parseSync({data:C.data,path:C.path,parent:C});return L.status==="aborted"?r.INVALID:L.status==="dirty"?(w.dirty(),{status:"dirty",value:L.value}):this._def.out._parseSync({data:L.value,path:C.path,parent:C})}}static create(g,w){return new ze({in:g,out:w,typeName:J.ZodPipeline})}}e.ZodPipeline=ze;class V extends c{_parse(g){const w=this._def.innerType._parse(g);return(0,r.isValid)(w)&&(w.value=Object.freeze(w.value)),w}}e.ZodReadonly=V,V.create=(P,g)=>new V({innerType:P,typeName:J.ZodReadonly,...l(g)});const Q=(P,g={},w)=>P?q.create().superRefine((C,L)=>{var $,ve;if(!P(C)){const fe=typeof g=="function"?g(C):typeof g=="string"?{message:g}:g,Ze=(ve=($=fe.fatal)!==null&&$!==void 0?$:w)!==null&&ve!==void 0?ve:!0,Ue=typeof fe=="string"?{message:fe}:fe;L.addIssue({code:"custom",...Ue,fatal:Ze})}}):q.create();e.custom=Q,e.late={object:k.lazycreate};var J;(function(P){P.ZodString="ZodString",P.ZodNumber="ZodNumber",P.ZodNaN="ZodNaN",P.ZodBigInt="ZodBigInt",P.ZodBoolean="ZodBoolean",P.ZodDate="ZodDate",P.ZodSymbol="ZodSymbol",P.ZodUndefined="ZodUndefined",P.ZodNull="ZodNull",P.ZodAny="ZodAny",P.ZodUnknown="ZodUnknown",P.ZodNever="ZodNever",P.ZodVoid="ZodVoid",P.ZodArray="ZodArray",P.ZodObject="ZodObject",P.ZodUnion="ZodUnion",P.ZodDiscriminatedUnion="ZodDiscriminatedUnion",P.ZodIntersection="ZodIntersection",P.ZodTuple="ZodTuple",P.ZodRecord="ZodRecord",P.ZodMap="ZodMap",P.ZodSet="ZodSet",P.ZodFunction="ZodFunction",P.ZodLazy="ZodLazy",P.ZodLiteral="ZodLiteral",P.ZodEnum="ZodEnum",P.ZodEffects="ZodEffects",P.ZodNativeEnum="ZodNativeEnum",P.ZodOptional="ZodOptional",P.ZodNullable="ZodNullable",P.ZodDefault="ZodDefault",P.ZodCatch="ZodCatch",P.ZodPromise="ZodPromise",P.ZodBranded="ZodBranded",P.ZodPipeline="ZodPipeline",P.ZodReadonly="ZodReadonly"})(J=e.ZodFirstPartyTypeKind||(e.ZodFirstPartyTypeKind={}));const $e=(P,g={message:`Input not instance of ${P.name}`})=>(0,e.custom)(w=>w instanceof P,g);e.instanceof=$e;const Ge=A.create;e.string=Ge;const St=j.create;e.number=St;const bt=Fe.create;e.nan=bt;const mt=U.create;e.bigint=mt;const At=H.create;e.boolean=At;const fn=T.create;e.date=fn;const Rt=N.create;e.symbol=Rt;const Ft=G.create;e.undefined=Ft;const Qt=W.create;e.null=Qt;const Gt=q.create;e.any=Gt;const Rr=B.create;e.unknown=Rr;const jn=z.create;e.never=jn;const fr=Y.create;e.void=fr;const Ai=K.create;e.array=Ai;const si=k.create;e.object=si;const oi=k.strictCreate;e.strictObject=oi;const $r=ee.create;e.union=$r;const Tt=S.create;e.discriminatedUnion=Tt;const Ot=Ne.create;e.intersection=Ot;const Xt=Ie.create;e.tuple=Xt;const en=je.create;e.record=en;const Yt=He.create;e.map=Yt;const Lt=De.create;e.set=Lt;const _n=we.create;e.function=_n;const Pn=ye.create;e.lazy=Pn;const hr=Te.create;e.literal=hr;const jd=Re.create;e.enum=jd;const Ud=qe.create;e.nativeEnum=Ud;const M=D.create;e.promise=M;const ge=ne.create;e.effect=ge,e.transformer=ge;const Ee=me.create;e.optional=Ee;const Ke=he.create;e.nullable=Ke;const ft=ne.createWithPreprocess;e.preprocess=ft;const gt=ze.create;e.pipeline=gt;const at=()=>Ge().optional();e.ostring=at;const it=()=>St().optional();e.onumber=it;const sn=()=>At().optional();e.oboolean=sn,e.coerce={string:P=>A.create({...P,coerce:!0}),number:P=>j.create({...P,coerce:!0}),boolean:P=>H.create({...P,coerce:!0}),bigint:P=>U.create({...P,coerce:!0}),date:P=>T.create({...P,coerce:!0})},e.NEVER=r.INVALID}(xg),function(e){var t=Me&&Me.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=Me&&Me.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(rr,e),n(Pu,e),n(wg,e),n(Js,e),n(xg,e),n(ir,e)}(Ou),function(e){var t=Me&&Me.__createBinding||(Object.create?function(o,a,l,c){c===void 0&&(c=l),Object.defineProperty(o,c,{enumerable:!0,get:function(){return a[l]}})}:function(o,a,l,c){c===void 0&&(c=l),o[c]=a[l]}),n=Me&&Me.__setModuleDefault||(Object.create?function(o,a){Object.defineProperty(o,"default",{enumerable:!0,value:a})}:function(o,a){o.default=a}),r=Me&&Me.__importStar||function(o){if(o&&o.__esModule)return o;var a={};if(o!=null)for(var l in o)l!=="default"&&Object.prototype.hasOwnProperty.call(o,l)&&t(a,o,l);return n(a,o),a},i=Me&&Me.__exportStar||function(o,a){for(var l in o)l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&t(a,o,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.z=void 0;const s=r(Ou);e.z=s,i(Ou,e),e.default=s}(Da);const Au={},kg=$l(Object.freeze(Object.defineProperty({__proto__:null,default:Au},Symbol.toStringTag,{value:"Module"})));function Cg(e,t){return function(){return e.apply(t,arguments)}}const{toString:fR}=Object.prototype,{getPrototypeOf:Ru}=Object,ja=(e=>t=>{const n=fR.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),sr=e=>(e=e.toLowerCase(),t=>ja(t)===e),Ua=e=>t=>typeof t===e,{isArray:ts}=Array,Gs=Ua("undefined");function hR(e){return e!==null&&!Gs(e)&&e.constructor!==null&&!Gs(e.constructor)&&Dn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Eg=sr("ArrayBuffer");function pR(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Eg(e.buffer),t}const mR=Ua("string"),Dn=Ua("function"),Sg=Ua("number"),Fa=e=>e!==null&&typeof e=="object",gR=e=>e===!0||e===!1,Ba=e=>{if(ja(e)!=="object")return!1;const t=Ru(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},yR=sr("Date"),vR=sr("File"),bR=sr("Blob"),wR=sr("FileList"),xR=e=>Fa(e)&&Dn(e.pipe),_R=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Dn(e.append)&&((t=ja(e))==="formdata"||t==="object"&&Dn(e.toString)&&e.toString()==="[object FormData]"))},kR=sr("URLSearchParams"),CR=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ys(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),ts(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(r=0;r<o;r++)a=s[r],t.call(null,e[a],a,e)}}function Tg(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Og=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Ig=e=>!Gs(e)&&e!==Og;function $u(){const{caseless:e}=Ig(this)&&this||{},t={},n=(r,i)=>{const s=e&&Tg(t,i)||i;Ba(t[s])&&Ba(r)?t[s]=$u(t[s],r):Ba(r)?t[s]=$u({},r):ts(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Ys(arguments[r],n);return t}const ER=(e,t,n,{allOwnKeys:r}={})=>(Ys(t,(i,s)=>{n&&Dn(i)?e[s]=Cg(i,n):e[s]=i},{allOwnKeys:r}),e),SR=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),TR=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},OR=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&Ru(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},IR=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},PR=e=>{if(!e)return null;if(ts(e))return e;let t=e.length;if(!Sg(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},AR=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ru(Uint8Array)),RR=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},$R=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},MR=sr("HTMLFormElement"),LR=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Pg=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),DR=sr("RegExp"),Ag=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ys(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},NR=e=>{Ag(e,(t,n)=>{if(Dn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Dn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},jR=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return ts(e)?r(e):r(String(e).split(t)),n},UR=()=>{},FR=(e,t)=>(e=+e,Number.isFinite(e)?e:t),Mu="abcdefghijklmnopqrstuvwxyz",Rg="0123456789",$g={DIGIT:Rg,ALPHA:Mu,ALPHA_DIGIT:Mu+Mu.toUpperCase()+Rg},BR=(e=16,t=$g.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function VR(e){return!!(e&&Dn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const zR=e=>{const t=new Array(10),n=(r,i)=>{if(Fa(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=ts(r)?[]:{};return Ys(r,(o,a)=>{const l=n(o,i+1);!Gs(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},ZR=sr("AsyncFunction"),re={isArray:ts,isArrayBuffer:Eg,isBuffer:hR,isFormData:_R,isArrayBufferView:pR,isString:mR,isNumber:Sg,isBoolean:gR,isObject:Fa,isPlainObject:Ba,isUndefined:Gs,isDate:yR,isFile:vR,isBlob:bR,isRegExp:DR,isFunction:Dn,isStream:xR,isURLSearchParams:kR,isTypedArray:AR,isFileList:wR,forEach:Ys,merge:$u,extend:ER,trim:CR,stripBOM:SR,inherits:TR,toFlatObject:OR,kindOf:ja,kindOfTest:sr,endsWith:IR,toArray:PR,forEachEntry:RR,matchAll:$R,isHTMLForm:MR,hasOwnProperty:Pg,hasOwnProp:Pg,reduceDescriptors:Ag,freezeMethods:NR,toObjectSet:jR,toCamelCase:LR,noop:UR,toFiniteNumber:FR,findKey:Tg,global:Og,isContextDefined:Ig,ALPHABET:$g,generateString:BR,isSpecCompliantForm:VR,toJSONObject:zR,isAsyncFn:ZR,isThenable:e=>e&&(Fa(e)||Dn(e))&&Dn(e.then)&&Dn(e.catch)};function ut(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}re.inherits(ut,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:re.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Mg=ut.prototype,Lg={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Lg[e]={value:e}}),Object.defineProperties(ut,Lg),Object.defineProperty(Mg,"isAxiosError",{value:!0}),ut.from=(e,t,n,r,i,s)=>{const o=Object.create(Mg);return re.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),ut.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const WR=null;function Lu(e){return re.isPlainObject(e)||re.isArray(e)}function Dg(e){return re.endsWith(e,"[]")?e.slice(0,-2):e}function Ng(e,t,n){return e?e.concat(t).map(function(i,s){return i=Dg(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function HR(e){return re.isArray(e)&&!e.some(Lu)}const qR=re.toFlatObject(re,{},null,function(t){return/^is[A-Z]/.test(t)});function Va(e,t,n){if(!re.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=re.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,v){return!re.isUndefined(v[m])});const r=n.metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&re.isSpecCompliantForm(t);if(!re.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(re.isDate(p))return p.toISOString();if(!l&&re.isBlob(p))throw new ut("Blob is not supported. Use a Buffer instead.");return re.isArrayBuffer(p)||re.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,v){let y=p;if(p&&!v&&typeof p=="object"){if(re.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(re.isArray(p)&&HR(p)||(re.isFileList(p)||re.endsWith(m,"[]"))&&(y=re.toArray(p)))return m=Dg(m),y.forEach(function(x,I){!(re.isUndefined(x)||x===null)&&t.append(o===!0?Ng([m],I,s):o===null?m:m+"[]",c(x))}),!1}return Lu(p)?!0:(t.append(Ng(v,m,s),c(p)),!1)}const d=[],h=Object.assign(qR,{defaultVisitor:u,convertValue:c,isVisitable:Lu});function f(p,m){if(!re.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),re.forEach(p,function(y,b){(!(re.isUndefined(y)||y===null)&&i.call(t,y,re.isString(b)?b.trim():b,m,h))===!0&&f(y,m?m.concat(b):[b])}),d.pop()}}if(!re.isObject(e))throw new TypeError("data must be an object");return f(e),t}function jg(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Du(e,t){this._pairs=[],e&&Va(e,this,t)}const Ug=Du.prototype;Ug.append=function(t,n){this._pairs.push([t,n])},Ug.toString=function(t){const n=t?function(r){return t.call(this,r,jg)}:jg;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function KR(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Fg(e,t,n){if(!t)return e;const r=n&&n.encode||KR,i=n&&n.serialize;let s;if(i?s=i(t,n):s=re.isURLSearchParams(t)?t.toString():new Du(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}const Bg=class{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){re.forEach(this.handlers,function(r){r!==null&&t(r)})}},Vg={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},JR={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Du,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},zg=typeof window<"u"&&typeof document<"u",GR=(e=>zg&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),YR=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),or={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:zg,hasStandardBrowserEnv:GR,hasStandardBrowserWebWorkerEnv:YR},Symbol.toStringTag,{value:"Module"})),...JR};function QR(e,t){return Va(e,new or.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return or.isNode&&re.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function XR(e){return re.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function e$(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function Zg(e){function t(n,r,i,s){let o=n[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=s>=n.length;return o=!o&&re.isArray(i)?i.length:o,l?(re.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!re.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&re.isArray(i[o])&&(i[o]=e$(i[o])),!a)}if(re.isFormData(e)&&re.isFunction(e.entries)){const n={};return re.forEachEntry(e,(r,i)=>{t(XR(r),i,n,0)}),n}return null}function t$(e,t,n){if(re.isString(e))try{return(t||JSON.parse)(e),re.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Nu={transitional:Vg,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=re.isObject(t);if(s&&re.isHTMLForm(t)&&(t=new FormData(t)),re.isFormData(t))return i?JSON.stringify(Zg(t)):t;if(re.isArrayBuffer(t)||re.isBuffer(t)||re.isStream(t)||re.isFile(t)||re.isBlob(t))return t;if(re.isArrayBufferView(t))return t.buffer;if(re.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return QR(t,this.formSerializer).toString();if((a=re.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Va(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),t$(t)):t}],transformResponse:[function(t){const n=this.transitional||Nu.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(t&&re.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?ut.from(a,ut.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:or.classes.FormData,Blob:or.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};re.forEach(["delete","get","head","post","put","patch"],e=>{Nu.headers[e]={}});const ju=Nu,n$=re.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),r$=e=>{const t={};let n,r,i;return e&&e.split(`
273
+ `).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&n$[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Wg=Symbol("internals");function Qs(e){return e&&String(e).trim().toLowerCase()}function za(e){return e===!1||e==null?e:re.isArray(e)?e.map(za):String(e)}function i$(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const s$=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Uu(e,t,n,r,i){if(re.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!re.isString(t)){if(re.isString(r))return t.indexOf(r)!==-1;if(re.isRegExp(r))return r.test(t)}}function o$(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function a$(e,t){const n=re.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}let Za=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,c){const u=Qs(l);if(!u)throw new Error("header name must be a non-empty string");const d=re.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=za(a))}const o=(a,l)=>re.forEach(a,(c,u)=>s(c,u,l));return re.isPlainObject(t)||t instanceof this.constructor?o(t,n):re.isString(t)&&(t=t.trim())&&!s$(t)?o(r$(t),n):t!=null&&s(n,t,r),this}get(t,n){if(t=Qs(t),t){const r=re.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return i$(i);if(re.isFunction(n))return n.call(this,i,r);if(re.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Qs(t),t){const r=re.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Uu(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=Qs(o),o){const a=re.findKey(r,o);a&&(!n||Uu(r,r[a],a,n))&&(delete r[a],i=!0)}}return re.isArray(t)?t.forEach(s):s(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!t||Uu(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return re.forEach(this,(i,s)=>{const o=re.findKey(r,s);if(o){n[o]=za(i),delete n[s];return}const a=t?o$(s):String(s).trim();a!==s&&delete n[s],n[a]=za(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return re.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&re.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
274
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Wg]=this[Wg]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=Qs(o);r[a]||(a$(i,o),r[a]=!0)}return re.isArray(t)?t.forEach(s):s(t),this}};Za.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),re.reduceDescriptors(Za.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),re.freezeMethods(Za);const kr=Za;function Fu(e,t){const n=this||ju,r=t||n,i=kr.from(r.headers);let s=r.data;return re.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Hg(e){return!!(e&&e.__CANCEL__)}function Xs(e,t,n){ut.call(this,e??"canceled",ut.ERR_CANCELED,t,n),this.name="CanceledError"}re.inherits(Xs,ut,{__CANCEL__:!0});function l$(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ut("Request failed with status code "+n.status,[ut.ERR_BAD_REQUEST,ut.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const c$=or.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];re.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),re.isString(r)&&o.push("path="+r),re.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function u$(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function d$(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function qg(e,t){return e&&!u$(t)?d$(e,t):t}const f$=or.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let o=s;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(o){const a=re.isString(o)?i(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function h$(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function p$(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[s];o||(o=c),n[i]=l,r[i]=c;let d=s,h=0;for(;d!==i;)h+=n[d++],d=d%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function Kg(e,t){let n=0;const r=p$(50,250);return i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-n,l=r(a),c=s<=o;n=s;const u={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&c?(o-s)/l:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}const Bu={http:WR,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let i=e.data;const s=kr.from(e.headers).normalize();let{responseType:o,withXSRFToken:a}=e,l;function c(){e.cancelToken&&e.cancelToken.unsubscribe(l),e.signal&&e.signal.removeEventListener("abort",l)}let u;if(re.isFormData(i)){if(or.hasStandardBrowserEnv||or.hasStandardBrowserWebWorkerEnv)s.setContentType(!1);else if((u=s.getContentType())!==!1){const[m,...v]=u?u.split(";").map(y=>y.trim()).filter(Boolean):[];s.setContentType([m||"multipart/form-data",...v].join("; "))}}let d=new XMLHttpRequest;if(e.auth){const m=e.auth.username||"",v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(m+":"+v))}const h=qg(e.baseURL,e.url);d.open(e.method.toUpperCase(),Fg(h,e.params,e.paramsSerializer),!0),d.timeout=e.timeout;function f(){if(!d)return;const m=kr.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),y={data:!o||o==="text"||o==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:m,config:e,request:d};l$(function(x){n(x),c()},function(x){r(x),c()},y),d=null}if("onloadend"in d?d.onloadend=f:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(f)},d.onabort=function(){d&&(r(new ut("Request aborted",ut.ECONNABORTED,e,d)),d=null)},d.onerror=function(){r(new ut("Network Error",ut.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let v=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const y=e.transitional||Vg;e.timeoutErrorMessage&&(v=e.timeoutErrorMessage),r(new ut(v,y.clarifyTimeoutError?ut.ETIMEDOUT:ut.ECONNABORTED,e,d)),d=null},or.hasStandardBrowserEnv&&(a&&re.isFunction(a)&&(a=a(e)),a||a!==!1&&f$(h))){const m=e.xsrfHeaderName&&e.xsrfCookieName&&c$.read(e.xsrfCookieName);m&&s.set(e.xsrfHeaderName,m)}i===void 0&&s.setContentType(null),"setRequestHeader"in d&&re.forEach(s.toJSON(),function(v,y){d.setRequestHeader(y,v)}),re.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),o&&o!=="json"&&(d.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&d.addEventListener("progress",Kg(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",Kg(e.onUploadProgress)),(e.cancelToken||e.signal)&&(l=m=>{d&&(r(!m||m.type?new Xs(null,e,d):m),d.abort(),d=null)},e.cancelToken&&e.cancelToken.subscribe(l),e.signal&&(e.signal.aborted?l():e.signal.addEventListener("abort",l)));const p=h$(h);if(p&&or.protocols.indexOf(p)===-1){r(new ut("Unsupported protocol "+p+":",ut.ERR_BAD_REQUEST,e));return}d.send(i||null)})}};re.forEach(Bu,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Jg=e=>`- ${e}`,m$=e=>re.isFunction(e)||e===null||e===!1,Gg={getAdapter:e=>{e=re.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let s=0;s<t;s++){n=e[s];let o;if(r=n,!m$(n)&&(r=Bu[(o=String(n)).toLowerCase()],r===void 0))throw new ut(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+s]=r}if(!r){const s=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since :
275
+ `+s.map(Jg).join(`
276
+ `):" "+Jg(s[0]):"as no adapter specified";throw new ut("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Bu};function Vu(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Xs(null,e)}function Yg(e){return Vu(e),e.headers=kr.from(e.headers),e.data=Fu.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Gg.getAdapter(e.adapter||ju.adapter)(e).then(function(r){return Vu(e),r.data=Fu.call(e,e.transformResponse,r),r.headers=kr.from(r.headers),r},function(r){return Hg(r)||(Vu(e),r&&r.response&&(r.response.data=Fu.call(e,e.transformResponse,r.response),r.response.headers=kr.from(r.response.headers))),Promise.reject(r)})}const Qg=e=>e instanceof kr?{...e}:e;function ns(e,t){t=t||{};const n={};function r(c,u,d){return re.isPlainObject(c)&&re.isPlainObject(u)?re.merge.call({caseless:d},c,u):re.isPlainObject(u)?re.merge({},u):re.isArray(u)?u.slice():u}function i(c,u,d){if(re.isUndefined(u)){if(!re.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function s(c,u){if(!re.isUndefined(u))return r(void 0,u)}function o(c,u){if(re.isUndefined(u)){if(!re.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u)=>i(Qg(c),Qg(u),!0)};return re.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=l[u]||i,h=d(e[u],t[u],u);re.isUndefined(h)&&d!==a||(n[u]=h)}),n}const Xg="1.6.8",zu={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{zu[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ey={};zu.transitional=function(t,n,r){function i(s,o){return"[Axios v"+Xg+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new ut(i(o," has been removed"+(n?" in "+n:"")),ut.ERR_DEPRECATED);return n&&!ey[o]&&(ey[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,a):!0}};function g$(e,t,n){if(typeof e!="object")throw new ut("options must be an object",ut.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new ut("option "+s+" must be "+l,ut.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ut("Unknown option "+s,ut.ERR_BAD_OPTION)}}const Zu={assertOptions:g$,validators:zu},Gr=Zu.validators;let Wa=class{constructor(t){this.defaults=t,this.interceptors={request:new Bg,response:new Bg}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
277
+ `+s):r.stack=s}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ns(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Zu.assertOptions(r,{silentJSONParsing:Gr.transitional(Gr.boolean),forcedJSONParsing:Gr.transitional(Gr.boolean),clarifyTimeoutError:Gr.transitional(Gr.boolean)},!1),i!=null&&(re.isFunction(i)?n.paramsSerializer={serialize:i}:Zu.assertOptions(i,{encode:Gr.function,serialize:Gr.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&re.merge(s.common,s[n.method]);s&&re.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=kr.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const p=[Yg.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(d=0;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(v){m.call(this,v);break}}try{u=Yg.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=ns(this.defaults,t);const n=qg(t.baseURL,t.url);return Fg(n,t.params,t.paramsSerializer)}};re.forEach(["delete","get","head","options"],function(t){Wa.prototype[t]=function(n,r){return this.request(ns(r||{},{method:t,url:n,data:(r||{}).data}))}}),re.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(ns(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Wa.prototype[t]=n(),Wa.prototype[t+"Form"]=n(!0)});const Ha=Wa,y$=class Lw{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new Xs(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Lw(function(i){t=i}),cancel:t}}};function v$(e){return function(n){return e.apply(null,n)}}function b$(e){return re.isObject(e)&&e.isAxiosError===!0}const Wu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Wu).forEach(([e,t])=>{Wu[t]=e});const w$=Wu;function ty(e){const t=new Ha(e),n=Cg(Ha.prototype.request,t);return re.extend(n,Ha.prototype,t,{allOwnKeys:!0}),re.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return ty(ns(e,i))},n}const Nt=ty(ju);Nt.Axios=Ha,Nt.CanceledError=Xs,Nt.CancelToken=y$,Nt.isCancel=Hg,Nt.VERSION=Xg,Nt.toFormData=Va,Nt.AxiosError=ut,Nt.Cancel=Nt.CanceledError,Nt.all=function(t){return Promise.all(t)},Nt.spread=v$,Nt.isAxiosError=b$,Nt.mergeConfig=ns,Nt.AxiosHeaders=kr,Nt.formToJSON=e=>Zg(re.isHTMLForm(e)?new FormData(e):e),Nt.getAdapter=Gg.getAdapter,Nt.HttpStatusCode=w$,Nt.default=Nt;const X=Nt,{Axios:x$,AxiosError:_$,CanceledError:k$,isCancel:C$,CancelToken:E$,VERSION:S$,all:T$,Cancel:O$,isAxiosError:I$,spread:P$,toFormData:A$,AxiosHeaders:R$,HttpStatusCode:$$,formToJSON:M$,getAdapter:L$,mergeConfig:D$}=X,N$=Object.freeze(Object.defineProperty({__proto__:null,Axios:x$,AxiosError:_$,AxiosHeaders:R$,Cancel:O$,CancelToken:E$,CanceledError:k$,HttpStatusCode:$$,VERSION:S$,all:T$,default:X,formToJSON:M$,getAdapter:L$,isAxiosError:I$,isCancel:C$,mergeConfig:D$,spread:P$,toFormData:A$},Symbol.toStringTag,{value:"Module"}));var rs={};Object.defineProperty(rs,"__esModule",{value:!0});var j$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U$=typeof window<"u"&&typeof window.document<"u",F$=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,B$=(typeof self>"u"?"undefined":j$(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",V$=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),z$=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",ny=rs.isBrowser=U$;rs.isWebWorker=B$;var Hu=rs.isNode=F$;rs.isJsDom=V$,rs.isDeno=z$;var Z$=Object.create,ry=Object.defineProperty,W$=Object.getOwnPropertyDescriptor,H$=Object.getOwnPropertyNames,q$=Object.getPrototypeOf,K$=Object.prototype.hasOwnProperty,iy=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),J$=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of H$(t))!K$.call(e,i)&&i!==n&&ry(e,i,{get:()=>t[i],enumerable:!(r=W$(t,i))||r.enumerable});return e},sy=(e,t,n)=>(n=e!=null?Z$(q$(e)):{},J$(t||!e||!e.__esModule?ry(n,"default",{value:e,enumerable:!0}):n,e)),G$=iy(()=>{}),Y$=iy(()=>{}),Q$=sy(G$()),X$=sy(Y$()),eM="https://api.botpress.cloud",tM=6e4,nM="BP_API_URL",rM="BP_BOT_ID",iM="BP_INTEGRATION_ID",sM="BP_WORKSPACE_ID",oM="BP_TOKEN";function aM(e){let t=lM(e),n={};t.workspaceId&&(n["x-workspace-id"]=t.workspaceId),t.botId&&(n["x-bot-id"]=t.botId),t.integrationId&&(n["x-integration-id"]=t.integrationId),t.token&&(n.Authorization=`Bearer ${t.token}`),n={...n,...t.headers};let r=t.apiUrl??eM,i=t.timeout??tM;return{apiUrl:r,timeout:i,withCredentials:ny,headers:n}}function lM(e){return ny?e:Hu?cM(e):e}function cM(e){let t={...e,apiUrl:e.apiUrl??process.env[nM],botId:e.botId??process.env[rM],integrationId:e.integrationId??process.env[iM],workspaceId:e.workspaceId??process.env[sM]},n=t.token??process.env[oM];return n&&(t.token=n),t}var ie="https://api.botpress.cloud".replace(/\/+$/,""),uM=class{constructor(t,n=ie,r=X){E(this,"configuration");this.basePath=n,this.axios=r,t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}},dM=class extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}},se="https://example.com",de=function(e,t,n){if(n==null)throw new dM(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function qu(e,t,n=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>qu(e,r,n)):Object.keys(t).forEach(r=>qu(e,t[r],`${n}${n!==""?".":""}${r}`)):e.has(n)?e.append(n,t):e.set(n,t))}var oe=function(e,...t){let n=new URLSearchParams(e.search);qu(n,t),e.search=n.toString()},Je=function(e,t,n){let r=typeof e!="string";return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},ae=function(e){return e.pathname+e.search+e.hash},le=function(e,t,n,r){return(i=t,s=n)=>{let o={...e.options,url:((r==null?void 0:r.basePath)||s)+e.url};return i.request(o)}},fM=function(e){return{addParticipant:async(t,n,r={})=>{de("addParticipant","id",t);let i="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},breakDownWorkspaceUsageByBot:async(t,n,r,i={})=>{de("breakDownWorkspaceUsageByBot","id",t),de("breakDownWorkspaceUsageByBot","type",n);let s="/v1/admin/workspaces/{id}/usages/by-bot".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.type=n),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},callAction:async(t,n={})=>{let r="/v1/chat/actions",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},changeAISpendQuota:async(t,n={})=>{let r="/v1/admin/quotas/ai-spend",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"PUT",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},changeWorkspacePlan:async(t,n,r={})=>{de("changeWorkspacePlan","id",t);let i="/v1/admin/workspaces/{id}/change-plan".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},chargeWorkspaceUnpaidInvoices:async(t,n,r={})=>{de("chargeWorkspaceUnpaidInvoices","id",t);let i="/v1/admin/workspaces/{id}/billing/invoices/charge-unpaid".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},checkHandleAvailability:async(t,n={})=>{let r="/v1/admin/workspaces/handle-availability",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"PUT",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},configureIntegration:async(t,n={})=>{let r="/v1/chat/integrations/configure",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createBot:async(t,n={})=>{let r="/v1/admin/bots",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createConversation:async(t,n={})=>{let r="/v1/chat/conversations",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createEvent:async(t,n={})=>{let r="/v1/chat/events",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createFile:async(t,n,r,i,s,o,a,l={})=>{de("createFile","xName",t);let c="/v1/files",u=new URL(c,se),d;e&&(d=e.baseOptions);let h={method:"POST",...d,...l},f={},p={};t!=null&&(f["x-name"]=String(t)),n!=null&&(f["x-tags"]=String(n)),r!=null&&(f["x-access-policies"]=String(r)),i!=null&&(f["x-index"]=String(i)),s!=null&&(f["Content-Type"]=String(s)),o!=null&&(f["Content-Length"]=String(o)),f["Content-Type"]="application/json",oe(u,p);let m=d&&d.headers?d.headers:{};return h.headers={...f,...m,...l.headers},h.data=Je(a,h,e),{url:ae(u),options:h}},createIntegration:async(t,n={})=>{let r="/v1/admin/integrations",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createMessage:async(t,n={})=>{let r="/v1/chat/messages",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createPersonalAccessToken:async(t,n={})=>{let r="/v1/admin/account/pats",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createTable:async(t,n={})=>{let r="/v1/tables",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createTableRows:async(t,n,r={})=>{de("createTableRows","table",t);let i="/v1/tables/{table}/rows".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},createTask:async(t,n={})=>{let r="/v1/chat/tasks",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createUser:async(t,n={})=>{let r="/v1/chat/users",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createWorkspace:async(t,n={})=>{let r="/v1/admin/workspaces",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createWorkspaceMember:async(t,n={})=>{let r="/v1/admin/workspace-members",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},deleteBot:async(t,n={})=>{de("deleteBot","id",t);let r="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteBotIssue:async(t,n,r={})=>{de("deleteBotIssue","id",t),de("deleteBotIssue","issueId",n);let i="/v1/admin/bots/{id}/issues/{issueId}".replace("{id}",encodeURIComponent(String(t))).replace("{issueId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"DELETE",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},deleteConversation:async(t,n={})=>{de("deleteConversation","id",t);let r="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteFile:async(t,n={})=>{de("deleteFile","id",t);let r="/v1/files/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteIntegration:async(t,n={})=>{de("deleteIntegration","id",t);let r="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteMessage:async(t,n={})=>{de("deleteMessage","id",t);let r="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deletePersonalAccessToken:async(t,n={})=>{de("deletePersonalAccessToken","id",t);let r="/v1/admin/account/pats/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteTable:async(t,n={})=>{de("deleteTable","table",t);let r="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteTableRows:async(t,n,r={})=>{de("deleteTableRows","table",t);let i="/v1/tables/{table}/rows/delete".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},deleteTask:async(t,n={})=>{de("deleteTask","id",t);let r="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteUser:async(t,n={})=>{de("deleteUser","id",t);let r="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteWorkspace:async(t,n={})=>{de("deleteWorkspace","id",t);let r="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteWorkspaceMember:async(t,n={})=>{de("deleteWorkspaceMember","id",t);let r="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},findTableRows:async(t,n,r={})=>{de("findTableRows","table",t);let i="/v1/tables/{table}/rows/find".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},getAccount:async(t={})=>{let n="/v1/admin/account/me",r=new URL(n,se),i;e&&(i=e.baseOptions);let s={method:"GET",...i,...t},o={};oe(r,{});let a=i&&i.headers?i.headers:{};return s.headers={...o,...a,...t.headers},{url:ae(r),options:s}},getAccountPreference:async(t,n={})=>{de("getAccountPreference","key",t);let r="/v1/admin/account/preferences/{key}".replace("{key}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getAllWorkspaceQuotaCompletion:async(t={})=>{let n="/v1/admin/workspaces/usages/quota-completion",r=new URL(n,se),i;e&&(i=e.baseOptions);let s={method:"GET",...i,...t},o={};oe(r,{});let a=i&&i.headers?i.headers:{};return s.headers={...o,...a,...t.headers},{url:ae(r),options:s}},getAuditRecords:async(t,n,r={})=>{de("getAuditRecords","id",t);let i="/v1/admin/workspaces/{id}/audit-records".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},getBot:async(t,n={})=>{de("getBot","id",t);let r="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getBotAnalytics:async(t,n,r,i={})=>{de("getBotAnalytics","id",t),de("getBotAnalytics","startDate",n),de("getBotAnalytics","endDate",r);let s="/v1/admin/bots/{id}/analytics".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.startDate=n),r!==void 0&&(u.endDate=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},getBotLogs:async(t,n,r,i,s={})=>{de("getBotLogs","id",t),de("getBotLogs","timeStart",n),de("getBotLogs","timeEnd",r);let o="/v1/admin/bots/{id}/logs".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};n!==void 0&&(d.timeStart=n),r!==void 0&&(d.timeEnd=r),i!==void 0&&(d.nextToken=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},getBotWebchat:async(t,n,r={})=>{de("getBotWebchat","id",t),de("getBotWebchat","type",n);let i="/v1/admin/bots/{id}/webchat".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.type=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},getConversation:async(t,n={})=>{de("getConversation","id",t);let r="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getEvent:async(t,n={})=>{de("getEvent","id",t);let r="/v1/chat/events/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getFileContent:async(t,n={})=>{de("getFileContent","id",t);let r="/v1/files/{id}/content".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getFileMetadata:async(t,n={})=>{de("getFileMetadata","id",t);let r="/v1/files/{id}/metadata".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getIntegration:async(t,n={})=>{de("getIntegration","id",t);let r="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getIntegrationByName:async(t,n,r={})=>{de("getIntegrationByName","name",t),de("getIntegrationByName","version",n);let i="/v1/admin/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(t))).replace("{version}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},getIntegrationLogs:async(t,n,r,i,s={})=>{de("getIntegrationLogs","id",t),de("getIntegrationLogs","timeStart",n),de("getIntegrationLogs","timeEnd",r);let o="/v1/admin/integrations/{id}/logs".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};n!==void 0&&(d.timeStart=n),r!==void 0&&(d.timeEnd=r),i!==void 0&&(d.nextToken=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},getMessage:async(t,n={})=>{de("getMessage","id",t);let r="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getOrCreateConversation:async(t,n={})=>{let r="/v1/chat/conversations/get-or-create",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},getOrCreateMessage:async(t,n={})=>{let r="/v1/chat/messages/get-or-create",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},getOrCreateUser:async(t,n={})=>{let r="/v1/chat/users/get-or-create",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},getOrSetState:async(t,n,r,i,s={})=>{de("getOrSetState","type",t),de("getOrSetState","id",n),de("getOrSetState","name",r);let o="/v1/chat/states/{type}/{id}/{name}/get-or-set".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"POST",...l,...s},u={},d={};u["Content-Type"]="application/json",oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},c.data=Je(i,c,e),{url:ae(a),options:c}},getParticipant:async(t,n,r={})=>{de("getParticipant","id",t),de("getParticipant","userId",n);let i="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(t))).replace("{userId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},getPublicIntegration:async(t,n,r={})=>{de("getPublicIntegration","name",t),de("getPublicIntegration","version",n);let i="/v1/admin/hub/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(t))).replace("{version}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},getPublicIntegrationById:async(t,n={})=>{de("getPublicIntegrationById","id",t);let r="/v1/admin/hub/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getPublicWorkspace:async(t,n={})=>{de("getPublicWorkspace","id",t);let r="/v1/admin/workspaces/{id}/public".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getState:async(t,n,r,i={})=>{de("getState","type",t),de("getState","id",n),de("getState","name",r);let s="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={};oe(o,{});let u=a&&a.headers?a.headers:{};return l.headers={...c,...u,...i.headers},{url:ae(o),options:l}},getTable:async(t,n={})=>{de("getTable","table",t);let r="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getTableRow:async(t,n,r={})=>{de("getTableRow","table",t),de("getTableRow","id",n);let i="/v1/tables/{table}/row".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.id=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},getTask:async(t,n={})=>{de("getTask","id",t);let r="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getUpcomingInvoice:async(t,n={})=>{de("getUpcomingInvoice","id",t);let r="/v1/admin/workspaces/{id}/billing/upcoming-invoice".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getUsage:async(t,n,r,i={})=>{de("getUsage","type",t),de("getUsage","id",n);let s="/v1/admin/usages/{id}".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.type=t),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},getUser:async(t,n={})=>{de("getUser","id",t);let r="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getWorkspace:async(t,n={})=>{de("getWorkspace","id",t);let r="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getWorkspaceBillingDetails:async(t,n={})=>{de("getWorkspaceBillingDetails","id",t);let r="/v1/admin/workspaces/{id}/billing/details".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getWorkspaceQuota:async(t,n,r,i={})=>{de("getWorkspaceQuota","id",t),de("getWorkspaceQuota","type",n);let s="/v1/admin/workspaces/{id}/quota".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.type=n),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},introspect:async(t,n={})=>{let r="/v1/admin/introspect",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},listActivities:async(t,n,r,i={})=>{de("listActivities","taskId",t),de("listActivities","botId",n);let s="/v1/admin/activities",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};r!==void 0&&(u.nextToken=r),t!==void 0&&(u.taskId=t),n!==void 0&&(u.botId=n),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listBotIssueEvents:async(t,n,r={})=>{de("listBotIssueEvents","id",t),de("listBotIssueEvents","issueId",n);let i="/v1/admin/bots/{id}/issues/{issueId}/events".replace("{id}",encodeURIComponent(String(t))).replace("{issueId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},listBotIssues:async(t,n,r={})=>{de("listBotIssues","id",t);let i="/v1/admin/bots/{id}/issues".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listBots:async(t,n,r={})=>{let i="/v1/admin/bots",s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};t!==void 0&&(c.dev=t),n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listConversations:async(t,n,r,i={})=>{let s="/v1/chat/conversations",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.tags=n),r&&(u.participantIds=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listEvents:async(t,n,r,i,s,o={})=>{let a="/v1/chat/events",l=new URL(a,se),c;e&&(c=e.baseOptions);let u={method:"GET",...c,...o},d={},h={};t!==void 0&&(h.nextToken=t),n!==void 0&&(h.type=n),r!==void 0&&(h.conversationId=r),i!==void 0&&(h.userId=i),s!==void 0&&(h.messageId=s),oe(l,h);let f=c&&c.headers?c.headers:{};return u.headers={...d,...f,...o.headers},{url:ae(l),options:u}},listFiles:async(t,n,r,i={})=>{de("listFiles","botId",t);let s="/v1/files/bot/{botId}".replace("{botId}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.nextToken=n),r!==void 0&&(u.tags=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listIntegrations:async(t,n,r,i,s={})=>{let o="/v1/admin/integrations",a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};t!==void 0&&(d.nextToken=t),n!==void 0&&(d.name=n),r!==void 0&&(d.version=r),i!==void 0&&(d.dev=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},listMessages:async(t,n,r,i={})=>{let s="/v1/chat/messages",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.conversationId=n),r!==void 0&&(u.tags=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listParticipants:async(t,n,r={})=>{de("listParticipants","id",t);let i="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listPersonalAccessTokens:async(t={})=>{let n="/v1/admin/account/pats",r=new URL(n,se),i;e&&(i=e.baseOptions);let s={method:"GET",...i,...t},o={};oe(r,{});let a=i&&i.headers?i.headers:{};return s.headers={...o,...a,...t.headers},{url:ae(r),options:s}},listPublicIntegrations:async(t,n,r,i={})=>{let s="/v1/admin/hub/integrations",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.name=n),r!==void 0&&(u.version=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listTables:async(t,n={})=>{let r="/v1/tables",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={},l={};t!==void 0&&(l.tags=t),oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:ae(i),options:o}},listTasks:async(t,n,r,i,s,o,a,l={})=>{let c="/v1/chat/tasks",u=new URL(c,se),d;e&&(d=e.baseOptions);let h={method:"GET",...d,...l},f={},p={};t!==void 0&&(p.nextToken=t),n!==void 0&&(p.tags=n),r!==void 0&&(p.conversationId=r),i!==void 0&&(p.userId=i),s!==void 0&&(p.parentTaskId=s),o&&(p.status=o),a!==void 0&&(p.type=a),oe(u,p);let m=d&&d.headers?d.headers:{};return h.headers={...f,...m,...l.headers},{url:ae(u),options:h}},listUsageHistory:async(t,n,r={})=>{de("listUsageHistory","type",t),de("listUsageHistory","id",n);let i="/v1/admin/usages/{id}/history".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};t!==void 0&&(c.type=t),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listUsers:async(t,n,r,i={})=>{let s="/v1/chat/users",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.conversationId=n),r!==void 0&&(u.tags=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listWorkspaceInvoices:async(t,n={})=>{de("listWorkspaceInvoices","id",t);let r="/v1/admin/workspaces/{id}/billing/invoices".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},listWorkspaceMembers:async(t,n={})=>{let r="/v1/admin/workspace-members",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={},l={};t!==void 0&&(l.nextToken=t),oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:ae(i),options:o}},listWorkspaceQuotas:async(t,n,r={})=>{de("listWorkspaceQuotas","id",t);let i="/v1/admin/workspaces/{id}/quotas".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.period=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listWorkspaceUsages:async(t,n,r,i={})=>{de("listWorkspaceUsages","id",t),de("listWorkspaceUsages","type",n);let s="/v1/admin/workspaces/{id}/usages".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.type=n),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listWorkspaces:async(t,n={})=>{let r="/v1/admin/workspaces",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={},l={};t!==void 0&&(l.nextToken=t),oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:ae(i),options:o}},patchState:async(t,n,r,i,s={})=>{de("patchState","type",t),de("patchState","id",n),de("patchState","name",r);let o="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"PATCH",...l,...s},u={},d={};u["Content-Type"]="application/json",oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},c.data=Je(i,c,e),{url:ae(a),options:c}},removeParticipant:async(t,n,r={})=>{de("removeParticipant","id",t),de("removeParticipant","userId",n);let i="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(t))).replace("{userId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"DELETE",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},renameTableColumn:async(t,n,r={})=>{de("renameTableColumn","table",t);let i="/v1/tables/{table}/column".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},runVrl:async(t,n={})=>{let r="/v1/admin/helper/vrl",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},searchFiles:async(t,n,r,i,s={})=>{de("searchFiles","botId",t),de("searchFiles","query",n);let o="/v1/files/bot/{botId}/search".replace("{botId}",encodeURIComponent(String(t))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};r!==void 0&&(d.tags=r),n!==void 0&&(d.query=n),i!==void 0&&(d.limit=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},setAccountPreference:async(t,n,r={})=>{de("setAccountPreference","key",t);let i="/v1/admin/account/preferences/{key}".replace("{key}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},setState:async(t,n,r,i,s={})=>{de("setState","type",t),de("setState","id",n),de("setState","name",r);let o="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"POST",...l,...s},u={},d={};u["Content-Type"]="application/json",oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},c.data=Je(i,c,e),{url:ae(a),options:c}},setWorkspacePaymentMethod:async(t,n,r={})=>{de("setWorkspacePaymentMethod","id",t);let i="/v1/admin/workspaces/{id}/billing/payment-method".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},transferBot:async(t,n,r={})=>{de("transferBot","id",t);let i="/v1/admin/bots/{id}/transfer".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateAccount:async(t,n={})=>{let r="/v1/admin/account/me",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"PUT",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},updateBot:async(t,n,r={})=>{de("updateBot","id",t);let i="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateConversation:async(t,n,r={})=>{de("updateConversation","id",t);let i="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateFileMetadata:async(t,n,r={})=>{de("updateFileMetadata","id",t);let i="/v1/files/{id}/metadata".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateIntegration:async(t,n,r={})=>{de("updateIntegration","id",t);let i="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateMessage:async(t,n,r={})=>{de("updateMessage","id",t);let i="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateTable:async(t,n,r={})=>{de("updateTable","table",t);let i="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateTableRows:async(t,n,r={})=>{de("updateTableRows","table",t);let i="/v1/tables/{table}/rows".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateTask:async(t,n,r={})=>{de("updateTask","id",t);let i="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateUser:async(t,n,r={})=>{de("updateUser","id",t);let i="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateWorkspace:async(t,n,r={})=>{de("updateWorkspace","id",t);let i="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateWorkspaceMember:async(t,n,r={})=>{de("updateWorkspaceMember","id",t);let i="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},upsertTableRows:async(t,n,r={})=>{de("upsertTableRows","table",t);let i="/v1/tables/{table}/rows/upsert".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}}}},ce=function(e){let t=fM(e);return{async addParticipant(n,r,i){let s=await t.addParticipant(n,r,i);return le(s,X,ie,e)},async breakDownWorkspaceUsageByBot(n,r,i,s){let o=await t.breakDownWorkspaceUsageByBot(n,r,i,s);return le(o,X,ie,e)},async callAction(n,r){let i=await t.callAction(n,r);return le(i,X,ie,e)},async changeAISpendQuota(n,r){let i=await t.changeAISpendQuota(n,r);return le(i,X,ie,e)},async changeWorkspacePlan(n,r,i){let s=await t.changeWorkspacePlan(n,r,i);return le(s,X,ie,e)},async chargeWorkspaceUnpaidInvoices(n,r,i){let s=await t.chargeWorkspaceUnpaidInvoices(n,r,i);return le(s,X,ie,e)},async checkHandleAvailability(n,r){let i=await t.checkHandleAvailability(n,r);return le(i,X,ie,e)},async configureIntegration(n,r){let i=await t.configureIntegration(n,r);return le(i,X,ie,e)},async createBot(n,r){let i=await t.createBot(n,r);return le(i,X,ie,e)},async createConversation(n,r){let i=await t.createConversation(n,r);return le(i,X,ie,e)},async createEvent(n,r){let i=await t.createEvent(n,r);return le(i,X,ie,e)},async createFile(n,r,i,s,o,a,l,c){let u=await t.createFile(n,r,i,s,o,a,l,c);return le(u,X,ie,e)},async createIntegration(n,r){let i=await t.createIntegration(n,r);return le(i,X,ie,e)},async createMessage(n,r){let i=await t.createMessage(n,r);return le(i,X,ie,e)},async createPersonalAccessToken(n,r){let i=await t.createPersonalAccessToken(n,r);return le(i,X,ie,e)},async createTable(n,r){let i=await t.createTable(n,r);return le(i,X,ie,e)},async createTableRows(n,r,i){let s=await t.createTableRows(n,r,i);return le(s,X,ie,e)},async createTask(n,r){let i=await t.createTask(n,r);return le(i,X,ie,e)},async createUser(n,r){let i=await t.createUser(n,r);return le(i,X,ie,e)},async createWorkspace(n,r){let i=await t.createWorkspace(n,r);return le(i,X,ie,e)},async createWorkspaceMember(n,r){let i=await t.createWorkspaceMember(n,r);return le(i,X,ie,e)},async deleteBot(n,r){let i=await t.deleteBot(n,r);return le(i,X,ie,e)},async deleteBotIssue(n,r,i){let s=await t.deleteBotIssue(n,r,i);return le(s,X,ie,e)},async deleteConversation(n,r){let i=await t.deleteConversation(n,r);return le(i,X,ie,e)},async deleteFile(n,r){let i=await t.deleteFile(n,r);return le(i,X,ie,e)},async deleteIntegration(n,r){let i=await t.deleteIntegration(n,r);return le(i,X,ie,e)},async deleteMessage(n,r){let i=await t.deleteMessage(n,r);return le(i,X,ie,e)},async deletePersonalAccessToken(n,r){let i=await t.deletePersonalAccessToken(n,r);return le(i,X,ie,e)},async deleteTable(n,r){let i=await t.deleteTable(n,r);return le(i,X,ie,e)},async deleteTableRows(n,r,i){let s=await t.deleteTableRows(n,r,i);return le(s,X,ie,e)},async deleteTask(n,r){let i=await t.deleteTask(n,r);return le(i,X,ie,e)},async deleteUser(n,r){let i=await t.deleteUser(n,r);return le(i,X,ie,e)},async deleteWorkspace(n,r){let i=await t.deleteWorkspace(n,r);return le(i,X,ie,e)},async deleteWorkspaceMember(n,r){let i=await t.deleteWorkspaceMember(n,r);return le(i,X,ie,e)},async findTableRows(n,r,i){let s=await t.findTableRows(n,r,i);return le(s,X,ie,e)},async getAccount(n){let r=await t.getAccount(n);return le(r,X,ie,e)},async getAccountPreference(n,r){let i=await t.getAccountPreference(n,r);return le(i,X,ie,e)},async getAllWorkspaceQuotaCompletion(n){let r=await t.getAllWorkspaceQuotaCompletion(n);return le(r,X,ie,e)},async getAuditRecords(n,r,i){let s=await t.getAuditRecords(n,r,i);return le(s,X,ie,e)},async getBot(n,r){let i=await t.getBot(n,r);return le(i,X,ie,e)},async getBotAnalytics(n,r,i,s){let o=await t.getBotAnalytics(n,r,i,s);return le(o,X,ie,e)},async getBotLogs(n,r,i,s,o){let a=await t.getBotLogs(n,r,i,s,o);return le(a,X,ie,e)},async getBotWebchat(n,r,i){let s=await t.getBotWebchat(n,r,i);return le(s,X,ie,e)},async getConversation(n,r){let i=await t.getConversation(n,r);return le(i,X,ie,e)},async getEvent(n,r){let i=await t.getEvent(n,r);return le(i,X,ie,e)},async getFileContent(n,r){let i=await t.getFileContent(n,r);return le(i,X,ie,e)},async getFileMetadata(n,r){let i=await t.getFileMetadata(n,r);return le(i,X,ie,e)},async getIntegration(n,r){let i=await t.getIntegration(n,r);return le(i,X,ie,e)},async getIntegrationByName(n,r,i){let s=await t.getIntegrationByName(n,r,i);return le(s,X,ie,e)},async getIntegrationLogs(n,r,i,s,o){let a=await t.getIntegrationLogs(n,r,i,s,o);return le(a,X,ie,e)},async getMessage(n,r){let i=await t.getMessage(n,r);return le(i,X,ie,e)},async getOrCreateConversation(n,r){let i=await t.getOrCreateConversation(n,r);return le(i,X,ie,e)},async getOrCreateMessage(n,r){let i=await t.getOrCreateMessage(n,r);return le(i,X,ie,e)},async getOrCreateUser(n,r){let i=await t.getOrCreateUser(n,r);return le(i,X,ie,e)},async getOrSetState(n,r,i,s,o){let a=await t.getOrSetState(n,r,i,s,o);return le(a,X,ie,e)},async getParticipant(n,r,i){let s=await t.getParticipant(n,r,i);return le(s,X,ie,e)},async getPublicIntegration(n,r,i){let s=await t.getPublicIntegration(n,r,i);return le(s,X,ie,e)},async getPublicIntegrationById(n,r){let i=await t.getPublicIntegrationById(n,r);return le(i,X,ie,e)},async getPublicWorkspace(n,r){let i=await t.getPublicWorkspace(n,r);return le(i,X,ie,e)},async getState(n,r,i,s){let o=await t.getState(n,r,i,s);return le(o,X,ie,e)},async getTable(n,r){let i=await t.getTable(n,r);return le(i,X,ie,e)},async getTableRow(n,r,i){let s=await t.getTableRow(n,r,i);return le(s,X,ie,e)},async getTask(n,r){let i=await t.getTask(n,r);return le(i,X,ie,e)},async getUpcomingInvoice(n,r){let i=await t.getUpcomingInvoice(n,r);return le(i,X,ie,e)},async getUsage(n,r,i,s){let o=await t.getUsage(n,r,i,s);return le(o,X,ie,e)},async getUser(n,r){let i=await t.getUser(n,r);return le(i,X,ie,e)},async getWorkspace(n,r){let i=await t.getWorkspace(n,r);return le(i,X,ie,e)},async getWorkspaceBillingDetails(n,r){let i=await t.getWorkspaceBillingDetails(n,r);return le(i,X,ie,e)},async getWorkspaceQuota(n,r,i,s){let o=await t.getWorkspaceQuota(n,r,i,s);return le(o,X,ie,e)},async introspect(n,r){let i=await t.introspect(n,r);return le(i,X,ie,e)},async listActivities(n,r,i,s){let o=await t.listActivities(n,r,i,s);return le(o,X,ie,e)},async listBotIssueEvents(n,r,i){let s=await t.listBotIssueEvents(n,r,i);return le(s,X,ie,e)},async listBotIssues(n,r,i){let s=await t.listBotIssues(n,r,i);return le(s,X,ie,e)},async listBots(n,r,i){let s=await t.listBots(n,r,i);return le(s,X,ie,e)},async listConversations(n,r,i,s){let o=await t.listConversations(n,r,i,s);return le(o,X,ie,e)},async listEvents(n,r,i,s,o,a){let l=await t.listEvents(n,r,i,s,o,a);return le(l,X,ie,e)},async listFiles(n,r,i,s){let o=await t.listFiles(n,r,i,s);return le(o,X,ie,e)},async listIntegrations(n,r,i,s,o){let a=await t.listIntegrations(n,r,i,s,o);return le(a,X,ie,e)},async listMessages(n,r,i,s){let o=await t.listMessages(n,r,i,s);return le(o,X,ie,e)},async listParticipants(n,r,i){let s=await t.listParticipants(n,r,i);return le(s,X,ie,e)},async listPersonalAccessTokens(n){let r=await t.listPersonalAccessTokens(n);return le(r,X,ie,e)},async listPublicIntegrations(n,r,i,s){let o=await t.listPublicIntegrations(n,r,i,s);return le(o,X,ie,e)},async listTables(n,r){let i=await t.listTables(n,r);return le(i,X,ie,e)},async listTasks(n,r,i,s,o,a,l,c){let u=await t.listTasks(n,r,i,s,o,a,l,c);return le(u,X,ie,e)},async listUsageHistory(n,r,i){let s=await t.listUsageHistory(n,r,i);return le(s,X,ie,e)},async listUsers(n,r,i,s){let o=await t.listUsers(n,r,i,s);return le(o,X,ie,e)},async listWorkspaceInvoices(n,r){let i=await t.listWorkspaceInvoices(n,r);return le(i,X,ie,e)},async listWorkspaceMembers(n,r){let i=await t.listWorkspaceMembers(n,r);return le(i,X,ie,e)},async listWorkspaceQuotas(n,r,i){let s=await t.listWorkspaceQuotas(n,r,i);return le(s,X,ie,e)},async listWorkspaceUsages(n,r,i,s){let o=await t.listWorkspaceUsages(n,r,i,s);return le(o,X,ie,e)},async listWorkspaces(n,r){let i=await t.listWorkspaces(n,r);return le(i,X,ie,e)},async patchState(n,r,i,s,o){let a=await t.patchState(n,r,i,s,o);return le(a,X,ie,e)},async removeParticipant(n,r,i){let s=await t.removeParticipant(n,r,i);return le(s,X,ie,e)},async renameTableColumn(n,r,i){let s=await t.renameTableColumn(n,r,i);return le(s,X,ie,e)},async runVrl(n,r){let i=await t.runVrl(n,r);return le(i,X,ie,e)},async searchFiles(n,r,i,s,o){let a=await t.searchFiles(n,r,i,s,o);return le(a,X,ie,e)},async setAccountPreference(n,r,i){let s=await t.setAccountPreference(n,r,i);return le(s,X,ie,e)},async setState(n,r,i,s,o){let a=await t.setState(n,r,i,s,o);return le(a,X,ie,e)},async setWorkspacePaymentMethod(n,r,i){let s=await t.setWorkspacePaymentMethod(n,r,i);return le(s,X,ie,e)},async transferBot(n,r,i){let s=await t.transferBot(n,r,i);return le(s,X,ie,e)},async updateAccount(n,r){let i=await t.updateAccount(n,r);return le(i,X,ie,e)},async updateBot(n,r,i){let s=await t.updateBot(n,r,i);return le(s,X,ie,e)},async updateConversation(n,r,i){let s=await t.updateConversation(n,r,i);return le(s,X,ie,e)},async updateFileMetadata(n,r,i){let s=await t.updateFileMetadata(n,r,i);return le(s,X,ie,e)},async updateIntegration(n,r,i){let s=await t.updateIntegration(n,r,i);return le(s,X,ie,e)},async updateMessage(n,r,i){let s=await t.updateMessage(n,r,i);return le(s,X,ie,e)},async updateTable(n,r,i){let s=await t.updateTable(n,r,i);return le(s,X,ie,e)},async updateTableRows(n,r,i){let s=await t.updateTableRows(n,r,i);return le(s,X,ie,e)},async updateTask(n,r,i){let s=await t.updateTask(n,r,i);return le(s,X,ie,e)},async updateUser(n,r,i){let s=await t.updateUser(n,r,i);return le(s,X,ie,e)},async updateWorkspace(n,r,i){let s=await t.updateWorkspace(n,r,i);return le(s,X,ie,e)},async updateWorkspaceMember(n,r,i){let s=await t.updateWorkspaceMember(n,r,i);return le(s,X,ie,e)},async upsertTableRows(n,r,i){let s=await t.upsertTableRows(n,r,i);return le(s,X,ie,e)}}},hM=class extends uM{addParticipant(t,n){return ce(this.configuration).addParticipant(t.id,t.addParticipantBody,n).then(r=>r(this.axios,this.basePath))}breakDownWorkspaceUsageByBot(t,n){return ce(this.configuration).breakDownWorkspaceUsageByBot(t.id,t.type,t.period,n).then(r=>r(this.axios,this.basePath))}callAction(t={},n){return ce(this.configuration).callAction(t.callActionBody,n).then(r=>r(this.axios,this.basePath))}changeAISpendQuota(t={},n){return ce(this.configuration).changeAISpendQuota(t.changeAISpendQuotaBody,n).then(r=>r(this.axios,this.basePath))}changeWorkspacePlan(t,n){return ce(this.configuration).changeWorkspacePlan(t.id,t.changeWorkspacePlanBody,n).then(r=>r(this.axios,this.basePath))}chargeWorkspaceUnpaidInvoices(t,n){return ce(this.configuration).chargeWorkspaceUnpaidInvoices(t.id,t.chargeWorkspaceUnpaidInvoicesBody,n).then(r=>r(this.axios,this.basePath))}checkHandleAvailability(t={},n){return ce(this.configuration).checkHandleAvailability(t.checkHandleAvailabilityBody,n).then(r=>r(this.axios,this.basePath))}configureIntegration(t={},n){return ce(this.configuration).configureIntegration(t.configureIntegrationBody,n).then(r=>r(this.axios,this.basePath))}createBot(t={},n){return ce(this.configuration).createBot(t.createBotBody,n).then(r=>r(this.axios,this.basePath))}createConversation(t={},n){return ce(this.configuration).createConversation(t.createConversationBody,n).then(r=>r(this.axios,this.basePath))}createEvent(t={},n){return ce(this.configuration).createEvent(t.createEventBody,n).then(r=>r(this.axios,this.basePath))}createFile(t,n){return ce(this.configuration).createFile(t.xName,t.xTags,t.xAccessPolicies,t.xIndex,t.contentType,t.contentLength,t.createFileBody,n).then(r=>r(this.axios,this.basePath))}createIntegration(t={},n){return ce(this.configuration).createIntegration(t.createIntegrationBody,n).then(r=>r(this.axios,this.basePath))}createMessage(t={},n){return ce(this.configuration).createMessage(t.createMessageBody,n).then(r=>r(this.axios,this.basePath))}createPersonalAccessToken(t={},n){return ce(this.configuration).createPersonalAccessToken(t.createPersonalAccessTokenBody,n).then(r=>r(this.axios,this.basePath))}createTable(t={},n){return ce(this.configuration).createTable(t.createTableBody,n).then(r=>r(this.axios,this.basePath))}createTableRows(t,n){return ce(this.configuration).createTableRows(t.table,t.createTableRowsBody,n).then(r=>r(this.axios,this.basePath))}createTask(t={},n){return ce(this.configuration).createTask(t.createTaskBody,n).then(r=>r(this.axios,this.basePath))}createUser(t={},n){return ce(this.configuration).createUser(t.createUserBody,n).then(r=>r(this.axios,this.basePath))}createWorkspace(t={},n){return ce(this.configuration).createWorkspace(t.createWorkspaceBody,n).then(r=>r(this.axios,this.basePath))}createWorkspaceMember(t={},n){return ce(this.configuration).createWorkspaceMember(t.createWorkspaceMemberBody,n).then(r=>r(this.axios,this.basePath))}deleteBot(t,n){return ce(this.configuration).deleteBot(t.id,n).then(r=>r(this.axios,this.basePath))}deleteBotIssue(t,n){return ce(this.configuration).deleteBotIssue(t.id,t.issueId,n).then(r=>r(this.axios,this.basePath))}deleteConversation(t,n){return ce(this.configuration).deleteConversation(t.id,n).then(r=>r(this.axios,this.basePath))}deleteFile(t,n){return ce(this.configuration).deleteFile(t.id,n).then(r=>r(this.axios,this.basePath))}deleteIntegration(t,n){return ce(this.configuration).deleteIntegration(t.id,n).then(r=>r(this.axios,this.basePath))}deleteMessage(t,n){return ce(this.configuration).deleteMessage(t.id,n).then(r=>r(this.axios,this.basePath))}deletePersonalAccessToken(t,n){return ce(this.configuration).deletePersonalAccessToken(t.id,n).then(r=>r(this.axios,this.basePath))}deleteTable(t,n){return ce(this.configuration).deleteTable(t.table,n).then(r=>r(this.axios,this.basePath))}deleteTableRows(t,n){return ce(this.configuration).deleteTableRows(t.table,t.deleteTableRowsBody,n).then(r=>r(this.axios,this.basePath))}deleteTask(t,n){return ce(this.configuration).deleteTask(t.id,n).then(r=>r(this.axios,this.basePath))}deleteUser(t,n){return ce(this.configuration).deleteUser(t.id,n).then(r=>r(this.axios,this.basePath))}deleteWorkspace(t,n){return ce(this.configuration).deleteWorkspace(t.id,n).then(r=>r(this.axios,this.basePath))}deleteWorkspaceMember(t,n){return ce(this.configuration).deleteWorkspaceMember(t.id,n).then(r=>r(this.axios,this.basePath))}findTableRows(t,n){return ce(this.configuration).findTableRows(t.table,t.findTableRowsBody,n).then(r=>r(this.axios,this.basePath))}getAccount(t){return ce(this.configuration).getAccount(t).then(n=>n(this.axios,this.basePath))}getAccountPreference(t,n){return ce(this.configuration).getAccountPreference(t.key,n).then(r=>r(this.axios,this.basePath))}getAllWorkspaceQuotaCompletion(t){return ce(this.configuration).getAllWorkspaceQuotaCompletion(t).then(n=>n(this.axios,this.basePath))}getAuditRecords(t,n){return ce(this.configuration).getAuditRecords(t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}getBot(t,n){return ce(this.configuration).getBot(t.id,n).then(r=>r(this.axios,this.basePath))}getBotAnalytics(t,n){return ce(this.configuration).getBotAnalytics(t.id,t.startDate,t.endDate,n).then(r=>r(this.axios,this.basePath))}getBotLogs(t,n){return ce(this.configuration).getBotLogs(t.id,t.timeStart,t.timeEnd,t.nextToken,n).then(r=>r(this.axios,this.basePath))}getBotWebchat(t,n){return ce(this.configuration).getBotWebchat(t.id,t.type,n).then(r=>r(this.axios,this.basePath))}getConversation(t,n){return ce(this.configuration).getConversation(t.id,n).then(r=>r(this.axios,this.basePath))}getEvent(t,n){return ce(this.configuration).getEvent(t.id,n).then(r=>r(this.axios,this.basePath))}getFileContent(t,n){return ce(this.configuration).getFileContent(t.id,n).then(r=>r(this.axios,this.basePath))}getFileMetadata(t,n){return ce(this.configuration).getFileMetadata(t.id,n).then(r=>r(this.axios,this.basePath))}getIntegration(t,n){return ce(this.configuration).getIntegration(t.id,n).then(r=>r(this.axios,this.basePath))}getIntegrationByName(t,n){return ce(this.configuration).getIntegrationByName(t.name,t.version,n).then(r=>r(this.axios,this.basePath))}getIntegrationLogs(t,n){return ce(this.configuration).getIntegrationLogs(t.id,t.timeStart,t.timeEnd,t.nextToken,n).then(r=>r(this.axios,this.basePath))}getMessage(t,n){return ce(this.configuration).getMessage(t.id,n).then(r=>r(this.axios,this.basePath))}getOrCreateConversation(t={},n){return ce(this.configuration).getOrCreateConversation(t.getOrCreateConversationBody,n).then(r=>r(this.axios,this.basePath))}getOrCreateMessage(t={},n){return ce(this.configuration).getOrCreateMessage(t.getOrCreateMessageBody,n).then(r=>r(this.axios,this.basePath))}getOrCreateUser(t={},n){return ce(this.configuration).getOrCreateUser(t.getOrCreateUserBody,n).then(r=>r(this.axios,this.basePath))}getOrSetState(t,n){return ce(this.configuration).getOrSetState(t.type,t.id,t.name,t.getOrSetStateBody,n).then(r=>r(this.axios,this.basePath))}getParticipant(t,n){return ce(this.configuration).getParticipant(t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}getPublicIntegration(t,n){return ce(this.configuration).getPublicIntegration(t.name,t.version,n).then(r=>r(this.axios,this.basePath))}getPublicIntegrationById(t,n){return ce(this.configuration).getPublicIntegrationById(t.id,n).then(r=>r(this.axios,this.basePath))}getPublicWorkspace(t,n){return ce(this.configuration).getPublicWorkspace(t.id,n).then(r=>r(this.axios,this.basePath))}getState(t,n){return ce(this.configuration).getState(t.type,t.id,t.name,n).then(r=>r(this.axios,this.basePath))}getTable(t,n){return ce(this.configuration).getTable(t.table,n).then(r=>r(this.axios,this.basePath))}getTableRow(t,n){return ce(this.configuration).getTableRow(t.table,t.id,n).then(r=>r(this.axios,this.basePath))}getTask(t,n){return ce(this.configuration).getTask(t.id,n).then(r=>r(this.axios,this.basePath))}getUpcomingInvoice(t,n){return ce(this.configuration).getUpcomingInvoice(t.id,n).then(r=>r(this.axios,this.basePath))}getUsage(t,n){return ce(this.configuration).getUsage(t.type,t.id,t.period,n).then(r=>r(this.axios,this.basePath))}getUser(t,n){return ce(this.configuration).getUser(t.id,n).then(r=>r(this.axios,this.basePath))}getWorkspace(t,n){return ce(this.configuration).getWorkspace(t.id,n).then(r=>r(this.axios,this.basePath))}getWorkspaceBillingDetails(t,n){return ce(this.configuration).getWorkspaceBillingDetails(t.id,n).then(r=>r(this.axios,this.basePath))}getWorkspaceQuota(t,n){return ce(this.configuration).getWorkspaceQuota(t.id,t.type,t.period,n).then(r=>r(this.axios,this.basePath))}introspect(t={},n){return ce(this.configuration).introspect(t.introspectBody,n).then(r=>r(this.axios,this.basePath))}listActivities(t,n){return ce(this.configuration).listActivities(t.taskId,t.botId,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listBotIssueEvents(t,n){return ce(this.configuration).listBotIssueEvents(t.id,t.issueId,n).then(r=>r(this.axios,this.basePath))}listBotIssues(t,n){return ce(this.configuration).listBotIssues(t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listBots(t={},n){return ce(this.configuration).listBots(t.dev,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listConversations(t={},n){return ce(this.configuration).listConversations(t.nextToken,t.tags,t.participantIds,n).then(r=>r(this.axios,this.basePath))}listEvents(t={},n){return ce(this.configuration).listEvents(t.nextToken,t.type,t.conversationId,t.userId,t.messageId,n).then(r=>r(this.axios,this.basePath))}listFiles(t,n){return ce(this.configuration).listFiles(t.botId,t.nextToken,t.tags,n).then(r=>r(this.axios,this.basePath))}listIntegrations(t={},n){return ce(this.configuration).listIntegrations(t.nextToken,t.name,t.version,t.dev,n).then(r=>r(this.axios,this.basePath))}listMessages(t={},n){return ce(this.configuration).listMessages(t.nextToken,t.conversationId,t.tags,n).then(r=>r(this.axios,this.basePath))}listParticipants(t,n){return ce(this.configuration).listParticipants(t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listPersonalAccessTokens(t){return ce(this.configuration).listPersonalAccessTokens(t).then(n=>n(this.axios,this.basePath))}listPublicIntegrations(t={},n){return ce(this.configuration).listPublicIntegrations(t.nextToken,t.name,t.version,n).then(r=>r(this.axios,this.basePath))}listTables(t={},n){return ce(this.configuration).listTables(t.tags,n).then(r=>r(this.axios,this.basePath))}listTasks(t={},n){return ce(this.configuration).listTasks(t.nextToken,t.tags,t.conversationId,t.userId,t.parentTaskId,t.status,t.type,n).then(r=>r(this.axios,this.basePath))}listUsageHistory(t,n){return ce(this.configuration).listUsageHistory(t.type,t.id,n).then(r=>r(this.axios,this.basePath))}listUsers(t={},n){return ce(this.configuration).listUsers(t.nextToken,t.conversationId,t.tags,n).then(r=>r(this.axios,this.basePath))}listWorkspaceInvoices(t,n){return ce(this.configuration).listWorkspaceInvoices(t.id,n).then(r=>r(this.axios,this.basePath))}listWorkspaceMembers(t={},n){return ce(this.configuration).listWorkspaceMembers(t.nextToken,n).then(r=>r(this.axios,this.basePath))}listWorkspaceQuotas(t,n){return ce(this.configuration).listWorkspaceQuotas(t.id,t.period,n).then(r=>r(this.axios,this.basePath))}listWorkspaceUsages(t,n){return ce(this.configuration).listWorkspaceUsages(t.id,t.type,t.period,n).then(r=>r(this.axios,this.basePath))}listWorkspaces(t={},n){return ce(this.configuration).listWorkspaces(t.nextToken,n).then(r=>r(this.axios,this.basePath))}patchState(t,n){return ce(this.configuration).patchState(t.type,t.id,t.name,t.patchStateBody,n).then(r=>r(this.axios,this.basePath))}removeParticipant(t,n){return ce(this.configuration).removeParticipant(t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}renameTableColumn(t,n){return ce(this.configuration).renameTableColumn(t.table,t.renameTableColumnBody,n).then(r=>r(this.axios,this.basePath))}runVrl(t={},n){return ce(this.configuration).runVrl(t.runVrlBody,n).then(r=>r(this.axios,this.basePath))}searchFiles(t,n){return ce(this.configuration).searchFiles(t.botId,t.query,t.tags,t.limit,n).then(r=>r(this.axios,this.basePath))}setAccountPreference(t,n){return ce(this.configuration).setAccountPreference(t.key,t.setAccountPreferenceBody,n).then(r=>r(this.axios,this.basePath))}setState(t,n){return ce(this.configuration).setState(t.type,t.id,t.name,t.setStateBody,n).then(r=>r(this.axios,this.basePath))}setWorkspacePaymentMethod(t,n){return ce(this.configuration).setWorkspacePaymentMethod(t.id,t.setWorkspacePaymentMethodBody,n).then(r=>r(this.axios,this.basePath))}transferBot(t,n){return ce(this.configuration).transferBot(t.id,t.transferBotBody,n).then(r=>r(this.axios,this.basePath))}updateAccount(t={},n){return ce(this.configuration).updateAccount(t.updateAccountBody,n).then(r=>r(this.axios,this.basePath))}updateBot(t,n){return ce(this.configuration).updateBot(t.id,t.updateBotBody,n).then(r=>r(this.axios,this.basePath))}updateConversation(t,n){return ce(this.configuration).updateConversation(t.id,t.updateConversationBody,n).then(r=>r(this.axios,this.basePath))}updateFileMetadata(t,n){return ce(this.configuration).updateFileMetadata(t.id,t.updateFileMetadataBody,n).then(r=>r(this.axios,this.basePath))}updateIntegration(t,n){return ce(this.configuration).updateIntegration(t.id,t.updateIntegrationBody,n).then(r=>r(this.axios,this.basePath))}updateMessage(t,n){return ce(this.configuration).updateMessage(t.id,t.updateMessageBody,n).then(r=>r(this.axios,this.basePath))}updateTable(t,n){return ce(this.configuration).updateTable(t.table,t.updateTableBody,n).then(r=>r(this.axios,this.basePath))}updateTableRows(t,n){return ce(this.configuration).updateTableRows(t.table,t.updateTableRowsBody,n).then(r=>r(this.axios,this.basePath))}updateTask(t,n){return ce(this.configuration).updateTask(t.id,t.updateTaskBody,n).then(r=>r(this.axios,this.basePath))}updateUser(t,n){return ce(this.configuration).updateUser(t.id,t.updateUserBody,n).then(r=>r(this.axios,this.basePath))}updateWorkspace(t,n){return ce(this.configuration).updateWorkspace(t.id,t.updateWorkspaceBody,n).then(r=>r(this.axios,this.basePath))}updateWorkspaceMember(t,n){return ce(this.configuration).updateWorkspaceMember(t.id,t.updateWorkspaceMemberBody,n).then(r=>r(this.axios,this.basePath))}upsertTableRows(t,n){return ce(this.configuration).upsertTableRows(t.table,t.upsertTableRowsBody,n).then(r=>r(this.axios,this.basePath))}},pM={getRandomValues:e=>new Uint8Array(e.map(()=>Math.floor(Math.random()*256)))},Ku=typeof window<"u"&&typeof window.document<"u"?window.crypto:Au;Ku.getRandomValues||(Ku=pM);var kt=class extends Error{constructor(n,r,i,s,o,a){super(s);E(this,"isApiError",!0);this.code=n,this.description=r,this.type=i,this.message=s,this.error=o,this.id=a,this.id||(this.id=kt.generateId())}format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){let n=this.getPrefix(),r=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],i=4,s=Array.from(Ku.getRandomValues(new Uint8Array(i))).map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase();return`${n}_${r}x${s}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}},mM=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,oy=e=>e instanceof kt||mM(e)&&e.isApiError===!0,is=class extends kt{constructor(e,t,n){super(500,"An unknown error occurred","Unknown",e,t,n)}},ay=class extends kt{constructor(t,n,r){super(500,"An internal error occurred","Internal",t,n,r)}},ly=class extends kt{constructor(e,t,n){super(401,"The request requires to be authenticated.","Unauthorized",e,t,n)}},cy=class extends kt{constructor(t,n,r){super(403,"The requested action can't be peform by this resource.","Forbidden",t,n,r)}},uy=class extends kt{constructor(t,n,r){super(413,"The request payload is too large.","PayloadTooLarge",t,n,r)}},dy=class extends kt{constructor(t,n,r){super(400,"The request payload is invalid.","InvalidPayload",t,n,r)}},fy=class extends kt{constructor(t,n,r){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,n,r)}},hy=class extends kt{constructor(t,n,r){super(405,"The requested method does not exist.","MethodNotFound",t,n,r)}},py=class extends kt{constructor(t,n,r){super(404,"The requested resource does not exist.","ResourceNotFound",t,n,r)}},my=class extends kt{constructor(t,n,r){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,n,r)}},gy=class extends kt{constructor(t,n,r){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,n,r)}},yy=class extends kt{constructor(t,n,r){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",t,n,r)}},vy=class extends kt{constructor(e,t,n){super(409,"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together.","RelationConflict",e,t,n)}},by=class extends kt{constructor(t,n,r){super(409,"The resource cannot be deleted because it's referenced by another resource","ReferenceConstraint",t,n,r)}},wy=class extends kt{constructor(t,n,r){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,n,r)}},xy=class extends kt{constructor(t,n,r){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,n,r)}},_y=class extends kt{constructor(t,n,r){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,n,r)}},ky=class extends kt{constructor(t,n,r){super(409,"The record attempted to be created already exists.","AlreadyExists",t,n,r)}},Cy=class extends kt{constructor(t,n,r){super(429,"The request has been rate limited.","RateLimited",t,n,r)}},Ey=class extends kt{constructor(t,n,r){super(402,"A payment is required to perform this request.","PaymentRequired",t,n,r)}},Sy=class extends kt{constructor(t,n,r){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",t,n,r)}},Ty=class extends kt{constructor(t,n,r){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",t,n,r)}},gM={Unknown:is,Internal:ay,Unauthorized:ly,Forbidden:cy,PayloadTooLarge:uy,InvalidPayload:dy,UnsupportedMediaType:fy,MethodNotFound:hy,ResourceNotFound:py,InvalidJsonSchema:my,InvalidDataFormat:gy,InvalidIdentifier:yy,RelationConflict:vy,ReferenceConstraint:by,ReferenceNotFound:wy,InvalidQuery:xy,Runtime:_y,AlreadyExists:ky,RateLimited:Cy,PaymentRequired:Ey,QuotaExceeded:Sy,LimitExceeded:Ty},eo=e=>oy(e)?e:e instanceof Error?new is(e.message,e):typeof e=="string"?new is(e):yM(e);function yM(e){if(typeof e=="object"&&"code"in e&&"type"in e&&"id"in e&&"message"in e&&typeof e.type=="string"&&typeof e.message=="string"){let t=gM[e.type];return t?new t(e.message,void 0,e.id||"UNKNOWN"):new is(`An unclassified API error occurred: ${e.message} (Type: ${e.type}, Code: ${e.code})`)}return new is("An invalid error occurred: "+JSON.stringify(e))}var vM=class{constructor(t,n,r){E(this,"_innerClient");E(this,"createConversation",t=>this._innerClient.createConversation({createConversationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getConversation",t=>this._innerClient.getConversation(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listConversations",t=>this._innerClient.listConversations(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getOrCreateConversation",t=>this._innerClient.getOrCreateConversation({getOrCreateConversationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateConversation",({id:t,...n})=>this._innerClient.updateConversation({id:t,updateConversationBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteConversation",t=>this._innerClient.deleteConversation(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listParticipants",t=>this._innerClient.listParticipants(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"addParticipant",({id:t,...n})=>this._innerClient.addParticipant({id:t,addParticipantBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"getParticipant",t=>this._innerClient.getParticipant(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"removeParticipant",t=>this._innerClient.removeParticipant(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createEvent",t=>this._innerClient.createEvent({createEventBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getEvent",t=>this._innerClient.getEvent(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listEvents",t=>this._innerClient.listEvents(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createMessage",t=>this._innerClient.createMessage({createMessageBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getOrCreateMessage",t=>this._innerClient.getOrCreateMessage({getOrCreateMessageBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getMessage",t=>this._innerClient.getMessage(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateMessage",({id:t,...n})=>this._innerClient.updateMessage({id:t,updateMessageBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listMessages",t=>this._innerClient.listMessages(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteMessage",t=>this._innerClient.deleteMessage(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createUser",t=>this._innerClient.createUser({createUserBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getUser",t=>this._innerClient.getUser(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listUsers",t=>this._innerClient.listUsers(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getOrCreateUser",t=>this._innerClient.getOrCreateUser({getOrCreateUserBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateUser",({id:t,...n})=>this._innerClient.updateUser({id:t,updateUserBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteUser",t=>this._innerClient.deleteUser(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getState",t=>this._innerClient.getState(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"setState",({type:t,id:n,name:r,...i})=>this._innerClient.setState({type:t,id:n,name:r,setStateBody:i}).then(s=>s.data).catch(s=>{throw ue(s)}));E(this,"getOrSetState",({type:t,id:n,name:r,...i})=>this._innerClient.getOrSetState({type:t,id:n,name:r,getOrSetStateBody:i}).then(s=>s.data).catch(s=>{throw ue(s)}));E(this,"patchState",({type:t,id:n,name:r,...i})=>this._innerClient.patchState({type:t,id:n,name:r,patchStateBody:i}).then(s=>s.data).catch(s=>{throw ue(s)}));E(this,"callAction",t=>this._innerClient.callAction({callActionBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"configureIntegration",t=>this._innerClient.configureIntegration({configureIntegrationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getTask",t=>this._innerClient.getTask(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createTask",t=>this._innerClient.createTask({createTaskBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateTask",({id:t,...n})=>this._innerClient.updateTask({id:t,updateTaskBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteTask",t=>this._innerClient.deleteTask(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listTasks",t=>this._innerClient.listTasks(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"runVrl",t=>this._innerClient.runVrl({runVrlBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getAccount",()=>this._innerClient.getAccount().then(t=>t.data).catch(t=>{throw ue(t)}));E(this,"updateAccount",t=>this._innerClient.updateAccount({updateAccountBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listPersonalAccessTokens",()=>this._innerClient.listPersonalAccessTokens().then(t=>t.data).catch(t=>{throw ue(t)}));E(this,"createPersonalAccessToken",t=>this._innerClient.createPersonalAccessToken({createPersonalAccessTokenBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deletePersonalAccessToken",t=>this._innerClient.deletePersonalAccessToken(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"setAccountPreference",({key:t,...n})=>this._innerClient.setAccountPreference({key:t,setAccountPreferenceBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"getAccountPreference",t=>this._innerClient.getAccountPreference(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listPublicIntegrations",t=>this._innerClient.listPublicIntegrations(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getPublicIntegrationById",t=>this._innerClient.getPublicIntegrationById(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getPublicIntegration",t=>this._innerClient.getPublicIntegration(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createBot",t=>this._innerClient.createBot({createBotBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateBot",({id:t,...n})=>this._innerClient.updateBot({id:t,updateBotBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"transferBot",({id:t,...n})=>this._innerClient.transferBot({id:t,transferBotBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listBots",t=>this._innerClient.listBots(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBot",t=>this._innerClient.getBot(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteBot",t=>this._innerClient.deleteBot(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBotLogs",t=>this._innerClient.getBotLogs(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBotWebchat",t=>this._innerClient.getBotWebchat(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBotAnalytics",t=>this._innerClient.getBotAnalytics(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listBotIssues",t=>this._innerClient.listBotIssues(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteBotIssue",t=>this._innerClient.deleteBotIssue(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listBotIssueEvents",t=>this._innerClient.listBotIssueEvents(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getWorkspaceBillingDetails",t=>this._innerClient.getWorkspaceBillingDetails(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"setWorkspacePaymentMethod",({id:t,...n})=>this._innerClient.setWorkspacePaymentMethod({id:t,setWorkspacePaymentMethodBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listWorkspaceInvoices",t=>this._innerClient.listWorkspaceInvoices(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getUpcomingInvoice",t=>this._innerClient.getUpcomingInvoice(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"chargeWorkspaceUnpaidInvoices",({id:t,...n})=>this._innerClient.chargeWorkspaceUnpaidInvoices({id:t,chargeWorkspaceUnpaidInvoicesBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"createWorkspace",t=>this._innerClient.createWorkspace({createWorkspaceBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getPublicWorkspace",t=>this._innerClient.getPublicWorkspace(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getWorkspace",t=>this._innerClient.getWorkspace(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaceUsages",t=>this._innerClient.listWorkspaceUsages(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"breakDownWorkspaceUsageByBot",t=>this._innerClient.breakDownWorkspaceUsageByBot(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getAllWorkspaceQuotaCompletion",()=>this._innerClient.getAllWorkspaceQuotaCompletion().then(t=>t.data).catch(t=>{throw ue(t)}));E(this,"getWorkspaceQuota",t=>this._innerClient.getWorkspaceQuota(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaceQuotas",t=>this._innerClient.listWorkspaceQuotas(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateWorkspace",({id:t,...n})=>this._innerClient.updateWorkspace({id:t,updateWorkspaceBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"checkHandleAvailability",t=>this._innerClient.checkHandleAvailability({checkHandleAvailabilityBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaces",t=>this._innerClient.listWorkspaces(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"changeWorkspacePlan",({id:t,...n})=>this._innerClient.changeWorkspacePlan({id:t,changeWorkspacePlanBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteWorkspace",t=>this._innerClient.deleteWorkspace(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getAuditRecords",t=>this._innerClient.getAuditRecords(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaceMembers",t=>this._innerClient.listWorkspaceMembers(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteWorkspaceMember",t=>this._innerClient.deleteWorkspaceMember(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createWorkspaceMember",t=>this._innerClient.createWorkspaceMember({createWorkspaceMemberBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateWorkspaceMember",({id:t,...n})=>this._innerClient.updateWorkspaceMember({id:t,updateWorkspaceMemberBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"createIntegration",t=>this._innerClient.createIntegration({createIntegrationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateIntegration",({id:t,...n})=>this._innerClient.updateIntegration({id:t,updateIntegrationBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listIntegrations",t=>this._innerClient.listIntegrations(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getIntegration",t=>this._innerClient.getIntegration(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getIntegrationLogs",t=>this._innerClient.getIntegrationLogs(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getIntegrationByName",t=>this._innerClient.getIntegrationByName(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteIntegration",t=>this._innerClient.deleteIntegration(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getUsage",t=>this._innerClient.getUsage(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listUsageHistory",t=>this._innerClient.listUsageHistory(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"changeAISpendQuota",t=>this._innerClient.changeAISpendQuota({changeAISpendQuotaBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listActivities",t=>this._innerClient.listActivities(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"introspect",t=>this._innerClient.introspect({introspectBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createFile",({xName:t,xTags:n,xAccessPolicies:r,xIndex:i,contentType:s,contentLength:o,...a})=>this._innerClient.createFile({xName:t,xTags:n,xAccessPolicies:r,xIndex:i,contentType:s,contentLength:o,createFileBody:a}).then(l=>l.data).catch(l=>{throw ue(l)}));E(this,"deleteFile",t=>this._innerClient.deleteFile(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listFiles",t=>this._innerClient.listFiles(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getFileMetadata",t=>this._innerClient.getFileMetadata(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getFileContent",t=>this._innerClient.getFileContent(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateFileMetadata",({id:t,...n})=>this._innerClient.updateFileMetadata({id:t,updateFileMetadataBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"searchFiles",t=>this._innerClient.searchFiles(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listTables",t=>this._innerClient.listTables(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getTable",t=>this._innerClient.getTable(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createTable",t=>this._innerClient.createTable({createTableBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateTable",({table:t,...n})=>this._innerClient.updateTable({table:t,updateTableBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"renameTableColumn",({table:t,...n})=>this._innerClient.renameTableColumn({table:t,renameTableColumnBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteTable",t=>this._innerClient.deleteTable(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getTableRow",t=>this._innerClient.getTableRow(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"findTableRows",({table:t,...n})=>this._innerClient.findTableRows({table:t,findTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"createTableRows",({table:t,...n})=>this._innerClient.createTableRows({table:t,createTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteTableRows",({table:t,...n})=>this._innerClient.deleteTableRows({table:t,deleteTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"updateTableRows",({table:t,...n})=>this._innerClient.updateTableRows({table:t,updateTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"upsertTableRows",({table:t,...n})=>this._innerClient.upsertTableRows({table:t,upsertTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));this._innerClient=new hM(t,n,r)}};function ue(e){var t;return X.isAxiosError(e)&&((t=e.response)!=null&&t.data)?eo(e.response.data):eo(e)}var Oy=100*1024*1024,bM=Oy,wM=Oy,xM=class extends vM{constructor(n={}){let r=aM(n),i=_M(r);super(void 0,r.apiUrl,i);E(this,"config");E(this,"axiosClient");E(this,"createFile",async({name:n,data:r,index:i,tags:s,contentType:o,contentLength:a,accessPolicies:l})=>{let c={...this.config.headers,"x-name":n,"x-tags":s?JSON.stringify(s):void 0,"x-index":i?"true":"false","x-access-policies":(l==null?void 0:l.join(","))??void 0,"content-type":o??!1,"content-length":a};return(await this.axiosClient.post("/v1/files",r,{headers:c,baseURL:this.config.apiUrl}).catch(u=>{throw kM(u)})).data});this.axiosClient=i,this.config=r}};function _M(e){let{headers:t,withCredentials:n,timeout:r}=e;return X.create({headers:t,withCredentials:n,timeout:r,maxBodyLength:bM,maxContentLength:wM,httpAgent:Hu?new Q$.default.Agent({keepAlive:!0}):void 0,httpsAgent:Hu?new X$.default.Agent({keepAlive:!0}):void 0})}function kM(e){var t;return X.isAxiosError(e)&&((t=e.response)!=null&&t.data)?eo(e.response.data):eo(e)}const Iy=$l(Object.freeze(Object.defineProperty({__proto__:null,AlreadyExistsError:ky,Client:xM,ForbiddenError:cy,InternalError:ay,InvalidDataFormatError:gy,InvalidIdentifierError:yy,InvalidJsonSchemaError:my,InvalidPayloadError:dy,InvalidQueryError:xy,LimitExceededError:Ty,MethodNotFoundError:hy,PayloadTooLargeError:uy,PaymentRequiredError:Ey,QuotaExceededError:Sy,RateLimitedError:Cy,ReferenceConstraintError:by,ReferenceNotFoundError:wy,RelationConflictError:vy,ResourceNotFoundError:py,RuntimeError:_y,UnauthorizedError:ly,UnknownError:is,UnsupportedMediaTypeError:fy,axios:N$,errorFrom:eo,isApiError:oy},Symbol.toStringTag,{value:"Module"})));var CM=Object.create,qa=Object.defineProperty,EM=Object.getOwnPropertyDescriptor,SM=Object.getOwnPropertyNames,TM=Object.getPrototypeOf,OM=Object.prototype.hasOwnProperty,Py=(e,t)=>{for(var n in t)qa(e,n,{get:t[n],enumerable:!0})},Ay=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of SM(t))!OM.call(e,i)&&i!==n&&qa(e,i,{get:()=>t[i],enumerable:!(r=EM(t,i))||r.enumerable});return e},Ry=(e,t,n)=>(n=e!=null?CM(TM(e)):{},Ay(t||!e||!e.__esModule?qa(n,"default",{value:e,enumerable:!0}):n,e)),IM=e=>Ay(qa({},"__esModule",{value:!0}),e),$y={};Py($y,{Bot:()=>mL,BotSpecificClient:()=>Zy,Integration:()=>sL,IntegrationDefinition:()=>KM,IntegrationSpecificClient:()=>Vy,botIdHeader:()=>Ju,botUserIdHeader:()=>Ny,configurationHeader:()=>Gu,integrationIdHeader:()=>jy,messages:()=>My,operationHeader:()=>Yu,parseBody:()=>Cr,serve:()=>Qu,typeHeader:()=>Fy,webhookIdHeader:()=>Uy});var PM=IM($y),My={};Py(My,{defaults:()=>UM});var Mt=Da,mn=Mt.z.string().min(1),AM=Mt.z.object({text:mn}),RM=Mt.z.object({markdown:mn}),$M=Mt.z.object({imageUrl:mn}),MM=Mt.z.object({audioUrl:mn}),LM=Mt.z.object({videoUrl:mn}),DM=Mt.z.object({fileUrl:mn,title:mn.optional()}),NM=Mt.z.object({latitude:Mt.z.number(),longitude:Mt.z.number(),address:Mt.z.string().optional(),title:Mt.z.string().optional()}),Ly=Mt.z.object({title:mn,subtitle:mn.optional(),imageUrl:mn.optional(),actions:Mt.z.array(Mt.z.object({action:Mt.z.enum(["postback","url","say"]),label:mn,value:mn}))}),Dy=Mt.z.object({text:mn,options:Mt.z.array(Mt.z.object({label:mn,value:mn}))}),jM=Mt.z.object({items:Mt.z.array(Ly)}),UM={text:{schema:AM},markdown:{schema:RM},image:{schema:$M},audio:{schema:MM},video:{schema:LM},file:{schema:DM},location:{schema:NM},carousel:{schema:jM},card:{schema:Ly},dropdown:{schema:Dy},choice:{schema:Dy}},Ju="x-bot-id",Ny="x-bot-user-id",jy="x-integration-id",Uy="x-webhook-id",Gu="x-bp-configuration",Yu="x-bp-operation",Fy="x-bp-type",FM=kg,Ka=console;function Cr(e){if(!e.body)throw new Error("Missing body");return JSON.parse(e.body)}async function Qu(e,t=8072,n=ZM){let r=(0,FM.createServer)(async(i,s)=>{try{let o=await BM(i);if(o.path==="/health"){s.writeHead(200).end("ok");return}let a=await e(o);s.writeHead((a==null?void 0:a.status)??200,(a==null?void 0:a.headers)??{}).end((a==null?void 0:a.body)??"{}")}catch(o){Ka.error("Error while handling request",{error:(o==null?void 0:o.message)??"Internal error occured"}),s.writeHead(500).end(JSON.stringify({error:(o==null?void 0:o.message)??"Internal error occured"}))}});return r.listen(t,()=>n(t)),r}async function BM(e){var i;let t=await zM(e),n={};for(let s=0;s<e.rawHeaders.length;s+=2){let o=e.rawHeaders[s].toLowerCase(),a=e.rawHeaders[s+1];n[o]=a}let r=new URL(e.url??"",e.headers.host?`http://${e.headers.host}`:"http://botpress.cloud");return{body:t,path:r.pathname,query:VM(r.search,"?"),headers:n,method:((i=e.method)==null?void 0:i.toUpperCase())??"GET"}}function VM(e,t){return e.indexOf(t)===0?e.slice(t.length):e}async function zM(e){return new Promise((t,n)=>{if(e.method!=="POST"&&e.method!=="PUT"&&e.method!=="PATCH")return t(void 0);let r="";e.on("data",i=>r+=i.toString()),e.on("error",i=>n(i)),e.on("end",()=>t(r))})}function ZM(e){Ka.info(`Listening on port ${e}`)}var WM=Da,HM=WM.z.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),qM=e=>{let t=e[Ju],n=e[Ny],r=e[jy],i=e[Uy],s=e[Gu],o=HM.parse(e[Yu]);if(!t)throw new Error("Missing bot headers");if(!n)throw new Error("Missing bot user headers");if(!r)throw new Error("Missing integration headers");if(!i)throw new Error("Missing webhook headers");if(!s)throw new Error("Missing configuration headers");if(!o)throw new Error("Missing operation headers");return{botId:t,botUserId:n,integrationId:r,webhookId:i,operation:o,configuration:s?JSON.parse(Buffer.from(s,"base64").toString("utf-8")):{}}},KM=class{constructor(e){E(this,"name");E(this,"version");E(this,"title");E(this,"description");E(this,"icon");E(this,"readme");E(this,"configuration");E(this,"events");E(this,"actions");E(this,"channels");E(this,"states");E(this,"user");E(this,"secrets");E(this,"identifier");E(this,"entities");this.props=e,this.name=e.name,this.version=e.version,this.icon=e.icon,this.readme=e.readme,this.title=e.title,this.identifier=e.identifier,this.description=e.description,this.configuration=e.configuration,this.events=e.events,this.actions=e.actions,this.channels=e.channels,this.states=e.states,this.user=e.user,this.secrets=e.secrets,this.entities=e.entities}},By=Iy,Vy=class{constructor(e){E(this,"createConversation",e=>this.client.createConversation(e));E(this,"getConversation",e=>this.client.getConversation(e));E(this,"listConversations",e=>this.client.listConversations(e));E(this,"getOrCreateConversation",e=>this.client.getOrCreateConversation(e));E(this,"updateConversation",e=>this.client.updateConversation(e));E(this,"deleteConversation",e=>this.client.deleteConversation(e));E(this,"listParticipants",e=>this.client.listParticipants(e));E(this,"addParticipant",e=>this.client.addParticipant(e));E(this,"getParticipant",e=>this.client.getParticipant(e));E(this,"removeParticipant",e=>this.client.removeParticipant(e));E(this,"createEvent",e=>this.client.createEvent(e));E(this,"getEvent",e=>this.client.getEvent(e));E(this,"listEvents",e=>this.client.listEvents(e));E(this,"createMessage",e=>this.client.createMessage(e));E(this,"getOrCreateMessage",e=>this.client.getOrCreateMessage(e));E(this,"getMessage",e=>this.client.getMessage(e));E(this,"updateMessage",e=>this.client.updateMessage(e));E(this,"listMessages",e=>this.client.listMessages(e));E(this,"deleteMessage",e=>this.client.deleteMessage(e));E(this,"createUser",e=>this.client.createUser(e));E(this,"getUser",e=>this.client.getUser(e));E(this,"listUsers",e=>this.client.listUsers(e));E(this,"getOrCreateUser",e=>this.client.getOrCreateUser(e));E(this,"updateUser",e=>this.client.updateUser(e));E(this,"deleteUser",e=>this.client.deleteUser(e));E(this,"getState",e=>this.client.getState(e));E(this,"setState",e=>this.client.setState(e));E(this,"getOrSetState",e=>this.client.getOrSetState(e));E(this,"patchState",e=>this.client.patchState(e));E(this,"configureIntegration",e=>this.client.configureIntegration(e));this.client=e}},zy=Ry(kg),Ja=e=>{if(process.env.BP_LOG_FORMAT==="json")return JSON.stringify({msg:zy.default.format(...e),visible_to_bot_owner:!0});{let[t,...n]=e;return zy.default.format(`[For Bot Owner] ${t}`,...n)}},JM={forBot:()=>({info:(...e)=>{console.info(Ja(e))},warn:(...e)=>{console.warn(Ja(e))},error:(...e)=>{console.error(Ja(e))},debug:(...e)=>{console.debug(Ja(e))}})},GM=e=>async t=>{let n=qM(t.headers),r=new Vy(new By.Client({botId:n.botId,integrationId:n.integrationId})),i={ctx:n,req:t,client:r,logger:JM,instance:e};try{let s;switch(n.operation){case"webhook_received":s=await QM(i);break;case"register":s=await XM(i);break;case"unregister":s=await eL(i);break;case"message_created":s=await rL(i);break;case"action_triggered":s=await iL(i);break;case"ping":s=await YM(i);break;case"create_user":s=await tL(i);break;case"create_conversation":s=await nL(i);break;default:throw new Error(`Unknown operation ${n.operation}`)}return s?{...s,status:s.status??200}:{status:200}}catch(s){if(s instanceof By.RuntimeError)return{status:s.code,body:JSON.stringify(s.toJSON())};throw s}},YM=async e=>{},QM=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{let{req:s}=Cr(n);return i.webhook({client:e,ctx:t,req:s,logger:r})},XM=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.register)return;let{webhookUrl:s}=Cr(n);await i.register({client:e,ctx:t,webhookUrl:s,logger:r})},eL=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.unregister)return;let{webhookUrl:s}=Cr(n);await i.unregister({ctx:t,webhookUrl:s,client:e,logger:r})},tL=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.createUser)return;let{tags:s}=Cr(n);return await i.createUser({ctx:t,client:e,tags:s,logger:r})},nL=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.createConversation)return;let{channel:s,tags:o}=Cr(n);return await i.createConversation({ctx:t,client:e,channel:s,tags:o,logger:r})},rL=async({ctx:e,req:t,client:n,logger:r,instance:i})=>{let{conversation:s,user:o,type:a,payload:l,message:c}=Cr(t),u=i.channels[s.channel];if(!u)throw new Error(`Channel ${s.channel} not found`);let d=u.messages[a];if(!d)throw new Error(`Message of type ${a} not found in channel ${s.channel}`);await d({ctx:e,conversation:s,message:c,user:o,type:a,client:n,payload:l,ack:async({tags:h})=>{await n.updateMessage({id:c.id,tags:h})},logger:r})},iL=async({req:e,ctx:t,client:n,logger:r,instance:i})=>{let{input:s,type:o}=Cr(e);if(!o)throw new Error("Missing action type");let a=i.actions[o];if(!a)throw new Error(`Action ${o} not found`);let l=await a({ctx:t,input:s,client:n,type:o,logger:r});return{body:JSON.stringify({output:l})}},sL=class{constructor(e){E(this,"props");E(this,"actions");E(this,"channels");E(this,"register");E(this,"unregister");E(this,"createUser");E(this,"createConversation");E(this,"webhook");E(this,"handler",GM(this));E(this,"start",e=>Qu(this.handler,e));this.props=e,this.actions=e.actions,this.channels=e.channels,this.register=e.register,this.unregister=e.unregister,this.createUser=e.createUser,this.createConversation=e.createConversation,this.webhook=e.handler}},oL=Ry(Iy),Zy=class{constructor(e){E(this,"getConversation",e=>this.client.getConversation(e));E(this,"listConversations",e=>this.client.listConversations(e));E(this,"updateConversation",e=>this.client.updateConversation(e));E(this,"deleteConversation",e=>this.client.deleteConversation(e));E(this,"listParticipants",e=>this.client.listParticipants(e));E(this,"addParticipant",e=>this.client.addParticipant(e));E(this,"getParticipant",e=>this.client.getParticipant(e));E(this,"removeParticipant",e=>this.client.removeParticipant(e));E(this,"getEvent",e=>this.client.getEvent(e));E(this,"listEvents",e=>this.client.listEvents(e));E(this,"createMessage",e=>this.client.createMessage(e));E(this,"getOrCreateMessage",e=>this.client.getOrCreateMessage(e));E(this,"getMessage",e=>this.client.getMessage(e));E(this,"updateMessage",e=>this.client.updateMessage(e));E(this,"listMessages",e=>this.client.listMessages(e));E(this,"deleteMessage",e=>this.client.deleteMessage(e));E(this,"getUser",e=>this.client.getUser(e));E(this,"listUsers",e=>this.client.listUsers(e));E(this,"updateUser",e=>this.client.updateUser(e));E(this,"deleteUser",e=>this.client.deleteUser(e));E(this,"getState",e=>this.client.getState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"setState",e=>this.client.setState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"getOrSetState",e=>this.client.getOrSetState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"patchState",e=>this.client.patchState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"callAction",e=>this.client.callAction(e));E(this,"createConversation",e=>this.client.createConversation(e));E(this,"getOrCreateConversation",e=>this.client.getOrCreateConversation(e));E(this,"createUser",e=>this.client.createUser(e));E(this,"getOrCreateUser",e=>this.client.getOrCreateUser(e));this.client=e}},aL=Da,lL=aL.z.enum(["event_received","register","unregister","ping","action_triggered"]),cL=e=>{let t=e[Ju],n=e[Gu],r=e[Fy],i=lL.parse(e[Yu]);if(!t)throw new Error("Missing bot headers");if(!r)throw new Error("Missing type headers");if(!n)throw new Error("Missing configuration headers");if(!i)throw new Error("Missing operation headers");return{botId:t,operation:i,type:r,configuration:n?JSON.parse(Buffer.from(n,"base64").toString("utf-8")):{}}},uL=e=>async t=>{let n=cL(t.headers);n.operation!=="ping"&&Ka.info(`Received ${n.operation} operation for bot ${n.botId} of type ${n.type}`);let r=new Zy(new oL.Client({botId:n.botId})),i={req:t,ctx:n,client:r,instance:e};switch(n.operation){case"action_triggered":throw new Error(`Operation ${n.operation} not supported yet`);case"event_received":await pL(i);break;case"register":await fL();break;case"unregister":await hL();break;case"ping":await dL();break;default:throw new Error(`Unknown operation ${n.operation}`)}return{status:200}},dL=async e=>{},fL=async e=>{},hL=async e=>{},pL=async({ctx:e,req:t,client:n,instance:r})=>{Ka.debug(`Received event ${e.type}`);let i=Cr(t),s=i.event;switch(e.type){case"message_created":let o={user:s.payload.user,conversation:s.payload.conversation,message:s.payload.message,states:s.payload.states,event:s};await Promise.all(r.messageHandlers.map(c=>c({client:n,ctx:e,...o})));break;case"state_expired":let a={state:s.payload.state};await Promise.all(r.stateExpiredHandlers.map(c=>c({client:n,ctx:e,...a})));break;default:let l={event:i.event};await Promise.all(r.eventHandlers.map(c=>c({client:n,ctx:e,...l})))}},mL=class{constructor(e){E(this,"_state",{messageHandlers:[],eventHandlers:[],stateExpiredHandlers:[]});E(this,"props");E(this,"message",e=>{this._state.messageHandlers.push(e)});E(this,"event",e=>{this._state.eventHandlers.push(e)});E(this,"stateExpired",e=>{this._state.stateExpiredHandlers.push(e)});E(this,"handler",uL(this._state));E(this,"start",e=>Qu(this.handler,e));this.props=e}},ht;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(const o of i)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(ht||(ht={}));var Xu;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Xu||(Xu={}));const Oe=ht.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Yr=e=>{switch(typeof e){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return isNaN(e)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(e)?Oe.array:e===null?Oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Oe.promise:typeof Map<"u"&&e instanceof Map?Oe.map:typeof Set<"u"&&e instanceof Set?Oe.set:typeof Date<"u"&&e instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},xe=ht.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),gL=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Zn extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,ht.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Zn.create=e=>new Zn(e);const to=(e,t)=>{let n;switch(e.code){case xe.invalid_type:e.received===Oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case xe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ht.jsonStringifyReplacer)}`;break;case xe.unrecognized_keys:n=`Unrecognized key(s) in object: ${ht.joinValues(e.keys,", ")}`;break;case xe.invalid_union:n="Invalid input";break;case xe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ht.joinValues(e.options)}`;break;case xe.invalid_enum_value:n=`Invalid enum value. Expected ${ht.joinValues(e.options)}, received '${e.received}'`;break;case xe.invalid_arguments:n="Invalid function arguments";break;case xe.invalid_return_type:n="Invalid function return type";break;case xe.invalid_date:n="Invalid date";break;case xe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ht.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case xe.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case xe.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case xe.custom:n="Invalid input";break;case xe.invalid_intersection_types:n="Intersection results could not be merged";break;case xe.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case xe.not_finite:n="Number must be finite";break;default:n=t.defaultError,ht.assertNever(e)}return{message:n}};let Wy=to;function yL(e){Wy=e}function Ga(){return Wy}const Ya=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],o={...i,path:s};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(o,{data:t,defaultError:a}).message;return{...i,path:s,message:i.message||a}},vL=[];function Ae(e,t){const n=Ya({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ga(),to].filter(r=>!!r)});e.common.issues.push(n)}class dn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Qe;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return dn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Qe;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:t.value,value:r}}}const Qe=Object.freeze({status:"aborted"}),Hy=e=>({status:"dirty",value:e}),gn=e=>({status:"valid",value:e}),ed=e=>e.status==="aborted",td=e=>e.status==="dirty",no=e=>e.status==="valid",Qa=e=>typeof Promise<"u"&&e instanceof Promise;var Be;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Be||(Be={}));class ar{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const qy=(e,t)=>{if(no(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Zn(e.common.issues);return this._error=n,this._error}}};function Xe(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class tt{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Yr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Yr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new dn,ctx:{common:t.parent.common,data:t.data,parsedType:Yr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Qa(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Yr(t)},s=this._parseSync({data:t,path:i.path,parent:i});return qy(i,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Yr(t)},i=this._parse({data:t,path:r.path,parent:r}),s=await(Qa(i)?i:Promise.resolve(i));return qy(r,s)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=t(i),a=()=>s.addIssue({code:xe.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new qn({schema:this,typeName:We.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Sr.create(this,this._def)}nullable(){return Oi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Hn.create(this,this._def)}promise(){return ls.create(this,this._def)}or(t){return oo.create([this,t],this._def)}and(t){return ao.create(this,t,this._def)}transform(t){return new qn({...Xe(this._def),schema:this,typeName:We.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new ho({...Xe(this._def),innerType:this,defaultValue:n,typeName:We.ZodDefault})}brand(){return new Jy({typeName:We.ZodBranded,type:this,...Xe(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new il({...Xe(this._def),innerType:this,catchValue:n,typeName:We.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return po.create(this,t)}readonly(){return ol.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const bL=/^c[^\s-]{8,}$/i,wL=/^[a-z][a-z0-9]*$/,xL=/^[0-9A-HJKMNP-TV-Z]{26}$/,_L=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,kL=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,CL="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let nd;const EL=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,SL=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,TL=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function OL(e,t){return!!((t==="v4"||!t)&&EL.test(e)||(t==="v6"||!t)&&SL.test(e))}class Wn extends tt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Oe.string){const s=this._getOrReturnCtx(t);return Ae(s,{code:xe.invalid_type,expected:Oe.string,received:s.parsedType}),Qe}const r=new dn;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,a=t.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(t,i),o?Ae(i,{code:xe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&Ae(i,{code:xe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")kL.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"email",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")nd||(nd=new RegExp(CL,"u")),nd.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"emoji",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")_L.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"uuid",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")bL.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"cuid",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")wL.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"cuid2",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")xL.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"ulid",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Ae(i,{validation:"url",code:xe.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"regex",code:xe.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?TL(s).test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="ip"?OL(t.data,s.version)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"ip",code:xe.invalid_string,message:s.message}),r.dirty()):ht.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:xe.invalid_string,...Be.errToObj(r)})}_addCheck(t){return new Wn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Be.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Be.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Be.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Be.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Be.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Be.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Be.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Be.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...Be.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Be.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Be.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Be.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Be.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Be.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Be.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Be.errToObj(n)})}nonempty(t){return this.min(1,Be.errToObj(t))}trim(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Wn.create=e=>{var t;return new Wn({checks:[],typeName:We.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Xe(e)})};function IL(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class Qr extends tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Oe.number){const s=this._getOrReturnCtx(t);return Ae(s,{code:xe.invalid_type,expected:Oe.number,received:s.parsedType}),Qe}let r;const i=new dn;for(const s of this._def.checks)s.kind==="int"?ht.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ae(r,{code:xe.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:xe.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:xe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?IL(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:xe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ae(r,{code:xe.not_finite,message:s.message}),i.dirty()):ht.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Be.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Be.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Be.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Be.toString(n))}setLimit(t,n,r,i){return new Qr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Be.toString(i)}]})}_addCheck(t){return new Qr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Be.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Be.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Be.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Be.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Be.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Be.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Be.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Be.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Be.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ht.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Qr.create=e=>new Qr({checks:[],typeName:We.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Xe(e)});class Xr extends tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Oe.bigint){const s=this._getOrReturnCtx(t);return Ae(s,{code:xe.invalid_type,expected:Oe.bigint,received:s.parsedType}),Qe}let r;const i=new dn;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:xe.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:xe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:xe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):ht.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Be.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Be.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Be.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Be.toString(n))}setLimit(t,n,r,i){return new Xr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Be.toString(i)}]})}_addCheck(t){return new Xr({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Be.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Be.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Be.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Be.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Be.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Xr.create=e=>{var t;return new Xr({checks:[],typeName:We.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Xe(e)})};class ro extends tt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Oe.boolean){const r=this._getOrReturnCtx(t);return Ae(r,{code:xe.invalid_type,expected:Oe.boolean,received:r.parsedType}),Qe}return gn(t.data)}}ro.create=e=>new ro({typeName:We.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Xe(e)});class Ei extends tt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Oe.date){const s=this._getOrReturnCtx(t);return Ae(s,{code:xe.invalid_type,expected:Oe.date,received:s.parsedType}),Qe}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return Ae(s,{code:xe.invalid_date}),Qe}const r=new dn;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ht.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ei({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Be.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Be.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Ei.create=e=>new Ei({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:We.ZodDate,...Xe(e)});class Xa extends tt{_parse(t){if(this._getType(t)!==Oe.symbol){const r=this._getOrReturnCtx(t);return Ae(r,{code:xe.invalid_type,expected:Oe.symbol,received:r.parsedType}),Qe}return gn(t.data)}}Xa.create=e=>new Xa({typeName:We.ZodSymbol,...Xe(e)});class io extends tt{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Ae(r,{code:xe.invalid_type,expected:Oe.undefined,received:r.parsedType}),Qe}return gn(t.data)}}io.create=e=>new io({typeName:We.ZodUndefined,...Xe(e)});class so extends tt{_parse(t){if(this._getType(t)!==Oe.null){const r=this._getOrReturnCtx(t);return Ae(r,{code:xe.invalid_type,expected:Oe.null,received:r.parsedType}),Qe}return gn(t.data)}}so.create=e=>new so({typeName:We.ZodNull,...Xe(e)});class ss extends tt{constructor(){super(...arguments),this._any=!0}_parse(t){return gn(t.data)}}ss.create=e=>new ss({typeName:We.ZodAny,...Xe(e)});class Si extends tt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return gn(t.data)}}Si.create=e=>new Si({typeName:We.ZodUnknown,...Xe(e)});class Er extends tt{_parse(t){const n=this._getOrReturnCtx(t);return Ae(n,{code:xe.invalid_type,expected:Oe.never,received:n.parsedType}),Qe}}Er.create=e=>new Er({typeName:We.ZodNever,...Xe(e)});class el extends tt{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Ae(r,{code:xe.invalid_type,expected:Oe.void,received:r.parsedType}),Qe}return gn(t.data)}}el.create=e=>new el({typeName:We.ZodVoid,...Xe(e)});class Hn extends tt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Oe.array)return Ae(n,{code:xe.invalid_type,expected:Oe.array,received:n.parsedType}),Qe;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(Ae(n,{code:o?xe.too_big:xe.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ae(n,{code:xe.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ae(n,{code:xe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new ar(n,o,n.path,a)))).then(o=>dn.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new ar(n,o,n.path,a)));return dn.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new Hn({...this._def,minLength:{value:t,message:Be.toString(n)}})}max(t,n){return new Hn({...this._def,maxLength:{value:t,message:Be.toString(n)}})}length(t,n){return new Hn({...this._def,exactLength:{value:t,message:Be.toString(n)}})}nonempty(t){return this.min(1,t)}}Hn.create=(e,t)=>new Hn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:We.ZodArray,...Xe(t)});function os(e){if(e instanceof Et){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Sr.create(os(r))}return new Et({...e._def,shape:()=>t})}else return e instanceof Hn?new Hn({...e._def,type:os(e.element)}):e instanceof Sr?Sr.create(os(e.unwrap())):e instanceof Oi?Oi.create(os(e.unwrap())):e instanceof lr?lr.create(e.items.map(t=>os(t))):e}class Et extends tt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=ht.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Oe.object){const c=this._getOrReturnCtx(t);return Ae(c,{code:xe.invalid_type,expected:Oe.object,received:c.parsedType}),Qe}const{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Er&&this._def.unknownKeys==="strip"))for(const c in i.data)o.includes(c)||a.push(c);const l=[];for(const c of o){const u=s[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new ar(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Er){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(Ae(i,{code:xe.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new ar(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key;c.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>dn.mergeObjectSync(r,c)):dn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Be.errToObj,new Et({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,s,o,a;const l=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Be.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Et({...this._def,unknownKeys:"strip"})}passthrough(){return new Et({...this._def,unknownKeys:"passthrough"})}extend(t){return new Et({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Et({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:We.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Et({...this._def,catchall:t})}pick(t){const n={};return ht.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Et({...this._def,shape:()=>n})}omit(t){const n={};return ht.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Et({...this._def,shape:()=>n})}deepPartial(){return os(this)}partial(t){const n={};return ht.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Et({...this._def,shape:()=>n})}required(t){const n={};return ht.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Sr;)s=s._def.innerType;n[r]=s}}),new Et({...this._def,shape:()=>n})}keyof(){return Ky(ht.objectKeys(this.shape))}}Et.create=(e,t)=>new Et({shape:()=>e,unknownKeys:"strip",catchall:Er.create(),typeName:We.ZodObject,...Xe(t)}),Et.strictCreate=(e,t)=>new Et({shape:()=>e,unknownKeys:"strict",catchall:Er.create(),typeName:We.ZodObject,...Xe(t)}),Et.lazycreate=(e,t)=>new Et({shape:e,unknownKeys:"strip",catchall:Er.create(),typeName:We.ZodObject,...Xe(t)});class oo extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Zn(a.ctx.common.issues));return Ae(n,{code:xe.invalid_union,unionErrors:o}),Qe}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Zn(l));return Ae(n,{code:xe.invalid_union,unionErrors:a}),Qe}}get options(){return this._def.options}}oo.create=(e,t)=>new oo({options:e,typeName:We.ZodUnion,...Xe(t)});const tl=e=>e instanceof co?tl(e.schema):e instanceof qn?tl(e.innerType()):e instanceof uo?[e.value]:e instanceof ei?e.options:e instanceof fo?Object.keys(e.enum):e instanceof ho?tl(e._def.innerType):e instanceof io?[void 0]:e instanceof so?[null]:null;class nl extends tt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.object)return Ae(n,{code:xe.invalid_type,expected:Oe.object,received:n.parsedType}),Qe;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Ae(n,{code:xe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Qe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const s of n){const o=tl(s.shape[t]);if(!o)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,s)}}return new nl({typeName:We.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Xe(r)})}}function rd(e,t){const n=Yr(e),r=Yr(t);if(e===t)return{valid:!0,data:e};if(n===Oe.object&&r===Oe.object){const i=ht.objectKeys(t),s=ht.objectKeys(e).filter(a=>i.indexOf(a)!==-1),o={...e,...t};for(const a of s){const l=rd(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(n===Oe.array&&r===Oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s<e.length;s++){const o=e[s],a=t[s],l=rd(o,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Oe.date&&r===Oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ao extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(s,o)=>{if(ed(s)||ed(o))return Qe;const a=rd(s.value,o.value);return a.valid?((td(s)||td(o))&&n.dirty(),{status:n.value,value:a.data}):(Ae(r,{code:xe.invalid_intersection_types}),Qe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ao.create=(e,t,n)=>new ao({left:e,right:t,typeName:We.ZodIntersection,...Xe(n)});class lr extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.array)return Ae(r,{code:xe.invalid_type,expected:Oe.array,received:r.parsedType}),Qe;if(r.data.length<this._def.items.length)return Ae(r,{code:xe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Qe;!this._def.rest&&r.data.length>this._def.items.length&&(Ae(r,{code:xe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new ar(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>dn.mergeArray(n,o)):dn.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new lr({...this._def,rest:t})}}lr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new lr({items:e,typeName:We.ZodTuple,rest:null,...Xe(t)})};class lo extends tt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.object)return Ae(r,{code:xe.invalid_type,expected:Oe.object,received:r.parsedType}),Qe;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new ar(r,a,r.path,a)),value:o._parse(new ar(r,r.data[a],r.path,a))});return r.common.async?dn.mergeObjectAsync(n,i):dn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof tt?new lo({keyType:t,valueType:n,typeName:We.ZodRecord,...Xe(r)}):new lo({keyType:Wn.create(),valueType:t,typeName:We.ZodRecord,...Xe(n)})}}class rl extends tt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.map)return Ae(r,{code:xe.invalid_type,expected:Oe.map,received:r.parsedType}),Qe;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new ar(r,a,r.path,[c,"key"])),value:s._parse(new ar(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Qe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Qe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}rl.create=(e,t,n)=>new rl({valueType:t,keyType:e,typeName:We.ZodMap,...Xe(n)});class Ti extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.set)return Ae(r,{code:xe.invalid_type,expected:Oe.set,received:r.parsedType}),Qe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ae(r,{code:xe.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ae(r,{code:xe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Qe;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>s._parse(new ar(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,n){return new Ti({...this._def,minSize:{value:t,message:Be.toString(n)}})}max(t,n){return new Ti({...this._def,maxSize:{value:t,message:Be.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Ti.create=(e,t)=>new Ti({valueType:e,minSize:null,maxSize:null,typeName:We.ZodSet,...Xe(t)});class as extends tt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.function)return Ae(n,{code:xe.invalid_type,expected:Oe.function,received:n.parsedType}),Qe;function r(a,l){return Ya({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ga(),to].filter(c=>!!c),issueData:{code:xe.invalid_arguments,argumentsError:l}})}function i(a,l){return Ya({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ga(),to].filter(c=>!!c),issueData:{code:xe.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof ls){const a=this;return gn(async function(...l){const c=new Zn([]),u=await a._def.args.parseAsync(l,s).catch(f=>{throw c.addIssue(r(l,f)),c}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw c.addIssue(i(d,f)),c})})}else{const a=this;return gn(function(...l){const c=a._def.args.safeParse(l,s);if(!c.success)throw new Zn([r(l,c.error)]);const u=Reflect.apply(o,this,c.data),d=a._def.returns.safeParse(u,s);if(!d.success)throw new Zn([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new as({...this._def,args:lr.create(t).rest(Si.create())})}returns(t){return new as({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new as({args:t||lr.create([]).rest(Si.create()),returns:n||Si.create(),typeName:We.ZodFunction,...Xe(r)})}}class co extends tt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}co.create=(e,t)=>new co({getter:e,typeName:We.ZodLazy,...Xe(t)});class uo extends tt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ae(n,{received:n.data,code:xe.invalid_literal,expected:this._def.value}),Qe}return{status:"valid",value:t.data}}get value(){return this._def.value}}uo.create=(e,t)=>new uo({value:e,typeName:We.ZodLiteral,...Xe(t)});function Ky(e,t){return new ei({values:e,typeName:We.ZodEnum,...Xe(t)})}class ei extends tt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ae(n,{expected:ht.joinValues(r),received:n.parsedType,code:xe.invalid_type}),Qe}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Ae(n,{received:n.data,code:xe.invalid_enum_value,options:r}),Qe}return gn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return ei.create(t)}exclude(t){return ei.create(this.options.filter(n=>!t.includes(n)))}}ei.create=Ky;class fo extends tt{_parse(t){const n=ht.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const i=ht.objectValues(n);return Ae(r,{expected:ht.joinValues(i),received:r.parsedType,code:xe.invalid_type}),Qe}if(n.indexOf(t.data)===-1){const i=ht.objectValues(n);return Ae(r,{received:r.data,code:xe.invalid_enum_value,options:i}),Qe}return gn(t.data)}get enum(){return this._def.values}}fo.create=(e,t)=>new fo({values:e,typeName:We.ZodNativeEnum,...Xe(t)});class ls extends tt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.promise&&n.common.async===!1)return Ae(n,{code:xe.invalid_type,expected:Oe.promise,received:n.parsedType}),Qe;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return gn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ls.create=(e,t)=>new ls({type:e,typeName:We.ZodPromise,...Xe(t)});class qn extends tt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===We.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o=>{Ae(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:o,path:r.path,parent:r})}if(i.type==="refinement"){const o=a=>{const l=i.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Qe:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Qe:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!no(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>no(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);ht.assertNever(i)}}qn.create=(e,t,n)=>new qn({schema:e,typeName:We.ZodEffects,effect:t,...Xe(n)}),qn.createWithPreprocess=(e,t,n)=>new qn({schema:t,effect:{type:"preprocess",transform:e},typeName:We.ZodEffects,...Xe(n)});class Sr extends tt{_parse(t){return this._getType(t)===Oe.undefined?gn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Sr.create=(e,t)=>new Sr({innerType:e,typeName:We.ZodOptional,...Xe(t)});class Oi extends tt{_parse(t){return this._getType(t)===Oe.null?gn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Oi.create=(e,t)=>new Oi({innerType:e,typeName:We.ZodNullable,...Xe(t)});class ho extends tt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ho.create=(e,t)=>new ho({innerType:e,typeName:We.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Xe(t)});class il extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Qa(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Zn(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Zn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}il.create=(e,t)=>new il({innerType:e,typeName:We.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Xe(t)});class sl extends tt{_parse(t){if(this._getType(t)!==Oe.nan){const r=this._getOrReturnCtx(t);return Ae(r,{code:xe.invalid_type,expected:Oe.nan,received:r.parsedType}),Qe}return{status:"valid",value:t.data}}}sl.create=e=>new sl({typeName:We.ZodNaN,...Xe(e)});const PL=Symbol("zod_brand");class Jy extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class po extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Qe:s.status==="dirty"?(n.dirty(),Hy(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Qe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new po({in:t,out:n,typeName:We.ZodPipeline})}}class ol extends tt{_parse(t){const n=this._def.innerType._parse(t);return no(n)&&(n.value=Object.freeze(n.value)),n}}ol.create=(e,t)=>new ol({innerType:e,typeName:We.ZodReadonly,...Xe(t)});const Gy=(e,t={},n)=>e?ss.create().superRefine((r,i)=>{var s,o;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:l})}}):ss.create(),AL={object:Et.lazycreate};var We;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(We||(We={}));const RL=(e,t={message:`Input not instance of ${e.name}`})=>Gy(n=>n instanceof e,t),rt=Wn.create,mo=Qr.create,$L=sl.create,ML=Xr.create,Tr=ro.create,LL=Ei.create,DL=Xa.create,NL=io.create,jL=so.create,go=ss.create,UL=Si.create,FL=Er.create,BL=el.create,cs=Hn.create,jt=Et.create,VL=Et.strictCreate,ti=oo.create,zL=nl.create,ZL=ao.create,WL=lr.create,yo=lo.create,HL=rl.create,qL=Ti.create,KL=as.create,JL=co.create,nt=uo.create,GL=ei.create,YL=fo.create,QL=ls.create,Yy=qn.create,XL=Sr.create,eD=Oi.create,tD=qn.createWithPreprocess,nD=po.create;var Z=Object.freeze({__proto__:null,defaultErrorMap:to,setErrorMap:yL,getErrorMap:Ga,makeIssue:Ya,EMPTY_PATH:vL,addIssueToContext:Ae,ParseStatus:dn,INVALID:Qe,DIRTY:Hy,OK:gn,isAborted:ed,isDirty:td,isValid:no,isAsync:Qa,get util(){return ht},get objectUtil(){return Xu},ZodParsedType:Oe,getParsedType:Yr,ZodType:tt,ZodString:Wn,ZodNumber:Qr,ZodBigInt:Xr,ZodBoolean:ro,ZodDate:Ei,ZodSymbol:Xa,ZodUndefined:io,ZodNull:so,ZodAny:ss,ZodUnknown:Si,ZodNever:Er,ZodVoid:el,ZodArray:Hn,ZodObject:Et,ZodUnion:oo,ZodDiscriminatedUnion:nl,ZodIntersection:ao,ZodTuple:lr,ZodRecord:lo,ZodMap:rl,ZodSet:Ti,ZodFunction:as,ZodLazy:co,ZodLiteral:uo,ZodEnum:ei,ZodNativeEnum:fo,ZodPromise:ls,ZodEffects:qn,ZodTransformer:qn,ZodOptional:Sr,ZodNullable:Oi,ZodDefault:ho,ZodCatch:il,ZodNaN:sl,BRAND:PL,ZodBranded:Jy,ZodPipeline:po,ZodReadonly:ol,custom:Gy,Schema:tt,ZodSchema:tt,late:AL,get ZodFirstPartyTypeKind(){return We},coerce:{string:e=>Wn.create({...e,coerce:!0}),number:e=>Qr.create({...e,coerce:!0}),boolean:e=>ro.create({...e,coerce:!0}),bigint:e=>Xr.create({...e,coerce:!0}),date:e=>Ei.create({...e,coerce:!0})},any:go,array:cs,bigint:ML,boolean:Tr,date:LL,discriminatedUnion:zL,effect:Yy,enum:GL,function:KL,instanceof:RL,intersection:ZL,lazy:JL,literal:nt,map:HL,nan:$L,nativeEnum:YL,never:FL,null:jL,nullable:eD,number:mo,object:jt,oboolean:()=>Tr().optional(),onumber:()=>mo().optional(),optional:XL,ostring:()=>rt().optional(),pipeline:nD,preprocess:tD,promise:QL,record:yo,set:qL,strictObject:VL,string:rt,symbol:DL,transformer:Yy,tuple:WL,undefined:NL,union:ti,unknown:UL,void:BL,NEVER:Qe,ZodIssueCode:xe,quotelessJson:gL,ZodError:Zn});const{defaults:cr}=PM.messages,Kn={className:rt().describe("CSS className to apply to the message").optional()},Qy=cr.audio.schema.extend({...Kn,type:nt("audio")}),id=cr.card.schema.extend({type:nt("card"),subtitle:rt().optional(),imageUrl:rt().optional(),...Kn}),rD=id.omit({type:!0}),Xy=jt({items:cs(rD),...Kn,type:nt("carousel")}),ev=cr.choice.schema.extend({text:rt(),...Kn,type:nt("choice"),disableFreeText:Tr().optional()}),tv=cr.dropdown.schema.extend({text:rt(),...Kn,type:nt("dropdown")}),nv=cr.file.schema.extend({...Kn,type:nt("file")}),rv=cr.image.schema.extend({...Kn,type:nt("image")}),iv=cr.location.schema.extend({...Kn,type:nt("location")}),sv=cr.markdown.schema.extend({...Kn,type:nt("markdown")}),ov=cr.text.schema.extend({...Kn,type:nt("text")}),av=cr.video.schema.extend({...Kn,type:nt("video")}),lv=ti([Qy,id,Xy,ev,tv,nv,rv,iv,sv,ov,av]),cv=jt({type:nt("webchat_visibility"),data:jt({visibility:ti([nt("show"),nt("hide"),nt("toggle")])})}),uv=jt({type:nt("webchat_config"),data:jt({config:yo(go())})}),dv=jt({type:nt("custom"),data:jt({event:yo(go())})}),fv=ti([cv,uv,dv]),iD=fv,sD=jt({type:nt("message_created"),data:lv}),oD=Object.freeze(Object.defineProperty({__proto__:null,audioSchema:Qy,cardSchema:id,carouselSchema:Xy,choiceSchema:ev,customSchema:dv,dropdownSchema:tv,fileSchema:nv,imageSchema:rv,locationSchema:iv,markdownSchema:sv,messageCreatedSchema:sD,messageSchema:lv,textSchema:ov,triggerSchema:fv,triggerSignalSchema:iD,videoSchema:av,webchatConfigSchema:uv,webchatVisibilitySchema:cv},Symbol.toStringTag,{value:"Module"})),ur=jt({className:rt().optional(),avatarUrl:rt().url().optional()}),hv=ur.extend({type:nt("audio"),audio:rt(),title:rt().optional()}),aD=ti([jt({title:rt(),action:nt("Say something"),text:rt()}),jt({title:rt(),action:nt("Open URL"),url:rt()}),jt({title:rt(),action:nt("Postback"),payload:rt()})]),sd=ur.extend({type:nt("card"),title:rt(),subtitle:rt().optional(),image:rt().optional(),actions:cs(aD)}),pv=ur.extend({type:nt("carousel"),items:cs(sd)}),mv=ur.extend({type:nt("dropdown"),message:rt().optional(),options:cs(jt({label:rt(),value:rt()})),allowCreation:Tr().optional(),placeholderText:rt().optional(),allowMultiple:Tr().optional(),buttonText:rt().optional(),width:mo().optional(),displayInKeyboard:Tr().optional(),markdown:Tr().optional(),text:rt().optional()}),gv=ur.extend({type:nt("file"),file:rt(),title:rt().optional()}),yv=ur.extend({type:nt("image"),image:rt()}),vv=ur.extend({type:nt("location"),latitude:mo(),longitude:mo(),address:rt().optional(),title:rt().optional()}),bv=ur.extend({type:nt("single-choice"),text:rt(),disableFreeText:Tr().optional(),choices:cs(jt({title:rt(),value:rt()}))}),wv=ur.extend({type:nt("text"),text:rt(),markdown:Tr().optional()}),xv=ur.extend({type:nt("video"),video:rt(),title:rt().optional()}),_v=jt({type:nt("quick_reply"),text:rt(),payload:rt().optional()}),al=ti([hv,sd,pv,mv,gv,yv,vv,bv,wv,xv,_v]),kv=jt({type:nt("webchat-visibility"),visibility:ti([nt("show"),nt("hide"),nt("toggle")])}),Cv=jt({type:nt("webchat-config"),config:yo(go())}),Ev=jt({type:nt("custom-event"),event:yo(go())}),Sv=ti([kv,Cv,Ev]),lD=jt({type:nt("trigger"),trigger:Sv}),cD=Object.freeze(Object.defineProperty({__proto__:null,audioSchema:hv,cardSchema:sd,carouselSchame:pv,customEventSchema:Ev,dropdownSchema:mv,fileSchema:gv,imageSchema:yv,locationSchema:vv,messageSchema:al,messageSignalSchema:al,quickReplySchema:_v,singleChoiceSchema:bv,textSchema:wv,triggerSchema:Sv,triggerSignalSchema:lD,videoSchema:xv,webchatConfigSchema:Cv,webchatVisibilitySchema:kv},Symbol.toStringTag,{value:"Module"})),Tv=e=>({type:"card",title:e.title,subtitle:e.subtitle,image:e.imageUrl,actions:e.actions.map(uD)}),uD=e=>{switch(e.action){case"postback":return{title:e.label,action:"Postback",payload:e.value};case"url":return{title:e.label,action:"Open URL",url:e.value};case"say":return{title:e.label,action:"Say something",text:e.value};default:throw new Error(`Unknown action type ${e.action}`)}},Ov=e=>({...e,type:"audio",audio:e.audioUrl}),Iv=e=>Tv(e),Pv=e=>({...e,type:"carousel",items:e.items.map(Tv)}),Av=e=>({...e,type:"single-choice",text:e.text,choices:e.options.map(t=>({title:t.label,value:t.value})),disableFreeText:e.disableFreeText}),Rv=e=>({...e,type:"dropdown",message:e.text,options:e.options.map(t=>({label:t.label,value:t.value}))}),$v=e=>({...e,type:"file",file:e.fileUrl,title:e.title}),Mv=e=>({...e,type:"image",image:e.imageUrl}),Lv=e=>({...e,type:"location",latitude:e.latitude,longitude:e.longitude}),Dv=e=>({...e,type:"text",text:e.markdown,markdown:!0}),Nv=e=>({...e,type:"text",text:e.text,markdown:!0}),jv=e=>({...e,type:"video",video:e.videoUrl}),dD=e=>{switch(e.type){case"audio":return Ov(e);case"card":return Iv(e);case"carousel":return Pv(e);case"choice":return Av(e);case"dropdown":return Rv(e);case"file":return $v(e);case"image":return Mv(e);case"location":return Lv(e);case"markdown":return Dv(e);case"text":return Nv(e);case"video":return jv(e);default:throw new Error("Unsuported message type")}},Uv=e=>({type:"webchat-visibility",visibility:e.data.visibility}),Fv=e=>({type:"webchat-config",config:e.data.config}),Bv=e=>({type:"custom-event",event:e.data.event}),fD=Object.freeze(Object.defineProperty({__proto__:null,audioAdapter:Ov,cardAdapter:Iv,carouselAdapter:Pv,choiceAdapter:Av,customAdapter:Bv,dropdownAdapter:Rv,fileAdapter:$v,imageAdapter:Mv,locationAdapter:Lv,markdownAdapter:Dv,messageAdapter:dD,textAdapter:Nv,triggerAdapter:e=>{switch(e.type){case"webchat_visibility":return Uv(e);case"webchat_config":return Fv(e);case"custom":return Bv(e);default:throw new Error("unknown trigger type")}},videoAdapter:jv,webchatConfigAdapter:Fv,webchatVisibilityAdapter:Uv},Symbol.toStringTag,{value:"Module"})),Vv=e=>({type:"card",title:e.title,subtitle:e.subtitle,imageUrl:e.image,actions:e.actions.map(hD)}),hD=e=>{switch(e.action){case"Postback":return{label:e.title,action:"postback",value:e.payload};case"Open URL":return{label:e.title,action:"url",value:e.url};case"Say something":return{label:e.title,action:"say",value:e.text};default:throw new Error("Unknown action type")}},pD=e=>({...e,type:"audio",audioUrl:e.audio}),mD=e=>Vv(e),gD=e=>({...e,type:"carousel",items:e.items.map(Vv)}),yD=e=>({...e,type:"dropdown",text:e.message??"",options:e.options.map(t=>({label:t.label,value:t.value}))}),vD=e=>({...e,type:"file",fileUrl:e.file,title:e.title}),bD=e=>({...e,type:"image",imageUrl:e.image}),wD=e=>({...e,type:"location",latitude:e.latitude,longitude:e.longitude}),xD=e=>({...e,type:"choice",text:e.text,options:e.choices.map(t=>({label:t.title,value:t.value})),disableFreeText:e.disableFreeText}),_D=e=>({...e,type:"text",text:e.text}),kD=e=>({...e,type:"video",videoUrl:e.video}),CD=e=>({...e,type:"text",text:e.text??e.payload}),ED=Object.freeze(Object.defineProperty({__proto__:null,messaging:cD,messagingToWebChat:Object.freeze(Object.defineProperty({__proto__:null,messageAdapter:e=>{switch(e.type){case"audio":return pD(e);case"card":return mD(e);case"carousel":return gD(e);case"dropdown":return yD(e);case"file":return vD(e);case"image":return bD(e);case"location":return wD(e);case"single-choice":return xD(e);case"text":return _D(e);case"video":return kD(e);case"quick_reply":return CD(e);default:throw new Error("Unsuported message type")}}},Symbol.toStringTag,{value:"Module"})),webchat:oD,webchatToMessaging:fD},Symbol.toStringTag,{value:"Module"}));let ll;const SD=new Uint8Array(16);function TD(){if(!ll&&(ll=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ll))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ll(SD)}const rn=[];for(let e=0;e<256;++e)rn.push((e+256).toString(16).slice(1));function OD(e,t=0){return rn[e[t+0]]+rn[e[t+1]]+rn[e[t+2]]+rn[e[t+3]]+"-"+rn[e[t+4]]+rn[e[t+5]]+"-"+rn[e[t+6]]+rn[e[t+7]]+"-"+rn[e[t+8]]+rn[e[t+9]]+"-"+rn[e[t+10]]+rn[e[t+11]]+rn[e[t+12]]+rn[e[t+13]]+rn[e[t+14]]+rn[e[t+15]]}const zv={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ID(e,t,n){if(zv.randomUUID&&!t&&!e)return zv.randomUUID();e=e||{};const r=e.random||(e.rng||TD)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return OD(r)}const cl=e=>({block:e,type:"bubble"}),PD=e=>e.action==="Say something"?{type:"button",variant:"action",text:e.title,buttonValue:e.text,reusable:!0}:e.action==="Open URL"?{type:"button",variant:"link",text:e.title,buttonValue:e.url,reusable:!0}:{type:"button",variant:"action",text:e.title,buttonValue:e.payload,reusable:!0},Zv=({title:e,image:t,actions:n,subtitle:r})=>{const i=[];return t&&i.push({type:"image",url:t}),e&&i.push({type:"text",text:`## ${e}`}),r&&i.push({type:"text",text:r}),n.length>0&&i.push({type:"row",blocks:n.map(PD)}),{type:"column",horizontalAlignment:"center",blocks:[...i]}},AD=({choices:e,text:t})=>{const n=ID(),r=cl({type:"text",text:t});return e.length===0?r:{type:"column",horizontalAlignment:"left",blocks:[r,{type:"row",blocks:e.map(({title:i,value:s})=>({type:"button",variant:"action",text:i,buttonValue:s,groupId:n}))}]}},RD=({options:e,text:t})=>{const n=[{type:"dropdown",label:t??"Select an option",options:e}];return t&&n.unshift({type:"text",text:t}),{type:"column",blocks:n}},Wv=({type:e,audio:t})=>({type:e,url:t}),Hv=e=>cl(Zv(e)),qv=({items:e})=>({type:"carousel",blocks:e.map(Zv)}),Kv=e=>AD(e),Jv=e=>cl(RD(e)),Gv=({file:e,...t})=>({url:e,...t}),Yv=({type:e,image:t})=>({type:e,url:t}),Qv=({type:e,latitude:t,longitude:n,title:r,address:i})=>({type:e,latitude:t,longitude:n,title:r??i??"View on map"}),od=({type:e,text:t})=>cl({type:e,text:t}),Xv=({type:e,video:t})=>({type:e,url:t}),eb=e=>{switch(e.type){case"audio":return Wv(e);case"card":return Hv(e);case"carousel":return qv(e);case"single-choice":return Kv(e);case"dropdown":return Jv(e);case"file":return Gv(e);case"image":return Yv(e);case"location":return Qv(e);case"text":return od(e);case"video":return Xv(e);default:throw new Error("Unsuported message type")}},{webchatToMessaging:Jn}=ED,$D=e=>{const t=Jn.audioAdapter(e);return Wv(t)},MD=e=>{const t=Jn.cardAdapter(e);return Hv(t)},LD=e=>{const t=Jn.carouselAdapter(e);return qv(t)},DD=e=>{const t=Jn.choiceAdapter(e);return Kv(t)},ND=e=>{const t=Jn.dropdownAdapter(e);return Jv(t)},jD=e=>{const t=Jn.fileAdapter(e);return Gv(t)},UD=e=>{const t=Jn.imageAdapter(e);return Yv(t)},FD=e=>{const t=Jn.locationAdapter(e);return Qv(t)},BD=e=>{const t=Jn.markdownAdapter(e);return od(t)},VD=e=>{const t=Jn.textAdapter(e);return od(t)},zD=e=>{const t=Jn.videoAdapter(e);return Xv(t)},ZD=e=>{switch(e.type){case"audio":return $D(e);case"card":return MD(e);case"carousel":return LD(e);case"choice":return DD(e);case"dropdown":return ND(e);case"file":return jD(e);case"image":return UD(e);case"location":return FD(e);case"markdown":return BD(e);case"text":return VD(e);case"video":return zD(e);default:throw new Error("Unsuported message type")}};class tb{constructor(t){E(this,"socket");E(this,"clientId");E(this,"userId");E(this,"conversationId");E(this,"userToken");E(this,"connected",!1);E(this,"emitter");E(this,"on");E(this,"mode","messaging");this.socket=new Mm.MessagingSocket(t),this.emitter=new jl,this.clientId=t.clientId,this.on=this.emitter.on.bind(this.emitter),this.socket.on("message",n=>{const r=n.payload;if(r.type==="trigger")switch(r.trigger.type){case"webchat-visibility":this.emitter.emit("webchatVisibility",r.trigger.visibility);break;case"webchat-config":this.emitter.emit("webchatConfig",r.trigger.config);break;case"custom-event":this.emitter.emit("customEvent",r.trigger.event);break}else{const i=al.parse(r),s=eb(i);this.emitter.emit("message",{...n,payload:s})}}),this.socket.on("conversation",n=>{this.emitter.emit("conversation",n)})}async connect(t,n){if(this.connected)return;this.connected=!0;const r=await this.socket.connect(t,n).catch(i=>{throw this.connected=!1,i});return this.userId=r.userId,this.userToken=r.userToken,r}async disconnect(){await this.socket.disconnect(),this.connected=!1}async sendMessage(t){this.conversationId||await this.newConversation(),await this.socket.sendText(t),this.emitter.emit("messageSent",t)}async sendEvent(t){this.conversationId||await this.newConversation(),await this.socket.sendPayload({type:"trigger",payload:t})}async switchConversation(t){await this.socket.switchConversation(t),this.conversationId=t}async conversationExists(t){return(await this.socket.listConversations()).some(r=>r.id===t)}async newConversation(){const{id:t}=await this.socket.createConversation();await this.socket.startConversation(),this.conversationId=t}async listMessages(t){return(await this.socket.listMessages(t)).map(r=>{const i=al.parse(r.payload),s=eb(i);return{...r,payload:s}})}}function nb(e,t){return function(){return e.apply(t,arguments)}}const{toString:rb}=Object.prototype,{getPrototypeOf:ad}=Object,ld=(e=>t=>{const n=rb.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Or=e=>(e=e.toLowerCase(),t=>ld(t)===e),ul=e=>t=>typeof t===e,{isArray:us}=Array,vo=ul("undefined");function WD(e){return e!==null&&!vo(e)&&e.constructor!==null&&!vo(e.constructor)&&Ii(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ib=Or("ArrayBuffer");function HD(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ib(e.buffer),t}const qD=ul("string"),Ii=ul("function"),sb=ul("number"),cd=e=>e!==null&&typeof e=="object",KD=e=>e===!0||e===!1,dl=e=>{if(ld(e)!=="object")return!1;const t=ad(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},JD=Or("Date"),GD=Or("File"),YD=Or("Blob"),QD=Or("FileList"),XD=e=>cd(e)&&Ii(e.pipe),eN=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||rb.call(e)===t||Ii(e.toString)&&e.toString()===t)},tN=Or("URLSearchParams"),nN=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function bo(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),us(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(r=0;r<o;r++)a=s[r],t.call(null,e[a],a,e)}}function ob(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const ab=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),lb=e=>!vo(e)&&e!==ab;function ud(){const{caseless:e}=lb(this)&&this||{},t={},n=(r,i)=>{const s=e&&ob(t,i)||i;dl(t[s])&&dl(r)?t[s]=ud(t[s],r):dl(r)?t[s]=ud({},r):us(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&bo(arguments[r],n);return t}const rN=(e,t,n,{allOwnKeys:r}={})=>(bo(t,(i,s)=>{n&&Ii(i)?e[s]=nb(i,n):e[s]=i},{allOwnKeys:r}),e),iN=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),sN=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},oN=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&ad(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},aN=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},lN=e=>{if(!e)return null;if(us(e))return e;let t=e.length;if(!sb(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},cN=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ad(Uint8Array)),uN=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},dN=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},fN=Or("HTMLFormElement"),hN=e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),cb=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),pN=Or("RegExp"),ub=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};bo(n,(i,s)=>{t(i,s,e)!==!1&&(r[s]=i)}),Object.defineProperties(e,r)},te={isArray:us,isArrayBuffer:ib,isBuffer:WD,isFormData:eN,isArrayBufferView:HD,isString:qD,isNumber:sb,isBoolean:KD,isObject:cd,isPlainObject:dl,isUndefined:vo,isDate:JD,isFile:GD,isBlob:YD,isRegExp:pN,isFunction:Ii,isStream:XD,isURLSearchParams:tN,isTypedArray:cN,isFileList:QD,forEach:bo,merge:ud,extend:rN,trim:nN,stripBOM:iN,inherits:sN,toFlatObject:oN,kindOf:ld,kindOfTest:Or,endsWith:aN,toArray:lN,forEachEntry:uN,matchAll:dN,isHTMLForm:fN,hasOwnProperty:cb,hasOwnProp:cb,reduceDescriptors:ub,freezeMethods:e=>{ub(e,(t,n)=>{if(Ii(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ii(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return us(e)?r(e):r(String(e).split(t)),n},toCamelCase:hN,noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:ob,global:ab,isContextDefined:lb,toJSONObject:e=>{const t=new Array(10),n=(r,i)=>{if(cd(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=us(r)?[]:{};return bo(r,(o,a)=>{const l=n(o,i+1);!vo(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)}};function dt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}te.inherits(dt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:te.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const db=dt.prototype,fb={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{fb[e]={value:e}}),Object.defineProperties(dt,fb),Object.defineProperty(db,"isAxiosError",{value:!0}),dt.from=(e,t,n,r,i,s)=>{const o=Object.create(db);return te.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),dt.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};var mN=typeof self=="object"?self.FormData:window.FormData;const gN=ai(mN);function dd(e){return te.isPlainObject(e)||te.isArray(e)}function hb(e){return te.endsWith(e,"[]")?e.slice(0,-2):e}function pb(e,t,n){return e?e.concat(t).map(function(i,s){return i=hb(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function yN(e){return te.isArray(e)&&!e.some(dd)}const vN=te.toFlatObject(te,{},null,function(t){return/^is[A-Z]/.test(t)});function bN(e){return e&&te.isFunction(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator]}function fl(e,t,n){if(!te.isObject(e))throw new TypeError("target must be an object");t=t||new(gN||FormData),n=te.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,v){return!te.isUndefined(v[m])});const r=n.metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&bN(t);if(!te.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(te.isDate(p))return p.toISOString();if(!l&&te.isBlob(p))throw new dt("Blob is not supported. Use a Buffer instead.");return te.isArrayBuffer(p)||te.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,v){let y=p;if(p&&!v&&typeof p=="object"){if(te.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(te.isArray(p)&&yN(p)||te.isFileList(p)||te.endsWith(m,"[]")&&(y=te.toArray(p)))return m=hb(m),y.forEach(function(x,I){!(te.isUndefined(x)||x===null)&&t.append(o===!0?pb([m],I,s):o===null?m:m+"[]",c(x))}),!1}return dd(p)?!0:(t.append(pb(v,m,s),c(p)),!1)}const d=[],h=Object.assign(vN,{defaultVisitor:u,convertValue:c,isVisitable:dd});function f(p,m){if(!te.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),te.forEach(p,function(y,b){(!(te.isUndefined(y)||y===null)&&i.call(t,y,te.isString(b)?b.trim():b,m,h))===!0&&f(y,m?m.concat(b):[b])}),d.pop()}}if(!te.isObject(e))throw new TypeError("data must be an object");return f(e),t}function mb(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function fd(e,t){this._pairs=[],e&&fl(e,this,t)}const gb=fd.prototype;gb.append=function(t,n){this._pairs.push([t,n])},gb.toString=function(t){const n=t?function(r){return t.call(this,r,mb)}:mb;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function wN(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function yb(e,t,n){if(!t)return e;const r=n&&n.encode||wN,i=n&&n.serialize;let s;if(i?s=i(t,n):s=te.isURLSearchParams(t)?t.toString():new fd(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class xN{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){te.forEach(this.handlers,function(r){r!==null&&t(r)})}}const vb=xN,bb={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_N=typeof URLSearchParams<"u"?URLSearchParams:fd,kN=FormData,CN=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),EN=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),dr={isBrowser:!0,classes:{URLSearchParams:_N,FormData:kN,Blob},isStandardBrowserEnv:CN,isStandardBrowserWebWorkerEnv:EN,protocols:["http","https","file","blob","url","data"]};function SN(e,t){return fl(e,new dr.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return dr.isNode&&te.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function TN(e){return te.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function ON(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function wb(e){function t(n,r,i,s){let o=n[s++];const a=Number.isFinite(+o),l=s>=n.length;return o=!o&&te.isArray(i)?i.length:o,l?(te.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!te.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&te.isArray(i[o])&&(i[o]=ON(i[o])),!a)}if(te.isFormData(e)&&te.isFunction(e.entries)){const n={};return te.forEachEntry(e,(r,i)=>{t(TN(r),i,n,0)}),n}return null}const IN={"Content-Type":void 0};function PN(e,t,n){if(te.isString(e))try{return(t||JSON.parse)(e),te.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const hl={transitional:bb,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=te.isObject(t);if(s&&te.isHTMLForm(t)&&(t=new FormData(t)),te.isFormData(t))return i&&i?JSON.stringify(wb(t)):t;if(te.isArrayBuffer(t)||te.isBuffer(t)||te.isStream(t)||te.isFile(t)||te.isBlob(t))return t;if(te.isArrayBufferView(t))return t.buffer;if(te.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return SN(t,this.formSerializer).toString();if((a=te.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return fl(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),PN(t)):t}],transformResponse:[function(t){const n=this.transitional||hl.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(t&&te.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?dt.from(a,dt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:dr.classes.FormData,Blob:dr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};te.forEach(["delete","get","head"],function(t){hl.headers[t]={}}),te.forEach(["post","put","patch"],function(t){hl.headers[t]=te.merge(IN)});const hd=hl,AN=te.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),RN=e=>{const t={};let n,r,i;return e&&e.split(`
278
+ `).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&AN[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},xb=Symbol("internals");function wo(e){return e&&String(e).trim().toLowerCase()}function pl(e){return e===!1||e==null?e:te.isArray(e)?e.map(pl):String(e)}function $N(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}function MN(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function _b(e,t,n,r){if(te.isFunction(r))return r.call(this,t,n);if(te.isString(t)){if(te.isString(r))return t.indexOf(r)!==-1;if(te.isRegExp(r))return r.test(t)}}function LN(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function DN(e,t){const n=te.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}class ml{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,c){const u=wo(l);if(!u)throw new Error("header name must be a non-empty string");const d=te.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=pl(a))}const o=(a,l)=>te.forEach(a,(c,u)=>s(c,u,l));return te.isPlainObject(t)||t instanceof this.constructor?o(t,n):te.isString(t)&&(t=t.trim())&&!MN(t)?o(RN(t),n):t!=null&&s(n,t,r),this}get(t,n){if(t=wo(t),t){const r=te.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return $N(i);if(te.isFunction(n))return n.call(this,i,r);if(te.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=wo(t),t){const r=te.findKey(this,t);return!!(r&&(!n||_b(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=wo(o),o){const a=te.findKey(r,o);a&&(!n||_b(r,r[a],a,n))&&(delete r[a],i=!0)}}return te.isArray(t)?t.forEach(s):s(t),i}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(t){const n=this,r={};return te.forEach(this,(i,s)=>{const o=te.findKey(r,s);if(o){n[o]=pl(i),delete n[s];return}const a=t?LN(s):String(s).trim();a!==s&&delete n[s],n[a]=pl(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return te.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&te.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
279
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[xb]=this[xb]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=wo(o);r[a]||(DN(i,o),r[a]=!0)}return te.isArray(t)?t.forEach(s):s(t),this}}ml.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),te.freezeMethods(ml.prototype),te.freezeMethods(ml);const Ir=ml;function pd(e,t){const n=this||hd,r=t||n,i=Ir.from(r.headers);let s=r.data;return te.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function kb(e){return!!(e&&e.__CANCEL__)}function xo(e,t,n){dt.call(this,e??"canceled",dt.ERR_CANCELED,t,n),this.name="CanceledError"}te.inherits(xo,dt,{__CANCEL__:!0});const NN=null;function jN(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new dt("Request failed with status code "+n.status,[dt.ERR_BAD_REQUEST,dt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const UN=dr.isStandardBrowserEnv?function(){return{write:function(n,r,i,s,o,a){const l=[];l.push(n+"="+encodeURIComponent(r)),te.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),te.isString(s)&&l.push("path="+s),te.isString(o)&&l.push("domain="+o),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function FN(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function BN(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Cb(e,t){return e&&!FN(t)?BN(e,t):t}const VN=dr.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let o=s;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(o){const a=te.isString(o)?i(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function zN(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function ZN(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[s];o||(o=c),n[i]=l,r[i]=c;let d=s,h=0;for(;d!==i;)h+=n[d++],d=d%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function Eb(e,t){let n=0;const r=ZN(50,250);return i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-n,l=r(a),c=s<=o;n=s;const u={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&c?(o-s)/l:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}const gl={http:NN,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let i=e.data;const s=Ir.from(e.headers).normalize(),o=e.responseType;let a;function l(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}te.isFormData(i)&&(dr.isStandardBrowserEnv||dr.isStandardBrowserWebWorkerEnv)&&s.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const f=e.auth.username||"",p=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(f+":"+p))}const u=Cb(e.baseURL,e.url);c.open(e.method.toUpperCase(),yb(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function d(){if(!c)return;const f=Ir.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),m={data:!o||o==="text"||o==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:f,config:e,request:c};jN(function(y){n(y),l()},function(y){r(y),l()},m),c=null}if("onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(d)},c.onabort=function(){c&&(r(new dt("Request aborted",dt.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new dt("Network Error",dt.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let p=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const m=e.transitional||bb;e.timeoutErrorMessage&&(p=e.timeoutErrorMessage),r(new dt(p,m.clarifyTimeoutError?dt.ETIMEDOUT:dt.ECONNABORTED,e,c)),c=null},dr.isStandardBrowserEnv){const f=(e.withCredentials||VN(u))&&e.xsrfCookieName&&UN.read(e.xsrfCookieName);f&&s.set(e.xsrfHeaderName,f)}i===void 0&&s.setContentType(null),"setRequestHeader"in c&&te.forEach(s.toJSON(),function(p,m){c.setRequestHeader(m,p)}),te.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&o!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",Eb(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",Eb(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=f=>{c&&(r(!f||f.type?new xo(null,e,c):f),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const h=zN(u);if(h&&dr.protocols.indexOf(h)===-1){r(new dt("Unsupported protocol "+h+":",dt.ERR_BAD_REQUEST,e));return}c.send(i||null)})}};te.forEach(gl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const WN={getAdapter:e=>{e=te.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=te.isString(n)?gl[n.toLowerCase()]:n));i++);if(!r)throw r===!1?new dt(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(te.hasOwnProp(gl,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!te.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:gl};function md(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xo(null,e)}function Sb(e){return md(e),e.headers=Ir.from(e.headers),e.data=pd.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),WN.getAdapter(e.adapter||hd.adapter)(e).then(function(r){return md(e),r.data=pd.call(e,e.transformResponse,r),r.headers=Ir.from(r.headers),r},function(r){return kb(r)||(md(e),r&&r.response&&(r.response.data=pd.call(e,e.transformResponse,r.response),r.response.headers=Ir.from(r.response.headers))),Promise.reject(r)})}const Tb=e=>e instanceof Ir?e.toJSON():e;function ds(e,t){t=t||{};const n={};function r(c,u,d){return te.isPlainObject(c)&&te.isPlainObject(u)?te.merge.call({caseless:d},c,u):te.isPlainObject(u)?te.merge({},u):te.isArray(u)?u.slice():u}function i(c,u,d){if(te.isUndefined(u)){if(!te.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function s(c,u){if(!te.isUndefined(u))return r(void 0,u)}function o(c,u){if(te.isUndefined(u)){if(!te.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u)=>i(Tb(c),Tb(u),!0)};return te.forEach(Object.keys(e).concat(Object.keys(t)),function(u){const d=l[u]||i,h=d(e[u],t[u],u);te.isUndefined(h)&&d!==a||(n[u]=h)}),n}const Ob="1.2.5",gd={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{gd[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ib={};gd.transitional=function(t,n,r){function i(s,o){return"[Axios v"+Ob+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new dt(i(o," has been removed"+(n?" in "+n:"")),dt.ERR_DEPRECATED);return n&&!Ib[o]&&(Ib[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,a):!0}};function HN(e,t,n){if(typeof e!="object")throw new dt("options must be an object",dt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new dt("option "+s+" must be "+l,dt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new dt("Unknown option "+s,dt.ERR_BAD_OPTION)}}const yd={assertOptions:HN,validators:gd},ni=yd.validators;class yl{constructor(t){this.defaults=t,this.interceptors={request:new vb,response:new vb}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ds(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&yd.assertOptions(r,{silentJSONParsing:ni.transitional(ni.boolean),forcedJSONParsing:ni.transitional(ni.boolean),clarifyTimeoutError:ni.transitional(ni.boolean)},!1),i!==void 0&&yd.assertOptions(i,{encode:ni.function,serialize:ni.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o;o=s&&te.merge(s.common,s[n.method]),o&&te.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=Ir.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const p=[Sb.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(d=0;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(v){m.call(this,v);break}}try{u=Sb.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=ds(this.defaults,t);const n=Cb(t.baseURL,t.url);return yb(n,t.params,t.paramsSerializer)}}te.forEach(["delete","get","head","options"],function(t){yl.prototype[t]=function(n,r){return this.request(ds(r||{},{method:t,url:n,data:(r||{}).data}))}}),te.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(ds(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}yl.prototype[t]=n(),yl.prototype[t+"Form"]=n(!0)});const vl=yl;class vd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new xo(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new vd(function(i){t=i}),cancel:t}}}const qN=vd;function KN(e){return function(n){return e.apply(null,n)}}function JN(e){return te.isObject(e)&&e.isAxiosError===!0}const bd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(bd).forEach(([e,t])=>{bd[t]=e});const GN=bd;function Pb(e){const t=new vl(e),n=nb(vl.prototype.request,t);return te.extend(n,vl.prototype,t,{allOwnKeys:!0}),te.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Pb(ds(e,i))},n}const zt=Pb(hd);zt.Axios=vl,zt.CanceledError=xo,zt.CancelToken=qN,zt.isCancel=kb,zt.VERSION=Ob,zt.toFormData=fl,zt.AxiosError=dt,zt.Cancel=zt.CanceledError,zt.all=function(t){return Promise.all(t)},zt.spread=KN,zt.isAxiosError=JN,zt.mergeConfig=ds,zt.AxiosHeaders=Ir,zt.formToJSON=e=>wb(te.isHTMLForm(e)?new FormData(e):e),zt.HttpStatusCode=GN,zt.default=zt;const Pt=zt,Ut="https://webchat.botpress.cloud".replace(/\/+$/,"");class YN{constructor(t,n=Ut,r=Pt){E(this,"configuration");this.basePath=n,this.axios=r,t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}}class QN extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}}const Zt="https://example.com",pt=function(e,t,n){if(n==null)throw new QN(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function wd(e,t,n=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>wd(e,r,n)):Object.keys(t).forEach(r=>wd(e,t[r],`${n}${n!==""?".":""}${r}`)):e.has(n)?e.append(n,t):e.set(n,t))}const Wt=function(e,...t){const n=new URLSearchParams(e.search);wd(n,t),e.search=n.toString()},fs=function(e,t,n){const r=typeof e!="string";return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},Ht=function(e){return e.pathname+e.search+e.hash},qt=function(e,t,n,r){return(i=t,s=n)=>{const o={...e.options,url:((r==null?void 0:r.basePath)||s)+e.url};return i.request(o)}},XN=function(e){return{addParticipant:async(t,n,r,i={})=>{pt("addParticipant","xUserKey",t),pt("addParticipant","id",n);const s="/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...i},c={},u={};t!=null&&(c["x-user-key"]=String(t)),c["Content-Type"]="application/json",Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},l.data=fs(r,l,e),{url:Ht(o),options:l}},createConversation:async(t,n,r={})=>{pt("createConversation","xUserKey",t);const i="/conversations",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"POST",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=fs(n,a,e),{url:Ht(s),options:a}},createEvent:async(t,n,r={})=>{pt("createEvent","xUserKey",t);const i="/events",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"POST",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=fs(n,a,e),{url:Ht(s),options:a}},createMessage:async(t,n,r={})=>{pt("createMessage","xUserKey",t);const i="/messages",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"POST",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=fs(n,a,e),{url:Ht(s),options:a}},createUser:async(t,n={})=>{const r="/users",i=new URL(r,Zt);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",Wt(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=fs(t,o,e),{url:Ht(i),options:o}},deleteConversation:async(t,n,r={})=>{pt("deleteConversation","xUserKey",t),pt("deleteConversation","id",n);const i="/conversations/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"DELETE",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},deleteMessage:async(t,n,r={})=>{pt("deleteMessage","xUserKey",t),pt("deleteMessage","id",n);const i="/messages/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"DELETE",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},deleteUser:async(t,n={})=>{pt("deleteUser","xUserKey",t);const r="/users/me",i=new URL(r,Zt);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...n},a={},l={};t!=null&&(a["x-user-key"]=String(t)),Wt(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:Ht(i),options:o}},getConversation:async(t,n,r={})=>{pt("getConversation","xUserKey",t),pt("getConversation","id",n);const i="/conversations/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},getEvent:async(t,n,r={})=>{pt("getEvent","xUserKey",t),pt("getEvent","id",n);const i="/events/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},getMessage:async(t,n,r={})=>{pt("getMessage","xUserKey",t),pt("getMessage","id",n);const i="/messages/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},getParticipant:async(t,n,r,i={})=>{pt("getParticipant","xUserKey",t),pt("getParticipant","id",n),pt("getParticipant","userId",r);const s="/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(n))).replace("{userId}",encodeURIComponent(String(r))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"GET",...a,...i},c={},u={};t!=null&&(c["x-user-key"]=String(t)),Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:Ht(o),options:l}},getUser:async(t,n={})=>{pt("getUser","xUserKey",t);const r="/users/me",i=new URL(r,Zt);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...n},a={},l={};t!=null&&(a["x-user-key"]=String(t)),Wt(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:Ht(i),options:o}},listConversationMessages:async(t,n,r,i={})=>{pt("listConversationMessages","xUserKey",t),pt("listConversationMessages","id",n);const s="/conversations/{id}/messages".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"GET",...a,...i},c={},u={};r!==void 0&&(u.nextToken=r),t!=null&&(c["x-user-key"]=String(t)),Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:Ht(o),options:l}},listConversations:async(t,n,r={})=>{pt("listConversations","xUserKey",t);const i="/conversations",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},listParticipants:async(t,n,r,i={})=>{pt("listParticipants","xUserKey",t),pt("listParticipants","id",n);const s="/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"GET",...a,...i},c={},u={};r!==void 0&&(u.nextToken=r),t!=null&&(c["x-user-key"]=String(t)),Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:Ht(o),options:l}},listenConversation:async(t,n,r={})=>{pt("listenConversation","xUserKey",t),pt("listenConversation","id",n);const i="/conversations/{id}/listen".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},removeParticipant:async(t,n,r,i={})=>{pt("removeParticipant","xUserKey",t),pt("removeParticipant","id",n),pt("removeParticipant","userId",r);const s="/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(n))).replace("{userId}",encodeURIComponent(String(r))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"DELETE",...a,...i},c={},u={};t!=null&&(c["x-user-key"]=String(t)),Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:Ht(o),options:l}},updateUser:async(t,n,r={})=>{pt("updateUser","xUserKey",t);const i="/users/me",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"PUT",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=fs(n,a,e),{url:Ht(s),options:a}}}},Kt=function(e){const t=XN(e);return{async addParticipant(n,r,i,s){const o=await t.addParticipant(n,r,i,s);return qt(o,Pt,Ut,e)},async createConversation(n,r,i){const s=await t.createConversation(n,r,i);return qt(s,Pt,Ut,e)},async createEvent(n,r,i){const s=await t.createEvent(n,r,i);return qt(s,Pt,Ut,e)},async createMessage(n,r,i){const s=await t.createMessage(n,r,i);return qt(s,Pt,Ut,e)},async createUser(n,r){const i=await t.createUser(n,r);return qt(i,Pt,Ut,e)},async deleteConversation(n,r,i){const s=await t.deleteConversation(n,r,i);return qt(s,Pt,Ut,e)},async deleteMessage(n,r,i){const s=await t.deleteMessage(n,r,i);return qt(s,Pt,Ut,e)},async deleteUser(n,r){const i=await t.deleteUser(n,r);return qt(i,Pt,Ut,e)},async getConversation(n,r,i){const s=await t.getConversation(n,r,i);return qt(s,Pt,Ut,e)},async getEvent(n,r,i){const s=await t.getEvent(n,r,i);return qt(s,Pt,Ut,e)},async getMessage(n,r,i){const s=await t.getMessage(n,r,i);return qt(s,Pt,Ut,e)},async getParticipant(n,r,i,s){const o=await t.getParticipant(n,r,i,s);return qt(o,Pt,Ut,e)},async getUser(n,r){const i=await t.getUser(n,r);return qt(i,Pt,Ut,e)},async listConversationMessages(n,r,i,s){const o=await t.listConversationMessages(n,r,i,s);return qt(o,Pt,Ut,e)},async listConversations(n,r,i){const s=await t.listConversations(n,r,i);return qt(s,Pt,Ut,e)},async listParticipants(n,r,i,s){const o=await t.listParticipants(n,r,i,s);return qt(o,Pt,Ut,e)},async listenConversation(n,r,i){const s=await t.listenConversation(n,r,i);return qt(s,Pt,Ut,e)},async removeParticipant(n,r,i,s){const o=await t.removeParticipant(n,r,i,s);return qt(o,Pt,Ut,e)},async updateUser(n,r,i){const s=await t.updateUser(n,r,i);return qt(s,Pt,Ut,e)}}};class e2 extends YN{addParticipant(t,n){return Kt(this.configuration).addParticipant(t.xUserKey,t.id,t.addParticipantBody,n).then(r=>r(this.axios,this.basePath))}createConversation(t,n){return Kt(this.configuration).createConversation(t.xUserKey,t.createConversationBody,n).then(r=>r(this.axios,this.basePath))}createEvent(t,n){return Kt(this.configuration).createEvent(t.xUserKey,t.createEventBody,n).then(r=>r(this.axios,this.basePath))}createMessage(t,n){return Kt(this.configuration).createMessage(t.xUserKey,t.createMessageBody,n).then(r=>r(this.axios,this.basePath))}createUser(t={},n){return Kt(this.configuration).createUser(t.createUserBody,n).then(r=>r(this.axios,this.basePath))}deleteConversation(t,n){return Kt(this.configuration).deleteConversation(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}deleteMessage(t,n){return Kt(this.configuration).deleteMessage(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}deleteUser(t,n){return Kt(this.configuration).deleteUser(t.xUserKey,n).then(r=>r(this.axios,this.basePath))}getConversation(t,n){return Kt(this.configuration).getConversation(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}getEvent(t,n){return Kt(this.configuration).getEvent(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}getMessage(t,n){return Kt(this.configuration).getMessage(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}getParticipant(t,n){return Kt(this.configuration).getParticipant(t.xUserKey,t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}getUser(t,n){return Kt(this.configuration).getUser(t.xUserKey,n).then(r=>r(this.axios,this.basePath))}listConversationMessages(t,n){return Kt(this.configuration).listConversationMessages(t.xUserKey,t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listConversations(t,n){return Kt(this.configuration).listConversations(t.xUserKey,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listParticipants(t,n){return Kt(this.configuration).listParticipants(t.xUserKey,t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listenConversation(t,n){return Kt(this.configuration).listenConversation(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}removeParticipant(t,n){return Kt(this.configuration).removeParticipant(t.xUserKey,t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}updateUser(t,n){return Kt(this.configuration).updateUser(t.xUserKey,t.updateUserBody,n).then(r=>r(this.axios,this.basePath))}}const t2={getRandomValues:e=>new Uint8Array(e.map(()=>Math.floor(Math.random()*256)))};let xd=typeof window<"u"&&typeof window.document<"u"?window.crypto:Au;xd.getRandomValues||(xd=t2);class wt extends Error{constructor(n,r,i,s,o,a){super(s);E(this,"isApiError",!0);this.code=n,this.description=r,this.type=i,this.message=s,this.error=o,this.id=a,this.id||(this.id=wt.generateId())}format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){const n=this.getPrefix(),r=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],i=4,s=Array.from(xd.getRandomValues(new Uint8Array(i))).map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase();return`${n}_${r}x${s}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}}const n2=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,_d=e=>e instanceof wt||n2(e)&&e.isApiError===!0;class _o extends wt{constructor(t,n,r){super(500,"An unknown error occurred","Unknown",t,n,r)}}class r2 extends wt{constructor(t,n,r){super(500,"An internal error occurred","Internal",t,n,r)}}class i2 extends wt{constructor(t,n,r){super(401,"The request requires to be authenticated.","Unauthorized",t,n,r)}}class s2 extends wt{constructor(t,n,r){super(403,"The requested action can't be peform by this resource.","Forbidden",t,n,r)}}class o2 extends wt{constructor(t,n,r){super(413,"The request payload is too large.","PayloadTooLarge",t,n,r)}}class a2 extends wt{constructor(t,n,r){super(400,"The request payload is invalid.","InvalidPayload",t,n,r)}}class l2 extends wt{constructor(t,n,r){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,n,r)}}class c2 extends wt{constructor(t,n,r){super(405,"The requested method does not exist.","MethodNotFound",t,n,r)}}class u2 extends wt{constructor(t,n,r){super(404,"The requested resource does not exist.","ResourceNotFound",t,n,r)}}class d2 extends wt{constructor(t,n,r){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,n,r)}}class f2 extends wt{constructor(t,n,r){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,n,r)}}class h2 extends wt{constructor(t,n,r){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",t,n,r)}}class p2 extends wt{constructor(t,n,r){super(409,"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together.","RelationConflict",t,n,r)}}class m2 extends wt{constructor(t,n,r){super(409,"The resource cannot be deleted because it's referenced by another resource","ReferenceConstraint",t,n,r)}}class g2 extends wt{constructor(t,n,r){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,n,r)}}class y2 extends wt{constructor(t,n,r){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,n,r)}}class v2 extends wt{constructor(t,n,r){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,n,r)}}class b2 extends wt{constructor(t,n,r){super(409,"The record attempted to be created already exists.","AlreadyExists",t,n,r)}}class w2 extends wt{constructor(t,n,r){super(429,"The request has been rate limited.","RateLimited",t,n,r)}}class x2 extends wt{constructor(t,n,r){super(402,"A payment is required to perform this request.","PaymentRequired",t,n,r)}}class _2 extends wt{constructor(t,n,r){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",t,n,r)}}class k2 extends wt{constructor(t,n,r){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",t,n,r)}}class C2 extends wt{constructor(t,n,r){super(400,"Request payload contains breaking changes which is not allowed for this resource without a version increment.","BreakingChanges",t,n,r)}}const E2={Unknown:_o,Internal:r2,Unauthorized:i2,Forbidden:s2,PayloadTooLarge:o2,InvalidPayload:a2,UnsupportedMediaType:l2,MethodNotFound:c2,ResourceNotFound:u2,InvalidJsonSchema:d2,InvalidDataFormat:f2,InvalidIdentifier:h2,RelationConflict:p2,ReferenceConstraint:m2,ReferenceNotFound:g2,InvalidQuery:y2,Runtime:v2,AlreadyExists:b2,RateLimited:w2,PaymentRequired:x2,QuotaExceeded:_2,LimitExceeded:k2,BreakingChanges:C2},Ab=e=>_d(e)?e:e instanceof Error?new _o(e.message,e):typeof e=="string"?new _o(e):S2(e);function S2(e){if(typeof e=="object"&&"code"in e&&"type"in e&&"id"in e&&"message"in e&&typeof e.type=="string"&&typeof e.message=="string"){const t=E2[e.type];return t?new t(e.message,void 0,e.id||"UNKNOWN"):new _o(`An unclassified API error occurred: ${e.message} (Type: ${e.type}, Code: ${e.code})`)}return new _o("An invalid error occurred: "+JSON.stringify(e))}class T2{constructor(t,n,r){E(this,"_innerClient");E(this,"addParticipant",({id:t,xUserKey:n,...r})=>this._innerClient.addParticipant({id:t,xUserKey:n,addParticipantBody:r}).then(i=>i.data).catch(i=>{throw Jt(i)}));E(this,"createConversation",({xUserKey:t,...n})=>this._innerClient.createConversation({xUserKey:t,createConversationBody:n}).then(r=>r.data).catch(r=>{throw Jt(r)}));E(this,"deleteConversation",t=>this._innerClient.deleteConversation(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"getConversation",t=>this._innerClient.getConversation(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"getParticipant",t=>this._innerClient.getParticipant(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"listConversationMessages",t=>this._innerClient.listConversationMessages(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"listConversations",t=>this._innerClient.listConversations(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"listParticipants",t=>this._innerClient.listParticipants(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"listenConversation",t=>this._innerClient.listenConversation(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"removeParticipant",t=>this._innerClient.removeParticipant(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"createMessage",({xUserKey:t,...n})=>this._innerClient.createMessage({xUserKey:t,createMessageBody:n}).then(r=>r.data).catch(r=>{throw Jt(r)}));E(this,"deleteMessage",t=>this._innerClient.deleteMessage(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"getMessage",t=>this._innerClient.getMessage(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"createUser",t=>this._innerClient.createUser({createUserBody:t}).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"deleteUser",t=>this._innerClient.deleteUser(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"getUser",t=>this._innerClient.getUser(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"updateUser",({xUserKey:t,...n})=>this._innerClient.updateUser({xUserKey:t,updateUserBody:n}).then(r=>r.data).catch(r=>{throw Jt(r)}));E(this,"createEvent",({xUserKey:t,...n})=>this._innerClient.createEvent({xUserKey:t,createEventBody:n}).then(r=>r.data).catch(r=>{throw Jt(r)}));E(this,"getEvent",t=>this._innerClient.getEvent(t).then(n=>n.data).catch(n=>{throw Jt(n)}));this._innerClient=new e2(t,n,r)}}function Jt(e){var t;return Pt.isAxiosError(e)&&((t=e.response)!=null&&t.data)?Ab(e.response.data):Ab(e)}class Rb{constructor(){E(this,"listeners",{})}emit(t,n){const r=this.listeners[t];if(r)for(const i of[...r])i(n)}onceOrMore(t,n){const r=i=>{n(i)==="stop-listening"&&this.off(t,r)};this.on(t,r)}once(t,n){const r=i=>{this.off(t,r),n(i)};this.on(t,r)}on(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}off(t,n){const r=this.listeners[t];if(!r)return;const i=r.indexOf(n);i!==-1&&r.splice(i,1)}cleanup(){this.listeners={}}}var kd={exports:{}};/** @license
280
280
  * eventsource.js
281
281
  * Available under MIT License (MIT)
282
282
  * https://github.com/Yaffle/EventSource/
283
- */(function(e,t){(function(n){var r=n.setTimeout,i=n.clearTimeout,s=n.XMLHttpRequest,o=n.XDomainRequest,a=n.ActiveXObject,l=n.EventSource,c=n.document,u=n.Promise,d=n.fetch,h=n.Response,f=n.TextDecoder,p=n.TextEncoder,m=n.AbortController;if(typeof window<"u"&&typeof c<"u"&&!("readyState"in c)&&c.body==null&&(c.readyState="loading",window.addEventListener("load",function(D){c.readyState="complete"},!1)),s==null&&a!=null&&(s=function(){return new a("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(D){function ne(){}return ne.prototype=D,new ne}),Date.now||(Date.now=function(){return new Date().getTime()}),m==null){var y=d;d=function(D,ne){var me=ne.signal;return y(D,{headers:ne.headers,credentials:ne.credentials,cache:ne.cache}).then(function(he){var Le=he.body.getReader();return me._reader=Le,me._aborted&&me._reader.cancel(),{status:he.status,statusText:he.statusText,headers:he.headers,body:{getReader:function(){return Le}}}})},m=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function v(){this.bitsNeeded=0,this.codePoint=0}v.prototype.decode=function(D){function ne(Z,Q,G){if(G===1)return Z>=128>>Q&&Z<<Q<=2047;if(G===2)return Z>=2048>>Q&&Z<<Q<=55295||Z>=57344>>Q&&Z<<Q<=65535;if(G===3)return Z>=65536>>Q&&Z<<Q<=1114111;throw new Error}function me(Z,Q){if(Z===6*1)return Q>>6>15?3:Q>31?2:1;if(Z===6*2)return Q>15?3:2;if(Z===6*3)return 3;throw new Error}for(var he=65533,Le="",Pe=this.bitsNeeded,Be=this.codePoint,ot=0;ot<D.length;ot+=1){var Ze=D[ot];Pe!==0&&(Ze<128||Ze>191||!ne(Be<<6|Ze&63,Pe-6,me(Pe,Be)))&&(Pe=0,Be=he,Le+=String.fromCharCode(Be)),Pe===0?(Ze>=0&&Ze<=127?(Pe=0,Be=Ze):Ze>=192&&Ze<=223?(Pe=6*1,Be=Ze&31):Ze>=224&&Ze<=239?(Pe=6*2,Be=Ze&15):Ze>=240&&Ze<=247?(Pe=6*3,Be=Ze&7):(Pe=0,Be=he),Pe!==0&&!ne(Be,Pe,me(Pe,Be))&&(Pe=0,Be=he)):(Pe-=6,Be=Be<<6|Ze&63),Pe===0&&(Be<=65535?Le+=String.fromCharCode(Be):(Le+=String.fromCharCode(55296+(Be-65535-1>>10)),Le+=String.fromCharCode(56320+(Be-65535-1&1023))))}return this.bitsNeeded=Pe,this.codePoint=Be,Le};var b=function(){try{return new f().decode(new p().encode("test"),{stream:!0})==="test"}catch(D){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+D)}return!1};(f==null||p==null||!b())&&(f=v);var x=function(){};function I(D){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=x,this.onload=x,this.onerror=x,this.onreadystatechange=x,this._contentType="",this._xhr=D,this._sendTimeout=0,this._abort=x}I.prototype.open=function(D,ne){this._abort(!0);var me=this,he=this._xhr,Le=1,Pe=0;this._abort=function(G){me._sendTimeout!==0&&(i(me._sendTimeout),me._sendTimeout=0),(Le===1||Le===2||Le===3)&&(Le=4,he.onload=x,he.onerror=x,he.onabort=x,he.onprogress=x,he.onreadystatechange=x,he.abort(),Pe!==0&&(i(Pe),Pe=0),G||(me.readyState=4,me.onabort(null),me.onreadystatechange())),Le=0};var Be=function(){if(Le===1){var G=0,$e="",Ge=void 0;if("contentType"in he)G=200,$e="OK",Ge=he.contentType;else try{G=he.status,$e=he.statusText,Ge=he.getResponseHeader("Content-Type")}catch{G=0,$e="",Ge=void 0}G!==0&&(Le=2,me.readyState=2,me.status=G,me.statusText=$e,me._contentType=Ge,me.onreadystatechange())}},ot=function(){if(Be(),Le===2||Le===3){Le=3;var G="";try{G=he.responseText}catch{}me.readyState=3,me.responseText=G,me.onprogress()}},Ze=function(G,$e){if(($e==null||$e.preventDefault==null)&&($e={preventDefault:x}),ot(),Le===1||Le===2||Le===3){if(Le=4,Pe!==0&&(i(Pe),Pe=0),me.readyState=4,G==="load")me.onload($e);else if(G==="error")me.onerror($e);else if(G==="abort")me.onabort($e);else throw new TypeError;me.onreadystatechange()}},Z=function(G){he!=null&&(he.readyState===4?(!("onload"in he)||!("onerror"in he)||!("onabort"in he))&&Ze(he.responseText===""?"error":"load",G):he.readyState===3?"onprogress"in he||ot():he.readyState===2&&Be())},Q=function(){Pe=r(function(){Q()},500),he.readyState===3&&ot()};"onload"in he&&(he.onload=function(G){Ze("load",G)}),"onerror"in he&&(he.onerror=function(G){Ze("error",G)}),"onabort"in he&&(he.onabort=function(G){Ze("abort",G)}),"onprogress"in he&&(he.onprogress=ot),"onreadystatechange"in he&&(he.onreadystatechange=function(G){Z(G)}),("contentType"in he||!("ontimeout"in s.prototype))&&(ne+=(ne.indexOf("?")===-1?"?":"&")+"padding=true"),he.open(D,ne,!0),"readyState"in he&&(Pe=r(function(){Q()},0))},I.prototype.abort=function(){this._abort(!1)},I.prototype.getResponseHeader=function(D){return this._contentType},I.prototype.setRequestHeader=function(D,ne){var me=this._xhr;"setRequestHeader"in me&&me.setRequestHeader(D,ne)},I.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},I.prototype.send=function(){if((!("ontimeout"in s.prototype)||!("sendAsBinary"in s.prototype)&&!("mozAnon"in s.prototype))&&c!=null&&c.readyState!=null&&c.readyState!=="complete"){var D=this;D._sendTimeout=r(function(){D._sendTimeout=0,D.send()},4);return}var ne=this._xhr;"withCredentials"in ne&&(ne.withCredentials=this.withCredentials);try{ne.send(void 0)}catch(me){throw me}};function P(D){return D.replace(/[A-Z]/g,function(ne){return String.fromCharCode(ne.charCodeAt(0)+32)})}function T(D){for(var ne=Object.create(null),me=D.split(`\r
284
- `),he=0;he<me.length;he+=1){var Le=me[he],Pe=Le.split(": "),Be=Pe.shift(),ot=Pe.join(": ");ne[P(Be)]=ot}this._map=ne}T.prototype.get=function(D){return this._map[P(D)]},s!=null&&s.HEADERS_RECEIVED==null&&(s.HEADERS_RECEIVED=2);function j(){}j.prototype.open=function(D,ne,me,he,Le,Pe,Be){D.open("GET",Le);var ot=0;D.onprogress=function(){var Z=D.responseText,Q=Z.slice(ot);ot+=Q.length,me(Q)},D.onerror=function(Z){Z.preventDefault(),he(new Error("NetworkError"))},D.onload=function(){he(null)},D.onabort=function(){he(null)},D.onreadystatechange=function(){if(D.readyState===s.HEADERS_RECEIVED){var Z=D.status,Q=D.statusText,G=D.getResponseHeader("Content-Type"),$e=D.getAllResponseHeaders();ne(Z,Q,G,new T($e))}},D.withCredentials=Pe;for(var Ze in Be)Object.prototype.hasOwnProperty.call(Be,Ze)&&D.setRequestHeader(Ze,Be[Ze]);return D.send(),D};function U(D){this._headers=D}U.prototype.get=function(D){return this._headers.get(D)};function F(){}F.prototype.open=function(D,ne,me,he,Le,Pe,Be){var ot=null,Ze=new m,Z=Ze.signal,Q=new f;return d(Le,{headers:Be,credentials:Pe?"include":"same-origin",signal:Z,cache:"no-store"}).then(function(G){return ot=G.body.getReader(),ne(G.status,G.statusText,G.headers.get("Content-Type"),new U(G.headers)),new u(function($e,Ge){var St=function(){ot.read().then(function(bt){if(bt.done)$e(void 0);else{var gt=Q.decode(bt.value,{stream:!0});me(gt),St()}}).catch(function(bt){Ge(bt)})};St()})}).catch(function(G){if(G.name!=="AbortError")return G}).then(function(G){he(G)}),{abort:function(){ot!=null&&ot.cancel(),Ze.abort()}}};function O(){this._listeners=Object.create(null)}function N(D){r(function(){throw D},0)}O.prototype.dispatchEvent=function(D){D.target=this;var ne=this._listeners[D.type];if(ne!=null)for(var me=ne.length,he=0;he<me;he+=1){var Le=ne[he];try{typeof Le.handleEvent=="function"?Le.handleEvent(D):Le.call(this,D)}catch(Pe){N(Pe)}}},O.prototype.addEventListener=function(D,ne){D=String(D);var me=this._listeners,he=me[D];he==null&&(he=[],me[D]=he);for(var Le=!1,Pe=0;Pe<he.length;Pe+=1)he[Pe]===ne&&(Le=!0);Le||he.push(ne)},O.prototype.removeEventListener=function(D,ne){D=String(D);var me=this._listeners,he=me[D];if(he!=null){for(var Le=[],Pe=0;Pe<he.length;Pe+=1)he[Pe]!==ne&&Le.push(he[Pe]);Le.length===0?delete me[D]:me[D]=Le}};function J(D){this.type=D,this.target=void 0}function q(D,ne){J.call(this,D),this.data=ne.data,this.lastEventId=ne.lastEventId}q.prototype=Object.create(J.prototype);function W(D,ne){J.call(this,D),this.status=ne.status,this.statusText=ne.statusText,this.headers=ne.headers}W.prototype=Object.create(J.prototype);function B(D,ne){J.call(this,D),this.error=ne.error}B.prototype=Object.create(J.prototype);var V=-1,Y=0,K=1,pe=2,k=-1,ee=0,xe=1,S=2,Te=3,Ne=/^text\/event\-stream(;.*)?$/i,Ie=1e3,je=18e6,De=function(D,ne){var me=D==null?ne:parseInt(D,10);return me!==me&&(me=ne),Ue(me)},Ue=function(D){return Math.min(Math.max(D,Ie),je)},_e=function(D,ne,me){try{typeof ne=="function"&&ne.call(D,me)}catch(he){N(he)}};function ve(D,ne){O.call(this),ne=ne||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,Re(this,D,ne)}function ke(){return s!=null&&"withCredentials"in s.prototype||o==null?new s:new o}var Ce=d!=null&&h!=null&&"body"in h.prototype;function Re(D,ne,me){ne=String(ne);var he=!!me.withCredentials,Le=me.lastEventIdQueryParameterName||"lastEventId",Pe=Ue(1e3),Be=De(me.heartbeatTimeout,45e3),ot="",Ze=Pe,Z=!1,Q=0,G=me.headers||{},$e=me.Transport,Ge=Ce&&$e==null?void 0:new I($e!=null?new $e:ke()),St=$e!=null&&typeof $e!="string"?new $e:Ge==null?new F:new j,bt=void 0,gt=0,At=V,fn="",Rt="",Ft="",Qt="",Gt=ee,Rr=0,jn=0,fr=function(Tt,Ot,Xt,en){if(At===Y)if(Tt===200&&Xt!=null&&Ne.test(Xt)){At=K,Z=Date.now(),Ze=Pe,D.readyState=K;var Yt=new W("open",{status:Tt,statusText:Ot,headers:en});D.dispatchEvent(Yt),_e(D,D.onopen,Yt)}else{var Lt="";Tt!==200?(Ot&&(Ot=Ot.replace(/\s+/g," ")),Lt="EventSource's response has a status "+Tt+" "+Ot+" that is not 200. Aborting the connection."):Lt="EventSource's response has a Content-Type specifying an unsupported type: "+(Xt==null?"-":Xt.replace(/\s+/g," "))+". Aborting the connection.",oi();var Yt=new W("error",{status:Tt,statusText:Ot,headers:en});D.dispatchEvent(Yt),_e(D,D.onerror,Yt),console.error(Lt)}},Ri=function(Tt){if(At===K){for(var Ot=-1,Xt=0;Xt<Tt.length;Xt+=1){var en=Tt.charCodeAt(Xt);(en===`
285
- `.charCodeAt(0)||en==="\r".charCodeAt(0))&&(Ot=Xt)}var Yt=(Ot!==-1?Qt:"")+Tt.slice(0,Ot+1);Qt=(Ot===-1?Qt:"")+Tt.slice(Ot+1),Tt!==""&&(Z=Date.now(),Q+=Tt.length);for(var Lt=0;Lt<Yt.length;Lt+=1){var en=Yt.charCodeAt(Lt);if(Gt===k&&en===`
283
+ */(function(e,t){(function(n){var r=n.setTimeout,i=n.clearTimeout,s=n.XMLHttpRequest,o=n.XDomainRequest,a=n.ActiveXObject,l=n.EventSource,c=n.document,u=n.Promise,d=n.fetch,h=n.Response,f=n.TextDecoder,p=n.TextEncoder,m=n.AbortController;if(typeof window<"u"&&typeof c<"u"&&!("readyState"in c)&&c.body==null&&(c.readyState="loading",window.addEventListener("load",function(D){c.readyState="complete"},!1)),s==null&&a!=null&&(s=function(){return new a("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(D){function ne(){}return ne.prototype=D,new ne}),Date.now||(Date.now=function(){return new Date().getTime()}),m==null){var v=d;d=function(D,ne){var me=ne.signal;return v(D,{headers:ne.headers,credentials:ne.credentials,cache:ne.cache}).then(function(he){var Le=he.body.getReader();return me._reader=Le,me._aborted&&me._reader.cancel(),{status:he.status,statusText:he.statusText,headers:he.headers,body:{getReader:function(){return Le}}}})},m=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function y(){this.bitsNeeded=0,this.codePoint=0}y.prototype.decode=function(D){function ne(V,Q,J){if(J===1)return V>=128>>Q&&V<<Q<=2047;if(J===2)return V>=2048>>Q&&V<<Q<=55295||V>=57344>>Q&&V<<Q<=65535;if(J===3)return V>=65536>>Q&&V<<Q<=1114111;throw new Error}function me(V,Q){if(V===6*1)return Q>>6>15?3:Q>31?2:1;if(V===6*2)return Q>15?3:2;if(V===6*3)return 3;throw new Error}for(var he=65533,Le="",Pe=this.bitsNeeded,Fe=this.codePoint,ot=0;ot<D.length;ot+=1){var ze=D[ot];Pe!==0&&(ze<128||ze>191||!ne(Fe<<6|ze&63,Pe-6,me(Pe,Fe)))&&(Pe=0,Fe=he,Le+=String.fromCharCode(Fe)),Pe===0?(ze>=0&&ze<=127?(Pe=0,Fe=ze):ze>=192&&ze<=223?(Pe=6*1,Fe=ze&31):ze>=224&&ze<=239?(Pe=6*2,Fe=ze&15):ze>=240&&ze<=247?(Pe=6*3,Fe=ze&7):(Pe=0,Fe=he),Pe!==0&&!ne(Fe,Pe,me(Pe,Fe))&&(Pe=0,Fe=he)):(Pe-=6,Fe=Fe<<6|ze&63),Pe===0&&(Fe<=65535?Le+=String.fromCharCode(Fe):(Le+=String.fromCharCode(55296+(Fe-65535-1>>10)),Le+=String.fromCharCode(56320+(Fe-65535-1&1023))))}return this.bitsNeeded=Pe,this.codePoint=Fe,Le};var b=function(){try{return new f().decode(new p().encode("test"),{stream:!0})==="test"}catch(D){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+D)}return!1};(f==null||p==null||!b())&&(f=y);var x=function(){};function I(D){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=x,this.onload=x,this.onerror=x,this.onreadystatechange=x,this._contentType="",this._xhr=D,this._sendTimeout=0,this._abort=x}I.prototype.open=function(D,ne){this._abort(!0);var me=this,he=this._xhr,Le=1,Pe=0;this._abort=function(J){me._sendTimeout!==0&&(i(me._sendTimeout),me._sendTimeout=0),(Le===1||Le===2||Le===3)&&(Le=4,he.onload=x,he.onerror=x,he.onabort=x,he.onprogress=x,he.onreadystatechange=x,he.abort(),Pe!==0&&(i(Pe),Pe=0),J||(me.readyState=4,me.onabort(null),me.onreadystatechange())),Le=0};var Fe=function(){if(Le===1){var J=0,$e="",Ge=void 0;if("contentType"in he)J=200,$e="OK",Ge=he.contentType;else try{J=he.status,$e=he.statusText,Ge=he.getResponseHeader("Content-Type")}catch{J=0,$e="",Ge=void 0}J!==0&&(Le=2,me.readyState=2,me.status=J,me.statusText=$e,me._contentType=Ge,me.onreadystatechange())}},ot=function(){if(Fe(),Le===2||Le===3){Le=3;var J="";try{J=he.responseText}catch{}me.readyState=3,me.responseText=J,me.onprogress()}},ze=function(J,$e){if(($e==null||$e.preventDefault==null)&&($e={preventDefault:x}),ot(),Le===1||Le===2||Le===3){if(Le=4,Pe!==0&&(i(Pe),Pe=0),me.readyState=4,J==="load")me.onload($e);else if(J==="error")me.onerror($e);else if(J==="abort")me.onabort($e);else throw new TypeError;me.onreadystatechange()}},V=function(J){he!=null&&(he.readyState===4?(!("onload"in he)||!("onerror"in he)||!("onabort"in he))&&ze(he.responseText===""?"error":"load",J):he.readyState===3?"onprogress"in he||ot():he.readyState===2&&Fe())},Q=function(){Pe=r(function(){Q()},500),he.readyState===3&&ot()};"onload"in he&&(he.onload=function(J){ze("load",J)}),"onerror"in he&&(he.onerror=function(J){ze("error",J)}),"onabort"in he&&(he.onabort=function(J){ze("abort",J)}),"onprogress"in he&&(he.onprogress=ot),"onreadystatechange"in he&&(he.onreadystatechange=function(J){V(J)}),("contentType"in he||!("ontimeout"in s.prototype))&&(ne+=(ne.indexOf("?")===-1?"?":"&")+"padding=true"),he.open(D,ne,!0),"readyState"in he&&(Pe=r(function(){Q()},0))},I.prototype.abort=function(){this._abort(!1)},I.prototype.getResponseHeader=function(D){return this._contentType},I.prototype.setRequestHeader=function(D,ne){var me=this._xhr;"setRequestHeader"in me&&me.setRequestHeader(D,ne)},I.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},I.prototype.send=function(){if((!("ontimeout"in s.prototype)||!("sendAsBinary"in s.prototype)&&!("mozAnon"in s.prototype))&&c!=null&&c.readyState!=null&&c.readyState!=="complete"){var D=this;D._sendTimeout=r(function(){D._sendTimeout=0,D.send()},4);return}var ne=this._xhr;"withCredentials"in ne&&(ne.withCredentials=this.withCredentials);try{ne.send(void 0)}catch(me){throw me}};function A(D){return D.replace(/[A-Z]/g,function(ne){return String.fromCharCode(ne.charCodeAt(0)+32)})}function O(D){for(var ne=Object.create(null),me=D.split(`\r
284
+ `),he=0;he<me.length;he+=1){var Le=me[he],Pe=Le.split(": "),Fe=Pe.shift(),ot=Pe.join(": ");ne[A(Fe)]=ot}this._map=ne}O.prototype.get=function(D){return this._map[A(D)]},s!=null&&s.HEADERS_RECEIVED==null&&(s.HEADERS_RECEIVED=2);function j(){}j.prototype.open=function(D,ne,me,he,Le,Pe,Fe){D.open("GET",Le);var ot=0;D.onprogress=function(){var V=D.responseText,Q=V.slice(ot);ot+=Q.length,me(Q)},D.onerror=function(V){V.preventDefault(),he(new Error("NetworkError"))},D.onload=function(){he(null)},D.onabort=function(){he(null)},D.onreadystatechange=function(){if(D.readyState===s.HEADERS_RECEIVED){var V=D.status,Q=D.statusText,J=D.getResponseHeader("Content-Type"),$e=D.getAllResponseHeaders();ne(V,Q,J,new O($e))}},D.withCredentials=Pe;for(var ze in Fe)Object.prototype.hasOwnProperty.call(Fe,ze)&&D.setRequestHeader(ze,Fe[ze]);return D.send(),D};function U(D){this._headers=D}U.prototype.get=function(D){return this._headers.get(D)};function H(){}H.prototype.open=function(D,ne,me,he,Le,Pe,Fe){var ot=null,ze=new m,V=ze.signal,Q=new f;return d(Le,{headers:Fe,credentials:Pe?"include":"same-origin",signal:V,cache:"no-store"}).then(function(J){return ot=J.body.getReader(),ne(J.status,J.statusText,J.headers.get("Content-Type"),new U(J.headers)),new u(function($e,Ge){var St=function(){ot.read().then(function(bt){if(bt.done)$e(void 0);else{var mt=Q.decode(bt.value,{stream:!0});me(mt),St()}}).catch(function(bt){Ge(bt)})};St()})}).catch(function(J){if(J.name!=="AbortError")return J}).then(function(J){he(J)}),{abort:function(){ot!=null&&ot.cancel(),ze.abort()}}};function T(){this._listeners=Object.create(null)}function N(D){r(function(){throw D},0)}T.prototype.dispatchEvent=function(D){D.target=this;var ne=this._listeners[D.type];if(ne!=null)for(var me=ne.length,he=0;he<me;he+=1){var Le=ne[he];try{typeof Le.handleEvent=="function"?Le.handleEvent(D):Le.call(this,D)}catch(Pe){N(Pe)}}},T.prototype.addEventListener=function(D,ne){D=String(D);var me=this._listeners,he=me[D];he==null&&(he=[],me[D]=he);for(var Le=!1,Pe=0;Pe<he.length;Pe+=1)he[Pe]===ne&&(Le=!0);Le||he.push(ne)},T.prototype.removeEventListener=function(D,ne){D=String(D);var me=this._listeners,he=me[D];if(he!=null){for(var Le=[],Pe=0;Pe<he.length;Pe+=1)he[Pe]!==ne&&Le.push(he[Pe]);Le.length===0?delete me[D]:me[D]=Le}};function G(D){this.type=D,this.target=void 0}function W(D,ne){G.call(this,D),this.data=ne.data,this.lastEventId=ne.lastEventId}W.prototype=Object.create(G.prototype);function q(D,ne){G.call(this,D),this.status=ne.status,this.statusText=ne.statusText,this.headers=ne.headers}q.prototype=Object.create(G.prototype);function B(D,ne){G.call(this,D),this.error=ne.error}B.prototype=Object.create(G.prototype);var z=-1,Y=0,K=1,pe=2,k=-1,ee=0,_e=1,S=2,Se=3,Ne=/^text\/event\-stream(;.*)?$/i,Ie=1e3,je=18e6,He=function(D,ne){var me=D==null?ne:parseInt(D,10);return me!==me&&(me=ne),De(me)},De=function(D){return Math.min(Math.max(D,Ie),je)},we=function(D,ne,me){try{typeof ne=="function"&&ne.call(D,me)}catch(he){N(he)}};function ye(D,ne){T.call(this),ne=ne||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,Re(this,D,ne)}function Te(){return s!=null&&"withCredentials"in s.prototype||o==null?new s:new o}var ke=d!=null&&h!=null&&"body"in h.prototype;function Re(D,ne,me){ne=String(ne);var he=!!me.withCredentials,Le=me.lastEventIdQueryParameterName||"lastEventId",Pe=De(1e3),Fe=He(me.heartbeatTimeout,45e3),ot="",ze=Pe,V=!1,Q=0,J=me.headers||{},$e=me.Transport,Ge=ke&&$e==null?void 0:new I($e!=null?new $e:Te()),St=$e!=null&&typeof $e!="string"?new $e:Ge==null?new H:new j,bt=void 0,mt=0,At=z,fn="",Rt="",Ft="",Qt="",Gt=ee,Rr=0,jn=0,fr=function(Tt,Ot,Xt,en){if(At===Y)if(Tt===200&&Xt!=null&&Ne.test(Xt)){At=K,V=Date.now(),ze=Pe,D.readyState=K;var Yt=new q("open",{status:Tt,statusText:Ot,headers:en});D.dispatchEvent(Yt),we(D,D.onopen,Yt)}else{var Lt="";Tt!==200?(Ot&&(Ot=Ot.replace(/\s+/g," ")),Lt="EventSource's response has a status "+Tt+" "+Ot+" that is not 200. Aborting the connection."):Lt="EventSource's response has a Content-Type specifying an unsupported type: "+(Xt==null?"-":Xt.replace(/\s+/g," "))+". Aborting the connection.",oi();var Yt=new q("error",{status:Tt,statusText:Ot,headers:en});D.dispatchEvent(Yt),we(D,D.onerror,Yt),console.error(Lt)}},Ai=function(Tt){if(At===K){for(var Ot=-1,Xt=0;Xt<Tt.length;Xt+=1){var en=Tt.charCodeAt(Xt);(en===`
285
+ `.charCodeAt(0)||en==="\r".charCodeAt(0))&&(Ot=Xt)}var Yt=(Ot!==-1?Qt:"")+Tt.slice(0,Ot+1);Qt=(Ot===-1?Qt:"")+Tt.slice(Ot+1),Tt!==""&&(V=Date.now(),Q+=Tt.length);for(var Lt=0;Lt<Yt.length;Lt+=1){var en=Yt.charCodeAt(Lt);if(Gt===k&&en===`
286
286
  `.charCodeAt(0))Gt=ee;else if(Gt===k&&(Gt=ee),en==="\r".charCodeAt(0)||en===`
287
- `.charCodeAt(0)){if(Gt!==ee){Gt===xe&&(jn=Lt+1);var _n=Yt.slice(Rr,jn-1),In=Yt.slice(jn+(jn<Lt&&Yt.charCodeAt(jn)===" ".charCodeAt(0)?1:0),Lt);_n==="data"?(fn+=`
288
- `,fn+=In):_n==="id"?Rt=In:_n==="event"?Ft=In:_n==="retry"?(Pe=De(In,Pe),Ze=Pe):_n==="heartbeatTimeout"&&(Be=De(In,Be),gt!==0&&(i(gt),gt=r(function(){$r()},Be)))}if(Gt===ee){if(fn!==""){ot=Rt,Ft===""&&(Ft="message");var hr=new q(Ft,{data:fn.slice(1),lastEventId:Rt});if(D.dispatchEvent(hr),Ft==="open"?_e(D,D.onopen,hr):Ft==="message"?_e(D,D.onmessage,hr):Ft==="error"&&_e(D,D.onerror,hr),At===pe)return}fn="",Ft=""}Gt=en==="\r".charCodeAt(0)?k:ee}else Gt===ee&&(Rr=Lt,Gt=xe),Gt===xe?en===":".charCodeAt(0)&&(jn=Lt+1,Gt=S):Gt===S&&(Gt=Te)}}},si=function(Tt){if(At===K||At===Y){At=V,gt!==0&&(i(gt),gt=0),gt=r(function(){$r()},Ze),Ze=Ue(Math.min(Pe*16,Ze*2)),D.readyState=Y;var Ot=new B("error",{error:Tt});D.dispatchEvent(Ot),_e(D,D.onerror,Ot),Tt!=null&&console.error(Tt)}},oi=function(){At=pe,bt!=null&&(bt.abort(),bt=void 0),gt!==0&&(i(gt),gt=0),D.readyState=pe},$r=function(){if(gt=0,At!==V){if(!Z&&bt!=null)si(new Error("No activity within "+Be+" milliseconds. "+(At===Y?"No response received.":Q+" chars received.")+" Reconnecting.")),bt!=null&&(bt.abort(),bt=void 0);else{var Tt=Math.max((Z||Date.now())+Be-Date.now(),1);Z=!1,gt=r(function(){$r()},Tt)}return}Z=!1,Q=0,gt=r(function(){$r()},Be),At=Y,fn="",Ft="",Rt=ot,Qt="",Rr=0,jn=0,Gt=ee;var Ot=ne;if(ne.slice(0,5)!=="data:"&&ne.slice(0,5)!=="blob:"&&ot!==""){var Xt=ne.indexOf("?");Ot=Xt===-1?ne:ne.slice(0,Xt+1)+ne.slice(Xt+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(In,hr){return hr===Le?"":In}),Ot+=(ne.indexOf("?")===-1?"?":"&")+Le+"="+encodeURIComponent(ot)}var en=D.withCredentials,Yt={};Yt.Accept="text/event-stream";var Lt=D.headers;if(Lt!=null)for(var _n in Lt)Object.prototype.hasOwnProperty.call(Lt,_n)&&(Yt[_n]=Lt[_n]);try{bt=St.open(Ge,fr,Ri,si,Ot,en,Yt)}catch(In){throw oi(),In}};D.url=ne,D.readyState=Y,D.withCredentials=he,D.headers=G,D._close=oi,$r()}ve.prototype=Object.create(O.prototype),ve.prototype.CONNECTING=Y,ve.prototype.OPEN=K,ve.prototype.CLOSED=pe,ve.prototype.close=function(){this._close()},ve.CONNECTING=Y,ve.OPEN=K,ve.CLOSED=pe,ve.prototype.withCredentials=void 0;var qe=l;s!=null&&(l==null||!("withCredentials"in l.prototype))&&(qe=ve),function(D){{var ne=D(t);ne!==void 0&&(e.exports=ne)}}(function(D){D.EventSourcePolyfill=ve,D.NativeEventSource=l,D.EventSource=qe})})(typeof globalThis>"u"?typeof window<"u"?window:typeof self<"u"?self:Me:globalThis)})(Ed,Ed.exports);var L2=Ed.exports;const D2=ai(L2),N2=(e,t={})=>{const n=new D2.EventSourcePolyfill(e,{headers:t.headers}),r=new Mb;return n.onopen=i=>r.emit("open",i),n.onmessage=i=>r.emit("message",i),n.onerror=i=>r.emit("error",i),{emitter:r,source:n}},j2=async(e,t={})=>{const{emitter:n,source:r}=N2(e,t);return await new Promise((i,s)=>{n.on("open",()=>{i()}),n.on("error",o=>{s(o)})}).finally(()=>n.cleanup()),{on:n.on.bind(n),close:()=>{n.cleanup(),r.close()}}},U2=H.object({type:H.literal("message_created"),data:H.object({id:H.string(),createdAt:H.string().datetime(),payload:H.union([H.object({audioUrl:H.string().min(1),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("audio")}),H.object({title:H.string().min(1),subtitle:H.string().optional(),imageUrl:H.string().optional(),actions:H.array(H.object({action:H.enum(["postback","url","say"]),label:H.string().min(1),value:H.string().min(1)})),type:H.literal("card"),className:H.string().describe("CSS className to apply to the message").optional()}),H.object({items:H.array(H.object({title:H.string().min(1),subtitle:H.string().optional(),imageUrl:H.string().optional(),actions:H.array(H.object({action:H.enum(["postback","url","say"]),label:H.string().min(1),value:H.string().min(1)})),className:H.string().describe("CSS className to apply to the message").optional()})),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("carousel")}),H.object({text:H.string(),options:H.array(H.object({label:H.string().min(1),value:H.string().min(1)})),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("choice"),disableFreeText:H.boolean().optional()}),H.object({text:H.string(),options:H.array(H.object({label:H.string().min(1),value:H.string().min(1)})),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("dropdown")}),H.object({fileUrl:H.string().min(1),title:H.string().min(1).optional(),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("file")}),H.object({imageUrl:H.string().min(1),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("image")}),H.object({latitude:H.number(),longitude:H.number(),address:H.string().optional(),title:H.string().optional(),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("location")}),H.object({markdown:H.string().min(1),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("markdown")}),H.object({text:H.string().min(1),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("text")}),H.object({videoUrl:H.string().min(1),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("video")})]),userId:H.string(),conversationId:H.string()})}),F2=H.object({type:H.literal("webchat_visibility"),data:H.object({visibility:H.enum(["show","hide","toggle"])})}),B2=H.object({type:H.literal("webchat_config"),data:H.object({config:H.record(H.any())})}),V2=H.object({type:H.literal("custom"),data:H.object({event:H.record(H.any())})}),z2={messageCreatedSignal:U2,webchatVisibilitySignal:F2,webchatConfigSignal:B2,customSignal:V2},Lb="unknown error",Ml=class Ml extends Mb{constructor(n){super();E(this,"_state",{status:"disconnected"});E(this,"connect",async()=>{if(this._state.status==="connected")return;if(this._state.status==="connecting"){await this._state.connectionPromise;return}const n=this._connect();this._state={status:"connecting",connectionPromise:n},await n});E(this,"disconnect",async()=>{if(this._state.status==="disconnected")return;let n;this._state.status==="connecting"?n=await this._state.connectionPromise:n=this._state.source,this._disconnectSync(n)});E(this,"_connect",async()=>{const n=await j2(`${this._props.url}/v1/conversations/${this._props.conversationId}/listen`,{headers:{"x-user-key":this._props.userKey}});return n.on("message",this._handleMessage),n.on("error",this._handleError(n)),this._state={status:"connected",source:n},n});E(this,"_disconnectSync",n=>{n.close(),this._state={status:"disconnected"}});E(this,"_handleMessage",n=>{const r=this._parseSignal(n.data);this.emit(r.type,r.data)});E(this,"_handleError",n=>r=>{this._disconnectSync(n);const i=this._toError(r);this.emit("error",i)});E(this,"_parseSignal",n=>{for(const r of Object.values(z2)){const i=this._safeJsonParse(n),s=r.safeParse(i);if(s.success)return s.data}return{type:"unknown",data:n}});E(this,"_safeJsonParse",n=>{try{return JSON.parse(n)}catch{return n}});E(this,"_toError",n=>{if(n instanceof Error)return n;if(typeof n=="string")return new Error(n);if(n===null)return new Error(Lb);if(typeof n=="object"&&"message"in n)return this._toError(n.message);try{const r=JSON.stringify(n);return new Error(r)}catch{return new Error(Lb)}});this._props=n}get status(){return this._state.status}};E(Ml,"listen",async n=>{const r=new Ml(n);return await r.connect(),r});let Sd=Ml;const Db=100*1024*1024,Z2=Db,W2=Db,H2=6e4;class q2{constructor(t){E(this,"_auto");E(this,"createConversation",t=>this._auto.createConversation(t));E(this,"getConversation",t=>this._auto.getConversation(t));E(this,"deleteConversation",t=>this._auto.deleteConversation(t));E(this,"listConversations",t=>this._auto.listConversations(t));E(this,"listConversationMessages",t=>this._auto.listConversationMessages(t));E(this,"addParticipant",t=>this._auto.addParticipant(t));E(this,"removeParticipant",t=>this._auto.removeParticipant(t));E(this,"getParticipant",t=>this._auto.getParticipant(t));E(this,"listParticipants",t=>this._auto.listParticipants(t));E(this,"createMessage",t=>this._auto.createMessage(t));E(this,"getMessage",t=>this._auto.getMessage(t));E(this,"deleteMessage",t=>this._auto.deleteMessage(t));E(this,"createUser",t=>this._auto.createUser(t));E(this,"getUser",t=>this._auto.getUser(t));E(this,"updateUser",t=>this._auto.updateUser(t));E(this,"deleteUser",t=>this._auto.deleteUser(t));E(this,"createEvent",t=>this._auto.createEvent(t));E(this,"getEvent",t=>this._auto.getEvent(t));E(this,"listenConversation",async({id:t,xUserKey:n})=>await Sd.listen({url:this.props.apiUrl,conversationId:t,userKey:n}));this.props=t;const{apiUrl:n}=t,r={...t.headers},i=t.timeout??H2,s=Pt.create({headers:r,withCredentials:!0,timeout:i,maxBodyLength:Z2,maxContentLength:W2});this._auto=new M2(void 0,n,s)}}const xl={disconnected:0,user_creating:1,user_created:2,conversation_creating:3,conversation_created:4},Nn=(e,t)=>e.status===t,Ai=(e,t)=>xl[e.status]<xl[t],Nb=(e,t)=>xl[e.status]>=xl[t];class hs extends Error{constructor(t){super(`Unexpected state: ${t.status}`),this.state=t}}class jb extends Fl{constructor(n){super();E(this,"_client");E(this,"_webhookId");E(this,"_state",{status:"disconnected"});E(this,"mode","pushpin");E(this,"_initialConnect",async n=>{if(Nb(this._state,"user_created"))throw new Error("Client is already connected. Please disconnect first.");if(Nn(this._state,"user_creating"))return;this._state={status:"user_creating"},console.log("createUser");const{user:{id:r},key:i}=await this._client.createUser({name:void 0,pictureUrl:void 0,userData:n});return this._state={status:"user_created",userId:r,userKey:i},{userId:r,userToken:i}});E(this,"_reConnect",async(n,r)=>{if(Nb(this._state,"user_created")){if(this._state.userId!==n.userId)throw new Error("Client is already connected. Please disconnect first.");return n}return Nn(this._state,"user_creating")||(this._state={status:"user_created",userId:n.userId,userKey:n.userToken},console.log("updateUser"),await this._client.updateUser({xUserKey:n.userToken,name:void 0,pictureUrl:void 0,userData:r})),n});E(this,"_mapMessage",n=>({id:n.id,conversationId:n.conversationId,authorId:n.userId,sentOn:new Date(n.createdAt),payload:YD(n.payload)}));const r=`${n.apiUrl}/${n.clientId}`;this._webhookId=n.clientId,this._client=new q2({apiUrl:r})}get clientId(){return this._webhookId}get userId(){if(!Ai(this._state,"user_created"))return this._state.userId}get conversationId(){if(!Ai(this._state,"conversation_created"))return this._state.conversationId}async connect(n,r){return n?await this.userExists(n)?this._reConnect(n,r):this._initialConnect(r):this._initialConnect(r)}async disconnect(){Nn(this._state,"conversation_created")?this._state.signalEmitter.cleanup():Nn(this._state,"conversation_creating")&&console.warn("zombie conversation..."),this._state={status:"disconnected"}}async sendMessage(n){if(Ai(this._state,"user_created"))throw new hs(this._state);if(Nn(this._state,"conversation_creating"))throw new hs(this._state);let r;Nn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),console.log("createMessage"),await this._client.createMessage({xUserKey:r.userKey,conversationId:r.conversationId,payload:{type:"text",text:n}}),this.emit("messageSent",n)}async sendEvent(n){if(Ai(this._state,"user_created"))throw new hs(this._state);if(Nn(this._state,"conversation_creating"))throw new hs(this._state);let r;Nn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),console.log("createEvent"),await this._client.createEvent({xUserKey:r.userKey,conversationId:r.conversationId,payload:{type:"custom",data:n}})}async switchConversation(n){if(Ai(this._state,"user_created"))throw new hs(this._state);Nn(this._state,"conversation_created")&&this._state.conversationId===n||Nn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._connectConversation(this._state,n))}async conversationExists(n){if(Ai(this._state,"user_created"))return!1;try{return await this._client.getConversation({xUserKey:this._state.userKey,id:n}),!0}catch(r){if(Cd(r)&&r.code===404)return!1;throw r}}async userExists({userToken:n}){try{return await this._client.getUser({xUserKey:n}),!0}catch(r){const i=s=>s.code===404||s.code===401;if(Cd(r)&&i(r))return!1;throw r}}async newConversation(){if(Ai(this._state,"user_created"))throw new hs(this._state);Nn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._createNewConversation(this._state))}async _createNewConversation(n){console.log("createConversation");const{conversation:{id:r}}=await this._client.createConversation({xUserKey:n.userKey}),i=await this._connectConversation(n,r);return await this._client.createEvent({xUserKey:n.userKey,conversationId:r,payload:{type:"conversation_started",data:{}}}),i}async listMessages(){if(!Nn(this._state,"conversation_created"))return[];const{conversationId:n,userKey:r}=this._state,i=[];let s;do{const o=await this._client.listConversationMessages({id:n,xUserKey:r,nextToken:s});i.push(...o.messages),s=o.meta.nextToken}while(s);return i.map(this._mapMessage)}async _connectConversation(n,r){const i=await this._client.listenConversation({id:r,xUserKey:n.userKey});return i.on("unknown",s=>console.log("unknown event",s)),i.on("message_created",s=>{s.userId!==n.userId&&this.emit("message",this._mapMessage(s))}),i.on("error",()=>{this._state={status:"user_created",userId:n.userId,userKey:n.userKey},this.emit("error",new Error("Connection to conversation lost"))}),i.on("webchat_visibility",s=>{this.emit("webchatVisibility",s.visibility)}),i.on("webchat_config",s=>{this.emit("webchatConfig",s.config)}),i.on("custom",s=>{this.emit("customEvent",s.event)}),this.emit("conversation",r),this._state={status:"conversation_created",userId:n.userId,userKey:n.userKey,conversationId:r,signalEmitter:i},this._state}}const K2=({clientId:e,apiUrl:t,mode:n="messaging"})=>{const[r,i]=_.useState();return _.useEffect(()=>{const s=n==="messaging"?new rb({url:t,clientId:e}):new jb({apiUrl:t,clientId:e});i(s)},[e,t,n]),r},Ub=_.memo(_.forwardRef((e,t)=>{const{state:n,theme:{composer:r},client:i}=mt(),[s,o]=_.useState(""),[a,l]=_.useState(-1);if(n.isReadOnly||!i)return null;const c=()=>{s&&(i.sendMessage(s),o(""),l(-1))};return z.jsx(np.Provider,{value:{value:s,setValue:o,historyIndex:a,setHistoryIndex:l,sendMessage:c},children:z.jsx("div",{"data-disabled":n.disableComposer,...e,...r==null?void 0:r.container,ref:t})})})),Fb=_.memo(({...e})=>{const{state:t,theme:{composer:n}}=mt(),{value:r,setValue:i,historyIndex:s,setHistoryIndex:o,sendMessage:a}=rp(),l=_.useRef(null),c=Hr(d=>d.user),u=Hr(d=>d.messageHistory);return _.useEffect(()=>{l.current&&(l.current.selectionStart=l.current.value.length,l.current.selectionEnd=l.current.value.length)},[r]),z.jsx("textarea",{...n==null?void 0:n.input,disabled:t.disableComposer,ref:l,value:r,"data-has-value":!!r,onChange:d=>i(d.target.value),onKeyDown:d=>{if(!t.disableComposer){if(d.key==="Enter"&&(d.preventDefault(),a()),d.key==="ArrowUp"){d.preventDefault();const h=u[(c==null?void 0:c.userId)??""]??[];s<h.length-1&&i(h[s+1]),o(()=>Math.min(s+1,h.length-1))}if(d.key==="ArrowDown"){d.preventDefault();const h=u[(c==null?void 0:c.userId)??""]??[];i(s===0?"":h[s-1]),o(()=>Math.max(s-1,-1))}}},...e})}),Bb=_.memo(_.forwardRef(({icon:e=iT,...t},n)=>{var o,a;const{value:r,sendMessage:i}=rp(),{theme:{composer:s}}=mt();return z.jsx("button",{ref:n,...t,...(o=s==null?void 0:s.button)==null?void 0:o.container,disabled:!r,onClick:i,children:z.jsx(e,{...(a=s==null?void 0:s.button)==null?void 0:a.icon})})})),Vb=({children:e})=>{const[t,n]=_.useState(!1),[r,i]=_.useState(""),[s,o]=_.useState(null),a=({title:c,content:u})=>{i(c),o(u),n(!0)},l=()=>{n(!1)};return z.jsxs(sp.Provider,{value:{hideModal:l,showModal:a,title:r,content:s,open:t},children:[z.jsx(ii,{open:t,onOpenChange:n,children:z.jsx(ii.Content,{title:r,children:s})}),e]})},J2=({theme:e={},renderers:t,client:n,children:r,configuration:i={},userData:s,closeWindow:o,...a})=>{const[l,c]=_.useState(0),[u,d]=_.useState([]),[h,f]=_.useState({disableComposer:!1,...a.defaultState,connected:!0}),[p,m]=_.useState(i),[y,v]=_.useState(e),b=Hr(F=>F.addMessageToHistory),x=Hr(F=>F.setConversationId),I=Hr(F=>F.user),P=Hr(F=>F.conversationId),T=Hr(F=>F.setUser),j=Hr(F=>F.setClientMode),U={...a,value:{theme:y,renderers:{...uu,...t},messages:u,setMessages:d,eventEmitter:Qw,configuration:i,setConfiguration:m,state:h,closeWindow:o,setState:F=>f({...h,...F}),setTheme:F=>{v(F)},client:n?{...n,sendMessage:async F=>{await n.sendMessage(F),d(O=>[...O,{direction:"outgoing",sender:{name:"You"},timestamp:new Date,block:{type:"bubble",block:{type:"text",text:F}}}]),n.userId&&b({message:F,userId:n.userId})},on:n.on,restartConversation:async()=>{await n.newConversation(),d([])}}:void 0}};return bi(()=>{n&&j(n.mode)}),bi(()=>{if(n)return n.on("message",F=>{try{const O=F.payload;d(N=>[...N,{direction:"incoming",sender:{name:p.botName??"Bot",avatar:p.botAvatar},timestamp:new Date(F.sentOn),block:O}])}catch{console.error("Invalid message payload")}})}),vu(async()=>{if(n)return n.on("error",()=>{console.log("client disconnected"),c(F=>F+1)})}),bi(()=>{if(n)return n.on("conversation",F=>{x(F)})}),vu(async()=>{if(!n)return;let F;try{F=await n.connect(I,s),f(N=>({...N,connected:!0}))}catch{f(J=>({...J,connected:!1}));return}T(F),P&&await n.conversationExists(P)?await n.switchConversation(P):await n.newConversation();const O=[];for(const N of await n.listMessages())try{const J=N.payload,q=N.authorId===n.userId?"outgoing":"incoming";O.push({direction:q,sender:q==="outgoing"?{name:"You"}:{name:p.botName??"Bot",avatar:p.botAvatar},timestamp:new Date(N.sentOn),block:J})}catch{console.error("Invalid message payload")}return d(O.reverse()),()=>{n.disconnect()}},[l]),z.jsx(ap.Provider,{...U,children:typeof r=="function"?r(p):r})};function Pr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}const G2=R["useId".toString()]||(()=>{});let Y2=0;function _l(e){const[t,n]=R.useState(G2());return xs(()=>{e||n(r=>r??String(Y2++))},[e]),e||(t?`radix-${t}`:"")}function zb({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Q2({defaultProp:t,onChange:n}),s=e!==void 0,o=s?e:r,a=Mr(n),l=_.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else i(c)},[s,e,i,a]);return[o,l]}function Q2({defaultProp:e,onChange:t}){const n=_.useState(e),[r]=n,i=_.useRef(r),s=Mr(t);return _.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}function X2(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(e);_.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Td="dismissableLayer.update",ej="dismissableLayer.pointerDownOutside",tj="dismissableLayer.focusOutside";let Zb;const nj=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rj=_.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=e,u=_.useContext(nj),[d,h]=_.useState(null),f=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,p]=_.useState({}),m=li(t,U=>h(U)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),x=d?y.indexOf(d):-1,I=u.layersWithOutsidePointerEventsDisabled.size>0,P=x>=b,T=ij(U=>{const F=U.target,O=[...u.branches].some(N=>N.contains(F));!P||O||(s==null||s(U),a==null||a(U),U.defaultPrevented||l==null||l())},f),j=sj(U=>{const F=U.target;[...u.branches].some(N=>N.contains(F))||(o==null||o(U),a==null||a(U),U.defaultPrevented||l==null||l())},f);return X2(U=>{x===u.layers.size-1&&(i==null||i(U),!U.defaultPrevented&&l&&(U.preventDefault(),l()))},f),_.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Zb=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Wb(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Zb)}},[d,f,r,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Wb())},[d,u]),_.useEffect(()=>{const U=()=>p({});return document.addEventListener(Td,U),()=>document.removeEventListener(Td,U)},[]),_.createElement(Pn.div,_t({},c,{ref:m,style:{pointerEvents:I?P?"auto":"none":void 0,...e.style},onFocusCapture:Pr(e.onFocusCapture,j.onFocusCapture),onBlurCapture:Pr(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Pr(e.onPointerDownCapture,T.onPointerDownCapture)}))});function ij(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(e),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Hb(ej,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function sj(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(e),r=_.useRef(!1);return _.useEffect(()=>{const i=s=>{s.target&&!r.current&&Hb(tj,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Wb(){const e=new CustomEvent(Td);document.dispatchEvent(e)}function Hb(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Hw(i,s):i.dispatchEvent(s)}const Od="focusScope.autoFocusOnMount",Id="focusScope.autoFocusOnUnmount",qb={bubbles:!1,cancelable:!0},oj=_.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[a,l]=_.useState(null),c=Mr(i),u=Mr(s),d=_.useRef(null),h=li(t,m=>l(m)),f=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let m=function(x){if(f.paused||!a)return;const I=x.target;a.contains(I)?d.current=I:ri(d.current,{select:!0})},y=function(x){if(f.paused||!a)return;const I=x.relatedTarget;I!==null&&(a.contains(I)||ri(d.current,{select:!0}))},v=function(x){const I=document.activeElement;for(const P of x)P.removedNodes.length>0&&(a!=null&&a.contains(I)||ri(a))};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const b=new MutationObserver(v);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,f.paused]),_.useEffect(()=>{if(a){Gb.add(f);const m=document.activeElement;if(!a.contains(m)){const v=new CustomEvent(Od,qb);a.addEventListener(Od,c),a.dispatchEvent(v),v.defaultPrevented||(aj(fj(Kb(a)),{select:!0}),document.activeElement===m&&ri(a))}return()=>{a.removeEventListener(Od,c),setTimeout(()=>{const v=new CustomEvent(Id,qb);a.addEventListener(Id,u),a.dispatchEvent(v),v.defaultPrevented||ri(m??document.body,{select:!0}),a.removeEventListener(Id,u),Gb.remove(f)},0)}}},[a,c,u,f]);const p=_.useCallback(m=>{if(!n&&!r||f.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,v=document.activeElement;if(y&&v){const b=m.currentTarget,[x,I]=lj(b);x&&I?!m.shiftKey&&v===I?(m.preventDefault(),n&&ri(x,{select:!0})):m.shiftKey&&v===x&&(m.preventDefault(),n&&ri(I,{select:!0})):v===b&&m.preventDefault()}},[n,r,f.paused]);return _.createElement(Pn.div,_t({tabIndex:-1},o,{ref:h,onKeyDown:p}))});function aj(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ri(r,{select:t}),document.activeElement!==n)return}function lj(e){const t=Kb(e),n=Jb(t,e),r=Jb(t.reverse(),e);return[n,r]}function Kb(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Jb(e,t){for(const n of e)if(!cj(n,{upTo:t}))return n}function cj(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function uj(e){return e instanceof HTMLInputElement&&"select"in e}function ri(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&uj(e)&&t&&e.select()}}const Gb=dj();function dj(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Yb(e,t),e.unshift(t)},remove(t){var n;e=Yb(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function Yb(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function fj(e){return e.filter(t=>t.tagName!=="A")}function hj(e,t){return _.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const kl=e=>{const{present:t,children:n}=e,r=pj(t),i=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),s=li(r.ref,i.ref);return typeof n=="function"||r.isPresent?_.cloneElement(i,{ref:s}):null};kl.displayName="Presence";function pj(e){const[t,n]=_.useState(),r=_.useRef({}),i=_.useRef(e),s=_.useRef("none"),o=e?"mounted":"unmounted",[a,l]=hj(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=Cl(r.current);s.current=a==="mounted"?c:"none"},[a]),xs(()=>{const c=r.current,u=i.current;if(u!==e){const h=s.current,f=Cl(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),xs(()=>{if(t){const c=d=>{const f=Cl(r.current).includes(d.animationName);d.target===t&&f&&Gn.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(s.current=Cl(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Cl(e){return(e==null?void 0:e.animationName)||"none"}let Pd=0;function mj(){_.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:Qb()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:Qb()),Pd++,()=>{Pd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Pd--}},[])}function Qb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var El="right-scroll-bar-position",Sl="width-before-scroll-bar",gj="with-scroll-bars-hidden",yj="--removed-body-scroll-bar-size";function vj(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function bj(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function wj(e,t){return bj(t||null,function(n){return e.forEach(function(r){return vj(r,n)})})}function xj(e){return e}function _j(e,t){t===void 0&&(t=xj);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var o=t(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var l=function(){var u=o;o=[],u.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){o.push(u),c()},filter:function(u){return o=o.filter(u),n}}}};return i}function kj(e){e===void 0&&(e={});var t=_j(null);return t.options=Mn({async:!0,ssr:!1},e),t}var Xb=function(e){var t=e.sideCar,n=Lm(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return R.createElement(r,Mn({},n))};Xb.isSideCarExport=!0;function Cj(e,t){return e.useMedium(t),Xb}var ew=kj(),Ad=function(){},Tl=R.forwardRef(function(e,t){var n=R.useRef(null),r=R.useState({onScrollCapture:Ad,onWheelCapture:Ad,onTouchMoveCapture:Ad}),i=r[0],s=r[1],o=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noIsolation,p=e.inert,m=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,b=Lm(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=h,I=wj([n,t]),P=Mn(Mn({},b),i);return R.createElement(R.Fragment,null,u&&R.createElement(x,{sideCar:ew,removeScrollBar:c,shards:d,noIsolation:f,inert:p,setCallbacks:s,allowPinchZoom:!!m,lockRef:n}),o?R.cloneElement(R.Children.only(a),Mn(Mn({},P),{ref:I})):R.createElement(v,Mn({},P,{className:l,ref:I}),a))});Tl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Tl.classNames={fullWidth:Sl,zeroRight:El};var tw,Ej=function(){if(tw)return tw;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Sj(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ej();return t&&e.setAttribute("nonce",t),e}function Tj(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Oj(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ij=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Sj())&&(Tj(t,n),Oj(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Pj=function(){var e=Ij();return function(t,n){R.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},nw=function(){var e=Pj(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Aj={left:0,top:0,right:0,gap:0},Rd=function(e){return parseInt(e||"",10)||0},Rj=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Rd(n),Rd(r),Rd(i)]},$j=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Aj;var t=Rj(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Mj=nw(),Lj=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),`
289
- .`.concat(gj,` {
287
+ `.charCodeAt(0)){if(Gt!==ee){Gt===_e&&(jn=Lt+1);var _n=Yt.slice(Rr,jn-1),Pn=Yt.slice(jn+(jn<Lt&&Yt.charCodeAt(jn)===" ".charCodeAt(0)?1:0),Lt);_n==="data"?(fn+=`
288
+ `,fn+=Pn):_n==="id"?Rt=Pn:_n==="event"?Ft=Pn:_n==="retry"?(Pe=He(Pn,Pe),ze=Pe):_n==="heartbeatTimeout"&&(Fe=He(Pn,Fe),mt!==0&&(i(mt),mt=r(function(){$r()},Fe)))}if(Gt===ee){if(fn!==""){ot=Rt,Ft===""&&(Ft="message");var hr=new W(Ft,{data:fn.slice(1),lastEventId:Rt});if(D.dispatchEvent(hr),Ft==="open"?we(D,D.onopen,hr):Ft==="message"?we(D,D.onmessage,hr):Ft==="error"&&we(D,D.onerror,hr),At===pe)return}fn="",Ft=""}Gt=en==="\r".charCodeAt(0)?k:ee}else Gt===ee&&(Rr=Lt,Gt=_e),Gt===_e?en===":".charCodeAt(0)&&(jn=Lt+1,Gt=S):Gt===S&&(Gt=Se)}}},si=function(Tt){if(At===K||At===Y){At=z,mt!==0&&(i(mt),mt=0),mt=r(function(){$r()},ze),ze=De(Math.min(Pe*16,ze*2)),D.readyState=Y;var Ot=new B("error",{error:Tt});D.dispatchEvent(Ot),we(D,D.onerror,Ot),Tt!=null&&console.error(Tt)}},oi=function(){At=pe,bt!=null&&(bt.abort(),bt=void 0),mt!==0&&(i(mt),mt=0),D.readyState=pe},$r=function(){if(mt=0,At!==z){if(!V&&bt!=null)si(new Error("No activity within "+Fe+" milliseconds. "+(At===Y?"No response received.":Q+" chars received.")+" Reconnecting.")),bt!=null&&(bt.abort(),bt=void 0);else{var Tt=Math.max((V||Date.now())+Fe-Date.now(),1);V=!1,mt=r(function(){$r()},Tt)}return}V=!1,Q=0,mt=r(function(){$r()},Fe),At=Y,fn="",Ft="",Rt=ot,Qt="",Rr=0,jn=0,Gt=ee;var Ot=ne;if(ne.slice(0,5)!=="data:"&&ne.slice(0,5)!=="blob:"&&ot!==""){var Xt=ne.indexOf("?");Ot=Xt===-1?ne:ne.slice(0,Xt+1)+ne.slice(Xt+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(Pn,hr){return hr===Le?"":Pn}),Ot+=(ne.indexOf("?")===-1?"?":"&")+Le+"="+encodeURIComponent(ot)}var en=D.withCredentials,Yt={};Yt.Accept="text/event-stream";var Lt=D.headers;if(Lt!=null)for(var _n in Lt)Object.prototype.hasOwnProperty.call(Lt,_n)&&(Yt[_n]=Lt[_n]);try{bt=St.open(Ge,fr,Ai,si,Ot,en,Yt)}catch(Pn){throw oi(),Pn}};D.url=ne,D.readyState=Y,D.withCredentials=he,D.headers=J,D._close=oi,$r()}ye.prototype=Object.create(T.prototype),ye.prototype.CONNECTING=Y,ye.prototype.OPEN=K,ye.prototype.CLOSED=pe,ye.prototype.close=function(){this._close()},ye.CONNECTING=Y,ye.OPEN=K,ye.CLOSED=pe,ye.prototype.withCredentials=void 0;var qe=l;s!=null&&(l==null||!("withCredentials"in l.prototype))&&(qe=ye),function(D){{var ne=D(t);ne!==void 0&&(e.exports=ne)}}(function(D){D.EventSourcePolyfill=ye,D.NativeEventSource=l,D.EventSource=qe})})(typeof globalThis>"u"?typeof window<"u"?window:typeof self<"u"?self:Me:globalThis)})(kd,kd.exports);var O2=kd.exports;const I2=ai(O2),P2=(e,t={})=>{const n=new I2.EventSourcePolyfill(e,{headers:t.headers}),r=new Rb;return n.onopen=i=>r.emit("open",i),n.onmessage=i=>r.emit("message",i),n.onerror=i=>r.emit("error",i),{emitter:r,source:n}},A2=async(e,t={})=>{const{emitter:n,source:r}=P2(e,t);return await new Promise((i,s)=>{n.on("open",()=>{i()}),n.on("error",o=>{s(o)})}).finally(()=>n.cleanup()),{on:n.on.bind(n),close:()=>{n.cleanup(),r.close()}}},R2=Z.object({type:Z.literal("message_created"),data:Z.object({id:Z.string(),createdAt:Z.string().datetime(),payload:Z.union([Z.object({audioUrl:Z.string().min(1),className:Z.string().describe("CSS className to apply to the message").optional(),type:Z.literal("audio")}),Z.object({title:Z.string().min(1),subtitle:Z.string().optional(),imageUrl:Z.string().optional(),actions:Z.array(Z.object({action:Z.enum(["postback","url","say"]),label:Z.string().min(1),value:Z.string().min(1)})),type:Z.literal("card"),className:Z.string().describe("CSS className to apply to the message").optional()}),Z.object({items:Z.array(Z.object({title:Z.string().min(1),subtitle:Z.string().optional(),imageUrl:Z.string().optional(),actions:Z.array(Z.object({action:Z.enum(["postback","url","say"]),label:Z.string().min(1),value:Z.string().min(1)})),className:Z.string().describe("CSS className to apply to the message").optional()})),className:Z.string().describe("CSS className to apply to the message").optional(),type:Z.literal("carousel")}),Z.object({text:Z.string(),options:Z.array(Z.object({label:Z.string().min(1),value:Z.string().min(1)})),className:Z.string().describe("CSS className to apply to the message").optional(),type:Z.literal("choice"),disableFreeText:Z.boolean().optional()}),Z.object({text:Z.string(),options:Z.array(Z.object({label:Z.string().min(1),value:Z.string().min(1)})),className:Z.string().describe("CSS className to apply to the message").optional(),type:Z.literal("dropdown")}),Z.object({fileUrl:Z.string().min(1),title:Z.string().min(1).optional(),className:Z.string().describe("CSS className to apply to the message").optional(),type:Z.literal("file")}),Z.object({imageUrl:Z.string().min(1),className:Z.string().describe("CSS className to apply to the message").optional(),type:Z.literal("image")}),Z.object({latitude:Z.number(),longitude:Z.number(),address:Z.string().optional(),title:Z.string().optional(),className:Z.string().describe("CSS className to apply to the message").optional(),type:Z.literal("location")}),Z.object({markdown:Z.string().min(1),className:Z.string().describe("CSS className to apply to the message").optional(),type:Z.literal("markdown")}),Z.object({text:Z.string().min(1),className:Z.string().describe("CSS className to apply to the message").optional(),type:Z.literal("text")}),Z.object({videoUrl:Z.string().min(1),className:Z.string().describe("CSS className to apply to the message").optional(),type:Z.literal("video")})]),userId:Z.string(),conversationId:Z.string()})}),$2=Z.object({type:Z.literal("webchat_visibility"),data:Z.object({visibility:Z.enum(["show","hide","toggle"])})}),M2=Z.object({type:Z.literal("webchat_config"),data:Z.object({config:Z.record(Z.any())})}),L2=Z.object({type:Z.literal("custom"),data:Z.object({event:Z.record(Z.any())})}),D2={messageCreatedSignal:R2,webchatVisibilitySignal:$2,webchatConfigSignal:M2,customSignal:L2},$b="unknown error",Rl=class Rl extends Rb{constructor(n){super();E(this,"_state",{status:"disconnected"});E(this,"connect",async()=>{if(this._state.status==="connected")return;if(this._state.status==="connecting"){await this._state.connectionPromise;return}const n=this._connect();this._state={status:"connecting",connectionPromise:n},await n});E(this,"disconnect",async()=>{if(this._state.status==="disconnected")return;let n;this._state.status==="connecting"?n=await this._state.connectionPromise:n=this._state.source,this._disconnectSync(n)});E(this,"_connect",async()=>{const n=await A2(`${this._props.url}/conversations/${this._props.conversationId}/listen`,{headers:{"x-user-key":this._props.userKey}});return n.on("message",this._handleMessage),n.on("error",this._handleError(n)),this._state={status:"connected",source:n},n});E(this,"_disconnectSync",n=>{n.close(),this._state={status:"disconnected"}});E(this,"_handleMessage",n=>{const r=this._parseSignal(n.data);this.emit(r.type,r.data)});E(this,"_handleError",n=>r=>{this._disconnectSync(n);const i=this._toError(r);this.emit("error",i)});E(this,"_parseSignal",n=>{for(const r of Object.values(D2)){const i=this._safeJsonParse(n),s=r.safeParse(i);if(s.success)return s.data}return{type:"unknown",data:n}});E(this,"_safeJsonParse",n=>{try{return JSON.parse(n)}catch{return n}});E(this,"_toError",n=>{if(n instanceof Error)return n;if(typeof n=="string")return new Error(n);if(n===null)return new Error($b);if(typeof n=="object"&&"message"in n)return this._toError(n.message);try{const r=JSON.stringify(n);return new Error(r)}catch{return new Error($b)}});this._props=n}get status(){return this._state.status}};E(Rl,"listen",async n=>{const r=new Rl(n);return await r.connect(),r});let Cd=Rl;const Mb=100*1024*1024,N2=Mb,j2=Mb,U2=6e4;class F2{constructor(t){E(this,"_auto");E(this,"createConversation",t=>this._auto.createConversation(t));E(this,"getConversation",t=>this._auto.getConversation(t));E(this,"deleteConversation",t=>this._auto.deleteConversation(t));E(this,"listConversations",t=>this._auto.listConversations(t));E(this,"listConversationMessages",t=>this._auto.listConversationMessages(t));E(this,"addParticipant",t=>this._auto.addParticipant(t));E(this,"removeParticipant",t=>this._auto.removeParticipant(t));E(this,"getParticipant",t=>this._auto.getParticipant(t));E(this,"listParticipants",t=>this._auto.listParticipants(t));E(this,"createMessage",t=>this._auto.createMessage(t));E(this,"getMessage",t=>this._auto.getMessage(t));E(this,"deleteMessage",t=>this._auto.deleteMessage(t));E(this,"createUser",t=>this._auto.createUser(t));E(this,"getUser",t=>this._auto.getUser(t));E(this,"updateUser",t=>this._auto.updateUser(t));E(this,"deleteUser",t=>this._auto.deleteUser(t));E(this,"createEvent",t=>this._auto.createEvent(t));E(this,"getEvent",t=>this._auto.getEvent(t));E(this,"listenConversation",async({id:t,xUserKey:n})=>await Cd.listen({url:this.props.apiUrl,conversationId:t,userKey:n}));this.props=t;const{apiUrl:n}=t,r={...t.headers},i=t.timeout??U2,s=Pt.create({headers:r,withCredentials:!0,timeout:i,maxBodyLength:N2,maxContentLength:j2});this._auto=new T2(void 0,n,s)}}const bl={disconnected:0,user_creating:1,user_created:2,conversation_creating:3,conversation_created:4},Nn=(e,t)=>e.status===t,Pi=(e,t)=>bl[e.status]<bl[t],Lb=(e,t)=>bl[e.status]>=bl[t];class hs extends Error{constructor(t){super(`Unexpected state: ${t.status}`),this.state=t}}class Db extends jl{constructor(n){super();E(this,"_client");E(this,"_webhookId");E(this,"_state",{status:"disconnected"});E(this,"mode","pushpin");E(this,"_initialConnect",async n=>{if(Lb(this._state,"user_created"))throw new Error("Client is already connected. Please disconnect first.");if(Nn(this._state,"user_creating"))return;this._state={status:"user_creating"},console.log("createUser");const{user:{id:r},key:i}=await this._client.createUser({name:void 0,pictureUrl:void 0,userData:n});return this._state={status:"user_created",userId:r,userKey:i},{userId:r,userToken:i}});E(this,"_reConnect",async(n,r)=>{if(Lb(this._state,"user_created")){if(this._state.userId!==n.userId)throw new Error("Client is already connected. Please disconnect first.");return n}return Nn(this._state,"user_creating")||(this._state={status:"user_created",userId:n.userId,userKey:n.userToken},console.log("updateUser"),await this._client.updateUser({xUserKey:n.userToken,name:void 0,pictureUrl:void 0,userData:r})),n});E(this,"_mapMessage",n=>({id:n.id,conversationId:n.conversationId,authorId:n.userId,sentOn:new Date(n.createdAt),payload:ZD(n.payload)}));const r=`${n.apiUrl}/${n.clientId}`;this._webhookId=n.clientId,this._client=new F2({apiUrl:r})}get clientId(){return this._webhookId}get userId(){if(!Pi(this._state,"user_created"))return this._state.userId}get conversationId(){if(!Pi(this._state,"conversation_created"))return this._state.conversationId}async connect(n,r){return n?await this.userExists(n)?this._reConnect(n,r):this._initialConnect(r):this._initialConnect(r)}async disconnect(){Nn(this._state,"conversation_created")?this._state.signalEmitter.cleanup():Nn(this._state,"conversation_creating")&&console.warn("zombie conversation..."),this._state={status:"disconnected"}}async sendMessage(n){if(Pi(this._state,"user_created"))throw new hs(this._state);if(Nn(this._state,"conversation_creating"))throw new hs(this._state);let r;Nn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),console.log("createMessage"),await this._client.createMessage({xUserKey:r.userKey,conversationId:r.conversationId,payload:{type:"text",text:n}}),this.emit("messageSent",n)}async sendEvent(n){if(Pi(this._state,"user_created"))throw new hs(this._state);if(Nn(this._state,"conversation_creating"))throw new hs(this._state);let r;Nn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),console.log("createEvent"),await this._client.createEvent({xUserKey:r.userKey,conversationId:r.conversationId,payload:{type:"custom",data:n}})}async switchConversation(n){if(Pi(this._state,"user_created"))throw new hs(this._state);Nn(this._state,"conversation_created")&&this._state.conversationId===n||Nn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._connectConversation(this._state,n))}async conversationExists(n){if(Pi(this._state,"user_created"))return!1;try{return await this._client.getConversation({xUserKey:this._state.userKey,id:n}),!0}catch(r){if(_d(r)&&r.code===404)return!1;throw r}}async userExists({userToken:n}){try{return await this._client.getUser({xUserKey:n}),!0}catch(r){const i=s=>s.code===404||s.code===401;if(_d(r)&&i(r))return!1;throw r}}async newConversation(){if(Pi(this._state,"user_created"))throw new hs(this._state);Nn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._createNewConversation(this._state))}async _createNewConversation(n){console.log("createConversation");const{conversation:{id:r}}=await this._client.createConversation({xUserKey:n.userKey}),i=await this._connectConversation(n,r);return await this._client.createEvent({xUserKey:n.userKey,conversationId:r,payload:{type:"conversation_started",data:{}}}),i}async listMessages(){if(!Nn(this._state,"conversation_created"))return[];const{conversationId:n,userKey:r}=this._state,i=[];let s;do{const o=await this._client.listConversationMessages({id:n,xUserKey:r,nextToken:s});i.push(...o.messages),s=o.meta.nextToken}while(s);return i.map(this._mapMessage)}async _connectConversation(n,r){const i=await this._client.listenConversation({id:r,xUserKey:n.userKey});return i.on("unknown",s=>console.log("unknown event",s)),i.on("message_created",s=>{s.userId!==n.userId&&this.emit("message",this._mapMessage(s))}),i.on("error",()=>{this._state={status:"user_created",userId:n.userId,userKey:n.userKey},this.emit("error",new Error("Connection to conversation lost"))}),i.on("webchat_visibility",s=>{this.emit("webchatVisibility",s.visibility)}),i.on("webchat_config",s=>{this.emit("webchatConfig",s.config)}),i.on("custom",s=>{this.emit("customEvent",s.event)}),this.emit("conversation",r),this._state={status:"conversation_created",userId:n.userId,userKey:n.userKey,conversationId:r,signalEmitter:i},this._state}}const B2=({clientId:e,apiUrl:t,mode:n="messaging"})=>{const[r,i]=_.useState();return _.useEffect(()=>{const s=n==="messaging"?new tb({url:t,clientId:e}):new Db({apiUrl:t,clientId:e});i(s)},[e,t,n]),r},Nb=_.memo(_.forwardRef((e,t)=>{const{state:n,theme:{composer:r},client:i}=vt(),[s,o]=_.useState(""),[a,l]=_.useState(-1);if(n.isReadOnly||!i)return null;const c=()=>{s&&(i.sendMessage(s),o(""),l(-1))};return F.jsx(ep.Provider,{value:{value:s,setValue:o,historyIndex:a,setHistoryIndex:l,sendMessage:c},children:F.jsx("div",{"data-disabled":n.disableComposer,...e,...r==null?void 0:r.container,ref:t})})})),jb=_.memo(({...e})=>{const{state:t,theme:{composer:n}}=vt(),{value:r,setValue:i,historyIndex:s,setHistoryIndex:o,sendMessage:a}=tp(),l=_.useRef(null),c=Hr(d=>d.user),u=Hr(d=>d.messageHistory);return _.useEffect(()=>{l.current&&(l.current.selectionStart=l.current.value.length,l.current.selectionEnd=l.current.value.length)},[r]),F.jsx("textarea",{...n==null?void 0:n.input,disabled:t.disableComposer,ref:l,value:r,"data-has-value":!!r,onChange:d=>i(d.target.value),onKeyDown:d=>{if(!t.disableComposer){if(d.key==="Enter"&&(d.preventDefault(),a()),d.key==="ArrowUp"){d.preventDefault();const h=u[(c==null?void 0:c.userId)??""]??[];s<h.length-1&&i(h[s+1]),o(()=>Math.min(s+1,h.length-1))}if(d.key==="ArrowDown"){d.preventDefault();const h=u[(c==null?void 0:c.userId)??""]??[];i(s===0?"":h[s-1]),o(()=>Math.max(s-1,-1))}}},...e})}),Ub=_.memo(_.forwardRef(({icon:e=nT,...t},n)=>{var o,a;const{value:r,sendMessage:i}=tp(),{theme:{composer:s}}=vt();return F.jsx("button",{ref:n,...t,...(o=s==null?void 0:s.button)==null?void 0:o.container,disabled:!r,onClick:i,children:F.jsx(e,{...(a=s==null?void 0:s.button)==null?void 0:a.icon})})})),Fb=({children:e})=>{const[t,n]=_.useState(!1),[r,i]=_.useState(""),[s,o]=_.useState(null),a=({title:c,content:u})=>{i(c),o(u),n(!0)},l=()=>{n(!1)};return F.jsxs(rp.Provider,{value:{hideModal:l,showModal:a,title:r,content:s,open:t},children:[F.jsx(ii,{open:t,onOpenChange:n,children:F.jsx(ii.Content,{title:r,children:s})}),e]})},V2=({theme:e={},renderers:t,client:n,children:r,configuration:i={},userData:s,closeWindow:o,...a})=>{const[l,c]=_.useState(0),[u,d]=_.useState([]),[h,f]=_.useState({disableComposer:!1,...a.defaultState,connected:!0}),[p,m]=_.useState(i),[v,y]=_.useState(e),b=Hr(T=>T.addMessageToHistory),x=Hr(T=>T.setConversationId),I=Hr(T=>T.user),A=Hr(T=>T.conversationId),O=Hr(T=>T.setUser),j=Hr(T=>T.setClientMode),U=_.useRef(null),H={...a,value:{theme:v,renderers:{...lu,...t},messages:u,messageContainerRef:U,setMessages:d,eventEmitter:Gw,configuration:i,setConfiguration:m,state:h,closeWindow:o,setState:T=>f({...h,...T}),setTheme:T=>{y(T)},client:n?{...n,sendMessage:async T=>{await n.sendMessage(T),d(N=>[...N,{direction:"outgoing",sender:{name:"You"},timestamp:new Date,block:{type:"bubble",block:{type:"text",text:T}}}]),n.userId&&b({message:T,userId:n.userId})},on:n.on,restartConversation:async()=>{await n.newConversation(),d([])}}:void 0}};return vi(()=>{n&&j(n.mode)}),vi(()=>{if(n)return n.on("message",T=>{try{const N=T.payload;d(G=>[...G,{direction:"incoming",sender:{name:p.botName??"Bot",avatar:p.botAvatar},timestamp:new Date(T.sentOn),block:N}])}catch{console.error("Invalid message payload")}})}),gu(async()=>{if(n)return n.on("error",()=>{console.log("client disconnected"),c(T=>T+1)})}),vi(()=>{if(n)return n.on("conversation",T=>{x(T)})}),gu(async()=>{if(!n)return;let T;try{T=await n.connect(I,s),f(G=>({...G,connected:!0}))}catch{f(W=>({...W,connected:!1}));return}O(T),A&&await n.conversationExists(A)?await n.switchConversation(A):await n.newConversation();const N=[];for(const G of await n.listMessages())try{const W=G.payload,q=G.authorId===n.userId?"outgoing":"incoming";N.push({direction:q,sender:q==="outgoing"?{name:"You"}:{name:p.botName??"Bot",avatar:p.botAvatar},timestamp:new Date(G.sentOn),block:W})}catch{console.error("Invalid message payload")}return d(N.reverse()),()=>{n.disconnect()}},[l]),F.jsx(sp.Provider,{...H,children:typeof r=="function"?r(p):r})};function Pr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}const z2=R["useId".toString()]||(()=>{});let Z2=0;function wl(e){const[t,n]=R.useState(z2());return xs(()=>{e||n(r=>r??String(Z2++))},[e]),e||(t?`radix-${t}`:"")}function Bb({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=W2({defaultProp:t,onChange:n}),s=e!==void 0,o=s?e:r,a=Mr(n),l=_.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else i(c)},[s,e,i,a]);return[o,l]}function W2({defaultProp:e,onChange:t}){const n=_.useState(e),[r]=n,i=_.useRef(r),s=Mr(t);return _.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}function H2(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(e);_.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Ed="dismissableLayer.update",q2="dismissableLayer.pointerDownOutside",K2="dismissableLayer.focusOutside";let Vb;const J2=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),G2=_.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=e,u=_.useContext(J2),[d,h]=_.useState(null),f=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,p]=_.useState({}),m=li(t,U=>h(U)),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=d?v.indexOf(d):-1,I=u.layersWithOutsidePointerEventsDisabled.size>0,A=x>=b,O=Y2(U=>{const H=U.target,T=[...u.branches].some(N=>N.contains(H));!A||T||(s==null||s(U),a==null||a(U),U.defaultPrevented||l==null||l())},f),j=Q2(U=>{const H=U.target;[...u.branches].some(N=>N.contains(H))||(o==null||o(U),a==null||a(U),U.defaultPrevented||l==null||l())},f);return H2(U=>{x===u.layers.size-1&&(i==null||i(U),!U.defaultPrevented&&l&&(U.preventDefault(),l()))},f),_.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Vb=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),zb(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Vb)}},[d,f,r,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),zb())},[d,u]),_.useEffect(()=>{const U=()=>p({});return document.addEventListener(Ed,U),()=>document.removeEventListener(Ed,U)},[]),_.createElement(An.div,_t({},c,{ref:m,style:{pointerEvents:I?A?"auto":"none":void 0,...e.style},onFocusCapture:Pr(e.onFocusCapture,j.onFocusCapture),onBlurCapture:Pr(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Pr(e.onPointerDownCapture,O.onPointerDownCapture)}))});function Y2(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(e),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Zb(q2,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Q2(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(e),r=_.useRef(!1);return _.useEffect(()=>{const i=s=>{s.target&&!r.current&&Zb(K2,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function zb(){const e=new CustomEvent(Ed);document.dispatchEvent(e)}function Zb(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Zw(i,s):i.dispatchEvent(s)}const Sd="focusScope.autoFocusOnMount",Td="focusScope.autoFocusOnUnmount",Wb={bubbles:!1,cancelable:!0},X2=_.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[a,l]=_.useState(null),c=Mr(i),u=Mr(s),d=_.useRef(null),h=li(t,m=>l(m)),f=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let m=function(x){if(f.paused||!a)return;const I=x.target;a.contains(I)?d.current=I:ri(d.current,{select:!0})},v=function(x){if(f.paused||!a)return;const I=x.relatedTarget;I!==null&&(a.contains(I)||ri(d.current,{select:!0}))},y=function(x){const I=document.activeElement;for(const A of x)A.removedNodes.length>0&&(a!=null&&a.contains(I)||ri(a))};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),b.disconnect()}}},[r,a,f.paused]),_.useEffect(()=>{if(a){Kb.add(f);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(Sd,Wb);a.addEventListener(Sd,c),a.dispatchEvent(y),y.defaultPrevented||(ej(sj(Hb(a)),{select:!0}),document.activeElement===m&&ri(a))}return()=>{a.removeEventListener(Sd,c),setTimeout(()=>{const y=new CustomEvent(Td,Wb);a.addEventListener(Td,u),a.dispatchEvent(y),y.defaultPrevented||ri(m??document.body,{select:!0}),a.removeEventListener(Td,u),Kb.remove(f)},0)}}},[a,c,u,f]);const p=_.useCallback(m=>{if(!n&&!r||f.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const b=m.currentTarget,[x,I]=tj(b);x&&I?!m.shiftKey&&y===I?(m.preventDefault(),n&&ri(x,{select:!0})):m.shiftKey&&y===x&&(m.preventDefault(),n&&ri(I,{select:!0})):y===b&&m.preventDefault()}},[n,r,f.paused]);return _.createElement(An.div,_t({tabIndex:-1},o,{ref:h,onKeyDown:p}))});function ej(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ri(r,{select:t}),document.activeElement!==n)return}function tj(e){const t=Hb(e),n=qb(t,e),r=qb(t.reverse(),e);return[n,r]}function Hb(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qb(e,t){for(const n of e)if(!nj(n,{upTo:t}))return n}function nj(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function rj(e){return e instanceof HTMLInputElement&&"select"in e}function ri(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rj(e)&&t&&e.select()}}const Kb=ij();function ij(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Jb(e,t),e.unshift(t)},remove(t){var n;e=Jb(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function Jb(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function sj(e){return e.filter(t=>t.tagName!=="A")}function oj(e,t){return _.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const xl=e=>{const{present:t,children:n}=e,r=aj(t),i=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),s=li(r.ref,i.ref);return typeof n=="function"||r.isPresent?_.cloneElement(i,{ref:s}):null};xl.displayName="Presence";function aj(e){const[t,n]=_.useState(),r=_.useRef({}),i=_.useRef(e),s=_.useRef("none"),o=e?"mounted":"unmounted",[a,l]=oj(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=_l(r.current);s.current=a==="mounted"?c:"none"},[a]),xs(()=>{const c=r.current,u=i.current;if(u!==e){const h=s.current,f=_l(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),xs(()=>{if(t){const c=d=>{const f=_l(r.current).includes(d.animationName);d.target===t&&f&&Gn.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(s.current=_l(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function _l(e){return(e==null?void 0:e.animationName)||"none"}let Od=0;function lj(){_.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:Gb()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:Gb()),Od++,()=>{Od===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Od--}},[])}function Gb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var kl="right-scroll-bar-position",Cl="width-before-scroll-bar",cj="with-scroll-bars-hidden",uj="--removed-body-scroll-bar-size";function dj(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function fj(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function hj(e,t){return fj(t||null,function(n){return e.forEach(function(r){return dj(r,n)})})}function pj(e){return e}function mj(e,t){t===void 0&&(t=pj);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var o=t(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var l=function(){var u=o;o=[],u.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){o.push(u),c()},filter:function(u){return o=o.filter(u),n}}}};return i}function gj(e){e===void 0&&(e={});var t=mj(null);return t.options=Mn({async:!0,ssr:!1},e),t}var Yb=function(e){var t=e.sideCar,n=$m(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return R.createElement(r,Mn({},n))};Yb.isSideCarExport=!0;function yj(e,t){return e.useMedium(t),Yb}var Qb=gj(),Id=function(){},El=R.forwardRef(function(e,t){var n=R.useRef(null),r=R.useState({onScrollCapture:Id,onWheelCapture:Id,onTouchMoveCapture:Id}),i=r[0],s=r[1],o=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noIsolation,p=e.inert,m=e.allowPinchZoom,v=e.as,y=v===void 0?"div":v,b=$m(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=h,I=hj([n,t]),A=Mn(Mn({},b),i);return R.createElement(R.Fragment,null,u&&R.createElement(x,{sideCar:Qb,removeScrollBar:c,shards:d,noIsolation:f,inert:p,setCallbacks:s,allowPinchZoom:!!m,lockRef:n}),o?R.cloneElement(R.Children.only(a),Mn(Mn({},A),{ref:I})):R.createElement(y,Mn({},A,{className:l,ref:I}),a))});El.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},El.classNames={fullWidth:Cl,zeroRight:kl};var Xb,vj=function(){if(Xb)return Xb;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bj(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=vj();return t&&e.setAttribute("nonce",t),e}function wj(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xj(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var _j=function(){var e=0,t=null;return{add:function(n){e==0&&(t=bj())&&(wj(t,n),xj(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},kj=function(){var e=_j();return function(t,n){R.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ew=function(){var e=kj(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Cj={left:0,top:0,right:0,gap:0},Pd=function(e){return parseInt(e||"",10)||0},Ej=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Pd(n),Pd(r),Pd(i)]},Sj=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Cj;var t=Ej(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Tj=ew(),Oj=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),`
289
+ .`.concat(cj,` {
290
290
  overflow: hidden `).concat(r,`;
291
291
  padding-right: `).concat(a,"px ").concat(r,`;
292
292
  }
@@ -303,26 +303,26 @@ to {
303
303
  `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
304
304
  }
305
305
 
306
- .`).concat(El,` {
306
+ .`).concat(kl,` {
307
307
  right: `).concat(a,"px ").concat(r,`;
308
308
  }
309
309
 
310
- .`).concat(Sl,` {
310
+ .`).concat(Cl,` {
311
311
  margin-right: `).concat(a,"px ").concat(r,`;
312
312
  }
313
313
 
314
- .`).concat(El," .").concat(El,` {
314
+ .`).concat(kl," .").concat(kl,` {
315
315
  right: 0 `).concat(r,`;
316
316
  }
317
317
 
318
- .`).concat(Sl," .").concat(Sl,` {
318
+ .`).concat(Cl," .").concat(Cl,` {
319
319
  margin-right: 0 `).concat(r,`;
320
320
  }
321
321
 
322
322
  body {
323
- `).concat(yj,": ").concat(a,`px;
323
+ `).concat(uj,": ").concat(a,`px;
324
324
  }
325
- `)},Dj=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,s=R.useMemo(function(){return $j(i)},[i]);return R.createElement(Mj,{styles:Lj(s,!t,i,n?"":"!important")})},$d=!1;if(typeof window<"u")try{var Ol=Object.defineProperty({},"passive",{get:function(){return $d=!0,!0}});window.addEventListener("test",Ol,Ol),window.removeEventListener("test",Ol,Ol)}catch{$d=!1}var ps=$d?{passive:!1}:!1,Nj=function(e){return e.tagName==="TEXTAREA"},rw=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Nj(e)&&n[t]==="visible")},jj=function(e){return rw(e,"overflowY")},Uj=function(e){return rw(e,"overflowX")},iw=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=sw(e,n);if(r){var i=ow(e,n),s=i[1],o=i[2];if(s>o)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Fj=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Bj=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},sw=function(e,t){return e==="v"?jj(t):Uj(t)},ow=function(e,t){return e==="v"?Fj(t):Bj(t)},Vj=function(e,t){return e==="h"&&t==="rtl"?-1:1},zj=function(e,t,n,r,i){var s=Vj(e,window.getComputedStyle(t).direction),o=s*r,a=n.target,l=t.contains(a),c=!1,u=o>0,d=0,h=0;do{var f=ow(e,a),p=f[0],m=f[1],y=f[2],v=m-y-s*p;(p||v)&&sw(e,a)&&(d+=v,h+=p),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(i&&d===0||!i&&o>d)||!u&&(i&&h===0||!i&&-o>h))&&(c=!0),c},Il=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},aw=function(e){return[e.deltaX,e.deltaY]},lw=function(e){return e&&"current"in e?e.current:e},Zj=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Wj=function(e){return`
325
+ `)},Ij=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,s=R.useMemo(function(){return Sj(i)},[i]);return R.createElement(Tj,{styles:Oj(s,!t,i,n?"":"!important")})},Ad=!1;if(typeof window<"u")try{var Sl=Object.defineProperty({},"passive",{get:function(){return Ad=!0,!0}});window.addEventListener("test",Sl,Sl),window.removeEventListener("test",Sl,Sl)}catch{Ad=!1}var ps=Ad?{passive:!1}:!1,Pj=function(e){return e.tagName==="TEXTAREA"},tw=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Pj(e)&&n[t]==="visible")},Aj=function(e){return tw(e,"overflowY")},Rj=function(e){return tw(e,"overflowX")},nw=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=rw(e,n);if(r){var i=iw(e,n),s=i[1],o=i[2];if(s>o)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},$j=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Mj=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},rw=function(e,t){return e==="v"?Aj(t):Rj(t)},iw=function(e,t){return e==="v"?$j(t):Mj(t)},Lj=function(e,t){return e==="h"&&t==="rtl"?-1:1},Dj=function(e,t,n,r,i){var s=Lj(e,window.getComputedStyle(t).direction),o=s*r,a=n.target,l=t.contains(a),c=!1,u=o>0,d=0,h=0;do{var f=iw(e,a),p=f[0],m=f[1],v=f[2],y=m-v-s*p;(p||y)&&rw(e,a)&&(d+=y,h+=p),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(i&&d===0||!i&&o>d)||!u&&(i&&h===0||!i&&-o>h))&&(c=!0),c},Tl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sw=function(e){return[e.deltaX,e.deltaY]},ow=function(e){return e&&"current"in e?e.current:e},Nj=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jj=function(e){return`
326
326
  .block-interactivity-`.concat(e,` {pointer-events: none;}
327
327
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
328
- `)},Hj=0,ms=[];function qj(e){var t=R.useRef([]),n=R.useRef([0,0]),r=R.useRef(),i=R.useState(Hj++)[0],s=R.useState(function(){return nw()})[0],o=R.useRef(e);R.useEffect(function(){o.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var m=rP([e.lockRef.current],(e.shards||[]).map(lw),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=R.useCallback(function(m,y){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var v=Il(m),b=n.current,x="deltaX"in m?m.deltaX:b[0]-v[0],I="deltaY"in m?m.deltaY:b[1]-v[1],P,T=m.target,j=Math.abs(x)>Math.abs(I)?"h":"v";if("touches"in m&&j==="h"&&T.type==="range")return!1;var U=iw(j,T);if(!U)return!0;if(U?P=j:(P=j==="v"?"h":"v",U=iw(j,T)),!U)return!1;if(!r.current&&"changedTouches"in m&&(x||I)&&(r.current=P),!P)return!0;var F=r.current||P;return zj(F,y,m,F==="h"?x:I,!0)},[]),l=R.useCallback(function(m){var y=m;if(!(!ms.length||ms[ms.length-1]!==s)){var v="deltaY"in y?aw(y):Il(y),b=t.current.filter(function(P){return P.name===y.type&&P.target===y.target&&Zj(P.delta,v)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var x=(o.current.shards||[]).map(lw).filter(Boolean).filter(function(P){return P.contains(y.target)}),I=x.length>0?a(y,x[0]):!o.current.noIsolation;I&&y.cancelable&&y.preventDefault()}}},[]),c=R.useCallback(function(m,y,v,b){var x={name:m,delta:y,target:v,should:b};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(I){return I!==x})},1)},[]),u=R.useCallback(function(m){n.current=Il(m),r.current=void 0},[]),d=R.useCallback(function(m){c(m.type,aw(m),m.target,a(m,e.lockRef.current))},[]),h=R.useCallback(function(m){c(m.type,Il(m),m.target,a(m,e.lockRef.current))},[]);R.useEffect(function(){return ms.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,ps),document.addEventListener("touchmove",l,ps),document.addEventListener("touchstart",u,ps),function(){ms=ms.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,ps),document.removeEventListener("touchmove",l,ps),document.removeEventListener("touchstart",u,ps)}},[]);var f=e.removeScrollBar,p=e.inert;return R.createElement(R.Fragment,null,p?R.createElement(s,{styles:Wj(i)}):null,f?R.createElement(Dj,{gapMode:"margin"}):null)}const Kj=Cj(ew,qj);var cw=R.forwardRef(function(e,t){return R.createElement(Tl,Mn({},e,{ref:t,sideCar:Kj}))});cw.classNames=Tl.classNames;const Jj=cw;var Gj=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},gs=new WeakMap,Pl=new WeakMap,Al={},Md=0,uw=function(e){return e&&(e.host||uw(e.parentNode))},Yj=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=uw(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Qj=function(e,t,n,r){var i=Yj(t,Array.isArray(e)?e:[e]);Al[n]||(Al[n]=new WeakMap);var s=Al[n],o=[],a=new Set,l=new Set(i),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))u(h);else{var f=h.getAttribute(r),p=f!==null&&f!=="false",m=(gs.get(h)||0)+1,y=(s.get(h)||0)+1;gs.set(h,m),s.set(h,y),o.push(h),m===1&&p&&Pl.set(h,!0),y===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}})};return u(t),a.clear(),Md++,function(){o.forEach(function(d){var h=gs.get(d)-1,f=s.get(d)-1;gs.set(d,h),s.set(d,f),h||(Pl.has(d)||d.removeAttribute(r),Pl.delete(d)),f||d.removeAttribute(n)}),Md--,Md||(gs=new WeakMap,gs=new WeakMap,Pl=new WeakMap,Al={})}},Xj=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||Gj(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Qj(r,i,n,"aria-hidden")):function(){return null}};const dw="Dialog",[fw,dB]=Nl(dw),[eU,Ar]=fw(dw),tU=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=e,a=_.useRef(null),l=_.useRef(null),[c=!1,u]=zb({prop:r,defaultProp:i,onChange:s});return _.createElement(eU,{scope:t,triggerRef:a,contentRef:l,contentId:_l(),titleId:_l(),descriptionId:_l(),open:c,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(d=>!d),[u]),modal:o},n)},nU="DialogTrigger",rU=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ar(nU,n),s=li(t,i.triggerRef);return _.createElement(Pn.button,_t({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Dd(i.open)},r,{ref:s,onClick:Pr(e.onClick,i.onOpenToggle)}))}),iU="DialogPortal",[fB,hw]=fw(iU,{forceMount:void 0}),Ld="DialogOverlay",sU=_.forwardRef((e,t)=>{const n=hw(Ld,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Ar(Ld,e.__scopeDialog);return s.modal?_.createElement(kl,{present:r||s.open},_.createElement(oU,_t({},i,{ref:t}))):null}),oU=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ar(Ld,n);return _.createElement(Jj,{as:jl,allowPinchZoom:!0,shards:[i.contentRef]},_.createElement(Pn.div,_t({"data-state":Dd(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),ko="DialogContent",aU=_.forwardRef((e,t)=>{const n=hw(ko,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Ar(ko,e.__scopeDialog);return _.createElement(kl,{present:r||s.open},s.modal?_.createElement(lU,_t({},i,{ref:t})):_.createElement(cU,_t({},i,{ref:t})))}),lU=_.forwardRef((e,t)=>{const n=Ar(ko,e.__scopeDialog),r=_.useRef(null),i=li(t,n.contentRef,r);return _.useEffect(()=>{const s=r.current;if(s)return Xj(s)},[]),_.createElement(pw,_t({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pr(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:Pr(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:Pr(e.onFocusOutside,s=>s.preventDefault())}))}),cU=_.forwardRef((e,t)=>{const n=Ar(ko,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return _.createElement(pw,_t({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=e.onCloseAutoFocus)===null||o===void 0||o.call(e,s),!s.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=e.onInteractOutside)===null||o===void 0||o.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=s.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),pw=_.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,a=Ar(ko,n),l=_.useRef(null),c=li(t,l);return mj(),_.createElement(_.Fragment,null,_.createElement(oj,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s},_.createElement(rj,_t({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Dd(a.open)},o,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),uU="DialogTitle",dU=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ar(uU,n);return _.createElement(Pn.h2,_t({id:i.titleId},r,{ref:t}))}),fU="DialogClose",hU=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ar(fU,n);return _.createElement(Pn.button,_t({type:"button"},r,{ref:t,onClick:Pr(e.onClick,()=>i.onOpenChange(!1))}))});function Dd(e){return e?"open":"closed"}const pU=tU,mU=rU,gU=sU,yU=aU,vU=dU,mw=hU;function bU({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))}const gw=R.forwardRef(bU);function ii({open:e,onOpenChange:t,children:n}){return z.jsx(pU,{open:e,onOpenChange:t,children:n})}function wU({title:e,children:t}){var r,i,s,o,a,l,c,u;const{theme:{modal:n}}=mt();return z.jsxs(z.Fragment,{children:[z.jsx(gU,{...n==null?void 0:n.overlay}),z.jsx("div",{...n==null?void 0:n.container,children:z.jsxs(yU,{...(r=n==null?void 0:n.dialog)==null?void 0:r.container,children:[z.jsxs("div",{...(s=(i=n==null?void 0:n.dialog)==null?void 0:i.title)==null?void 0:s.container,children:[z.jsx(vU,{...(a=(o=n==null?void 0:n.dialog)==null?void 0:o.title)==null?void 0:a.text,children:e}),z.jsx(mw,{children:z.jsx(gw,{role:"button",tabIndex:0,...(c=(l=n==null?void 0:n.dialog)==null?void 0:l.title)==null?void 0:c.closeIcon})})]}),z.jsx("div",{...(u=n==null?void 0:n.dialog)==null?void 0:u.content,children:t})]})})]})}ii.Button=mU,ii.Close=mw,ii.Content=wU;const yw=_.forwardRef(({children:e,...t},n)=>{const{theme:{container:r}}=mt();return z.jsxs("div",{...t,...r,ref:n,children:[z.jsx(wS,{}),z.jsxs(Vb,{children:[z.jsx(xU,{}),e]})]})}),xU=()=>{const{theme:{modal:e},state:{connected:t}}=mt(),{showModal:n}=op();return _.useEffect(()=>{var r,i,s,o;t||n({title:"Connection Error",content:z.jsxs(z.Fragment,{children:[z.jsx("p",{...(i=(r=e==null?void 0:e.dialog)==null?void 0:r.newConversation)==null?void 0:i.text,children:"There was an error connecting to the server. Please check your internet connection and try again."}),z.jsx(ii.Close,{asChild:!0,children:z.jsx("button",{...(o=(s=e==null?void 0:e.dialog)==null?void 0:s.newConversation)==null?void 0:o.button,onClick:()=>window.location.reload(),children:"Restart"})})]})})},[t]),z.jsx(z.Fragment,{})},_U=_.forwardRef(({children:e,onClick:t,...n},r)=>{const{theme:{fab:i}}=mt(),{container:s,icon:o}=i??{};return z.jsx("div",{...n,...s,ref:r,onClick:t,children:z.jsx("div",{...o})})}),vw="Collapsible",[kU,pB]=Nl(vw),[CU,Nd]=kU(vw),EU=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:o,...a}=e,[l=!1,c]=zb({prop:r,defaultProp:i,onChange:o});return _.createElement(CU,{scope:n,disabled:s,contentId:_l(),open:l,onOpenToggle:_.useCallback(()=>c(u=>!u),[c])},_.createElement(Pn.div,_t({"data-state":jd(l),"data-disabled":s?"":void 0},a,{ref:t})))}),SU="CollapsibleTrigger",TU=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Nd(SU,n);return _.createElement(Pn.button,_t({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":jd(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:t,onClick:Pr(e.onClick,i.onOpenToggle)}))}),bw="CollapsibleContent",OU=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Nd(bw,e.__scopeCollapsible);return _.createElement(kl,{present:n||i.open},({present:s})=>_.createElement(IU,_t({},r,{ref:t,present:s})))}),IU=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=e,o=Nd(bw,n),[a,l]=_.useState(r),c=_.useRef(null),u=li(t,c),d=_.useRef(0),h=d.current,f=_.useRef(0),p=f.current,m=o.open||a,y=_.useRef(m),v=_.useRef();return _.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),xs(()=>{const b=c.current;if(b){v.current=v.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const x=b.getBoundingClientRect();d.current=x.height,f.current=x.width,y.current||(b.style.transitionDuration=v.current.transitionDuration,b.style.animationName=v.current.animationName),l(r)}},[o.open,r]),_.createElement(Pn.div,_t({"data-state":jd(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m},s,{ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style}}),m&&i)});function jd(e){return e?"open":"closed"}const PU=EU,AU=TU,RU=OU,$U=e=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16",...e},R.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M15.5 5.5v-5m0 0h-5m5 0L8.833 7.167m-2.5-5H4.5c-1.4 0-2.1 0-2.635.272A2.5 2.5 0 0 0 .772 3.532C.5 4.066.5 4.767.5 6.167V11.5c0 1.4 0 2.1.272 2.635a2.5 2.5 0 0 0 1.093 1.092C2.4 15.5 3.1 15.5 4.5 15.5h5.333c1.4 0 2.1 0 2.635-.273a2.5 2.5 0 0 0 1.093-1.092c.272-.535.272-1.235.272-2.635V9.667"})),MU=_.memo(_.forwardRef((e,t)=>{const{theme:{header:n}}=mt(),[r,i]=_.useState(!1);return z.jsx(PU,{...e,...n==null?void 0:n.container,open:r,onOpenChange:i,ref:t})})),LU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=mt();return z.jsx(AU,{...e,...(r=n==null?void 0:n.content)==null?void 0:r.container,ref:t})}),DU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=mt();return z.jsx(RU,{...e,...(r=n==null?void 0:n.expandedContent)==null?void 0:r.container,ref:t})}),NU=_.forwardRef(({src:e,children:t},n)=>{var s;const{theme:{header:r},client:i}=mt();return z.jsx(Bl,{ref:n,userId:i==null?void 0:i.clientId,children:t,src:e,...(s=r==null?void 0:r.content)==null?void 0:s.avatar})}),jU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=mt();return z.jsx("h2",{...e,...(r=n==null?void 0:n.content)==null?void 0:r.title,ref:t})}),UU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=mt();return z.jsx("p",{...e,...(r=n==null?void 0:n.content)==null?void 0:r.description,ref:t})}),FU=_.forwardRef((e,t)=>{var r,i;const{theme:{header:n}}=mt();return z.jsx("div",{...e,...(i=(r=n==null?void 0:n.content)==null?void 0:r.actions)==null?void 0:i.container,ref:t})}),On=Object.assign(MU,{Content:LU,ExpandedContent:DU,Avatar:NU,Description:UU,Title:jU,Actions:FU,DescriptionItem:({icon:e,title:t,link:n,...r})=>{var a,l,c,u,d,h,f,p,m,y,v,b;const{theme:{header:i}}=mt(),s=e??$U,o=x=>{x&&IE(x)};return!n&&!t?null:n?z.jsxs("a",{...r,...(l=(a=i==null?void 0:i.expandedContent)==null?void 0:a.descriptionItems)==null?void 0:l.container,href:n,target:"_blank",rel:"noopener",children:[z.jsx(s,{...(u=(c=i==null?void 0:i.expandedContent)==null?void 0:c.descriptionItems)==null?void 0:u.icon}),z.jsx("p",{...(h=(d=i==null?void 0:i.expandedContent)==null?void 0:d.descriptionItems)==null?void 0:h.link,children:t})]}):z.jsxs("div",{...r,...(p=(f=i==null?void 0:i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:p.container,onClick:x=>{o(x.currentTarget.textContent)},children:[z.jsx(s,{...(y=(m=i==null?void 0:i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:y.icon}),z.jsx("p",{...(b=(v=i==null?void 0:i.expandedContent)==null?void 0:v.descriptionItems)==null?void 0:b.text,children:t})]})}}),ww=_.memo(({...e})=>{const{theme:{loadingIndicator:t}}=mt();return z.jsx("div",{...e,...t==null?void 0:t.container,children:z.jsx("div",{...t==null?void 0:t.loader})})}),Ud=_.forwardRef(({direction:e,block:t,scroll:n,disableInput:r,children:i,sender:s,...o},a)=>{var m,y,v,b;const[l,c]=_.useState([]),{theme:{message:u},configuration:{botAvatar:d,botName:h},client:f}=mt();uP(()=>{n()}),_.useEffect(()=>{l.length===0&&n()},[l.length]);const p=Qd((f==null?void 0:f.clientId)??"",15);return z.jsx(ip.Provider,{value:{isLoading:l,setIsLoading:c},children:z.jsxs("div",{...o,...u==null?void 0:u.container,"data-loaded":l.length===0,"data-disable-input":!!r,"data-direction":e,ref:a,children:[z.jsxs(Jd,{"data-color":p,...(m=u==null?void 0:u.avatar)==null?void 0:m.container,children:[z.jsx(Gd,{...(y=u==null?void 0:u.avatar)==null?void 0:y.image,src:(s==null?void 0:s.avatar)??d}),z.jsx(Yd,{...(v=u==null?void 0:u.avatar)==null?void 0:v.fallback,children:(s==null?void 0:s.name[0])??((b=h??"Bot")==null?void 0:b[0])})]}),t&&z.jsx(Wi,{block:t,styles:u==null?void 0:u.blocks}),i]})})});var xw={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Me,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",a="minute",l="hour",c="day",u="week",d="month",h="quarter",f="year",p="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(W){var B=["th","st","nd","rd"],V=W%100;return"["+W+(B[(V-20)%10]||B[V]||B[0])+"]"}},x=function(W,B,V){var Y=String(W);return!Y||Y.length>=B?W:""+Array(B+1-Y.length).join(V)+W},I={s:x,z:function(W){var B=-W.utcOffset(),V=Math.abs(B),Y=Math.floor(V/60),K=V%60;return(B<=0?"+":"-")+x(Y,2,"0")+":"+x(K,2,"0")},m:function W(B,V){if(B.date()<V.date())return-W(V,B);var Y=12*(V.year()-B.year())+(V.month()-B.month()),K=B.clone().add(Y,d),pe=V-K<0,k=B.clone().add(Y+(pe?-1:1),d);return+(-(Y+(V-K)/(pe?K-k:k-K))||0)},a:function(W){return W<0?Math.ceil(W)||0:Math.floor(W)},p:function(W){return{M:d,y:f,w:u,d:c,D:p,h:l,m:a,s:o,ms:s,Q:h}[W]||String(W||"").toLowerCase().replace(/s$/,"")},u:function(W){return W===void 0}},P="en",T={};T[P]=b;var j="$isDayjsObject",U=function(W){return W instanceof J||!(!W||!W[j])},F=function W(B,V,Y){var K;if(!B)return P;if(typeof B=="string"){var pe=B.toLowerCase();T[pe]&&(K=pe),V&&(T[pe]=V,K=pe);var k=B.split("-");if(!K&&k.length>1)return W(k[0])}else{var ee=B.name;T[ee]=B,K=ee}return!Y&&K&&(P=K),K||!Y&&P},O=function(W,B){if(U(W))return W.clone();var V=typeof B=="object"?B:{};return V.date=W,V.args=arguments,new J(V)},N=I;N.l=F,N.i=U,N.w=function(W,B){return O(W,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var J=function(){function W(V){this.$L=F(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[j]=!0}var B=W.prototype;return B.parse=function(V){this.$d=function(Y){var K=Y.date,pe=Y.utc;if(K===null)return new Date(NaN);if(N.u(K))return new Date;if(K instanceof Date)return new Date(K);if(typeof K=="string"&&!/Z$/i.test(K)){var k=K.match(y);if(k){var ee=k[2]-1||0,xe=(k[7]||"0").substring(0,3);return pe?new Date(Date.UTC(k[1],ee,k[3]||1,k[4]||0,k[5]||0,k[6]||0,xe)):new Date(k[1],ee,k[3]||1,k[4]||0,k[5]||0,k[6]||0,xe)}}return new Date(K)}(V),this.init()},B.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},B.$utils=function(){return N},B.isValid=function(){return this.$d.toString()!==m},B.isSame=function(V,Y){var K=O(V);return this.startOf(Y)<=K&&K<=this.endOf(Y)},B.isAfter=function(V,Y){return O(V)<this.startOf(Y)},B.isBefore=function(V,Y){return this.endOf(Y)<O(V)},B.$g=function(V,Y,K){return N.u(V)?this[Y]:this.set(K,V)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(V,Y){var K=this,pe=!!N.u(Y)||Y,k=N.p(V),ee=function(Ue,_e){var ve=N.w(K.$u?Date.UTC(K.$y,_e,Ue):new Date(K.$y,_e,Ue),K);return pe?ve:ve.endOf(c)},xe=function(Ue,_e){return N.w(K.toDate()[Ue].apply(K.toDate("s"),(pe?[0,0,0,0]:[23,59,59,999]).slice(_e)),K)},S=this.$W,Te=this.$M,Ne=this.$D,Ie="set"+(this.$u?"UTC":"");switch(k){case f:return pe?ee(1,0):ee(31,11);case d:return pe?ee(1,Te):ee(0,Te+1);case u:var je=this.$locale().weekStart||0,De=(S<je?S+7:S)-je;return ee(pe?Ne-De:Ne+(6-De),Te);case c:case p:return xe(Ie+"Hours",0);case l:return xe(Ie+"Minutes",1);case a:return xe(Ie+"Seconds",2);case o:return xe(Ie+"Milliseconds",3);default:return this.clone()}},B.endOf=function(V){return this.startOf(V,!1)},B.$set=function(V,Y){var K,pe=N.p(V),k="set"+(this.$u?"UTC":""),ee=(K={},K[c]=k+"Date",K[p]=k+"Date",K[d]=k+"Month",K[f]=k+"FullYear",K[l]=k+"Hours",K[a]=k+"Minutes",K[o]=k+"Seconds",K[s]=k+"Milliseconds",K)[pe],xe=pe===c?this.$D+(Y-this.$W):Y;if(pe===d||pe===f){var S=this.clone().set(p,1);S.$d[ee](xe),S.init(),this.$d=S.set(p,Math.min(this.$D,S.daysInMonth())).$d}else ee&&this.$d[ee](xe);return this.init(),this},B.set=function(V,Y){return this.clone().$set(V,Y)},B.get=function(V){return this[N.p(V)]()},B.add=function(V,Y){var K,pe=this;V=Number(V);var k=N.p(Y),ee=function(Te){var Ne=O(pe);return N.w(Ne.date(Ne.date()+Math.round(Te*V)),pe)};if(k===d)return this.set(d,this.$M+V);if(k===f)return this.set(f,this.$y+V);if(k===c)return ee(1);if(k===u)return ee(7);var xe=(K={},K[a]=r,K[l]=i,K[o]=n,K)[k]||1,S=this.$d.getTime()+V*xe;return N.w(S,this)},B.subtract=function(V,Y){return this.add(-1*V,Y)},B.format=function(V){var Y=this,K=this.$locale();if(!this.isValid())return K.invalidDate||m;var pe=V||"YYYY-MM-DDTHH:mm:ssZ",k=N.z(this),ee=this.$H,xe=this.$m,S=this.$M,Te=K.weekdays,Ne=K.months,Ie=K.meridiem,je=function(_e,ve,ke,Ce){return _e&&(_e[ve]||_e(Y,pe))||ke[ve].slice(0,Ce)},De=function(_e){return N.s(ee%12||12,_e,"0")},Ue=Ie||function(_e,ve,ke){var Ce=_e<12?"AM":"PM";return ke?Ce.toLowerCase():Ce};return pe.replace(v,function(_e,ve){return ve||function(ke){switch(ke){case"YY":return String(Y.$y).slice(-2);case"YYYY":return N.s(Y.$y,4,"0");case"M":return S+1;case"MM":return N.s(S+1,2,"0");case"MMM":return je(K.monthsShort,S,Ne,3);case"MMMM":return je(Ne,S);case"D":return Y.$D;case"DD":return N.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return je(K.weekdaysMin,Y.$W,Te,2);case"ddd":return je(K.weekdaysShort,Y.$W,Te,3);case"dddd":return Te[Y.$W];case"H":return String(ee);case"HH":return N.s(ee,2,"0");case"h":return De(1);case"hh":return De(2);case"a":return Ue(ee,xe,!0);case"A":return Ue(ee,xe,!1);case"m":return String(xe);case"mm":return N.s(xe,2,"0");case"s":return String(Y.$s);case"ss":return N.s(Y.$s,2,"0");case"SSS":return N.s(Y.$ms,3,"0");case"Z":return k}return null}(_e)||k.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(V,Y,K){var pe,k=this,ee=N.p(Y),xe=O(V),S=(xe.utcOffset()-this.utcOffset())*r,Te=this-xe,Ne=function(){return N.m(k,xe)};switch(ee){case f:pe=Ne()/12;break;case d:pe=Ne();break;case h:pe=Ne()/3;break;case u:pe=(Te-S)/6048e5;break;case c:pe=(Te-S)/864e5;break;case l:pe=Te/i;break;case a:pe=Te/r;break;case o:pe=Te/n;break;default:pe=Te}return K?pe:N.a(pe)},B.daysInMonth=function(){return this.endOf(d).$D},B.$locale=function(){return T[this.$L]},B.locale=function(V,Y){if(!V)return this.$L;var K=this.clone(),pe=F(V,Y,!0);return pe&&(K.$L=pe),K},B.clone=function(){return N.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},W}(),q=J.prototype;return O.prototype=q,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",d],["$y",f],["$D",p]].forEach(function(W){q[W[1]]=function(B){return this.$g(B,W[0],W[1])}}),O.extend=function(W,B){return W.$i||(W(B,J,O),W.$i=!0),O},O.locale=F,O.isDayjs=U,O.unix=function(W){return O(1e3*W)},O.en=T[P],O.Ls=T,O.p={},O})})(xw);var BU=xw.exports;const Rl=ai(BU);var _w={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Me,function(){return function(n,r,i){r.prototype.isToday=function(){var s="YYYY-MM-DD",o=i();return this.format(s)===o.format(s)}}})})(_w);var VU=_w.exports;const zU=ai(VU);var kw={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Me,function(){return function(n,r,i){r.prototype.isYesterday=function(){var s="YYYY-MM-DD",o=i().subtract(1,"day");return this.format(s)===o.format(s)}}})})(kw);var ZU=kw.exports;const WU=ai(ZU);Rl.extend(zU),Rl.extend(WU);function HU(e,t="day"){if(!e||e.length===0)return[];const n=[];n.push(Cw(e[0].timestamp));for(let r=0;r<e.length;r++)if(n.push(e[r]),r+1<e.length){const i=e[r].timestamp,s=e[r+1].timestamp;Rl(i).isSame(s,t)||n.push(Cw(s))}return n}function Cw(e){return{direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:qU(e)}}}function qU(e,t=!1){const n=Rl(e),r="h:mma";return n.isToday()?t?`Today • ${n.format(r)}`:"Today":n.isYesterday()?t?`Yesterday • ${n.format(r)}`:"Yesterday":t?n.format(`YYYY-MM-DD • ${r}`):n.format("YYYY-MM-DD")}const Ew=10*1e3,Sw=_.memo(({scrollDownButton:e,...t})=>{var b,x,I,P,T,j,U,F;const{configuration:n,theme:{messageList:r}}=mt(),{messages:i,setState:s,client:o}=mt(),a=_.useMemo(()=>HU(i),[i]),[l,c]=_.useState(!0),u=_.useRef(null),{y:d}=gP(u),[h,f]=_.useState(!1),[p,m]=vP(),y=()=>{if(!u.current)return;const{scrollHeight:O}=u.current;l&&u.current.scrollTo({top:O})};_.useEffect(()=>{const O=new Date(Date.now()-Ew+2e3);i.length>0&&i[i.length-1].timestamp<O&&f(!1)},[p]),bi(()=>o==null?void 0:o.on("messageSent",()=>{f(!0),m(new Date(Date.now()+Ew))})),bi(()=>o==null?void 0:o.on("message",()=>{f(!1)})),_.useEffect(()=>{const O=i[i.length-1];s({disableComposer:!!(O!=null&&O.disableInput)})},[i.length]),_.useEffect(()=>{if(!u.current)return;const{offsetHeight:O,scrollHeight:N,scrollTop:J}=u.current;c(N<=J+O+100)},[d]);const v=e!=null&&e.icon?e==null?void 0:e.icon:eT;return z.jsxs("ul",{...t,...r==null?void 0:r.container,ref:u,children:[z.jsx("li",{...(b=r==null?void 0:r.scrollDownButton)==null?void 0:b.container,children:!!i.length&&z.jsxs("button",{"data-is-at-bottom":l,...(x=r==null?void 0:r.scrollDownButton)==null?void 0:x.button,onClick:()=>{var O,N;return(N=u.current)==null?void 0:N.scrollBy({top:(O=u.current)==null?void 0:O.scrollHeight})},children:[(e==null?void 0:e.text)??"Back"," ",z.jsx(v,{...(I=r==null?void 0:r.scrollDownButton)==null?void 0:I.icon})]})}),z.jsxs("li",{...(P=r==null?void 0:r.marquee)==null?void 0:P.container,children:[z.jsx(Bl,{userId:o==null?void 0:o.clientId,src:n.botAvatar,...(T=r==null?void 0:r.marquee)==null?void 0:T.avatar,children:(n.botName||"Bot").slice(0,1)}),z.jsxs("div",{...(j=r==null?void 0:r.marquee)==null?void 0:j.content,children:[z.jsx("h1",{...(U=r==null?void 0:r.marquee)==null?void 0:U.title,children:n.botName||"Bot"}),z.jsx("p",{...(F=r==null?void 0:r.marquee)==null?void 0:F.description,children:n.botDescription})]})]}),a.map((O,N)=>z.jsx(Ud,{scroll:y,...O},N)),h&&z.jsx(Ud,{scroll:y,direction:"incoming",children:z.jsx(ww,{})})]})}),Tw=({...e})=>{var o,a;const{theme:{header:t,modal:n},client:r}=mt(),{showModal:i}=op(),s=l=>{var c,u,d,h;l.stopPropagation(),i({title:"Restart Conversation",content:z.jsxs(z.Fragment,{children:[z.jsx("p",{...(u=(c=n==null?void 0:n.dialog)==null?void 0:c.newConversation)==null?void 0:u.text,children:"Are you sure you want to restart a new conversation?"}),z.jsx(ii.Close,{asChild:!0,children:z.jsx("button",{...(h=(d=n==null?void 0:n.dialog)==null?void 0:d.newConversation)==null?void 0:h.button,onClick:r==null?void 0:r.restartConversation,children:"Restart"})})]})})};return z.jsx(nT,{...e,...(a=(o=t==null?void 0:t.content)==null?void 0:o.actions)==null?void 0:a.icons,role:"button",tabIndex:0,onClick:s,onKeyDown:l=>{l.key==="Enter"&&s(l)}})},KU=({...e})=>{var o,a;const{theme:{header:t,modal:n},closeWindow:r,client:i}=mt(),s=l=>{l.stopPropagation(),r==null||r()};return z.jsx(gw,{...e,...(a=(o=t==null?void 0:t.content)==null?void 0:o.actions)==null?void 0:a.icons,role:"button",tabIndex:0,onClick:s,onKeyDown:l=>{l.key==="Enter"&&s(l)}})},JU=()=>{var r,i,s,o,a,l,c,u,d,h,f,p,m,y,v;const{configuration:e,closeWindow:t}=mt(),n=!!((r=e.email)!=null&&r.title)||!!((i=e.phone)!=null&&i.title)||!!((s=e.website)!=null&&s.link)||!!((o=e.termsOfService)!=null&&o.link)||!!((a=e.privacyPolicy)!=null&&a.link);return z.jsxs(yw,{children:[z.jsxs(On,{children:[z.jsxs(On.Content,{disabled:!n,children:[z.jsx(On.Avatar,{src:e.botAvatar,children:e.botName||"Bot"}),z.jsx(On.Title,{children:e.botName||"Bot"}),z.jsx(On.Description,{children:e.botDescription}),z.jsxs(On.Actions,{children:[z.jsx(Tw,{}),t&&z.jsx(KU,{})]})]}),z.jsxs(On.ExpandedContent,{children:[z.jsx(On.DescriptionItem,{"data-email":"",icon:QT,title:(l=e.email)==null?void 0:l.title,link:(c=e.email)==null?void 0:c.link}),z.jsx(On.DescriptionItem,{"data-phone":"",icon:iO,title:(u=e.phone)==null?void 0:u.title,link:(d=e.phone)==null?void 0:d.link}),z.jsx(On.DescriptionItem,{"data-website":"",link:(h=e.website)==null?void 0:h.link,icon:eO,title:(f=e.website)==null?void 0:f.title}),z.jsx(On.DescriptionItem,{"data-terms":"",link:(p=e.termsOfService)==null?void 0:p.link,icon:GT,title:(m=e.termsOfService)==null?void 0:m.title}),z.jsx(On.DescriptionItem,{"data-privacy":"",link:(y=e.privacyPolicy)==null?void 0:y.link,icon:nO,title:(v=e.privacyPolicy)==null?void 0:v.title})]})]}),z.jsx(Sw,{}),z.jsxs(Ub,{children:[z.jsx(Fb,{placeholder:e.composerPlaceholder||"Type your message"}),z.jsx(Bb,{})]})]})},ys=H.object({title:H.string(),link:H.string().optional()}),Ow=H.object({composerPlaceholder:H.string().optional(),botName:H.string().optional(),botAvatar:H.string().optional(),botDescription:H.string().optional(),website:ys.optional(),email:ys.optional(),phone:ys.optional(),privacyPolicy:ys.optional(),termsOfService:ys.optional()}),Iw=H.enum(["heading1","heading2","heading3","text","horizontalRule","link","italic","bold","orderedList","unorderedList","listItem","lineBreak","pre"]),Pw=H.object({}).passthrough().transform(e=>e),Ee=H.object({className:H.string().optional(),style:Pw.optional()}),$l=H.object({container:Ee.optional(),image:Ee.optional(),fallback:Ee.optional()}),Aw=H.object({button:Ee.optional(),text:H.record(Iw,Ee.optional()),image:H.object({image:Ee.optional(),placeholder:Ee.optional()}).optional(),audio:Ee.optional(),video:Ee.optional(),file:H.object({container:Ee.optional(),title:Ee.optional(),icon:Ee.optional()}).optional(),location:H.object({container:Ee.optional(),title:Ee.optional(),icon:Ee.optional()}).optional(),column:Ee.optional(),row:Ee.optional(),bubble:Ee.optional(),carousel:H.object({container:Ee.optional(),slidesContainer:Ee.optional(),backButton:Ee.optional(),nextButton:Ee.optional()}).optional(),dropdown:H.object({button:H.object({container:Ee.optional(),icon:Ee.optional(),text:Ee.optional()}).optional(),content:H.object({container:Ee.optional(),item:Ee.optional()}).optional()}).optional()}),Rw=H.object({container:Ee.optional(),modal:H.object({overlay:Ee.optional(),container:Ee.optional(),dialog:H.object({container:Ee.optional(),title:H.object({container:Ee.optional(),text:Ee.optional(),closeIcon:Ee.optional()}).optional(),content:Ee.optional(),newConversation:H.object({text:Ee.optional(),button:Ee.optional()}).optional()}).optional()}).optional(),notification:H.object({container:Ee.optional(),title:Ee.optional(),description:Ee.optional(),icon:Ee.optional(),closeIcon:Ee.optional()}).optional(),header:H.object({container:Ee.optional(),content:H.object({container:Ee.optional(),title:Ee.optional(),description:Ee.optional(),avatar:$l.optional(),actions:H.object({container:Ee.optional(),icons:Ee.optional()}).optional()}),expandedContent:H.object({container:Ee.optional(),descriptionItems:H.object({container:Ee.optional(),icon:Ee.optional(),text:Ee.optional(),link:Ee.optional()}).optional()}).optional(),description:H.object({container:Ee.optional(),title:Ee.optional(),subtitle:Ee.optional()}).optional(),newConversationIcon:Ee.optional()}).optional(),composer:H.object({container:Ee.optional(),input:Ee.optional(),button:H.object({container:Ee.optional(),icon:Ee.optional()}).optional()}).optional(),fab:H.object({icon:Ee.optional(),container:Ee.optional()}).optional(),messageList:H.object({container:Ee.optional(),marquee:H.object({content:Ee.optional(),title:Ee.optional(),description:Ee.optional(),avatar:$l.optional(),container:Ee.optional()}).optional(),scrollDownButton:H.object({container:Ee.optional(),button:Ee.optional(),icon:Ee.optional()}).optional()}).optional(),message:H.object({container:Ee.optional(),avatar:$l.optional(),blocks:Aw.optional()}).optional(),loadingIndicator:H.object({container:Ee.optional(),loader:Ee.optional()}).optional()}),$w=H.enum(["opened","closed","initial"]),Mw=H.object({data:H.record(H.string()).optional()}),Lw=H.enum(["messaging","pushpin"]),Dw=H.object({configuration:Ow.optional().catch(void 0),theme:Rw.optional().catch(void 0),style:H.string().optional().catch(void 0),user:Mw.optional().catch(void 0)}),GU=Dw.extend({clientId:H.string(),botId:H.string(),selector:H.string().optional().catch(void 0),webchatScriptUrl:H.string().optional().catch(void 0),fabScriptUrl:H.string().optional().catch(void 0),messagingUrl:H.string().optional().catch(void 0),pushpinUrl:H.string().optional().catch(void 0),clientMode:Lw.optional().catch(void 0),defaultState:$w.optional().catch(void 0)}),YU=({clientId:e,apiUrl:t,mode:n="messaging"})=>n==="messaging"?new rb({url:t,clientId:e}):new jb({apiUrl:t,clientId:e});Ye.Avatar=Bl,Ye.Block=Wi,Ye.Composer=Ub,Ye.ComposerButton=Bb,Ye.ComposerInput=Fb,Ye.Container=yw,Ye.Fab=_U,Ye.Header=On,Ye.LoadingIndicator=ww,Ye.Message=Ud,Ye.MessageList=Sw,Ye.Modal=ii,Ye.ModalProvider=Vb,Ye.RestartConversation=Tw,Ye.Webchat=JU,Ye.WebchatProvider=J2,Ye.avatarThemeSchema=$l,Ye.blockThemeSchema=Aw,Ye.clientModePropsSchema=Lw,Ye.configPropsSchema=Dw,Ye.configurationSchema=Ow,Ye.cssStyleSchema=Pw,Ye.descriptionItemSchema=ys,Ye.getClient=YU,Ye.initPropsSchema=GU,Ye.markdownTypeSchema=Iw,Ye.renderers=uu,Ye.statePropsSchema=$w,Ye.styleOptionSchema=Ee,Ye.themeSchema=Rw,Ye.useClient=K2,Ye.useWebchatContext=mt,Ye.userPropsSchema=Mw,Object.defineProperty(Ye,Symbol.toStringTag,{value:"Module"})});
328
+ `)},Uj=0,ms=[];function Fj(e){var t=R.useRef([]),n=R.useRef([0,0]),r=R.useRef(),i=R.useState(Uj++)[0],s=R.useState(function(){return ew()})[0],o=R.useRef(e);R.useEffect(function(){o.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var m=GI([e.lockRef.current],(e.shards||[]).map(ow),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=R.useCallback(function(m,v){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var y=Tl(m),b=n.current,x="deltaX"in m?m.deltaX:b[0]-y[0],I="deltaY"in m?m.deltaY:b[1]-y[1],A,O=m.target,j=Math.abs(x)>Math.abs(I)?"h":"v";if("touches"in m&&j==="h"&&O.type==="range")return!1;var U=nw(j,O);if(!U)return!0;if(U?A=j:(A=j==="v"?"h":"v",U=nw(j,O)),!U)return!1;if(!r.current&&"changedTouches"in m&&(x||I)&&(r.current=A),!A)return!0;var H=r.current||A;return Dj(H,v,m,H==="h"?x:I,!0)},[]),l=R.useCallback(function(m){var v=m;if(!(!ms.length||ms[ms.length-1]!==s)){var y="deltaY"in v?sw(v):Tl(v),b=t.current.filter(function(A){return A.name===v.type&&A.target===v.target&&Nj(A.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var x=(o.current.shards||[]).map(ow).filter(Boolean).filter(function(A){return A.contains(v.target)}),I=x.length>0?a(v,x[0]):!o.current.noIsolation;I&&v.cancelable&&v.preventDefault()}}},[]),c=R.useCallback(function(m,v,y,b){var x={name:m,delta:v,target:y,should:b};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(I){return I!==x})},1)},[]),u=R.useCallback(function(m){n.current=Tl(m),r.current=void 0},[]),d=R.useCallback(function(m){c(m.type,sw(m),m.target,a(m,e.lockRef.current))},[]),h=R.useCallback(function(m){c(m.type,Tl(m),m.target,a(m,e.lockRef.current))},[]);R.useEffect(function(){return ms.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,ps),document.addEventListener("touchmove",l,ps),document.addEventListener("touchstart",u,ps),function(){ms=ms.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,ps),document.removeEventListener("touchmove",l,ps),document.removeEventListener("touchstart",u,ps)}},[]);var f=e.removeScrollBar,p=e.inert;return R.createElement(R.Fragment,null,p?R.createElement(s,{styles:jj(i)}):null,f?R.createElement(Ij,{gapMode:"margin"}):null)}const Bj=yj(Qb,Fj);var aw=R.forwardRef(function(e,t){return R.createElement(El,Mn({},e,{ref:t,sideCar:Bj}))});aw.classNames=El.classNames;const Vj=aw;var zj=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},gs=new WeakMap,Ol=new WeakMap,Il={},Rd=0,lw=function(e){return e&&(e.host||lw(e.parentNode))},Zj=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=lw(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Wj=function(e,t,n,r){var i=Zj(t,Array.isArray(e)?e:[e]);Il[n]||(Il[n]=new WeakMap);var s=Il[n],o=[],a=new Set,l=new Set(i),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))u(h);else{var f=h.getAttribute(r),p=f!==null&&f!=="false",m=(gs.get(h)||0)+1,v=(s.get(h)||0)+1;gs.set(h,m),s.set(h,v),o.push(h),m===1&&p&&Ol.set(h,!0),v===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}})};return u(t),a.clear(),Rd++,function(){o.forEach(function(d){var h=gs.get(d)-1,f=s.get(d)-1;gs.set(d,h),s.set(d,f),h||(Ol.has(d)||d.removeAttribute(r),Ol.delete(d)),f||d.removeAttribute(n)}),Rd--,Rd||(gs=new WeakMap,gs=new WeakMap,Ol=new WeakMap,Il={})}},Hj=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||zj(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Wj(r,i,n,"aria-hidden")):function(){return null}};const cw="Dialog",[uw,iB]=Ll(cw),[qj,Ar]=uw(cw),Kj=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=e,a=_.useRef(null),l=_.useRef(null),[c=!1,u]=Bb({prop:r,defaultProp:i,onChange:s});return _.createElement(qj,{scope:t,triggerRef:a,contentRef:l,contentId:wl(),titleId:wl(),descriptionId:wl(),open:c,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(d=>!d),[u]),modal:o},n)},Jj="DialogTrigger",Gj=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ar(Jj,n),s=li(t,i.triggerRef);return _.createElement(An.button,_t({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Md(i.open)},r,{ref:s,onClick:Pr(e.onClick,i.onOpenToggle)}))}),Yj="DialogPortal",[sB,dw]=uw(Yj,{forceMount:void 0}),$d="DialogOverlay",Qj=_.forwardRef((e,t)=>{const n=dw($d,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Ar($d,e.__scopeDialog);return s.modal?_.createElement(xl,{present:r||s.open},_.createElement(Xj,_t({},i,{ref:t}))):null}),Xj=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ar($d,n);return _.createElement(Vj,{as:Dl,allowPinchZoom:!0,shards:[i.contentRef]},_.createElement(An.div,_t({"data-state":Md(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),ko="DialogContent",eU=_.forwardRef((e,t)=>{const n=dw(ko,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Ar(ko,e.__scopeDialog);return _.createElement(xl,{present:r||s.open},s.modal?_.createElement(tU,_t({},i,{ref:t})):_.createElement(nU,_t({},i,{ref:t})))}),tU=_.forwardRef((e,t)=>{const n=Ar(ko,e.__scopeDialog),r=_.useRef(null),i=li(t,n.contentRef,r);return _.useEffect(()=>{const s=r.current;if(s)return Hj(s)},[]),_.createElement(fw,_t({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pr(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:Pr(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:Pr(e.onFocusOutside,s=>s.preventDefault())}))}),nU=_.forwardRef((e,t)=>{const n=Ar(ko,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return _.createElement(fw,_t({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=e.onCloseAutoFocus)===null||o===void 0||o.call(e,s),!s.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=e.onInteractOutside)===null||o===void 0||o.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=s.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),fw=_.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,a=Ar(ko,n),l=_.useRef(null),c=li(t,l);return lj(),_.createElement(_.Fragment,null,_.createElement(X2,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s},_.createElement(G2,_t({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Md(a.open)},o,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),rU="DialogTitle",iU=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ar(rU,n);return _.createElement(An.h2,_t({id:i.titleId},r,{ref:t}))}),sU="DialogClose",oU=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ar(sU,n);return _.createElement(An.button,_t({type:"button"},r,{ref:t,onClick:Pr(e.onClick,()=>i.onOpenChange(!1))}))});function Md(e){return e?"open":"closed"}const aU=Kj,lU=Gj,cU=Qj,uU=eU,dU=iU,hw=oU;function fU({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))}const pw=R.forwardRef(fU);function ii({open:e,onOpenChange:t,children:n}){return F.jsx(aU,{open:e,onOpenChange:t,children:n})}function hU({title:e,children:t}){var r,i,s,o,a,l,c,u;const{theme:{modal:n}}=vt();return F.jsxs(F.Fragment,{children:[F.jsx(cU,{...n==null?void 0:n.overlay}),F.jsx("div",{...n==null?void 0:n.container,children:F.jsxs(uU,{...(r=n==null?void 0:n.dialog)==null?void 0:r.container,children:[F.jsxs("div",{...(s=(i=n==null?void 0:n.dialog)==null?void 0:i.title)==null?void 0:s.container,children:[F.jsx(dU,{...(a=(o=n==null?void 0:n.dialog)==null?void 0:o.title)==null?void 0:a.text,children:e}),F.jsx(hw,{children:F.jsx(pw,{role:"button",tabIndex:0,...(c=(l=n==null?void 0:n.dialog)==null?void 0:l.title)==null?void 0:c.closeIcon})})]}),F.jsx("div",{...(u=n==null?void 0:n.dialog)==null?void 0:u.content,children:t})]})})]})}ii.Button=lU,ii.Close=hw,ii.Content=hU;const mw=_.forwardRef(({children:e,...t},n)=>{const{theme:{container:r}}=vt();return F.jsxs("div",{...t,...r,ref:n,children:[F.jsx(vS,{}),F.jsxs(Fb,{children:[F.jsx(pU,{}),e]})]})}),pU=()=>{const{theme:{modal:e},state:{connected:t}}=vt(),{showModal:n}=ip();return _.useEffect(()=>{var r,i,s,o;t||n({title:"Connection Error",content:F.jsxs(F.Fragment,{children:[F.jsx("p",{...(i=(r=e==null?void 0:e.dialog)==null?void 0:r.newConversation)==null?void 0:i.text,children:"There was an error connecting to the server. Please check your internet connection and try again."}),F.jsx(ii.Close,{asChild:!0,children:F.jsx("button",{...(o=(s=e==null?void 0:e.dialog)==null?void 0:s.newConversation)==null?void 0:o.button,onClick:()=>window.location.reload(),children:"Restart"})})]})})},[t]),F.jsx(F.Fragment,{})},mU=_.forwardRef(({children:e,onClick:t,...n},r)=>{const{theme:{fab:i}}=vt(),{container:s,icon:o}=i??{};return F.jsx("div",{...n,...s,ref:r,onClick:t,children:F.jsx("div",{...o})})}),gw="Collapsible",[gU,aB]=Ll(gw),[yU,Ld]=gU(gw),vU=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:o,...a}=e,[l=!1,c]=Bb({prop:r,defaultProp:i,onChange:o});return _.createElement(yU,{scope:n,disabled:s,contentId:wl(),open:l,onOpenToggle:_.useCallback(()=>c(u=>!u),[c])},_.createElement(An.div,_t({"data-state":Dd(l),"data-disabled":s?"":void 0},a,{ref:t})))}),bU="CollapsibleTrigger",wU=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Ld(bU,n);return _.createElement(An.button,_t({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Dd(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:t,onClick:Pr(e.onClick,i.onOpenToggle)}))}),yw="CollapsibleContent",xU=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ld(yw,e.__scopeCollapsible);return _.createElement(xl,{present:n||i.open},({present:s})=>_.createElement(_U,_t({},r,{ref:t,present:s})))}),_U=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=e,o=Ld(yw,n),[a,l]=_.useState(r),c=_.useRef(null),u=li(t,c),d=_.useRef(0),h=d.current,f=_.useRef(0),p=f.current,m=o.open||a,v=_.useRef(m),y=_.useRef();return _.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),xs(()=>{const b=c.current;if(b){y.current=y.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const x=b.getBoundingClientRect();d.current=x.height,f.current=x.width,v.current||(b.style.transitionDuration=y.current.transitionDuration,b.style.animationName=y.current.animationName),l(r)}},[o.open,r]),_.createElement(An.div,_t({"data-state":Dd(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m},s,{ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style}}),m&&i)});function Dd(e){return e?"open":"closed"}const kU=vU,CU=wU,EU=xU,SU=e=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16",...e},R.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M15.5 5.5v-5m0 0h-5m5 0L8.833 7.167m-2.5-5H4.5c-1.4 0-2.1 0-2.635.272A2.5 2.5 0 0 0 .772 3.532C.5 4.066.5 4.767.5 6.167V11.5c0 1.4 0 2.1.272 2.635a2.5 2.5 0 0 0 1.093 1.092C2.4 15.5 3.1 15.5 4.5 15.5h5.333c1.4 0 2.1 0 2.635-.273a2.5 2.5 0 0 0 1.093-1.092c.272-.535.272-1.235.272-2.635V9.667"})),TU=_.memo(_.forwardRef(({defaultOpen:e,...t},n)=>{const{theme:{header:r}}=vt(),[i,s]=_.useState(!!e);return F.jsx(kU,{open:i,onOpenChange:s,...t,...r==null?void 0:r.container,ref:n})})),OU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=vt();return F.jsx(CU,{...e,...(r=n==null?void 0:n.content)==null?void 0:r.container,ref:t})}),IU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=vt();return F.jsx(EU,{...e,...(r=n==null?void 0:n.expandedContent)==null?void 0:r.container,ref:t})}),PU=_.forwardRef(({src:e,children:t},n)=>{var s;const{theme:{header:r},client:i}=vt();return F.jsx(Ul,{ref:n,userId:i==null?void 0:i.clientId,children:t,src:e,...(s=r==null?void 0:r.content)==null?void 0:s.avatar})}),AU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=vt();return F.jsx("h2",{...e,...(r=n==null?void 0:n.content)==null?void 0:r.title,ref:t})}),RU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=vt();return F.jsx("p",{...e,...(r=n==null?void 0:n.content)==null?void 0:r.description,ref:t})}),$U=_.forwardRef((e,t)=>{var r,i;const{theme:{header:n}}=vt();return F.jsx("div",{...e,...(i=(r=n==null?void 0:n.content)==null?void 0:r.actions)==null?void 0:i.container,ref:t})}),In=Object.assign(TU,{Content:OU,ExpandedContent:IU,Avatar:PU,Description:RU,Title:AU,Actions:$U,DescriptionItem:({icon:e,title:t,link:n,...r})=>{var a,l,c,u,d,h,f,p,m,v,y,b;const{theme:{header:i}}=vt(),s=e??SU,o=x=>{x&&TE(x)};return!n&&!t?null:n?F.jsxs("a",{...r,...(l=(a=i==null?void 0:i.expandedContent)==null?void 0:a.descriptionItems)==null?void 0:l.container,href:n,target:"_blank",rel:"noopener",children:[F.jsx(s,{...(u=(c=i==null?void 0:i.expandedContent)==null?void 0:c.descriptionItems)==null?void 0:u.icon}),F.jsx("p",{...(h=(d=i==null?void 0:i.expandedContent)==null?void 0:d.descriptionItems)==null?void 0:h.link,children:t})]}):F.jsxs("div",{...r,...(p=(f=i==null?void 0:i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:p.container,onClick:x=>{o(x.currentTarget.textContent)},children:[F.jsx(s,{...(v=(m=i==null?void 0:i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:v.icon}),F.jsx("p",{...(b=(y=i==null?void 0:i.expandedContent)==null?void 0:y.descriptionItems)==null?void 0:b.text,children:t})]})}}),vw=_.memo(({...e})=>{const{theme:{loadingIndicator:t}}=vt();return F.jsx("div",{...e,...t==null?void 0:t.container,children:F.jsx("div",{...t==null?void 0:t.loader})})}),Nd=_.forwardRef(({direction:e,block:t,scroll:n,disableInput:r,children:i,sender:s,...o},a)=>{var m,v,y,b;const[l,c]=_.useState([]),{theme:{message:u},configuration:{botAvatar:d,botName:h},client:f}=vt();rP(()=>{n()}),_.useEffect(()=>{l.length===0&&n()},[l.length]);const p=Gd((f==null?void 0:f.clientId)??"",15);return F.jsx(np.Provider,{value:{isLoading:l,setIsLoading:c},children:F.jsxs("div",{...o,...u==null?void 0:u.container,"data-loaded":l.length===0,"data-disable-input":!!r,"data-direction":e,ref:a,children:[F.jsxs(qd,{"data-color":p,...(m=u==null?void 0:u.avatar)==null?void 0:m.container,children:[F.jsx(Kd,{...(v=u==null?void 0:u.avatar)==null?void 0:v.image,src:(s==null?void 0:s.avatar)??d}),F.jsx(Jd,{...(y=u==null?void 0:u.avatar)==null?void 0:y.fallback,children:(s==null?void 0:s.name[0])??((b=h??"Bot")==null?void 0:b[0])})]}),t&&F.jsx(Wi,{block:t,styles:u==null?void 0:u.blocks}),i]})})});var bw={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Me,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",a="minute",l="hour",c="day",u="week",d="month",h="quarter",f="year",p="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(q){var B=["th","st","nd","rd"],z=q%100;return"["+q+(B[(z-20)%10]||B[z]||B[0])+"]"}},x=function(q,B,z){var Y=String(q);return!Y||Y.length>=B?q:""+Array(B+1-Y.length).join(z)+q},I={s:x,z:function(q){var B=-q.utcOffset(),z=Math.abs(B),Y=Math.floor(z/60),K=z%60;return(B<=0?"+":"-")+x(Y,2,"0")+":"+x(K,2,"0")},m:function q(B,z){if(B.date()<z.date())return-q(z,B);var Y=12*(z.year()-B.year())+(z.month()-B.month()),K=B.clone().add(Y,d),pe=z-K<0,k=B.clone().add(Y+(pe?-1:1),d);return+(-(Y+(z-K)/(pe?K-k:k-K))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:d,y:f,w:u,d:c,D:p,h:l,m:a,s:o,ms:s,Q:h}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},A="en",O={};O[A]=b;var j="$isDayjsObject",U=function(q){return q instanceof G||!(!q||!q[j])},H=function q(B,z,Y){var K;if(!B)return A;if(typeof B=="string"){var pe=B.toLowerCase();O[pe]&&(K=pe),z&&(O[pe]=z,K=pe);var k=B.split("-");if(!K&&k.length>1)return q(k[0])}else{var ee=B.name;O[ee]=B,K=ee}return!Y&&K&&(A=K),K||!Y&&A},T=function(q,B){if(U(q))return q.clone();var z=typeof B=="object"?B:{};return z.date=q,z.args=arguments,new G(z)},N=I;N.l=H,N.i=U,N.w=function(q,B){return T(q,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var G=function(){function q(z){this.$L=H(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[j]=!0}var B=q.prototype;return B.parse=function(z){this.$d=function(Y){var K=Y.date,pe=Y.utc;if(K===null)return new Date(NaN);if(N.u(K))return new Date;if(K instanceof Date)return new Date(K);if(typeof K=="string"&&!/Z$/i.test(K)){var k=K.match(v);if(k){var ee=k[2]-1||0,_e=(k[7]||"0").substring(0,3);return pe?new Date(Date.UTC(k[1],ee,k[3]||1,k[4]||0,k[5]||0,k[6]||0,_e)):new Date(k[1],ee,k[3]||1,k[4]||0,k[5]||0,k[6]||0,_e)}}return new Date(K)}(z),this.init()},B.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},B.$utils=function(){return N},B.isValid=function(){return this.$d.toString()!==m},B.isSame=function(z,Y){var K=T(z);return this.startOf(Y)<=K&&K<=this.endOf(Y)},B.isAfter=function(z,Y){return T(z)<this.startOf(Y)},B.isBefore=function(z,Y){return this.endOf(Y)<T(z)},B.$g=function(z,Y,K){return N.u(z)?this[Y]:this.set(K,z)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(z,Y){var K=this,pe=!!N.u(Y)||Y,k=N.p(z),ee=function(De,we){var ye=N.w(K.$u?Date.UTC(K.$y,we,De):new Date(K.$y,we,De),K);return pe?ye:ye.endOf(c)},_e=function(De,we){return N.w(K.toDate()[De].apply(K.toDate("s"),(pe?[0,0,0,0]:[23,59,59,999]).slice(we)),K)},S=this.$W,Se=this.$M,Ne=this.$D,Ie="set"+(this.$u?"UTC":"");switch(k){case f:return pe?ee(1,0):ee(31,11);case d:return pe?ee(1,Se):ee(0,Se+1);case u:var je=this.$locale().weekStart||0,He=(S<je?S+7:S)-je;return ee(pe?Ne-He:Ne+(6-He),Se);case c:case p:return _e(Ie+"Hours",0);case l:return _e(Ie+"Minutes",1);case a:return _e(Ie+"Seconds",2);case o:return _e(Ie+"Milliseconds",3);default:return this.clone()}},B.endOf=function(z){return this.startOf(z,!1)},B.$set=function(z,Y){var K,pe=N.p(z),k="set"+(this.$u?"UTC":""),ee=(K={},K[c]=k+"Date",K[p]=k+"Date",K[d]=k+"Month",K[f]=k+"FullYear",K[l]=k+"Hours",K[a]=k+"Minutes",K[o]=k+"Seconds",K[s]=k+"Milliseconds",K)[pe],_e=pe===c?this.$D+(Y-this.$W):Y;if(pe===d||pe===f){var S=this.clone().set(p,1);S.$d[ee](_e),S.init(),this.$d=S.set(p,Math.min(this.$D,S.daysInMonth())).$d}else ee&&this.$d[ee](_e);return this.init(),this},B.set=function(z,Y){return this.clone().$set(z,Y)},B.get=function(z){return this[N.p(z)]()},B.add=function(z,Y){var K,pe=this;z=Number(z);var k=N.p(Y),ee=function(Se){var Ne=T(pe);return N.w(Ne.date(Ne.date()+Math.round(Se*z)),pe)};if(k===d)return this.set(d,this.$M+z);if(k===f)return this.set(f,this.$y+z);if(k===c)return ee(1);if(k===u)return ee(7);var _e=(K={},K[a]=r,K[l]=i,K[o]=n,K)[k]||1,S=this.$d.getTime()+z*_e;return N.w(S,this)},B.subtract=function(z,Y){return this.add(-1*z,Y)},B.format=function(z){var Y=this,K=this.$locale();if(!this.isValid())return K.invalidDate||m;var pe=z||"YYYY-MM-DDTHH:mm:ssZ",k=N.z(this),ee=this.$H,_e=this.$m,S=this.$M,Se=K.weekdays,Ne=K.months,Ie=K.meridiem,je=function(we,ye,Te,ke){return we&&(we[ye]||we(Y,pe))||Te[ye].slice(0,ke)},He=function(we){return N.s(ee%12||12,we,"0")},De=Ie||function(we,ye,Te){var ke=we<12?"AM":"PM";return Te?ke.toLowerCase():ke};return pe.replace(y,function(we,ye){return ye||function(Te){switch(Te){case"YY":return String(Y.$y).slice(-2);case"YYYY":return N.s(Y.$y,4,"0");case"M":return S+1;case"MM":return N.s(S+1,2,"0");case"MMM":return je(K.monthsShort,S,Ne,3);case"MMMM":return je(Ne,S);case"D":return Y.$D;case"DD":return N.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return je(K.weekdaysMin,Y.$W,Se,2);case"ddd":return je(K.weekdaysShort,Y.$W,Se,3);case"dddd":return Se[Y.$W];case"H":return String(ee);case"HH":return N.s(ee,2,"0");case"h":return He(1);case"hh":return He(2);case"a":return De(ee,_e,!0);case"A":return De(ee,_e,!1);case"m":return String(_e);case"mm":return N.s(_e,2,"0");case"s":return String(Y.$s);case"ss":return N.s(Y.$s,2,"0");case"SSS":return N.s(Y.$ms,3,"0");case"Z":return k}return null}(we)||k.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(z,Y,K){var pe,k=this,ee=N.p(Y),_e=T(z),S=(_e.utcOffset()-this.utcOffset())*r,Se=this-_e,Ne=function(){return N.m(k,_e)};switch(ee){case f:pe=Ne()/12;break;case d:pe=Ne();break;case h:pe=Ne()/3;break;case u:pe=(Se-S)/6048e5;break;case c:pe=(Se-S)/864e5;break;case l:pe=Se/i;break;case a:pe=Se/r;break;case o:pe=Se/n;break;default:pe=Se}return K?pe:N.a(pe)},B.daysInMonth=function(){return this.endOf(d).$D},B.$locale=function(){return O[this.$L]},B.locale=function(z,Y){if(!z)return this.$L;var K=this.clone(),pe=H(z,Y,!0);return pe&&(K.$L=pe),K},B.clone=function(){return N.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},q}(),W=G.prototype;return T.prototype=W,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",d],["$y",f],["$D",p]].forEach(function(q){W[q[1]]=function(B){return this.$g(B,q[0],q[1])}}),T.extend=function(q,B){return q.$i||(q(B,G,T),q.$i=!0),T},T.locale=H,T.isDayjs=U,T.unix=function(q){return T(1e3*q)},T.en=O[A],T.Ls=O,T.p={},T})})(bw);var MU=bw.exports;const Pl=ai(MU);var ww={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Me,function(){return function(n,r,i){r.prototype.isToday=function(){var s="YYYY-MM-DD",o=i();return this.format(s)===o.format(s)}}})})(ww);var LU=ww.exports;const DU=ai(LU);var xw={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Me,function(){return function(n,r,i){r.prototype.isYesterday=function(){var s="YYYY-MM-DD",o=i().subtract(1,"day");return this.format(s)===o.format(s)}}})})(xw);var NU=xw.exports;const jU=ai(NU);Pl.extend(DU),Pl.extend(jU);function UU(e,t="day"){if(!e||e.length===0)return[];const n=[];n.push(_w(e[0].timestamp));for(let r=0;r<e.length;r++)if(n.push(e[r]),r+1<e.length){const i=e[r].timestamp,s=e[r+1].timestamp;Pl(i).isSame(s,t)||n.push(_w(s))}return n}function _w(e){return{direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:FU(e)}}}function FU(e,t=!1){const n=Pl(e),r="h:mma";return n.isToday()?t?`Today • ${n.format(r)}`:"Today":n.isYesterday()?t?`Yesterday • ${n.format(r)}`:"Yesterday":t?n.format(`YYYY-MM-DD • ${r}`):n.format("YYYY-MM-DD")}const kw=10*1e3,Cw=_.memo(({scrollDownButton:e,...t})=>{var b,x,I,A,O,j,U,H;const{messages:n,setState:r,client:i,configuration:s,messageContainerRef:o,theme:{messageList:a}}=vt(),l=_.useMemo(()=>UU(n),[n]),[c,u]=_.useState(!0),{y:d}=cP(o),[h,f]=_.useState(!1),[p,m]=dP(),v=()=>{if(!o.current)return;const{scrollHeight:T}=o.current;c&&o.current.scrollTo({top:T})};_.useEffect(()=>{const T=new Date(Date.now()-kw+2e3);n.length>0&&n[n.length-1].timestamp<T&&f(!1)},[p]),vi(()=>i==null?void 0:i.on("messageSent",()=>{f(!0),m(new Date(Date.now()+kw))})),vi(()=>i==null?void 0:i.on("message",()=>{f(!1)})),_.useEffect(()=>{const T=n[n.length-1];r({disableComposer:!!(T!=null&&T.disableInput)})},[n.length]),_.useEffect(()=>{if(!o.current)return;const{offsetHeight:T,scrollHeight:N,scrollTop:G}=o.current;u(N<=G+T+100)},[d]);const y=e!=null&&e.icon?e==null?void 0:e.icon:QS;return F.jsxs("ul",{...t,...a==null?void 0:a.container,ref:o,children:[F.jsx("li",{...(b=a==null?void 0:a.scrollDownButton)==null?void 0:b.container,children:!!n.length&&F.jsxs("button",{"data-is-at-bottom":c,...(x=a==null?void 0:a.scrollDownButton)==null?void 0:x.button,onClick:()=>{var T,N;return(N=o.current)==null?void 0:N.scrollBy({top:(T=o.current)==null?void 0:T.scrollHeight})},children:[(e==null?void 0:e.text)??"Back"," ",F.jsx(y,{...(I=a==null?void 0:a.scrollDownButton)==null?void 0:I.icon})]})}),F.jsxs("li",{...(A=a==null?void 0:a.marquee)==null?void 0:A.container,children:[F.jsx(Ul,{userId:i==null?void 0:i.clientId,src:s.botAvatar,...(O=a==null?void 0:a.marquee)==null?void 0:O.avatar,children:(s.botName||"Bot").slice(0,1)}),F.jsxs("div",{...(j=a==null?void 0:a.marquee)==null?void 0:j.content,children:[F.jsx("h1",{...(U=a==null?void 0:a.marquee)==null?void 0:U.title,children:s.botName||"Bot"}),F.jsx("p",{...(H=a==null?void 0:a.marquee)==null?void 0:H.description,children:s.botDescription})]})]}),l.map((T,N)=>F.jsx(Nd,{scroll:v,...T},N)),h&&F.jsx(Nd,{scroll:v,direction:"incoming",children:F.jsx(vw,{})})]})}),Ew=({...e})=>{var o,a;const{theme:{header:t,modal:n},client:r}=vt(),{showModal:i}=ip(),s=l=>{var c,u,d,h;l.stopPropagation(),i({title:"Restart Conversation",content:F.jsxs(F.Fragment,{children:[F.jsx("p",{...(u=(c=n==null?void 0:n.dialog)==null?void 0:c.newConversation)==null?void 0:u.text,children:"Are you sure you want to restart a new conversation?"}),F.jsx(ii.Close,{asChild:!0,children:F.jsx("button",{...(h=(d=n==null?void 0:n.dialog)==null?void 0:d.newConversation)==null?void 0:h.button,onClick:r==null?void 0:r.restartConversation,children:"Restart"})})]})})};return F.jsx(eT,{...e,...(a=(o=t==null?void 0:t.content)==null?void 0:o.actions)==null?void 0:a.icons,role:"button",tabIndex:0,onClick:s,onKeyDown:l=>{l.key==="Enter"&&s(l)}})},BU=({...e})=>{var i,s;const{theme:{header:t},closeWindow:n}=vt(),r=o=>{o.stopPropagation(),n==null||n()};return F.jsx(pw,{...e,...(s=(i=t==null?void 0:t.content)==null?void 0:i.actions)==null?void 0:s.icons,role:"button",tabIndex:0,onClick:r,onKeyDown:o=>{o.key==="Enter"&&r(o)}})},VU=()=>{var r,i,s,o,a,l,c,u,d,h,f,p,m,v,y;const{configuration:e,closeWindow:t}=vt(),n=!!((r=e.email)!=null&&r.title)||!!((i=e.phone)!=null&&i.title)||!!((s=e.website)!=null&&s.title)||!!((o=e.termsOfService)!=null&&o.link)||!!((a=e.privacyPolicy)!=null&&a.link);return F.jsxs(mw,{children:[F.jsxs(In,{open:n?void 0:!1,"data-disabled":n?void 0:"",children:[F.jsxs(In.Content,{children:[F.jsx(In.Avatar,{src:e.botAvatar,children:e.botName||"Bot"}),F.jsx(In.Title,{children:e.botName||"Bot"}),F.jsx(In.Description,{children:e.botDescription}),F.jsxs(In.Actions,{children:[F.jsx(Ew,{}),t&&F.jsx(BU,{})]})]}),F.jsxs(In.ExpandedContent,{children:[F.jsx(In.DescriptionItem,{"data-email":"",icon:GT,title:(l=e.email)==null?void 0:l.title,link:(c=e.email)==null?void 0:c.link}),F.jsx(In.DescriptionItem,{"data-phone":"",icon:nO,title:(u=e.phone)==null?void 0:u.title,link:(d=e.phone)==null?void 0:d.link}),F.jsx(In.DescriptionItem,{"data-website":"",link:(h=e.website)==null?void 0:h.link,icon:QT,title:(f=e.website)==null?void 0:f.title}),F.jsx(In.DescriptionItem,{"data-terms":"",link:(p=e.termsOfService)==null?void 0:p.link,icon:KT,title:(m=e.termsOfService)==null?void 0:m.title}),F.jsx(In.DescriptionItem,{"data-privacy":"",link:(v=e.privacyPolicy)==null?void 0:v.link,icon:eO,title:(y=e.privacyPolicy)==null?void 0:y.title})]})]}),F.jsx(Cw,{}),F.jsxs(Nb,{children:[F.jsx(jb,{placeholder:e.composerPlaceholder||"Type your message"}),F.jsx(Ub,{})]})]})},ys=Z.object({title:Z.string(),link:Z.string().optional()}),Sw=Z.object({composerPlaceholder:Z.string().optional(),botName:Z.string().optional(),botAvatar:Z.string().optional(),botDescription:Z.string().optional(),website:ys.optional(),email:ys.optional(),phone:ys.optional(),privacyPolicy:ys.optional(),termsOfService:ys.optional()}),Tw=Z.enum(["heading1","heading2","heading3","text","horizontalRule","link","italic","bold","orderedList","unorderedList","listItem","lineBreak","pre"]),Ow=Z.object({}).passthrough().transform(e=>e),Ce=Z.object({className:Z.string().optional(),style:Ow.optional()}),Al=Z.object({container:Ce.optional(),image:Ce.optional(),fallback:Ce.optional()}),Iw=Z.object({button:Ce.optional(),text:Z.record(Tw,Ce.optional()),image:Z.object({image:Ce.optional(),placeholder:Ce.optional()}).optional(),audio:Ce.optional(),video:Ce.optional(),file:Z.object({container:Ce.optional(),title:Ce.optional(),icon:Ce.optional()}).optional(),location:Z.object({container:Ce.optional(),title:Ce.optional(),icon:Ce.optional()}).optional(),column:Ce.optional(),row:Ce.optional(),bubble:Ce.optional(),carousel:Z.object({container:Ce.optional(),slidesContainer:Ce.optional(),backButton:Ce.optional(),nextButton:Ce.optional()}).optional(),dropdown:Z.object({button:Z.object({container:Ce.optional(),icon:Ce.optional(),text:Ce.optional()}).optional(),content:Z.object({container:Ce.optional(),item:Ce.optional()}).optional()}).optional()}),Pw=Z.object({container:Ce.optional(),modal:Z.object({overlay:Ce.optional(),container:Ce.optional(),dialog:Z.object({container:Ce.optional(),title:Z.object({container:Ce.optional(),text:Ce.optional(),closeIcon:Ce.optional()}).optional(),content:Ce.optional(),newConversation:Z.object({text:Ce.optional(),button:Ce.optional()}).optional()}).optional()}).optional(),notification:Z.object({container:Ce.optional(),title:Ce.optional(),description:Ce.optional(),icon:Ce.optional(),closeIcon:Ce.optional()}).optional(),header:Z.object({container:Ce.optional(),content:Z.object({container:Ce.optional(),title:Ce.optional(),description:Ce.optional(),avatar:Al.optional(),actions:Z.object({container:Ce.optional(),icons:Ce.optional()}).optional()}),expandedContent:Z.object({container:Ce.optional(),descriptionItems:Z.object({container:Ce.optional(),icon:Ce.optional(),text:Ce.optional(),link:Ce.optional()}).optional()}).optional(),description:Z.object({container:Ce.optional(),title:Ce.optional(),subtitle:Ce.optional()}).optional(),newConversationIcon:Ce.optional()}).optional(),composer:Z.object({container:Ce.optional(),input:Ce.optional(),button:Z.object({container:Ce.optional(),icon:Ce.optional()}).optional()}).optional(),fab:Z.object({icon:Ce.optional(),container:Ce.optional()}).optional(),messageList:Z.object({container:Ce.optional(),marquee:Z.object({content:Ce.optional(),title:Ce.optional(),description:Ce.optional(),avatar:Al.optional(),container:Ce.optional()}).optional(),scrollDownButton:Z.object({container:Ce.optional(),button:Ce.optional(),icon:Ce.optional()}).optional()}).optional(),message:Z.object({container:Ce.optional(),avatar:Al.optional(),blocks:Iw.optional()}).optional(),loadingIndicator:Z.object({container:Ce.optional(),loader:Ce.optional()}).optional()}),Aw=Z.enum(["opened","closed","initial"]),Rw=Z.object({data:Z.record(Z.string()).optional()}),$w=Z.enum(["messaging","pushpin"]),Mw=Z.object({configuration:Sw.optional().catch(void 0),theme:Pw.optional().catch(void 0),style:Z.string().optional().catch(void 0),user:Rw.optional().catch(void 0)}),zU=Mw.extend({clientId:Z.string(),botId:Z.string(),selector:Z.string().optional().catch(void 0),webchatScriptUrl:Z.string().optional().catch(void 0),fabScriptUrl:Z.string().optional().catch(void 0),messagingUrl:Z.string().optional().catch(void 0),pushpinUrl:Z.string().optional().catch(void 0),clientMode:$w.optional().catch(void 0),defaultState:Aw.optional().catch(void 0)}),ZU=({clientId:e,apiUrl:t,mode:n="messaging"})=>n==="messaging"?new tb({url:t,clientId:e}):new Db({apiUrl:t,clientId:e});Ye.Avatar=Ul,Ye.Block=Wi,Ye.Composer=Nb,Ye.ComposerButton=Ub,Ye.ComposerInput=jb,Ye.Container=mw,Ye.Fab=mU,Ye.Header=In,Ye.LoadingIndicator=vw,Ye.Message=Nd,Ye.MessageList=Cw,Ye.Modal=ii,Ye.ModalProvider=Fb,Ye.RestartConversation=Ew,Ye.Webchat=VU,Ye.WebchatProvider=V2,Ye.avatarThemeSchema=Al,Ye.blockThemeSchema=Iw,Ye.clientModePropsSchema=$w,Ye.configPropsSchema=Mw,Ye.configurationSchema=Sw,Ye.cssStyleSchema=Ow,Ye.descriptionItemSchema=ys,Ye.getClient=ZU,Ye.initPropsSchema=zU,Ye.markdownTypeSchema=Tw,Ye.renderers=lu,Ye.statePropsSchema=Aw,Ye.styleOptionSchema=Ce,Ye.themeSchema=Pw,Ye.useClient=B2,Ye.useWebchatContext=vt,Ye.userPropsSchema=Rw,Object.defineProperty(Ye,Symbol.toStringTag,{value:"Module"})});